diff --git a/src/main/java/net/minestom/server/instance/InstanceContainer.java b/src/main/java/net/minestom/server/instance/InstanceContainer.java index 3a31fd7e3..91ae70621 100644 --- a/src/main/java/net/minestom/server/instance/InstanceContainer.java +++ b/src/main/java/net/minestom/server/instance/InstanceContainer.java @@ -410,7 +410,7 @@ public class InstanceContainer extends Instance { if(currentBlock.getCustomBlockId() != toUpdate.getCustomBlockId()) { // block changed return; } - currentBlock.update(instance, position, getBlockData(position)); + currentBlock.scheduledUpdate(instance, position, getBlockData(position)); } }, new UpdateOption(time, unit)); } diff --git a/src/main/java/net/minestom/server/instance/block/CustomBlock.java b/src/main/java/net/minestom/server/instance/block/CustomBlock.java index 106c60b86..acaab9d61 100644 --- a/src/main/java/net/minestom/server/instance/block/CustomBlock.java +++ b/src/main/java/net/minestom/server/instance/block/CustomBlock.java @@ -104,4 +104,14 @@ public abstract class CustomBlock { update(instance, thisPosition, instance.getBlockData(thisPosition)); } } + + /** + * Called when a scheduled update on this block happens. By default, calls 'update' + * @param instance + * @param position + * @param blockData + */ + public void scheduledUpdate(Instance instance, BlockPosition position, Data blockData) { + update(instance, position, blockData); + } }