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 52daf91..bfed2bb 100644 --- a/BauSystem_12/src/de/steamwar/bausystem/tracer/TNTTracer_12.java +++ b/BauSystem_12/src/de/steamwar/bausystem/tracer/TNTTracer_12.java @@ -34,4 +34,12 @@ public class TNTTracer_12 { return material == Material.WATER || material == Material.STATIONARY_WATER; } + public static Material getTraceShowMaterial() { + return Material.CONCRETE; + } + + public static Material getTraceHideMaterial() { + return Material.CONCRETE; + } + } 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 16be514..ace2691 100644 --- a/BauSystem_15/src/de/steamwar/bausystem/tracer/TNTTracer_15.java +++ b/BauSystem_15/src/de/steamwar/bausystem/tracer/TNTTracer_15.java @@ -44,4 +44,12 @@ public class TNTTracer_15 { return ((Waterlogged) data).isWaterlogged(); } + public static Material getTraceShowMaterial() { + return Material.LIME_CONCRETE; + } + + public static Material getTraceHideMaterial() { + return Material.RED_CONCRETE; + } + } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/gui/GuiTraceShow.java b/BauSystem_Main/src/de/steamwar/bausystem/gui/GuiTraceShow.java index 78e7a8a..56b0fa3 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/gui/GuiTraceShow.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/gui/GuiTraceShow.java @@ -22,9 +22,12 @@ package de.steamwar.bausystem.gui; import de.steamwar.bausystem.BauSystem; +import de.steamwar.bausystem.tracer.TNTTracer_12; +import de.steamwar.bausystem.tracer.TNTTracer_15; import de.steamwar.bausystem.tracer.show.ShowModeParameter; import de.steamwar.bausystem.tracer.show.TraceShowManager; import de.steamwar.bausystem.tracer.show.mode.EntityShowMode; +import de.steamwar.core.VersionedCallable; import de.steamwar.inventory.SWInventory; import de.steamwar.inventory.SWItem; import org.bukkit.Material; @@ -73,14 +76,16 @@ public class GuiTraceShow { private static void setActiveShow(Player player, SWInventory swInventory) { if (TraceShowManager.hasActiveShow(player)) { - SWItem shown = new SWItem(Material.LIME_CONCRETE, "§aTraces angezeigt", new ArrayList<>(), false, clickType -> { + Material showMaterial = VersionedCallable.call(new VersionedCallable<>(TNTTracer_12::getTraceShowMaterial, 8), new VersionedCallable<>(TNTTracer_15::getTraceShowMaterial, 14)); + SWItem shown = new SWItem(showMaterial, (byte) 5, "§aTraces angezeigt", new ArrayList<>(), false, clickType -> { TraceShowManager.hide(player); player.sendMessage(BauSystem.PREFIX + "§cAlle TNT-Positionen ausgeblendet"); setActiveShow(player, swInventory); }); swInventory.setItem(1, shown); } else { - SWItem hidden = new SWItem(Material.RED_CONCRETE, "§cTraces ausgeblendet", new ArrayList<>(), false, clickType -> { + Material hideMaterial = VersionedCallable.call(new VersionedCallable<>(TNTTracer_12::getTraceHideMaterial, 8), new VersionedCallable<>(TNTTracer_15::getTraceHideMaterial, 14)); + SWItem hidden = new SWItem(hideMaterial, (byte) 14, "§cTraces ausgeblendet", new ArrayList<>(), false, clickType -> { show(player); player.sendMessage(BauSystem.PREFIX + "§aAlle TNT-Positionen angezeigt"); setActiveShow(player, swInventory);