From 43f1ecc985ad52caa83cca3db7b646e022b18418 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 3 Mar 2023 17:10:45 +0100 Subject: [PATCH] Revert "Hotfix everything that does not work" This reverts commit 4cfd7402a4c3c6d61031adfaaa19a12f6ee7d68f. --- .../src/de/steamwar/bausystem/BauSystem.java | 2 +- .../bausystem/features/detonator/DetonatorCommand.java | 2 +- .../features/detonator/DetonatorListener.java | 2 +- .../features/killchecker/KillcheckerCommand.java | 2 +- .../bausystem/features/script/variables/Constants.java | 4 ---- .../bausystem/features/simulator/SimulatorCommand.java | 2 +- .../bausystem/features/simulator/SimulatorStorage.java | 2 +- .../features/simulator/TNTSimulatorListener.java | 2 +- .../bausystem/features/tracer/TraceCommand.java | 2 +- .../bausystem/features/tracer/record/Recorder.java | 10 +++++++++- .../steamwar/bausystem/features/warp/WarpCommand.java | 2 +- .../steamwar/bausystem/features/warp/WarpListener.java | 2 +- 12 files changed, 19 insertions(+), 15 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java index 44ad2b3a..1d1e6362 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java @@ -94,7 +94,7 @@ public class BauSystem extends JavaPlugin implements Listener { @Override public void onDisable() { - // LinkageUtils.unlink(); + LinkageUtils.unlink(); WorldData.write(); Config.getInstance().saveAll(); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorCommand.java index f703729f..bb71245d 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorCommand.java @@ -34,7 +34,7 @@ import org.bukkit.inventory.meta.ItemMeta; import java.util.Arrays; -// @Linked +@Linked public class DetonatorCommand extends SWCommand { public static ItemStack getWAND(Player player) { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorListener.java index f0ced4e5..be8e8ce9 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorListener.java @@ -38,7 +38,7 @@ import org.bukkit.event.player.PlayerSwapHandItemsEvent; import java.util.HashSet; import java.util.Set; -// @Linked +@Linked public class DetonatorListener implements Listener { static final Set HAS_UPDATED = new HashSet<>(); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/killchecker/KillcheckerCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/killchecker/KillcheckerCommand.java index 74fae22f..fee15416 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/killchecker/KillcheckerCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/killchecker/KillcheckerCommand.java @@ -37,7 +37,7 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; -// @Linked +@Linked public class KillcheckerCommand extends SWCommand implements Listener { private Map visualizers = new HashMap<>(); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/script/variables/Constants.java b/BauSystem_Main/src/de/steamwar/bausystem/features/script/variables/Constants.java index 576a8fc1..e0ec0872 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/script/variables/Constants.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/script/variables/Constants.java @@ -171,7 +171,6 @@ public class Constants { static { CONSTANTS.put("trace", player -> { - if (true) return new ConstantBooleanValue(() -> false); Region region = Region.getRegion(player.getLocation()); if (region.isGlobal()) { return new ConstantBooleanValue(() -> false); @@ -179,7 +178,6 @@ public class Constants { return new ConstantBooleanValue(() -> Recorder.INSTANCE.get(region) instanceof ActiveTracer); }); CONSTANTS.put("autotrace", player -> { - if (true) return new ConstantBooleanValue(() -> false); Region region = Region.getRegion(player.getLocation()); if (region.isGlobal()) { return new ConstantBooleanValue(() -> false); @@ -187,12 +185,10 @@ public class Constants { return new ConstantBooleanValue(() -> Recorder.INSTANCE.get(region) instanceof AutoTraceRecorder); }); CONSTANTS.put("trace_status", player -> { - if (true) return new ConstantStringValue(() -> ""); TraceRecorder recorder = Recorder.INSTANCE.get(Region.getRegion(player.getLocation())); return new ConstantStringValue(recorder::scriptState); }); CONSTANTS.put("trace_time", player -> { - if (true) return new ConstantLongValue(() -> 0L); TraceRecorder recorder = Recorder.INSTANCE.get(Region.getRegion(player.getLocation())); return new ConstantLongValue(recorder::scriptTime); }); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorCommand.java index c4462dc9..640d0360 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorCommand.java @@ -35,7 +35,7 @@ import org.bukkit.inventory.ItemStack; import java.util.Collection; -// @Linked +@Linked public class SimulatorCommand extends SWCommand { public SimulatorCommand() { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorStorage.java b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorStorage.java index 5103136a..a549e0a2 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorStorage.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorStorage.java @@ -48,7 +48,7 @@ import java.util.Map; import java.util.Set; import java.util.stream.Collectors; -// @Linked +@Linked public class SimulatorStorage implements Enable, Disable { public static final World WORLD = Bukkit.getWorlds().get(0); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulatorListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulatorListener.java index df76dc5b..48285d78 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulatorListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulatorListener.java @@ -35,7 +35,7 @@ import org.bukkit.inventory.PlayerInventory; import java.util.function.Function; -// @Linked +@Linked public class TNTSimulatorListener implements Listener { private boolean permissionCheck(Player player) { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java index a3c3cc71..b24ec012 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java @@ -43,7 +43,7 @@ import java.util.function.BiFunction; import java.util.function.Supplier; import java.util.stream.Collectors; -// @Linked +@Linked public class TraceCommand extends SWCommand { public TraceCommand() { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/record/Recorder.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/record/Recorder.java index 7e037875..2d74492d 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/record/Recorder.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/record/Recorder.java @@ -39,7 +39,7 @@ import org.bukkit.event.entity.EntitySpawnEvent; import java.util.*; import java.util.stream.Collectors; -// @Linked +@Linked public class Recorder implements Listener { public static Recorder INSTANCE; @@ -108,6 +108,14 @@ public class Recorder implements Listener { } private static final DisabledTracerRecorder DISABLED = new DisabledTracerRecorder(); + static Recorder instance; + + { + instance = this; + } + + private final World world = Bukkit.getWorlds().get(0); + private Map regionTraceRecorderMap = new HashMap<>(); private Map tntTraceRecorderMap = new HashMap<>(); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/warp/WarpCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/warp/WarpCommand.java index ac21b447..cf44f51f 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/warp/WarpCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/warp/WarpCommand.java @@ -40,7 +40,7 @@ import yapion.hierarchy.types.YAPIONObject; import java.util.ArrayList; -// @Linked +@Linked public class WarpCommand extends SWCommand implements Disable, Enable { private static final String[] FORBIDDEN_NAMES = new String[]{ diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/warp/WarpListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/warp/WarpListener.java index fa040556..953d709a 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/warp/WarpListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/warp/WarpListener.java @@ -38,7 +38,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -// @Linked +@Linked public class WarpListener implements Listener { private Map warpEntityServer = new HashMap<>();