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")
|
@Register("restore")
|
||||||
public void genericRestoreCommand(Player p) {
|
public void genericRestoreCommand(Player p) {
|
||||||
if (!permissionCheck(p)) return;
|
if (!permissionCheck(p)) return;
|
||||||
Region region = regionCheck(p);
|
Region region = Region.getRegion(p.getLocation());
|
||||||
|
if(checkGlobalRegion(region, p)) return;
|
||||||
|
|
||||||
if (region == null) return;
|
if (region == null) return;
|
||||||
try {
|
try {
|
||||||
region.reset(null, true);
|
region.reset(null, true);
|
||||||
@ -72,7 +74,9 @@ public class CommandRegion extends SWCommand {
|
|||||||
@Register("restore")
|
@Register("restore")
|
||||||
public void schematicRestoreCommand(Player p, String s) {
|
public void schematicRestoreCommand(Player p, String s) {
|
||||||
if (!permissionCheck(p)) return;
|
if (!permissionCheck(p)) return;
|
||||||
Region region = regionCheck(p);
|
Region region = Region.getRegion(p.getLocation());
|
||||||
|
if(checkGlobalRegion(region, p)) return;
|
||||||
|
|
||||||
if (region == null) return;
|
if (region == null) return;
|
||||||
Schematic schem = Schematic.getSchemFromDB(s, p.getUniqueId());
|
Schematic schem = Schematic.getSchemFromDB(s, p.getUniqueId());
|
||||||
if (schem == null) {
|
if (schem == null) {
|
||||||
@ -104,15 +108,6 @@ public class CommandRegion extends SWCommand {
|
|||||||
return true;
|
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 {
|
enum Action {
|
||||||
UNDO,
|
UNDO,
|
||||||
REDO
|
REDO
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren