From 55a8fbef4307cd485c7923bf53e1c6c00adca579 Mon Sep 17 00:00:00 2001 From: vodofrede Date: Mon, 11 Oct 2021 18:18:09 +0200 Subject: [PATCH] Fixed sweet berry bushes --- src/main/java/dk/palmoe/immersivexp/Events.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/dk/palmoe/immersivexp/Events.java b/src/main/java/dk/palmoe/immersivexp/Events.java index 295c6bb..8eb2356 100644 --- a/src/main/java/dk/palmoe/immersivexp/Events.java +++ b/src/main/java/dk/palmoe/immersivexp/Events.java @@ -7,6 +7,7 @@ import net.minecraft.block.CropBlock; import net.minecraft.block.MelonBlock; import net.minecraft.block.SweetBerryBushBlock; import net.minecraft.server.world.ServerWorld; +import net.minecraft.state.property.Property; import net.minecraft.tag.BlockTags; import net.minecraft.util.ActionResult; import net.minecraft.util.Identifier; @@ -37,7 +38,11 @@ public class Events { BlockState state = world.getBlockState(hitResult.getBlockPos()); if (state.getBlock() instanceof SweetBerryBushBlock && world instanceof ServerWorld) { - Util.spawnExp((ServerWorld) world, hitResult.getBlockPos(), 1, 1); + int age = state.get(SweetBerryBushBlock.AGE); + if (age == 3) { + Util.spawnExp((ServerWorld) world, hitResult.getBlockPos(), 1, 1); + } + } return ActionResult.PASS;