Renamed Chunk#setBlock to Chunk#UNSAFE_setBlock for reliability and security purpose

This commit is contained in:
themode 2020-10-05 02:03:08 +02:00
parent 857d3f0c6e
commit f79a024dc1
6 changed files with 6 additions and 6 deletions

View File

@ -115,7 +115,7 @@ public abstract class Chunk implements Viewable, DataContainer {
* Warning: <code>customBlockId</code> cannot be 0 and needs to be valid since the update delay and method
* will be retrieved from the associated {@link CustomBlock} object
*/
public abstract void setBlock(int x, int y, int z, short blockStateId, short customBlockId, Data data, boolean updatable);
public abstract void UNSAFE_setBlock(int x, int y, int z, short blockStateId, short customBlockId, Data data, boolean updatable);
/**
* Set the {@link Data} at a position

View File

@ -32,7 +32,7 @@ public class DynamicChunk extends Chunk {
}
@Override
public void setBlock(int x, int y, int z, short blockStateId, short customBlockId, Data data, boolean updatable) {
public void UNSAFE_setBlock(int x, int y, int z, short blockStateId, short customBlockId, Data data, boolean updatable) {
{
// Update pathfinder

View File

@ -188,7 +188,7 @@ public class InstanceContainer extends Instance {
}
// Set the block
chunk.setBlock(x, y, z, blockStateId, customBlockId, data, hasUpdate);
chunk.UNSAFE_setBlock(x, y, z, blockStateId, customBlockId, data, hasUpdate);
// Refresh neighbors since a new block has been placed
executeNeighboursBlockPlacementRule(blockPosition);

View File

@ -21,7 +21,7 @@ public class StaticChunk extends Chunk {
}
@Override
public void setBlock(int x, int y, int z, short blockStateId, short customBlockId, Data data, boolean updatable) {
public void UNSAFE_setBlock(int x, int y, int z, short blockStateId, short customBlockId, Data data, boolean updatable) {
//noop
}

View File

@ -102,7 +102,7 @@ public class BlockBatch implements InstanceBatch {
private Data data;
public void apply(Chunk chunk) {
chunk.setBlock(x, y, z, blockStateId, customBlockId, data, CustomBlockUtils.hasUpdate(customBlockId));
chunk.UNSAFE_setBlock(x, y, z, blockStateId, customBlockId, data, CustomBlockUtils.hasUpdate(customBlockId));
}
}

View File

@ -142,7 +142,7 @@ public class ChunkBatch implements InstanceBatch {
private Data data;
public void apply(Chunk chunk) {
chunk.setBlock(x, y, z, blockStateId, customBlockId, data, CustomBlockUtils.hasUpdate(customBlockId));
chunk.UNSAFE_setBlock(x, y, z, blockStateId, customBlockId, data, CustomBlockUtils.hasUpdate(customBlockId));
}
}