From a440ab677241e9de7f185cd6e28c33d4da02f4bb Mon Sep 17 00:00:00 2001 From: grimmauld Date: Fri, 16 Oct 2020 12:18:14 +0200 Subject: [PATCH] Make tree fertilizer work on slime saplings --- .../create/content/curiosities/TreeFertilizerItem.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/curiosities/TreeFertilizerItem.java b/src/main/java/com/simibubi/create/content/curiosities/TreeFertilizerItem.java index 2b9d25a5f..ebed5db35 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/TreeFertilizerItem.java +++ b/src/main/java/com/simibubi/create/content/curiosities/TreeFertilizerItem.java @@ -31,7 +31,7 @@ public class TreeFertilizerItem extends Item { return ActionResultType.SUCCESS; } - TreesDreamWorld world = new TreesDreamWorld((ServerWorld) context.getWorld()); + TreesDreamWorld world = new TreesDreamWorld((ServerWorld) context.getWorld(), context.getPos()); BlockPos saplingPos = context.getPos(); for (BlockPos pos : BlockPos.getAllInBoxMutable(-1, 0, -1, 1, 0, 1)) { @@ -83,15 +83,17 @@ public class TreeFertilizerItem extends Item { } private class TreesDreamWorld extends PlacementSimulationServerWorld { + private final BlockPos saplingPos; - protected TreesDreamWorld(ServerWorld wrapped) { + protected TreesDreamWorld(ServerWorld wrapped, BlockPos saplingPos) { super(wrapped); + this.saplingPos = saplingPos; } @Override public BlockState getBlockState(BlockPos pos) { if (pos.getY() <= 9) - return Blocks.GRASS_BLOCK.getDefaultState(); + return world.getBlockState(saplingPos.down()); return super.getBlockState(pos); }