From 153cd4f9aacb77c064e5869cbf29e060fada0f98 Mon Sep 17 00:00:00 2001 From: FirstMegaGame4 <84094287+FirstMegaGame4@users.noreply.github.com> Date: Fri, 21 Jun 2024 21:26:49 +0200 Subject: [PATCH] Fix #1 --- .../extravaganza/ExtravaganzaDataGenerator.java | 2 +- .../extravaganza/init/ExtravaganzaBlocks.java | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/mmodding/extravaganza/ExtravaganzaDataGenerator.java b/src/main/java/com/mmodding/extravaganza/ExtravaganzaDataGenerator.java index 0866e0a2..3ad71251 100644 --- a/src/main/java/com/mmodding/extravaganza/ExtravaganzaDataGenerator.java +++ b/src/main/java/com/mmodding/extravaganza/ExtravaganzaDataGenerator.java @@ -224,7 +224,7 @@ public void generateBlockStateModels(BlockStateModelGenerator blockStateModelGen planks.fence(ExtravaganzaBlocks.HEVEA_BRASILIENSIS_FENCE); planks.fenceGate(ExtravaganzaBlocks.HEVEA_BRASILIENSIS_FENCE_GATE); blockStateModelGenerator.registerDoor(ExtravaganzaBlocks.HEVEA_BRASILIENSIS_DOOR); - blockStateModelGenerator.registerTrapdoor(ExtravaganzaBlocks.HEVEA_BRASILIENSIS_TRAPDOOR); + blockStateModelGenerator.registerOrientableTrapdoor(ExtravaganzaBlocks.HEVEA_BRASILIENSIS_TRAPDOOR); planks.pressurePlate(ExtravaganzaBlocks.HEVEA_BRASILIENSIS_PRESSURE_PLATE); planks.button(ExtravaganzaBlocks.HEVEA_BRASILIENSIS_BUTTON); blockStateModelGenerator.registerSingleton(ExtravaganzaBlocks.HEVEA_BRASILIENSIS_LEAVES, TexturedModel.LEAVES); diff --git a/src/main/java/com/mmodding/extravaganza/init/ExtravaganzaBlocks.java b/src/main/java/com/mmodding/extravaganza/init/ExtravaganzaBlocks.java index 5635b5b5..f95cf430 100644 --- a/src/main/java/com/mmodding/extravaganza/init/ExtravaganzaBlocks.java +++ b/src/main/java/com/mmodding/extravaganza/init/ExtravaganzaBlocks.java @@ -4,12 +4,16 @@ import com.mmodding.extravaganza.ExtravaganzaColor; import com.mmodding.extravaganza.block.*; import net.minecraft.block.*; +import net.minecraft.block.enums.DoubleBlockHalf; import net.minecraft.item.BlockItem; import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.loot.context.LootContextParameterSet; import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; import net.minecraft.sound.BlockSoundGroup; +import java.util.List; import java.util.Optional; public class ExtravaganzaBlocks { @@ -29,7 +33,12 @@ public class ExtravaganzaBlocks { public static final Block HEVEA_BRASILIENSIS_SLAB = new SlabBlock(AbstractBlock.Settings.create().strength(2.0f).sounds(BlockSoundGroup.WOOD).burnable()); public static final Block HEVEA_BRASILIENSIS_FENCE = new FenceBlock(AbstractBlock.Settings.create().strength(2.0f).sounds(BlockSoundGroup.WOOD).burnable()); public static final Block HEVEA_BRASILIENSIS_FENCE_GATE = new FenceGateBlock(ExtravaganzaBlocks.HEVEA_BRASILIENSIS, AbstractBlock.Settings.create().strength(2.0f).sounds(BlockSoundGroup.WOOD).burnable()); - public static final Block HEVEA_BRASILIENSIS_DOOR = new DoorBlock(ExtravaganzaBlocks.HEVEA_BRASILIENSIS_TYPE, AbstractBlock.Settings.create().strength(2.0f).sounds(BlockSoundGroup.WOOD).burnable()); + public static final Block HEVEA_BRASILIENSIS_DOOR = new DoorBlock(ExtravaganzaBlocks.HEVEA_BRASILIENSIS_TYPE, AbstractBlock.Settings.create().strength(2.0f).sounds(BlockSoundGroup.WOOD).burnable()) { + @Override + protected List getDroppedStacks(BlockState state, LootContextParameterSet.Builder builder) { + return state.get(BallDistributorBlock.HALF).equals(DoubleBlockHalf.LOWER) ? super.getDroppedStacks(state, builder) : List.of(); + } + }; public static final Block HEVEA_BRASILIENSIS_TRAPDOOR = new TrapdoorBlock(ExtravaganzaBlocks.HEVEA_BRASILIENSIS_TYPE, AbstractBlock.Settings.create().strength(2.0f).sounds(BlockSoundGroup.WOOD).burnable()); public static final Block HEVEA_BRASILIENSIS_PRESSURE_PLATE = new PressurePlateBlock(ExtravaganzaBlocks.HEVEA_BRASILIENSIS_TYPE, AbstractBlock.Settings.create().strength(2.0f).sounds(BlockSoundGroup.WOOD).burnable()); public static final Block HEVEA_BRASILIENSIS_BUTTON = Blocks.createWoodenButtonBlock(ExtravaganzaBlocks.HEVEA_BRASILIENSIS_TYPE);