mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 07:06:44 +01:00
clean up ProcessedWEExtent
This commit is contained in:
parent
435d877262
commit
e6878d7804
@ -89,55 +89,19 @@ public class ProcessedWEExtent extends AbstractDelegateExtent {
|
||||
@Override
|
||||
public <T extends BlockStateHolder<T>> boolean setBlock(BlockVector3 location, T block)
|
||||
throws WorldEditException {
|
||||
String id = block.getBlockType().getId();
|
||||
switch (id) {
|
||||
case "54":
|
||||
case "130":
|
||||
case "142":
|
||||
case "27":
|
||||
case "137":
|
||||
case "52":
|
||||
case "154":
|
||||
case "84":
|
||||
case "25":
|
||||
case "144":
|
||||
case "138":
|
||||
case "176":
|
||||
case "177":
|
||||
case "63":
|
||||
case "68":
|
||||
case "323":
|
||||
case "117":
|
||||
case "116":
|
||||
case "28":
|
||||
case "66":
|
||||
case "157":
|
||||
case "61":
|
||||
case "62":
|
||||
case "140":
|
||||
case "146":
|
||||
case "149":
|
||||
case "150":
|
||||
case "158":
|
||||
case "23":
|
||||
case "123":
|
||||
case "124":
|
||||
case "29":
|
||||
case "33":
|
||||
case "151":
|
||||
case "178":
|
||||
|
||||
final boolean isTile = block.toBaseBlock().getNbtData() != null;
|
||||
if (isTile) {
|
||||
if (this.BSblocked) {
|
||||
return false;
|
||||
}
|
||||
this.BScount++;
|
||||
if (this.BScount > Settings.Chunk_Processor.MAX_TILES) {
|
||||
if (++this.BScount > Settings.Chunk_Processor.MAX_TILES) {
|
||||
this.BSblocked = true;
|
||||
PlotSquared.debug(
|
||||
Captions.PREFIX + "&cDetected unsafe WorldEdit: " + location.getX() + ","
|
||||
PlotSquared.debug(Captions.PREFIX + "&cDetected unsafe WorldEdit: " + location.getX() + ","
|
||||
+ location.getZ());
|
||||
}
|
||||
if (WEManager
|
||||
.maskContains(this.mask, location.getX(), location.getY(), location.getZ())) {
|
||||
}
|
||||
if (WEManager.maskContains(this.mask, location.getX(), location.getY(), location.getZ())) {
|
||||
if (this.count++ > this.max) {
|
||||
if (this.parent != null) {
|
||||
try {
|
||||
@ -154,30 +118,8 @@ public class ProcessedWEExtent extends AbstractDelegateExtent {
|
||||
}
|
||||
return super.setBlock(location, block);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (WEManager
|
||||
.maskContains(this.mask, location.getX(), location.getY(), location.getZ())) {
|
||||
if (this.count++ > this.max) {
|
||||
if (this.parent != null) {
|
||||
try {
|
||||
Field field =
|
||||
AbstractDelegateExtent.class.getDeclaredField("extent");
|
||||
field.setAccessible(true);
|
||||
field.set(this.parent, new NullExtent());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
this.parent = null;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
super.setBlock(location, block);
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
return false;
|
||||
return !isTile;
|
||||
}
|
||||
|
||||
@Override public Entity createEntity(Location location, BaseEntity entity) {
|
||||
|
Loading…
Reference in New Issue
Block a user