Fix CommandTNT
Fix RegionToggleCommand
Dieser Commit ist enthalten in:
Ursprung
ea345fb46c
Commit
041741bc75
@ -116,31 +116,32 @@ public class CommandTNT implements CommandExecutor, Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TNTMode finalRequestedMode = requestedMode;
|
Region region = Region.getRegion(player.getLocation());
|
||||||
String finalRequestedMessage = requestedMessage;
|
if (region == null) {
|
||||||
Region.getRegion(player.getLocation(), region -> {
|
RegionToggleCommand.actionBar(player, getNoRegionMessage());
|
||||||
if (finalRequestedMode != null) {
|
return false;
|
||||||
region.setTntMode(finalRequestedMode);
|
}
|
||||||
RegionToggleCommand.actionBar(region, finalRequestedMessage);
|
if (requestedMode != null) {
|
||||||
return;
|
region.setTntMode(requestedMode);
|
||||||
}
|
RegionToggleCommand.actionBar(region, requestedMessage);
|
||||||
switch (region.getTntMode()) {
|
return false;
|
||||||
case ON:
|
}
|
||||||
case ONLY_TB:
|
switch (region.getTntMode()) {
|
||||||
region.setTntMode(TNTMode.OFF);
|
case ON:
|
||||||
RegionToggleCommand.actionBar(region, getDisableMessage());
|
case ONLY_TB:
|
||||||
break;
|
region.setTntMode(TNTMode.OFF);
|
||||||
case OFF:
|
RegionToggleCommand.actionBar(region, getDisableMessage());
|
||||||
if (Region.buildAreaEnabled()) {
|
break;
|
||||||
region.setTntMode(TNTMode.ONLY_TB);
|
case OFF:
|
||||||
RegionToggleCommand.actionBar(region, getTestblockEnableMessage());
|
if (Region.buildAreaEnabled()) {
|
||||||
} else {
|
region.setTntMode(TNTMode.ONLY_TB);
|
||||||
region.setTntMode(TNTMode.ON);
|
RegionToggleCommand.actionBar(region, getTestblockEnableMessage());
|
||||||
RegionToggleCommand.actionBar(region, getEnableMessage());
|
} else {
|
||||||
}
|
region.setTntMode(TNTMode.ON);
|
||||||
break;
|
RegionToggleCommand.actionBar(region, getEnableMessage());
|
||||||
}
|
}
|
||||||
}, () -> RegionToggleCommand.actionBar(player, getNoRegionMessage()));
|
break;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,13 +52,16 @@ public abstract class RegionToggleCommand implements CommandExecutor, Listener {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Region.getRegion(player.getLocation(), region -> {
|
Region region = Region.getRegion(player);
|
||||||
if (toggle(region)) {
|
if (region == null) {
|
||||||
actionBar(region, getEnableMessage());
|
actionBar(player, getNoRegionMessage());
|
||||||
} else {
|
return false;
|
||||||
actionBar(region, getDisableMessage());
|
}
|
||||||
}
|
if (toggle(region)) {
|
||||||
}, () -> actionBar(player, getNoRegionMessage()));
|
actionBar(region, getEnableMessage());
|
||||||
|
} else {
|
||||||
|
actionBar(region, getDisableMessage());
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren