diff --git a/src/main/java/thedarkcolour/exdeorum/event/EventHandler.java b/src/main/java/thedarkcolour/exdeorum/event/EventHandler.java index aef11d79..be7aea33 100644 --- a/src/main/java/thedarkcolour/exdeorum/event/EventHandler.java +++ b/src/main/java/thedarkcolour/exdeorum/event/EventHandler.java @@ -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)); }); } diff --git a/src/main/java/thedarkcolour/exdeorum/item/WitchWaterBucketItem.java b/src/main/java/thedarkcolour/exdeorum/item/WitchWaterBucketItem.java deleted file mode 100644 index fafac51a..00000000 --- a/src/main/java/thedarkcolour/exdeorum/item/WitchWaterBucketItem.java +++ /dev/null @@ -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 . - */ - -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); - } -} diff --git a/src/main/java/thedarkcolour/exdeorum/registry/EItems.java b/src/main/java/thedarkcolour/exdeorum/registry/EItems.java index b83e1282..a50ac420 100644 --- a/src/main/java/thedarkcolour/exdeorum/registry/EItems.java +++ b/src/main/java/thedarkcolour/exdeorum/registry/EItems.java @@ -130,7 +130,7 @@ public class EItems { public static final RegistryObject 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 WITCH_WATER_BUCKET = ITEMS.register("witch_water_bucket", () -> new WitchWaterBucketItem(props().craftRemainder(Items.BUCKET).stacksTo(1))); + public static final RegistryObject WITCH_WATER_BUCKET = ITEMS.register("witch_water_bucket", () -> new BucketItem(EFluids.WITCH_WATER, props().craftRemainder(Items.BUCKET).stacksTo(1))); public static RegistryObject registerSimpleItem(String name) { return ITEMS.register(name, () -> new Item(props())); diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg index f4a3823b..cb838260 100644 --- a/src/main/resources/META-INF/accesstransformer.cfg +++ b/src/main/resources/META-INF/accesstransformer.cfg @@ -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