Add '/rg restore' to restore broken blocks not self set ones
Dieser Commit ist enthalten in:
Ursprung
fc7e502a16
Commit
738954f669
@ -58,7 +58,9 @@ public class CommandRegion extends SWCommand {
|
||||
@Register("restore")
|
||||
public void genericRestoreCommand(Player p) {
|
||||
if (!permissionCheck(p)) return;
|
||||
Region region = regionCheck(p);
|
||||
Region region = Region.getRegion(p.getLocation());
|
||||
if(checkGlobalRegion(region, p)) return;
|
||||
|
||||
if (region == null) return;
|
||||
try {
|
||||
region.reset(null, true);
|
||||
@ -72,7 +74,9 @@ public class CommandRegion extends SWCommand {
|
||||
@Register("restore")
|
||||
public void schematicRestoreCommand(Player p, String s) {
|
||||
if (!permissionCheck(p)) return;
|
||||
Region region = regionCheck(p);
|
||||
Region region = Region.getRegion(p.getLocation());
|
||||
if(checkGlobalRegion(region, p)) return;
|
||||
|
||||
if (region == null) return;
|
||||
Schematic schem = Schematic.getSchemFromDB(s, p.getUniqueId());
|
||||
if (schem == null) {
|
||||
@ -104,15 +108,6 @@ public class CommandRegion extends SWCommand {
|
||||
return true;
|
||||
}
|
||||
|
||||
private Region regionCheck(Player player) {
|
||||
Region region = Region.getRegion(player.getLocation());
|
||||
if (region == Region.GlobalRegion.getInstance()) {
|
||||
player.sendMessage(BauSystem.PREFIX + "§cDu befindest dich derzeit in keiner Region");
|
||||
return null;
|
||||
}
|
||||
return region;
|
||||
}
|
||||
|
||||
enum Action {
|
||||
UNDO,
|
||||
REDO
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren