diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockContainerImpl.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockContainerImpl.java index 6b4b64be..56249932 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockContainerImpl.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockContainerImpl.java @@ -114,7 +114,7 @@ public class BlockContainerImpl extends BaseEntityBlock implements IModItem { public List getDrops(BlockState state, LootContext.Builder builder) { var drops = super.getDrops(state, builder); - var tile = builder.getParameter(LootContextParams.BLOCK_ENTITY); + var tile = builder.getOptionalParameter(LootContextParams.BLOCK_ENTITY); if (tile instanceof BlockEntityImpl) { for (var stack : drops) { if (stack.getItem() != this.asItem()) diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockEndFlower.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockEndFlower.java index 70a714a2..9f6d361e 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockEndFlower.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockEndFlower.java @@ -105,8 +105,8 @@ public class BlockEndFlower extends BushBlock implements IModItem, ICustomBlockS @Override public List getDrops(BlockState state, LootContext.Builder builder) { - var tile = builder.getParameter(LootContextParams.BLOCK_ENTITY); - if (tile instanceof BlockEntityEndFlower && ((BlockEntityEndFlower) tile).isDrainMode) + var tile = builder.getOptionalParameter(LootContextParams.BLOCK_ENTITY); + if (tile instanceof BlockEntityEndFlower f && f.isDrainMode) return NonNullList.create(); return super.getDrops(state, builder); }