From fcf8f2790bc2a09425ff38f004c3d64fcaca288c Mon Sep 17 00:00:00 2001 From: yoyosource Date: Mon, 5 Apr 2021 13:22:36 +0200 Subject: [PATCH 1/2] Hotfix CommandColor --- .../src/de/steamwar/bausystem/commands/CommandColor.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandColor.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandColor.java index 09b25d7..ada9fb0 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandColor.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandColor.java @@ -35,6 +35,10 @@ public class CommandColor extends SWCommand { return; } Region region = Region.getRegion(p.getLocation()); + if (Region.GlobalRegion.isGlobalRegion(region)) { + p.sendMessage(BauSystem.PREFIX + "§cDu befindest dich derzeit in keiner Region"); + return; + } region.setColor(color); p.sendMessage(BauSystem.PREFIX + "Regions farben auf §e" + color.name().toLowerCase() + "§7 gesetzt"); } From 28fb4bc6ab3e9a94456fbe6d38b996c3f587fcea Mon Sep 17 00:00:00 2001 From: Zeanon Date: Mon, 5 Apr 2021 14:40:34 +0200 Subject: [PATCH 2/2] added rg color command --- .../de/steamwar/bausystem/commands/CommandColor.java | 12 ++++++++++++ .../steamwar/bausystem/commands/CommandRegion.java | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandColor.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandColor.java index ada9fb0..342866e 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandColor.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandColor.java @@ -9,8 +9,15 @@ import org.bukkit.entity.Player; public class CommandColor extends SWCommand { + private static CommandColor instance = null; + public CommandColor() { super("color"); + instance = this; + } + + public static CommandColor getInstance() { + return instance; } @Register(help = true) @@ -43,6 +50,11 @@ public class CommandColor extends SWCommand { p.sendMessage(BauSystem.PREFIX + "Regions farben auf §e" + color.name().toLowerCase() + "§7 gesetzt"); } + @Register + public void genericColorSet(Player p, ColorizationType colorizationType, Color color) { + genericColorSet(p, color, colorizationType); + } + private boolean permissionCheck(Player p) { if (!BauSystem.getOwner().equals(p.getUniqueId())) { p.sendMessage(BauSystem.PREFIX + "§cDies ist nicht deine Welt!"); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandRegion.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandRegion.java index dcd8d5b..c39918b 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandRegion.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandRegion.java @@ -2,6 +2,7 @@ package de.steamwar.bausystem.commands; import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.Permission; +import de.steamwar.bausystem.world.Color; import de.steamwar.bausystem.world.Region; import de.steamwar.bausystem.world.Welt; import de.steamwar.command.SWCommand; @@ -92,6 +93,11 @@ public class CommandRegion extends SWCommand { } } + @Register("color") + public void colorCommand(Player p, Color color) { + CommandColor.getInstance().genericColor(p, color); + } + static boolean checkGlobalRegion(Region region, Player p) { if(Region.GlobalRegion.isGlobalRegion(region)) { p.sendMessage(BauSystem.PREFIX + "§cDu bist in keiner Region");