Add CommandTNT with extension explode message
Dieser Commit ist enthalten in:
Ursprung
2b068041e7
Commit
fb73fa6fce
@ -75,6 +75,10 @@ public class CommandTNT implements CommandExecutor, Listener {
|
|||||||
return "§cEine Explosion hätte Blöcke im Baubereich zerstört";
|
return "§cEine Explosion hätte Blöcke im Baubereich zerstört";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getDamageExtensionMessage() {
|
||||||
|
return "§cEine Explosion hätte Blöcke im Ausfahrbereich zerstört";
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(CommandSender sender, Command command, String s, String[] args) {
|
public boolean onCommand(CommandSender sender, Command command, String s, String[] args) {
|
||||||
if (!(sender instanceof Player)) return false;
|
if (!(sender instanceof Player)) return false;
|
||||||
@ -149,6 +153,10 @@ public class CommandTNT implements CommandExecutor, Listener {
|
|||||||
RegionToggleCommand.actionBar(region, getDamageMessage());
|
RegionToggleCommand.actionBar(region, getDamageMessage());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (region.hasBuildRegion() && region.inBuildRegionExtension(block.getLocation())) {
|
||||||
|
RegionToggleCommand.actionBar(region, getDamageExtensionMessage());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -162,6 +162,10 @@ public class Region {
|
|||||||
return prototype.buildArea.inRegion(this, l);
|
return prototype.buildArea.inRegion(this, l);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean inBuildRegionExtension(Location l) {
|
||||||
|
return prototype.buildArea.inRegionExtension(this, l);
|
||||||
|
}
|
||||||
|
|
||||||
public void fastreset(){
|
public void fastreset(){
|
||||||
prototype.fastreset(this);
|
prototype.fastreset(this);
|
||||||
}
|
}
|
||||||
@ -212,11 +216,6 @@ public class Region {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean inBuildRegion(Location l) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasTestblock() {
|
public boolean hasTestblock() {
|
||||||
return false;
|
return false;
|
||||||
@ -288,6 +287,12 @@ public class Region {
|
|||||||
inRange(l.getZ(), region.minZ + offsetZ, sizeZ);
|
inRange(l.getZ(), region.minZ + offsetZ, sizeZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean inRegionExtension(Region region, Location l) {
|
||||||
|
return inRange(l.getX(), region.minX + offsetX - extensionAxisX + 1, sizeX + extensionAxisX * 2 - 1) &&
|
||||||
|
inRange(l.getY(), region.minY + offsetY, sizeY + extensionPositiveY - 1) &&
|
||||||
|
inRange(l.getZ(), region.minZ + offsetZ - extensionNegativeZ + 1, sizeZ + extensionNegativeZ - 1 + extensionPositiveZ);
|
||||||
|
}
|
||||||
|
|
||||||
public void fastreset(Region region){
|
public void fastreset(Region region){
|
||||||
File file = new File(schematic);
|
File file = new File(schematic);
|
||||||
int x = region.minX + offsetX + sizeX/2;
|
int x = region.minX + offsetX + sizeX/2;
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren