From 7025dabd8a4b0ec2604fffaced4cb6a986857c8b Mon Sep 17 00:00:00 2001 From: jojo Date: Sun, 14 Feb 2021 11:19:46 +0100 Subject: [PATCH 1/4] Fix GuiTraceShow --- .../src/de/steamwar/bausystem/tracer/TNTTracer_12.java | 8 ++++++++ .../src/de/steamwar/bausystem/tracer/TNTTracer_15.java | 8 ++++++++ .../src/de/steamwar/bausystem/gui/GuiTraceShow.java | 9 +++++++-- 3 files changed, 23 insertions(+), 2 deletions(-) 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); -- 2.39.5 From 311c41383b64c65ddb19660a2e313496122aa7b7 Mon Sep 17 00:00:00 2001 From: jojo Date: Sun, 14 Feb 2021 14:45:30 +0100 Subject: [PATCH 2/4] Fix GuiTraceShow --- .../src/de/steamwar/bausystem/tracer/TNTTracer_12.java | 4 ++++ .../src/de/steamwar/bausystem/tracer/TNTTracer_15.java | 4 ++++ .../src/de/steamwar/bausystem/gui/GuiTraceShow.java | 3 ++- 3 files changed, 10 insertions(+), 1 deletion(-) 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 bfed2bb..4f1ed78 100644 --- a/BauSystem_12/src/de/steamwar/bausystem/tracer/TNTTracer_12.java +++ b/BauSystem_12/src/de/steamwar/bausystem/tracer/TNTTracer_12.java @@ -42,4 +42,8 @@ public class TNTTracer_12 { return Material.CONCRETE; } + public static Material getTraceXZMaterial() { + return Material.STEP; + } + } 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 ace2691..20ef07f 100644 --- a/BauSystem_15/src/de/steamwar/bausystem/tracer/TNTTracer_15.java +++ b/BauSystem_15/src/de/steamwar/bausystem/tracer/TNTTracer_15.java @@ -52,4 +52,8 @@ public class TNTTracer_15 { return Material.RED_CONCRETE; } + public static Material getTraceXZMaterial() { + return Material.QUARTZ_SLAB; + } + } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/gui/GuiTraceShow.java b/BauSystem_Main/src/de/steamwar/bausystem/gui/GuiTraceShow.java index 56b0fa3..c3625f7 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/gui/GuiTraceShow.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/gui/GuiTraceShow.java @@ -60,7 +60,8 @@ public class GuiTraceShow { swInventory.setItem(5, water); swInventory.setCallback(5, clickType -> toggleHideTNTinWaterExploded(player, swInventory, water)); - SWItem interpolateY = new SWItem(Material.QUARTZ_STAIRS, "§eInterpolation §7Y-Achse", Arrays.asList("§7Zeigt die Interpolation", "§7auf der Y-Achse."), false, clickType -> {}); + Material xzMaterial = VersionedCallable.call(new VersionedCallable<>(TNTTracer_12::getTraceXZMaterial, 8), new VersionedCallable<>(TNTTracer_15::getTraceXZMaterial, 14)); + SWItem interpolateY = new SWItem(xzMaterial, (byte) 7, "§eInterpolation §7Y-Achse", Arrays.asList("§7Zeigt die Interpolation", "§7auf der Y-Achse."), false, clickType -> {}); swInventory.setItem(6, interpolateY); swInventory.setCallback(6, clickType -> toggleInterpolateYPosition(player, swInventory, interpolateY)); -- 2.39.5 From 870bbd94f0f65bb8158e1d19974880937b4cb51c Mon Sep 17 00:00:00 2001 From: jojo Date: Sun, 14 Feb 2021 18:09:08 +0100 Subject: [PATCH 3/4] Fix pr stuff --- .../src/de/steamwar/bausystem/gui/GuiTraceShow.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/gui/GuiTraceShow.java b/BauSystem_Main/src/de/steamwar/bausystem/gui/GuiTraceShow.java index c3625f7..07f1886 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/gui/GuiTraceShow.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/gui/GuiTraceShow.java @@ -60,12 +60,12 @@ public class GuiTraceShow { swInventory.setItem(5, water); swInventory.setCallback(5, clickType -> toggleHideTNTinWaterExploded(player, swInventory, water)); - Material xzMaterial = VersionedCallable.call(new VersionedCallable<>(TNTTracer_12::getTraceXZMaterial, 8), new VersionedCallable<>(TNTTracer_15::getTraceXZMaterial, 14)); - SWItem interpolateY = new SWItem(xzMaterial, (byte) 7, "§eInterpolation §7Y-Achse", Arrays.asList("§7Zeigt die Interpolation", "§7auf der Y-Achse."), false, clickType -> {}); + SWItem interpolateY = new SWItem(Material.QUARTZ_STAIRS, (byte) 7, "§eInterpolation §7Y-Achse", Arrays.asList("§7Zeigt die Interpolation", "§7auf der Y-Achse."), false, clickType -> {}); swInventory.setItem(6, interpolateY); swInventory.setCallback(6, clickType -> toggleInterpolateYPosition(player, swInventory, interpolateY)); - SWItem interpolateXZ = new SWItem(Material.QUARTZ_SLAB, "§eInterpolation §7XZ-Achse", Arrays.asList("§7Zeigt die Interpolation", "§7auf der XZ-Achse."), false, clickType -> {}); + Material xzMaterial = VersionedCallable.call(new VersionedCallable<>(TNTTracer_12::getTraceXZMaterial, 8), new VersionedCallable<>(TNTTracer_15::getTraceXZMaterial, 14)); + SWItem interpolateXZ = new SWItem(xzMaterial, "§eInterpolation §7XZ-Achse", Arrays.asList("§7Zeigt die Interpolation", "§7auf der XZ-Achse."), false, clickType -> {}); swInventory.setItem(7, interpolateXZ); swInventory.setCallback(7, clickType -> toggleInterpolateXZPosition(player, swInventory, interpolateXZ)); // Water Bucket (-water) -- 2.39.5 From 5aaa1aaa38e963d9fc7618ee5a604dc0ac13756f Mon Sep 17 00:00:00 2001 From: jojo Date: Mon, 15 Feb 2021 10:37:20 +0100 Subject: [PATCH 4/4] Fix pr stuff --- .../src/de/steamwar/bausystem/gui/GuiTraceShow.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/gui/GuiTraceShow.java b/BauSystem_Main/src/de/steamwar/bausystem/gui/GuiTraceShow.java index 07f1886..8331f02 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/gui/GuiTraceShow.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/gui/GuiTraceShow.java @@ -60,12 +60,12 @@ public class GuiTraceShow { swInventory.setItem(5, water); swInventory.setCallback(5, clickType -> toggleHideTNTinWaterExploded(player, swInventory, water)); - SWItem interpolateY = new SWItem(Material.QUARTZ_STAIRS, (byte) 7, "§eInterpolation §7Y-Achse", Arrays.asList("§7Zeigt die Interpolation", "§7auf der Y-Achse."), false, clickType -> {}); + SWItem interpolateY = new SWItem(Material.QUARTZ_STAIRS, "§eInterpolation §7Y-Achse", Arrays.asList("§7Zeigt die Interpolation", "§7auf der Y-Achse."), false, clickType -> {}); swInventory.setItem(6, interpolateY); swInventory.setCallback(6, clickType -> toggleInterpolateYPosition(player, swInventory, interpolateY)); Material xzMaterial = VersionedCallable.call(new VersionedCallable<>(TNTTracer_12::getTraceXZMaterial, 8), new VersionedCallable<>(TNTTracer_15::getTraceXZMaterial, 14)); - SWItem interpolateXZ = new SWItem(xzMaterial, "§eInterpolation §7XZ-Achse", Arrays.asList("§7Zeigt die Interpolation", "§7auf der XZ-Achse."), false, clickType -> {}); + SWItem interpolateXZ = new SWItem(xzMaterial, (byte) 7, "§eInterpolation §7XZ-Achse", Arrays.asList("§7Zeigt die Interpolation", "§7auf der XZ-Achse."), false, clickType -> {}); swInventory.setItem(7, interpolateXZ); swInventory.setCallback(7, clickType -> toggleInterpolateXZPosition(player, swInventory, interpolateXZ)); // Water Bucket (-water) -- 2.39.5