mirror of
https://github.com/Minestom/Minestom.git
synced 2025-02-14 03:11:25 +01:00
Fixed tickable warning message to be outside of assertions.
This commit is contained in:
parent
ec3230c7c6
commit
294601a6b5
@ -186,7 +186,10 @@ public class DynamicChunk extends Chunk {
|
||||
final Block block = entry.getValue();
|
||||
final BlockHandler handler = block.handler();
|
||||
if (handler == null) return;
|
||||
assert handler.tickable(): String.format("You cannot change the tickable state of %s during runtime!", handler.getNamespaceId());
|
||||
// We cannot throw an exception as that could cause other blocks to not get properly ticked.
|
||||
if (!handler.tickable()) {
|
||||
LOGGER.warn("Ticking a block {} using the handler {}, but it is no longer considered tickable. Previously, it was tickable, but this is unsupported since tickable is immutable.", block, handler);
|
||||
}
|
||||
final Point blockPosition = CoordConversion.chunkBlockIndexGetGlobal(index, chunkX, chunkZ);
|
||||
handler.tick(new BlockHandler.Tick(block, instance, blockPosition));
|
||||
});
|
||||
|
@ -75,9 +75,9 @@ public interface BlockHandler {
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies if this block should be ticked.
|
||||
* Specifies if this block should be ticked, this is immutable after the block is set.
|
||||
* <p>
|
||||
* This method is only called when the block is set.
|
||||
* This method is only called during the block set and later to check immutability.
|
||||
*
|
||||
* @return true if this block should be ticked
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user