Fixed sweet berry bushes
This commit is contained in:
parent
f849e49e42
commit
55a8fbef43
1 changed files with 6 additions and 1 deletions
|
@ -7,6 +7,7 @@ import net.minecraft.block.CropBlock;
|
||||||
import net.minecraft.block.MelonBlock;
|
import net.minecraft.block.MelonBlock;
|
||||||
import net.minecraft.block.SweetBerryBushBlock;
|
import net.minecraft.block.SweetBerryBushBlock;
|
||||||
import net.minecraft.server.world.ServerWorld;
|
import net.minecraft.server.world.ServerWorld;
|
||||||
|
import net.minecraft.state.property.Property;
|
||||||
import net.minecraft.tag.BlockTags;
|
import net.minecraft.tag.BlockTags;
|
||||||
import net.minecraft.util.ActionResult;
|
import net.minecraft.util.ActionResult;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
|
@ -37,9 +38,13 @@ public class Events {
|
||||||
BlockState state = world.getBlockState(hitResult.getBlockPos());
|
BlockState state = world.getBlockState(hitResult.getBlockPos());
|
||||||
|
|
||||||
if (state.getBlock() instanceof SweetBerryBushBlock && world instanceof ServerWorld) {
|
if (state.getBlock() instanceof SweetBerryBushBlock && world instanceof ServerWorld) {
|
||||||
|
int age = state.get(SweetBerryBushBlock.AGE);
|
||||||
|
if (age == 3) {
|
||||||
Util.spawnExp((ServerWorld) world, hitResult.getBlockPos(), 1, 1);
|
Util.spawnExp((ServerWorld) world, hitResult.getBlockPos(), 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return ActionResult.PASS;
|
return ActionResult.PASS;
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue