Merge pull request #458 from Project-Cepi/add-chunk-ref-to-block-handler-methods

Add chunk reference to Tick, blockPosition (Tick) -> relativeBlockPosition
This commit is contained in:
TheMode 2021-09-11 23:20:41 +02:00 committed by GitHub
commit e77e32889b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -93,9 +93,9 @@ public class DynamicChunk extends Chunk {
final Block block = entry.getValue();
final BlockHandler handler = block.handler();
if (handler == null) return;
final int x = ChunkUtils.blockIndexToChunkPositionX(index);
final int y = ChunkUtils.blockIndexToChunkPositionY(index);
final int z = ChunkUtils.blockIndexToChunkPositionZ(index);
final int x = ChunkUtils.blockIndexToPositionX(index, chunkX);
final int y = ChunkUtils.blockIndexToPositionY(index);
final int z = ChunkUtils.blockIndexToPositionZ(index, chunkZ);
final Vec blockPosition = new Vec(x, y, z);
handler.tick(new BlockHandler.Tick(block, instance, blockPosition));
});