mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-03 23:17:48 +01:00
Renamed Chunk#setBlock to Chunk#UNSAFE_setBlock for reliability and security purpose
This commit is contained in:
parent
857d3f0c6e
commit
f79a024dc1
@ -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
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user