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