From 1f2b6a0290e443a992155b8e2e74fe92aceded5b Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sun, 30 Aug 2020 07:13:11 +0200 Subject: [PATCH] Simplify Tracer #1 --- .../bausystem/tracer/TNTTracer_12.java | 90 +------------------ .../bausystem/tracer/TNTTracer_15.java | 87 +----------------- .../bausystem/tracer/TracerGuiUpdater.java | 4 - .../src/de/steamwar/bausystem/BauSystem.java | 27 ++---- .../steamwar/bausystem/tracer/MoveEvent.java | 17 ---- .../bausystem/tracer/TNTListener.java | 42 --------- .../steamwar/bausystem/tracer/TNTTracer.java | 89 ++++++++++++++---- .../bausystem/tracer/TNTTracerGUI_15.java | 0 .../bausystem/tracer/TraceActionbar.java | 1 + .../steamwar/bausystem/tracer/TraceCache.java | 0 .../bausystem/tracer/TraceListener.java | 33 +++++++ .../steamwar/bausystem/tracer/TraceUtils.java | 11 +-- .../bausystem/tracer/TracerUpdater.java | 0 .../tracer/recorder/RecordManager.java | 6 +- 14 files changed, 125 insertions(+), 282 deletions(-) delete mode 100644 BauSystem_API/src/de/steamwar/bausystem/tracer/TracerGuiUpdater.java delete mode 100644 BauSystem_Main/src/de/steamwar/bausystem/tracer/MoveEvent.java delete mode 100644 BauSystem_Main/src/de/steamwar/bausystem/tracer/TNTListener.java rename {BauSystem_15 => BauSystem_Main}/src/de/steamwar/bausystem/tracer/TNTTracerGUI_15.java (100%) rename {BauSystem_API => BauSystem_Main}/src/de/steamwar/bausystem/tracer/TraceCache.java (100%) create mode 100644 BauSystem_Main/src/de/steamwar/bausystem/tracer/TraceListener.java rename {BauSystem_API => BauSystem_Main}/src/de/steamwar/bausystem/tracer/TraceUtils.java (86%) rename {BauSystem_API => BauSystem_Main}/src/de/steamwar/bausystem/tracer/TracerUpdater.java (100%) diff --git a/BauSystem_12/src/de/steamwar/bausystem/tracer/TNTTracer_12.java b/BauSystem_12/src/de/steamwar/bausystem/tracer/TNTTracer_12.java index 018245c..0f5d0f3 100644 --- a/BauSystem_12/src/de/steamwar/bausystem/tracer/TNTTracer_12.java +++ b/BauSystem_12/src/de/steamwar/bausystem/tracer/TNTTracer_12.java @@ -1,95 +1,11 @@ package de.steamwar.bausystem.tracer; -import net.md_5.bungee.api.ChatMessageType; -import net.md_5.bungee.api.chat.TextComponent; -import org.bukkit.*; -import org.bukkit.block.Block; -import org.bukkit.block.BlockFace; -import org.bukkit.entity.Player; -import org.bukkit.entity.TNTPrimed; -import org.bukkit.material.Step; -import org.bukkit.plugin.Plugin; +import org.bukkit.Material; -import java.util.*; - -import static de.steamwar.bausystem.tracer.TraceUtils.actionBar; - -@SuppressWarnings("deprecation") class TNTTracer_12 { - private TNTTracer_12(){} - private static TracerUpdater tracerUpdater; - private static TraceCache traceCache = new TraceCache(); - - private static class Synchronizer {} - private static final Synchronizer synchronizer = new Synchronizer(); - - private static World world; - static void worldInit() { - if (world != null) return; - world = Bukkit.getWorlds().get(0); + static Material getMaterial(){ + return Material.STAINED_GLASS; } - - static void init(Plugin plugin, TracerUpdater tracerUpdater) { - Bukkit.getScheduler().runTaskTimer(plugin, () -> { - synchronized (synchronizer) { - synchronizer.notifyAll(); - } - }, 1, 20); - Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> { - while (true) { - synchronized (synchronizer) { - try { - synchronizer.wait(); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } - } - run(); - } - }); - - TNTTracer_12.tracerUpdater = tracerUpdater; - } - - private static void run() { - for (Player p : Bukkit.getOnlinePlayers()) { - if (actionBar) { - String actionBar = tracerUpdater.actionBar(p); - p.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(actionBar)); - } - - boolean dirty = tracerUpdater.needsUpdate(p); - if (tracerUpdater.getDisplayType(p) == TracerUpdater.DisplayMode.Block && !dirty) { - continue; - } - Set toHide = traceCache.update(p, tracerUpdater, dirty); - Set toShow = traceCache.get(p); - - hideBlockTraces(toHide, p); - showTraces(toShow, tracerUpdater.getDisplayType(p), p); - } - } - - private static void hideBlockTraces(Set locs, Player player) { - if (locs.isEmpty()) return; - - for (TraceCache.Loc l : locs) { - TraceUtils.hideBlock(player, l.x, l.y - 0.49F, l.z); - } - } - - private static void showTraces(Set locs, TracerUpdater.DisplayMode displayMode, Player player) { - if (locs.isEmpty()) return; - - for (TraceCache.Loc l : locs) { - if (displayMode == TracerUpdater.DisplayMode.Block) { - TraceUtils.showBlock(player, l.x, l.y - 0.49F, l.z, Material.STAINED_GLASS, (l.updatePoint ? (byte) 5 : (byte) 14)); - } else { - TraceUtils.showCorner(player, l.x - 0.49F, l.y, l.z - 0.49F, (l.updatePoint ? Particle.FLAME : Particle.VILLAGER_HAPPY)); - } - } - } - } diff --git a/BauSystem_15/src/de/steamwar/bausystem/tracer/TNTTracer_15.java b/BauSystem_15/src/de/steamwar/bausystem/tracer/TNTTracer_15.java index 63a545d..553e1ea 100644 --- a/BauSystem_15/src/de/steamwar/bausystem/tracer/TNTTracer_15.java +++ b/BauSystem_15/src/de/steamwar/bausystem/tracer/TNTTracer_15.java @@ -1,94 +1,11 @@ package de.steamwar.bausystem.tracer; -import net.md_5.bungee.api.ChatMessageType; -import net.md_5.bungee.api.chat.TextComponent; -import org.bukkit.Bukkit; import org.bukkit.Material; -import org.bukkit.Particle; -import org.bukkit.World; -import org.bukkit.entity.Player; -import org.bukkit.plugin.Plugin; -import java.util.Set; - -import static de.steamwar.bausystem.tracer.TraceUtils.actionBar; - -@SuppressWarnings("deprecation") class TNTTracer_15 { - private TNTTracer_15(){} - private static TracerUpdater tracerUpdater; - private static TraceCache traceCache = new TraceCache(); - - private static class Synchronizer {} - private static final Synchronizer synchronizer = new Synchronizer(); - - private static World world; - static void worldInit() { - if (world != null) return; - world = Bukkit.getWorlds().get(0); + static Material getMaterial(boolean updatePoint){ + return updatePoint ? Material.LIME_STAINED_GLASS : Material.RED_STAINED_GLASS; } - - static void init(Plugin plugin, TracerUpdater tracerUpdater) { - Bukkit.getScheduler().runTaskTimer(plugin, () -> { - synchronized (synchronizer) { - synchronizer.notifyAll(); - } - }, 1, 20); - Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> { - while (true) { - synchronized (synchronizer) { - try { - synchronizer.wait(); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } - } - run(); - } - }); - - TNTTracer_15.tracerUpdater = tracerUpdater; - } - - private static void run() { - for (Player p : Bukkit.getOnlinePlayers()) { - if (actionBar) { - String actionBar = tracerUpdater.actionBar(p); - p.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(actionBar)); - } - - boolean dirty = tracerUpdater.needsUpdate(p); - if (tracerUpdater.getDisplayType(p) == TracerUpdater.DisplayMode.Block && !dirty) { - continue; - } - Set toHide = traceCache.update(p, tracerUpdater, dirty); - Set toShow = traceCache.get(p); - - hideBlockTraces(toHide, p); - showTraces(toShow, tracerUpdater.getDisplayType(p), p); - } - } - - private static void hideBlockTraces(Set locs, Player player) { - if (locs.isEmpty()) return; - - for (TraceCache.Loc l : locs) { - TraceUtils.hideBlock(player, l.x, l.y - 0.49F, l.z); - } - } - - private static void showTraces(Set locs, TracerUpdater.DisplayMode displayMode, Player player) { - if (locs.isEmpty()) return; - - for (TraceCache.Loc l : locs) { - if (displayMode == TracerUpdater.DisplayMode.Block) { - TraceUtils.showBlock(player, l.x, l.y - 0.49F, l.z, (l.updatePoint ? Material.LIME_STAINED_GLASS : Material.RED_STAINED_GLASS), (l.updatePoint ? (byte) 5 : (byte) 14)); - } else { - TraceUtils.showCorner(player, l.x - 0.49F, l.y, l.z - 0.49F, (l.updatePoint ? Particle.FLAME : Particle.VILLAGER_HAPPY)); - } - } - } - } diff --git a/BauSystem_API/src/de/steamwar/bausystem/tracer/TracerGuiUpdater.java b/BauSystem_API/src/de/steamwar/bausystem/tracer/TracerGuiUpdater.java deleted file mode 100644 index 1f3dd47..0000000 --- a/BauSystem_API/src/de/steamwar/bausystem/tracer/TracerGuiUpdater.java +++ /dev/null @@ -1,4 +0,0 @@ -package de.steamwar.bausystem.tracer; - -public class TracerGuiUpdater { -} diff --git a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java index 5625da9..093c3bd 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java @@ -1,12 +1,9 @@ package de.steamwar.bausystem; import de.steamwar.bausystem.commands.*; -import de.steamwar.bausystem.tracer.MoveEvent; -import de.steamwar.bausystem.tracer.TNTListener; +import de.steamwar.bausystem.tracer.TraceListener; import de.steamwar.bausystem.tracer.TNTTracer; -import de.steamwar.bausystem.tracer.TraceUtils; import de.steamwar.bausystem.tracer.manager.ShowManager; -import de.steamwar.bausystem.tracer.recorder.RecordManager; import de.steamwar.bausystem.world.AFKStopper; import de.steamwar.bausystem.world.ArenaSection; import de.steamwar.bausystem.world.BauScoreboard; @@ -104,15 +101,10 @@ public class BauSystem extends JavaPlugin implements Listener { Bukkit.getPluginManager().registerEvents(this, this); Bukkit.getPluginManager().registerEvents(new RegionListener(), this); - Bukkit.getPluginManager().registerEvents(new TNTListener(), this); Bukkit.getPluginManager().registerEvents(new BauScoreboard(), this); - Bukkit.getPluginManager().registerEvents(new MoveEvent(), this); + Bukkit.getPluginManager().registerEvents(new TraceListener(), this); new AFKStopper(); - if (Core.getVersion() == 15) { - TNTTracer.init15(); - } else { - TNTTracer.init12(); - } + TNTTracer.init(); autoShutdown = Bukkit.getScheduler().runTaskLater(this, Bukkit::shutdown, 1200); } @@ -277,16 +269,10 @@ public class BauSystem extends JavaPlugin implements Listener { attachment.setPermission("worldedit.calc", true); attachment.setPermission("worldedit.fill", true);*/ - RecordManager.worldInit(); - TNTTracer.worldInit(); - TraceUtils.locationInit(); - ShowManager.add(p); - if (Core.getVersion() == 15){ - ShowManager.add(p); + if (Core.getVersion() == 15) Bukkit.getWorlds().get(0).setGameRule(GameRule.REDUCED_DEBUG_INFO, false); - } } @EventHandler @@ -301,8 +287,9 @@ public class BauSystem extends JavaPlugin implements Listener { @EventHandler public void onInventoryClick(InventoryClickEvent e) { ItemStack stack = e.getCursor(); - if (stack == null) return; - if (!stack.hasItemMeta()) return; + if (stack == null || !stack.hasItemMeta()) + return; + assert stack.getItemMeta() != null; if (stack.getItemMeta().hasEnchants()) { for (Enchantment en : Enchantment.values()) { if (stack.getEnchantmentLevel(en) > en.getMaxLevel()) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/tracer/MoveEvent.java b/BauSystem_Main/src/de/steamwar/bausystem/tracer/MoveEvent.java deleted file mode 100644 index 3cfb0dc..0000000 --- a/BauSystem_Main/src/de/steamwar/bausystem/tracer/MoveEvent.java +++ /dev/null @@ -1,17 +0,0 @@ -package de.steamwar.bausystem.tracer; - -import de.steamwar.bausystem.tracer.manager.ShowManager; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerMoveEvent; - -public class MoveEvent implements Listener { - - @EventHandler - public void playerMove(PlayerMoveEvent event) { - Player p = event.getPlayer(); - ShowManager.get(p).move(p); - } - -} diff --git a/BauSystem_Main/src/de/steamwar/bausystem/tracer/TNTListener.java b/BauSystem_Main/src/de/steamwar/bausystem/tracer/TNTListener.java deleted file mode 100644 index 8499435..0000000 --- a/BauSystem_Main/src/de/steamwar/bausystem/tracer/TNTListener.java +++ /dev/null @@ -1,42 +0,0 @@ -package de.steamwar.bausystem.tracer; - -import de.steamwar.bausystem.tracer.manager.TNTManager; -import de.steamwar.bausystem.tracer.recorder.RecordManager; -import de.steamwar.bausystem.tracer.recorder.TNTRecorder; -import de.steamwar.core.Core; -import org.bukkit.entity.TNTPrimed; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.entity.EntityExplodeEvent; - -public class TNTListener implements Listener { - - @EventHandler - public void onEntityExplode(EntityExplodeEvent event) { - if (!(event.getEntity() instanceof TNTPrimed)) return; - - if (RecordManager.getStatus() == RecordManager.Status.IDLE_AUTO) { - RecordManager.startAuto(); - } - if (RecordManager.getStatus() == RecordManager.Status.RECORD_AUTO) { - RecordManager.updateAuto(); - } - - TNTManager.explode((TNTPrimed) event.getEntity()); - } - - /*private void onEntityExplode12(EntityExplodeEvent event) { - if(TNTTracer12.getStatus() != TNTTracer12.Status.RECORD) return; - if(!(event.getEntity() instanceof TNTPrimed)) return; - TNTPrimed entity = (TNTPrimed) event.getEntity(); - TNTTracer12.remove(entity); - } - - private void onEntityExplode15(EntityExplodeEvent event) { - if(!(event.getEntity() instanceof TNTPrimed)) return; - if (TraceRecorder.getStatus() == TraceRecorder.Status.IDLE_AUTO || TraceRecorder.getStatus() == TraceRecorder.Status.RECORD_AUTO) { - TraceRecorder.start(); - } - TraceRecorder.explode((TNTPrimed) event.getEntity()); - }*/ -} diff --git a/BauSystem_Main/src/de/steamwar/bausystem/tracer/TNTTracer.java b/BauSystem_Main/src/de/steamwar/bausystem/tracer/TNTTracer.java index 3d77d5e..3de47f9 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/tracer/TNTTracer.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/tracer/TNTTracer.java @@ -4,15 +4,26 @@ import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.tracer.manager.ShowManager; import de.steamwar.bausystem.tracer.trace.TNTTrace; import de.steamwar.core.Core; +import net.md_5.bungee.api.ChatMessageType; +import net.md_5.bungee.api.chat.TextComponent; +import org.bukkit.Bukkit; +import org.bukkit.Material; +import org.bukkit.Particle; import org.bukkit.entity.Player; import java.util.HashSet; import java.util.Iterator; import java.util.Set; -public class TNTTracer { +import static de.steamwar.bausystem.tracer.TraceUtils.DEBUG; - private static TracerUpdater tracerUpdater = new TracerUpdater() { +public class TNTTracer { + private TNTTracer(){} + + private static final Object synchronizer = new Object(); + private static final TraceCache traceCache = new TraceCache(); + + private static final TracerUpdater tracerUpdater = new TracerUpdater() { @Override public Set updateLocations(Player player) { Iterator traces = ShowManager.get(player).getTraces().descendingIterator(); @@ -61,23 +72,71 @@ public class TNTTracer { } }; - public static void init15() { - TNTTracer_15.init(BauSystem.getPlugin(), tracerUpdater); + public static void init(){ + Bukkit.getScheduler().runTaskTimer(BauSystem.getPlugin(), () -> { + synchronized (synchronizer) { + synchronizer.notifyAll(); + } + }, 1, 20); + Bukkit.getScheduler().runTaskAsynchronously(BauSystem.getPlugin(), () -> { + while (true) { + synchronized (synchronizer) { + try { + synchronizer.wait(); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + } + } + run(); + } + }); } - public static void init12() { - TNTTracer_12.init(BauSystem.getPlugin(), tracerUpdater); - } + private static void run(){ + for (Player p : Bukkit.getOnlinePlayers()) { + if (DEBUG) { + String actionBar = tracerUpdater.actionBar(p); + p.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(actionBar)); + } - public static void worldInit() { - switch (Core.getVersion()) { - case 15: - TNTTracer_15.worldInit(); - break; - default: - TNTTracer_12.worldInit(); - break; + boolean dirty = tracerUpdater.needsUpdate(p); + if (tracerUpdater.getDisplayType(p) == TracerUpdater.DisplayMode.Block && !dirty) { + continue; + } + Set toHide = traceCache.update(p, tracerUpdater, dirty); + Set toShow = traceCache.get(p); + + hideBlockTraces(toHide, p); + showTraces(toShow, tracerUpdater.getDisplayType(p), p); } } + private static void hideBlockTraces(Set locs, Player player) { + if (locs.isEmpty()) return; + + for (TraceCache.Loc l : locs) { + TraceUtils.hideBlock(player, l.x, l.y - 0.49F, l.z); + } + } + + private static void showTraces(Set locs, TracerUpdater.DisplayMode displayMode, Player player) { + if (locs.isEmpty()) return; + + for (TraceCache.Loc l : locs) { + if (displayMode == TracerUpdater.DisplayMode.Block) { + TraceUtils.showBlock(player, l.x, l.y - 0.49F, l.z, getMaterial(l), (l.updatePoint ? (byte) 5 : (byte) 14)); + } else { + TraceUtils.showCorner(player, l.x - 0.49F, l.y, l.z - 0.49F, (l.updatePoint ? Particle.FLAME : Particle.VILLAGER_HAPPY)); + } + } + } + + private static Material getMaterial(TraceCache.Loc l){ + switch(Core.getVersion()){ + case 15: + return TNTTracer_15.getMaterial(l.updatePoint); + default: + return TNTTracer_12.getMaterial(); + } + } } diff --git a/BauSystem_15/src/de/steamwar/bausystem/tracer/TNTTracerGUI_15.java b/BauSystem_Main/src/de/steamwar/bausystem/tracer/TNTTracerGUI_15.java similarity index 100% rename from BauSystem_15/src/de/steamwar/bausystem/tracer/TNTTracerGUI_15.java rename to BauSystem_Main/src/de/steamwar/bausystem/tracer/TNTTracerGUI_15.java diff --git a/BauSystem_Main/src/de/steamwar/bausystem/tracer/TraceActionbar.java b/BauSystem_Main/src/de/steamwar/bausystem/tracer/TraceActionbar.java index 86f71ea..7fb8984 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/tracer/TraceActionbar.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/tracer/TraceActionbar.java @@ -9,6 +9,7 @@ import java.util.Iterator; import java.util.LinkedList; public class TraceActionbar { + private TraceActionbar(){} private static double round(double toRound, int digits) { int x = (int)Math.pow(10, digits); diff --git a/BauSystem_API/src/de/steamwar/bausystem/tracer/TraceCache.java b/BauSystem_Main/src/de/steamwar/bausystem/tracer/TraceCache.java similarity index 100% rename from BauSystem_API/src/de/steamwar/bausystem/tracer/TraceCache.java rename to BauSystem_Main/src/de/steamwar/bausystem/tracer/TraceCache.java diff --git a/BauSystem_Main/src/de/steamwar/bausystem/tracer/TraceListener.java b/BauSystem_Main/src/de/steamwar/bausystem/tracer/TraceListener.java new file mode 100644 index 0000000..137bd63 --- /dev/null +++ b/BauSystem_Main/src/de/steamwar/bausystem/tracer/TraceListener.java @@ -0,0 +1,33 @@ +package de.steamwar.bausystem.tracer; + +import de.steamwar.bausystem.tracer.manager.ShowManager; +import de.steamwar.bausystem.tracer.manager.TNTManager; +import de.steamwar.bausystem.tracer.recorder.RecordManager; +import org.bukkit.entity.Player; +import org.bukkit.entity.TNTPrimed; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.EntityExplodeEvent; +import org.bukkit.event.player.PlayerMoveEvent; + +public class TraceListener implements Listener { + + @EventHandler + public void onEntityExplode(EntityExplodeEvent event) { + if (!(event.getEntity() instanceof TNTPrimed)) return; + + if (RecordManager.getStatus() == RecordManager.Status.IDLE_AUTO) + RecordManager.startAuto(); + if (RecordManager.getStatus() == RecordManager.Status.RECORD_AUTO) + RecordManager.updateAuto(); + + TNTManager.explode((TNTPrimed) event.getEntity()); + } + + + @EventHandler + public void playerMove(PlayerMoveEvent event) { + Player p = event.getPlayer(); + ShowManager.get(p).move(p); + } +} diff --git a/BauSystem_API/src/de/steamwar/bausystem/tracer/TraceUtils.java b/BauSystem_Main/src/de/steamwar/bausystem/tracer/TraceUtils.java similarity index 86% rename from BauSystem_API/src/de/steamwar/bausystem/tracer/TraceUtils.java rename to BauSystem_Main/src/de/steamwar/bausystem/tracer/TraceUtils.java index bcb4404..492f990 100644 --- a/BauSystem_API/src/de/steamwar/bausystem/tracer/TraceUtils.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/tracer/TraceUtils.java @@ -7,14 +7,11 @@ import org.bukkit.Particle; import org.bukkit.entity.Player; public class TraceUtils { + private TraceUtils(){} - private static Location location; + public static final boolean DEBUG = false; - public static boolean actionBar = false; - - public static void locationInit() { - location = new Location(Bukkit.getWorlds().get(0), 0, 0, 0); - } + private static Location location = new Location(Bukkit.getWorlds().get(0), 0, 0, 0); public static void showCorner(Player player, float x, float y, float z, Particle particle) { player.spawnParticle(particle, makeLocation(x + 0.00F, y + 0.00F, z + 0.00F), 1, 0F, 0F, 0F, 0.001); @@ -40,7 +37,7 @@ public class TraceUtils { } } - public static Location makeLocation(float x, float y, float z) { + private static Location makeLocation(float x, float y, float z) { location.setX(x); location.setY(y); location.setZ(z); diff --git a/BauSystem_API/src/de/steamwar/bausystem/tracer/TracerUpdater.java b/BauSystem_Main/src/de/steamwar/bausystem/tracer/TracerUpdater.java similarity index 100% rename from BauSystem_API/src/de/steamwar/bausystem/tracer/TracerUpdater.java rename to BauSystem_Main/src/de/steamwar/bausystem/tracer/TracerUpdater.java diff --git a/BauSystem_Main/src/de/steamwar/bausystem/tracer/recorder/RecordManager.java b/BauSystem_Main/src/de/steamwar/bausystem/tracer/recorder/RecordManager.java index b04e3c7..a7b22b1 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/tracer/recorder/RecordManager.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/tracer/recorder/RecordManager.java @@ -15,11 +15,7 @@ public class RecordManager { static Status status = Status.IDLE; public static Integer activeFrameID = null; - static World world; - public static void worldInit() { - if (world != null) return; - world = Bukkit.getWorlds().get(0); - } + static final World world = Bukkit.getWorlds().get(0); public static void tracer(Player player, String[] args) { switch (args[0].toLowerCase()) {