From 50d4e7ef2fdd1db3725cb6a6087727f616deabee Mon Sep 17 00:00:00 2001 From: MoBrot <90271578+MoBrot@users.noreply.github.com> Date: Wed, 18 Jan 2023 16:35:33 +0100 Subject: [PATCH 01/10] NoSchemSharing with Testblock Fix. --- BauSystem_Main/src/BauSystem.properties | 1 + BauSystem_Main/src/BauSystem_de.properties | 1 + .../bausystem/features/region/TestblockCommand.java | 13 +++++++++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/BauSystem_Main/src/BauSystem.properties b/BauSystem_Main/src/BauSystem.properties index 690fcb6d..c84e9d27 100644 --- a/BauSystem_Main/src/BauSystem.properties +++ b/BauSystem_Main/src/BauSystem.properties @@ -1053,6 +1053,7 @@ REGION_TB_DONE=§7Dummy reset REGION_TB_ERROR=§cError resetting the dummy REGION_TB_NO_PERMS=§cYou are not allowed to reset the dummy here REGION_TB_NO_REGION=§cYou are currently not in any region +REGION_TB_NO_SCHEMSHARING=§cYou have an active NoSchemSharing ban until {0}. REGION_TNT_HELP=§8/§etnt §8- §7Change the TNT behaviour REGION_TNT_HELP_MODE=§8/§etnt §8[§7Mode§8] §8- §7Set TNT behaviour to a given mode REGION_TNT_ON=§aTNT-Damage activated diff --git a/BauSystem_Main/src/BauSystem_de.properties b/BauSystem_Main/src/BauSystem_de.properties index 7320b18d..a239a281 100644 --- a/BauSystem_Main/src/BauSystem_de.properties +++ b/BauSystem_Main/src/BauSystem_de.properties @@ -1022,6 +1022,7 @@ REGION_TB_DONE=§7Testblock zurückgesetzt REGION_TB_ERROR=§cFehler beim Zurücksetzen des Testblocks REGION_TB_NO_PERMS=§cDu darfst hier nicht den Testblock zurücksetzen REGION_TB_NO_REGION=§cDu befindest dich derzeit in keiner Region +REGION_TB_NO_SCHEMSHARING=§cDu hast einen aktiven NoSchemSharing ban bis {0}. REGION_TNT_HELP=§8/§etnt §8- §7Ändere das TNT verhalten REGION_TNT_HELP_MODE=§8/§etnt §8[§7Mode§8] §8- §7Setzte das TNT verhalten auf einen Modus REGION_TNT_ON=§aTNT-Schaden aktiviert diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java index a677e4df..7f31f971 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java @@ -27,6 +27,7 @@ import de.steamwar.bausystem.region.utils.RegionExtensionType; import de.steamwar.bausystem.region.utils.RegionType; import de.steamwar.command.*; import de.steamwar.linkage.Linked; +import de.steamwar.sql.Punishment; import de.steamwar.sql.SchematicNode; import de.steamwar.sql.SteamwarUser; import org.bukkit.Bukkit; @@ -85,6 +86,14 @@ public class TestblockCommand extends SWCommand { return; } + if(Punishment.isPunished(SteamwarUser.get(p.getUniqueId()), Punishment.PunishmentType.NoSchemSharing, punishment -> { + + BauSystem.MESSAGE.parse("REGION_TB_NO_SCHEMSHARING", p, punishment.getEndTime()); + + })) { + return; + } + try { region.reset(node, RegionType.TESTBLOCK, regionExtensionType); RegionUtils.message(region, "REGION_TB_DONE"); @@ -126,14 +135,14 @@ public class TestblockCommand extends SWCommand { public TypeMapper nodeWithPublic() { return new TypeMapper() { @Override - public List tabCompletes(CommandSender commandSender, PreviousArguments previousArguments, String s) { + public List tabCompletes(CommandSender commandSender, String[] previousArguments, String s) { List stringList = new ArrayList<>(SchematicNode.getNodeTabcomplete(SteamwarUser.get(((Player) commandSender).getUniqueId()), s)); stringList.addAll(SchematicNode.getNodeTabcomplete(SteamwarUser.get(0), s)); return stringList; } @Override - public SchematicNode map(CommandSender commandSender, PreviousArguments previousArguments, String s) { + public SchematicNode map(CommandSender commandSender, String[] previousArguments, String s) { SchematicNode node = SchematicNode.getNodeFromPath(SteamwarUser.get(((Player) commandSender).getUniqueId()), s); if(node == null) { node = SchematicNode.getNodeFromPath(SteamwarUser.get(0), s); -- 2.39.5 From 37559ca68848bf29ddf68c9fc368c61a36e9ad0d Mon Sep 17 00:00:00 2001 From: zOnlyKroks Date: Wed, 26 Jul 2023 12:15:33 +0200 Subject: [PATCH 02/10] Fix spelling and logic --- BauSystem_Main/src/BauSystem.properties | 2 +- BauSystem_Main/src/BauSystem_de.properties | 2 +- .../features/region/TestblockCommand.java | 14 ++++++++------ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/BauSystem_Main/src/BauSystem.properties b/BauSystem_Main/src/BauSystem.properties index c84e9d27..572a859b 100644 --- a/BauSystem_Main/src/BauSystem.properties +++ b/BauSystem_Main/src/BauSystem.properties @@ -1053,7 +1053,7 @@ REGION_TB_DONE=§7Dummy reset REGION_TB_ERROR=§cError resetting the dummy REGION_TB_NO_PERMS=§cYou are not allowed to reset the dummy here REGION_TB_NO_REGION=§cYou are currently not in any region -REGION_TB_NO_SCHEMSHARING=§cYou have an active NoSchemSharing ban until {0}. +REGION_TB_NO_SCHEMSHARING=§cYou currently cannot share schematics until {0}. REGION_TNT_HELP=§8/§etnt §8- §7Change the TNT behaviour REGION_TNT_HELP_MODE=§8/§etnt §8[§7Mode§8] §8- §7Set TNT behaviour to a given mode REGION_TNT_ON=§aTNT-Damage activated diff --git a/BauSystem_Main/src/BauSystem_de.properties b/BauSystem_Main/src/BauSystem_de.properties index a239a281..67a9ae2f 100644 --- a/BauSystem_Main/src/BauSystem_de.properties +++ b/BauSystem_Main/src/BauSystem_de.properties @@ -1022,7 +1022,7 @@ REGION_TB_DONE=§7Testblock zurückgesetzt REGION_TB_ERROR=§cFehler beim Zurücksetzen des Testblocks REGION_TB_NO_PERMS=§cDu darfst hier nicht den Testblock zurücksetzen REGION_TB_NO_REGION=§cDu befindest dich derzeit in keiner Region -REGION_TB_NO_SCHEMSHARING=§cDu hast einen aktiven NoSchemSharing ban bis {0}. +REGION_TB_NO_SCHEMSHARING=§cDu kannst aktuell keine Schematics teilen bis {0}. REGION_TNT_HELP=§8/§etnt §8- §7Ändere das TNT verhalten REGION_TNT_HELP_MODE=§8/§etnt §8[§7Mode§8] §8- §7Setzte das TNT verhalten auf einen Modus REGION_TNT_ON=§aTNT-Schaden aktiviert diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java index 7f31f971..af903853 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java @@ -21,6 +21,7 @@ package de.steamwar.bausystem.features.region; import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.Permission; +import de.steamwar.bausystem.config.BauServer; import de.steamwar.bausystem.region.Region; import de.steamwar.bausystem.region.RegionUtils; import de.steamwar.bausystem.region.utils.RegionExtensionType; @@ -44,6 +45,9 @@ import java.util.logging.Level; @Linked public class TestblockCommand extends SWCommand { + @LinkedInstance + public BauServer bauServer; + public TestblockCommand() { super("testblock", "tb", "dummy"); } @@ -86,12 +90,10 @@ public class TestblockCommand extends SWCommand { return; } - if(Punishment.isPunished(SteamwarUser.get(p.getUniqueId()), Punishment.PunishmentType.NoSchemSharing, punishment -> { - - BauSystem.MESSAGE.parse("REGION_TB_NO_SCHEMSHARING", p, punishment.getEndTime()); - - })) { - return; + if(bauServer.getOwner() != p.getUniqueId()) { + if(Punishment.isPunished(SteamwarUser.get(p.getUniqueId()), Punishment.PunishmentType.NoSchemSharing, punishment -> BauSystem.MESSAGE.parse("REGION_TB_NO_SCHEMSHARING", p, punishment.getEndTime()))) { + return; + } } try { -- 2.39.5 From 361d96ddf3ecdda6c75665572867ac51bda52874 Mon Sep 17 00:00:00 2001 From: zOnlyKroks Date: Wed, 26 Jul 2023 13:49:53 +0200 Subject: [PATCH 03/10] Fix import --- .../de/steamwar/bausystem/features/region/TestblockCommand.java | 1 + 1 file changed, 1 insertion(+) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java index af903853..ad5e68a6 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java @@ -28,6 +28,7 @@ import de.steamwar.bausystem.region.utils.RegionExtensionType; import de.steamwar.bausystem.region.utils.RegionType; import de.steamwar.command.*; import de.steamwar.linkage.Linked; +import de.steamwar.linkage.LinkedInstance; import de.steamwar.sql.Punishment; import de.steamwar.sql.SchematicNode; import de.steamwar.sql.SteamwarUser; -- 2.39.5 From 040f0373c863fd9c00d999c0ff2395436b768795 Mon Sep 17 00:00:00 2001 From: zOnlyKroks Date: Wed, 26 Jul 2023 13:55:45 +0200 Subject: [PATCH 04/10] Implement Punishment Check in ResetCommand --- .../bausystem/features/region/ResetCommand.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/ResetCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/ResetCommand.java index 670facf5..9fc8490d 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/ResetCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/ResetCommand.java @@ -21,6 +21,7 @@ package de.steamwar.bausystem.features.region; import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.Permission; +import de.steamwar.bausystem.config.BauServer; import de.steamwar.bausystem.region.GlobalRegion; import de.steamwar.bausystem.region.Region; import de.steamwar.bausystem.region.RegionUtils; @@ -28,7 +29,10 @@ import de.steamwar.bausystem.region.utils.RegionType; import de.steamwar.command.SWCommand; import de.steamwar.command.TypeValidator; import de.steamwar.linkage.Linked; +import de.steamwar.linkage.LinkedInstance; +import de.steamwar.sql.Punishment; import de.steamwar.sql.SchematicNode; +import de.steamwar.sql.SteamwarUser; import org.bukkit.Bukkit; import org.bukkit.entity.Player; @@ -38,6 +42,9 @@ import java.util.logging.Level; @Linked public class ResetCommand extends SWCommand { + @LinkedInstance + public BauServer bauServer; + public ResetCommand() { super("reset"); } @@ -59,6 +66,13 @@ public class ResetCommand extends SWCommand { public void schematicResetCommand(@Validator Player p, SchematicNode node) { Region region = regionCheck(p); if (region == null) return; + + if(bauServer.getOwner() != p.getUniqueId()) { + if(Punishment.isPunished(SteamwarUser.get(p.getUniqueId()), Punishment.PunishmentType.NoSchemSharing, punishment -> BauSystem.MESSAGE.parse("REGION_TB_NO_SCHEMSHARING", p, punishment.getEndTime()))) { + return; + } + } + if (node.isDir()) { BauSystem.MESSAGE.send("ONLY_SCHEMS", p); return; -- 2.39.5 From 3e703c8b065699b6d2386c713419ea6ae271d004 Mon Sep 17 00:00:00 2001 From: zOnlyKroks Date: Wed, 26 Jul 2023 18:07:30 +0200 Subject: [PATCH 05/10] No Schem Receiving --- BauSystem_Main/src/BauSystem.properties | 1 + BauSystem_Main/src/BauSystem_de.properties | 1 + .../src/de/steamwar/bausystem/features/region/ResetCommand.java | 2 ++ .../de/steamwar/bausystem/features/region/TestblockCommand.java | 2 ++ 4 files changed, 6 insertions(+) diff --git a/BauSystem_Main/src/BauSystem.properties b/BauSystem_Main/src/BauSystem.properties index b2ac92cc..2a06663e 100644 --- a/BauSystem_Main/src/BauSystem.properties +++ b/BauSystem_Main/src/BauSystem.properties @@ -848,6 +848,7 @@ REGION_TB_ERROR=§cError resetting the dummy REGION_TB_NO_PERMS=§cYou are not allowed to reset the dummy here REGION_TB_NO_REGION=§cYou are currently not in any region REGION_TB_NO_SCHEMSHARING=§cYou currently cannot share schematics until {0}. +REGION_TB_NO_SCHEMRECEIVING=§cThe Owner of this build server cannot receive any schematics until {0}. REGION_TNT_HELP=§8/§etnt §8- §7Change the TNT behaviour REGION_TNT_HELP_MODE=§8/§etnt §8[§7Mode§8] §8- §7Set TNT behaviour to a given mode REGION_TNT_ON=§aTNT-Damage activated diff --git a/BauSystem_Main/src/BauSystem_de.properties b/BauSystem_Main/src/BauSystem_de.properties index 28899db2..f60c069e 100644 --- a/BauSystem_Main/src/BauSystem_de.properties +++ b/BauSystem_Main/src/BauSystem_de.properties @@ -811,6 +811,7 @@ REGION_TB_ERROR=§cFehler beim Zurücksetzen des Testblocks REGION_TB_NO_PERMS=§cDu darfst hier nicht den Testblock zurücksetzen REGION_TB_NO_REGION=§cDu befindest dich derzeit in keiner Region REGION_TB_NO_SCHEMSHARING=§cDu kannst aktuell keine Schematics teilen bis {0}. +REGION_TB_NO_SCHEMRECEIVING=§cDer Besitzer dieses Bauservers kann keine Schematics erhalten bis {0}. REGION_TNT_HELP=§8/§etnt §8- §7Ändere das TNT verhalten REGION_TNT_HELP_MODE=§8/§etnt §8[§7Mode§8] §8- §7Setzte das TNT verhalten auf einen Modus REGION_TNT_ON=§aTNT-Schaden aktiviert diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/ResetCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/ResetCommand.java index 9fc8490d..03e0e429 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/ResetCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/ResetCommand.java @@ -71,6 +71,8 @@ public class ResetCommand extends SWCommand { if(Punishment.isPunished(SteamwarUser.get(p.getUniqueId()), Punishment.PunishmentType.NoSchemSharing, punishment -> BauSystem.MESSAGE.parse("REGION_TB_NO_SCHEMSHARING", p, punishment.getEndTime()))) { return; } + }else if(Punishment.isPunished(SteamwarUser.get(bauServer.getOwner(), Punishment.PunishmentType.NoSchemReceiving, punishment -> BauSystem.MESSAGE.parse("REGION_TB_NO_SCHEMRECEIVING", p, punishment.getEndTime())))) { + return; } if (node.isDir()) { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java index ad5e68a6..1062bea1 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java @@ -95,6 +95,8 @@ public class TestblockCommand extends SWCommand { if(Punishment.isPunished(SteamwarUser.get(p.getUniqueId()), Punishment.PunishmentType.NoSchemSharing, punishment -> BauSystem.MESSAGE.parse("REGION_TB_NO_SCHEMSHARING", p, punishment.getEndTime()))) { return; } + }else if(Punishment.isPunished(SteamwarUser.get(bauServer.getOwner(), Punishment.PunishmentType.NoSchemReceiving, punishment -> BauSystem.MESSAGE.parse("REGION_TB_NO_SCHEMRECEIVING", p, punishment.getEndTime())))) { + return; } try { -- 2.39.5 From 6afc5f3e81fb3822ce60fc4b3093d4b82dee7a53 Mon Sep 17 00:00:00 2001 From: zOnlyKroks Date: Wed, 26 Jul 2023 18:08:43 +0200 Subject: [PATCH 06/10] Fix typo --- .../src/de/steamwar/bausystem/features/region/ResetCommand.java | 2 +- .../de/steamwar/bausystem/features/region/TestblockCommand.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/ResetCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/ResetCommand.java index 03e0e429..ec5a48e0 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/ResetCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/ResetCommand.java @@ -71,7 +71,7 @@ public class ResetCommand extends SWCommand { if(Punishment.isPunished(SteamwarUser.get(p.getUniqueId()), Punishment.PunishmentType.NoSchemSharing, punishment -> BauSystem.MESSAGE.parse("REGION_TB_NO_SCHEMSHARING", p, punishment.getEndTime()))) { return; } - }else if(Punishment.isPunished(SteamwarUser.get(bauServer.getOwner(), Punishment.PunishmentType.NoSchemReceiving, punishment -> BauSystem.MESSAGE.parse("REGION_TB_NO_SCHEMRECEIVING", p, punishment.getEndTime())))) { + }else if(Punishment.isPunished(SteamwarUser.get(bauServer.getOwner()), Punishment.PunishmentType.NoSchemReceiving, punishment -> BauSystem.MESSAGE.parse("REGION_TB_NO_SCHEMRECEIVING", p, punishment.getEndTime())))) { return; } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java index 1062bea1..91515113 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java @@ -95,7 +95,7 @@ public class TestblockCommand extends SWCommand { if(Punishment.isPunished(SteamwarUser.get(p.getUniqueId()), Punishment.PunishmentType.NoSchemSharing, punishment -> BauSystem.MESSAGE.parse("REGION_TB_NO_SCHEMSHARING", p, punishment.getEndTime()))) { return; } - }else if(Punishment.isPunished(SteamwarUser.get(bauServer.getOwner(), Punishment.PunishmentType.NoSchemReceiving, punishment -> BauSystem.MESSAGE.parse("REGION_TB_NO_SCHEMRECEIVING", p, punishment.getEndTime())))) { + }else if(Punishment.isPunished(SteamwarUser.get(bauServer.getOwner()), Punishment.PunishmentType.NoSchemReceiving, punishment -> BauSystem.MESSAGE.parse("REGION_TB_NO_SCHEMRECEIVING", p, punishment.getEndTime())))) { return; } -- 2.39.5 From 65f11dc9177c18ace31c80e4b1e40b63a98cfb04 Mon Sep 17 00:00:00 2001 From: zOnlyKroks Date: Wed, 26 Jul 2023 18:10:02 +0200 Subject: [PATCH 07/10] Fix yet another typo --- .../src/de/steamwar/bausystem/features/region/ResetCommand.java | 2 +- .../de/steamwar/bausystem/features/region/TestblockCommand.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/ResetCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/ResetCommand.java index ec5a48e0..5622eba0 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/ResetCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/ResetCommand.java @@ -71,7 +71,7 @@ public class ResetCommand extends SWCommand { if(Punishment.isPunished(SteamwarUser.get(p.getUniqueId()), Punishment.PunishmentType.NoSchemSharing, punishment -> BauSystem.MESSAGE.parse("REGION_TB_NO_SCHEMSHARING", p, punishment.getEndTime()))) { return; } - }else if(Punishment.isPunished(SteamwarUser.get(bauServer.getOwner()), Punishment.PunishmentType.NoSchemReceiving, punishment -> BauSystem.MESSAGE.parse("REGION_TB_NO_SCHEMRECEIVING", p, punishment.getEndTime())))) { + }else if(Punishment.isPunished(SteamwarUser.get(bauServer.getOwner()), Punishment.PunishmentType.NoSchemReceiving, punishment -> BauSystem.MESSAGE.parse("REGION_TB_NO_SCHEMRECEIVING", p, punishment.getEndTime()))) { return; } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java index 91515113..9c53b59d 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java @@ -95,7 +95,7 @@ public class TestblockCommand extends SWCommand { if(Punishment.isPunished(SteamwarUser.get(p.getUniqueId()), Punishment.PunishmentType.NoSchemSharing, punishment -> BauSystem.MESSAGE.parse("REGION_TB_NO_SCHEMSHARING", p, punishment.getEndTime()))) { return; } - }else if(Punishment.isPunished(SteamwarUser.get(bauServer.getOwner()), Punishment.PunishmentType.NoSchemReceiving, punishment -> BauSystem.MESSAGE.parse("REGION_TB_NO_SCHEMRECEIVING", p, punishment.getEndTime())))) { + }else if(Punishment.isPunished(SteamwarUser.get(bauServer.getOwner()), Punishment.PunishmentType.NoSchemReceiving, punishment -> BauSystem.MESSAGE.parse("REGION_TB_NO_SCHEMRECEIVING", p, punishment.getEndTime()))) { return; } -- 2.39.5 From 966a7336e1bf1d452d025bfb36687c9bf5bd0ec2 Mon Sep 17 00:00:00 2001 From: zOnlyKroks Date: Wed, 26 Jul 2023 18:50:56 +0200 Subject: [PATCH 08/10] Unscrew intellij --- .../steamwar/bausystem/features/region/TestblockCommand.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java index 9c53b59d..c766eb36 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java @@ -140,14 +140,14 @@ public class TestblockCommand extends SWCommand { public TypeMapper nodeWithPublic() { return new TypeMapper() { @Override - public List tabCompletes(CommandSender commandSender, String[] previousArguments, String s) { + public List tabCompletes(CommandSender commandSender, PreviousArguments previousArguments, String s) { List stringList = new ArrayList<>(SchematicNode.getNodeTabcomplete(SteamwarUser.get(((Player) commandSender).getUniqueId()), s)); stringList.addAll(SchematicNode.getNodeTabcomplete(SteamwarUser.get(0), s)); return stringList; } @Override - public SchematicNode map(CommandSender commandSender, String[] previousArguments, String s) { + public SchematicNode map(CommandSender commandSender, PreviousArguments previousArguments, String s) { SchematicNode node = SchematicNode.getNodeFromPath(SteamwarUser.get(((Player) commandSender).getUniqueId()), s); if(node == null) { node = SchematicNode.getNodeFromPath(SteamwarUser.get(0), s); -- 2.39.5 From d4c38367c7e689333aa704599881576ab64da48a Mon Sep 17 00:00:00 2001 From: zOnlyKroks Date: Wed, 26 Jul 2023 18:51:50 +0200 Subject: [PATCH 09/10] Add import --- .../de/steamwar/bausystem/features/region/TestblockCommand.java | 1 + 1 file changed, 1 insertion(+) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java index c766eb36..d0868382 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java @@ -29,6 +29,7 @@ import de.steamwar.bausystem.region.utils.RegionType; import de.steamwar.command.*; import de.steamwar.linkage.Linked; import de.steamwar.linkage.LinkedInstance; +import de.steamwar.command.PreviousArguments; import de.steamwar.sql.Punishment; import de.steamwar.sql.SchematicNode; import de.steamwar.sql.SteamwarUser; -- 2.39.5 From 69347e652f8b72c6223c401174783ab3e00b8e8f Mon Sep 17 00:00:00 2001 From: zOnlyKroks Date: Wed, 26 Jul 2023 19:40:15 +0200 Subject: [PATCH 10/10] Fix formatting --- .../steamwar/bausystem/features/region/ResetCommand.java | 6 +++--- .../bausystem/features/region/TestblockCommand.java | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/ResetCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/ResetCommand.java index 5622eba0..d057d59f 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/ResetCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/ResetCommand.java @@ -67,11 +67,11 @@ public class ResetCommand extends SWCommand { Region region = regionCheck(p); if (region == null) return; - if(bauServer.getOwner() != p.getUniqueId()) { - if(Punishment.isPunished(SteamwarUser.get(p.getUniqueId()), Punishment.PunishmentType.NoSchemSharing, punishment -> BauSystem.MESSAGE.parse("REGION_TB_NO_SCHEMSHARING", p, punishment.getEndTime()))) { + if (bauServer.getOwner() != p.getUniqueId()) { + if (Punishment.isPunished(SteamwarUser.get(p.getUniqueId()), Punishment.PunishmentType.NoSchemSharing, punishment -> BauSystem.MESSAGE.parse("REGION_TB_NO_SCHEMSHARING", p, punishment.getEndTime()))) { return; } - }else if(Punishment.isPunished(SteamwarUser.get(bauServer.getOwner()), Punishment.PunishmentType.NoSchemReceiving, punishment -> BauSystem.MESSAGE.parse("REGION_TB_NO_SCHEMRECEIVING", p, punishment.getEndTime()))) { + } else if (Punishment.isPunished(SteamwarUser.get(bauServer.getOwner()), Punishment.PunishmentType.NoSchemReceiving, punishment -> BauSystem.MESSAGE.parse("REGION_TB_NO_SCHEMRECEIVING", p, punishment.getEndTime()))) { return; } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java index d0868382..f4d45fb4 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java @@ -92,11 +92,11 @@ public class TestblockCommand extends SWCommand { return; } - if(bauServer.getOwner() != p.getUniqueId()) { - if(Punishment.isPunished(SteamwarUser.get(p.getUniqueId()), Punishment.PunishmentType.NoSchemSharing, punishment -> BauSystem.MESSAGE.parse("REGION_TB_NO_SCHEMSHARING", p, punishment.getEndTime()))) { + if (bauServer.getOwner() != p.getUniqueId()) { + if (Punishment.isPunished(SteamwarUser.get(p.getUniqueId()), Punishment.PunishmentType.NoSchemSharing, punishment -> BauSystem.MESSAGE.parse("REGION_TB_NO_SCHEMSHARING", p, punishment.getEndTime()))) { return; } - }else if(Punishment.isPunished(SteamwarUser.get(bauServer.getOwner()), Punishment.PunishmentType.NoSchemReceiving, punishment -> BauSystem.MESSAGE.parse("REGION_TB_NO_SCHEMRECEIVING", p, punishment.getEndTime()))) { + } else if (Punishment.isPunished(SteamwarUser.get(bauServer.getOwner()), Punishment.PunishmentType.NoSchemReceiving, punishment -> BauSystem.MESSAGE.parse("REGION_TB_NO_SCHEMRECEIVING", p, punishment.getEndTime()))) { return; } @@ -148,7 +148,7 @@ public class TestblockCommand extends SWCommand { } @Override - public SchematicNode map(CommandSender commandSender, PreviousArguments previousArguments, String s) { + public SchematicNode map(CommandSender commandSender, PreviousArguments previousArguments, String s) { SchematicNode node = SchematicNode.getNodeFromPath(SteamwarUser.get(((Player) commandSender).getUniqueId()), s); if(node == null) { node = SchematicNode.getNodeFromPath(SteamwarUser.get(0), s); -- 2.39.5