mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-13 10:54:43 +02:00
PlotBlock cache / events / flags
This commit is contained in:
@ -1066,7 +1066,7 @@ public class BukkitChunkManager extends ChunkManager {
|
||||
if (typeId == 0) {
|
||||
ids[y] = PlotBlock.EVERYTHING;
|
||||
} else {
|
||||
ids[y] = new PlotBlock((short) typeId, block.getData());
|
||||
ids[y] = PlotBlock.get((short) typeId, block.getData());
|
||||
}
|
||||
}
|
||||
if (!id.equals(Material.AIR)) {
|
||||
|
@ -270,7 +270,7 @@ public class BukkitUtil extends WorldUtil {
|
||||
public StringComparison<PlotBlock>.ComparisonResult getClosestBlock(String name) {
|
||||
try {
|
||||
Material material = Material.valueOf(name.toUpperCase());
|
||||
return new StringComparison<PlotBlock>().new ComparisonResult(0, new PlotBlock((short) material.getId(), (byte) 0));
|
||||
return new StringComparison<PlotBlock>().new ComparisonResult(0, PlotBlock.get((short) material.getId(), (byte) 0));
|
||||
} catch (IllegalArgumentException ignored) {}
|
||||
try {
|
||||
byte data;
|
||||
@ -291,7 +291,7 @@ public class BukkitUtil extends WorldUtil {
|
||||
match = comparison.match;
|
||||
id = (short) comparison.best.getId();
|
||||
}
|
||||
PlotBlock block = new PlotBlock(id, data);
|
||||
PlotBlock block = PlotBlock.get(id, data);
|
||||
StringComparison<PlotBlock> outer = new StringComparison<>();
|
||||
return outer.new ComparisonResult(match, block);
|
||||
|
||||
@ -317,7 +317,7 @@ public class BukkitUtil extends WorldUtil {
|
||||
if (block == null) {
|
||||
return PlotBlock.EVERYTHING;
|
||||
}
|
||||
return new PlotBlock((short) block.getTypeId(), block.getData());
|
||||
return PlotBlock.get((short) block.getTypeId(), block.getData());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -35,7 +35,7 @@ public class SlowChunk extends PlotChunk<Chunk> {
|
||||
if (this.result[y >> 4] == null) {
|
||||
this.result[y >> 4] = new PlotBlock[4096];
|
||||
}
|
||||
this.result[MainUtil.CACHE_I[y][x][z]][MainUtil.CACHE_J[y][x][z]] = new PlotBlock((short) id, data);
|
||||
this.result[MainUtil.CACHE_I[y][x][z]][MainUtil.CACHE_J[y][x][z]] = PlotBlock.get((short) id, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user