Fix CommandTNT for Region without Testblock
Dieser Commit ist enthalten in:
Ursprung
f2ad417f75
Commit
d406ed7e66
@ -140,6 +140,10 @@ public class CommandTNT implements CommandExecutor, Listener {
|
|||||||
|
|
||||||
private void tntToggle(Region region, TNTMode requestedMode, String requestedMessage) {
|
private void tntToggle(Region region, TNTMode requestedMode, String requestedMessage) {
|
||||||
if (requestedMode != null) {
|
if (requestedMode != null) {
|
||||||
|
if (!region.hasTestblock() && requestedMode == TNTMode.ONLY_TB) {
|
||||||
|
requestedMode = TNTMode.ON;
|
||||||
|
requestedMessage = getEnableMessage();
|
||||||
|
}
|
||||||
region.setTntMode(requestedMode);
|
region.setTntMode(requestedMode);
|
||||||
RegionToggleCommand.actionBar(region, requestedMessage);
|
RegionToggleCommand.actionBar(region, requestedMessage);
|
||||||
return;
|
return;
|
||||||
@ -151,7 +155,7 @@ public class CommandTNT implements CommandExecutor, Listener {
|
|||||||
RegionToggleCommand.actionBar(region, getDisableMessage());
|
RegionToggleCommand.actionBar(region, getDisableMessage());
|
||||||
break;
|
break;
|
||||||
case OFF:
|
case OFF:
|
||||||
if (Region.buildAreaEnabled()) {
|
if (Region.buildAreaEnabled() && region.hasTestblock()) {
|
||||||
region.setTntMode(TNTMode.ONLY_TB);
|
region.setTntMode(TNTMode.ONLY_TB);
|
||||||
RegionToggleCommand.actionBar(region, getTestblockEnableMessage());
|
RegionToggleCommand.actionBar(region, getTestblockEnableMessage());
|
||||||
} else {
|
} else {
|
||||||
|
@ -110,6 +110,7 @@ public class Region {
|
|||||||
minZ = config.getInt("minZ");
|
minZ = config.getInt("minZ");
|
||||||
prototype = Prototype.prototypes.get(config.getString("prototype"));
|
prototype = Prototype.prototypes.get(config.getString("prototype"));
|
||||||
optionsLinkedWith = config.getString("optionsLinkedWith", null);
|
optionsLinkedWith = config.getString("optionsLinkedWith", null);
|
||||||
|
if (!hasTestblock()) tntMode = TNTMode.OFF;
|
||||||
regions.add(this);
|
regions.add(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren