Differentiate scheduled and general updates

This commit is contained in:
jglrxavpok 2020-05-01 23:48:52 +02:00
parent 4ca4631f8a
commit e57addcbf7
2 changed files with 11 additions and 1 deletions

View File

@ -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));
}

View File

@ -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);
}
}