Only capture actual tree growth

This commit is contained in:
Jake Potrebic
2021-08-21 18:53:03 -07:00
parent 1754e3426c
commit 36ae0bcfea
5 changed files with 58 additions and 43 deletions

View File

@@ -29,7 +29,7 @@
@Override
public MapCodec<? extends SaplingBlock> codec() {
@@ -37,48 +45,73 @@
@@ -37,48 +45,74 @@
protected SaplingBlock(TreeGrower generator, BlockBehaviour.Properties settings) {
super(settings);
this.treeGrower = generator;
@@ -81,6 +81,7 @@
+ if (event == null || !event.isCancelled()) {
+ for (BlockState blockstate : blocks) {
+ CapturedBlockState.setBlockState(blockstate);
+ world.checkCapturedTreeStateForObserverNotify(pos, (org.bukkit.craftbukkit.block.CraftBlockState) blockstate); // Paper - notify observers even if grow failed
+ }
+ }
+ }