Witch water buckets now dispense properly

This commit is contained in:
thedarkcolour 2024-06-30 13:07:04 -07:00
parent fe49bb2bfc
commit a86082b028
No known key found for this signature in database
GPG Key ID: 6599A8E0516C8F38
4 changed files with 6 additions and 39 deletions

View File

@ -31,12 +31,14 @@ import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.util.RandomSource;
import net.minecraft.util.Unit;
import net.minecraft.world.entity.ai.behavior.GoAndGiveItemsToTarget;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.GameRules;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.DispenserBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.Heightmap;
import net.minecraft.world.level.levelgen.XoroshiroRandomSource;
@ -187,6 +189,8 @@ public final class EventHandler {
BarrelMaterial.loadTransparentBlocks();
AbstractCrucibleMaterial.loadTransparentBlocks();
DispenserBlock.registerBehavior(EItems.WITCH_WATER_BUCKET.get(), DispenserBlock.DISPENSER_REGISTRY.get(Items.WATER_BUCKET));
});
}

View File

@ -1,38 +0,0 @@
/*
* Ex Deorum
* Copyright (c) 2024 thedarkcolour
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package thedarkcolour.exdeorum.item;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.item.BucketItem;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.common.capabilities.ICapabilityProvider;
import net.minecraftforge.fluids.capability.wrappers.FluidBucketWrapper;
import org.jetbrains.annotations.Nullable;
import thedarkcolour.exdeorum.registry.EFluids;
public class WitchWaterBucketItem extends BucketItem {
public WitchWaterBucketItem(Properties properties) {
super(EFluids.WITCH_WATER, properties);
}
@Override
public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable CompoundTag nbt) {
return new FluidBucketWrapper(stack);
}
}

View File

@ -130,7 +130,7 @@ public class EItems {
public static final RegistryObject<Item> PORCELAIN_WITCH_WATER_BUCKET = ITEMS.register("porcelain_witch_water_bucket", () -> new PorcelainBucket(EFluids.WITCH_WATER, props().craftRemainder(PORCELAIN_BUCKET.get()).stacksTo(1)));
// Fluids
public static final RegistryObject<Item> WITCH_WATER_BUCKET = ITEMS.register("witch_water_bucket", () -> new WitchWaterBucketItem(props().craftRemainder(Items.BUCKET).stacksTo(1)));
public static final RegistryObject<Item> WITCH_WATER_BUCKET = ITEMS.register("witch_water_bucket", () -> new BucketItem(EFluids.WITCH_WATER, props().craftRemainder(Items.BUCKET).stacksTo(1)));
public static RegistryObject<Item> registerSimpleItem(String name) {
return ITEMS.register(name, () -> new Item(props()));

View File

@ -19,3 +19,4 @@ public net.minecraft.client.renderer.RenderStateShard f_110152_ # LIGHTMAP
public net.minecraft.client.renderer.RenderStateShard f_110145_ # BLOCK_SHEET_MIPPED
public net.minecraft.world.entity.monster.Creeper f_32274_ # DATA_IS_POWERED
public net.minecraft.world.entity.npc.Villager m_35524_()V # releaseAllPois
public net.minecraft.world.level.block.DispenserBlock f_52661_ # DISPENSER_REGISTRY