SteamWar/BauSystem
Archiviert
13
0

Fix GuiTraceShow #195

Manuell gemergt
YoyoNow hat 4 Commits von TraceFix nach master 2021-02-16 11:37:18 +01:00 zusammengeführt
3 geänderte Dateien mit 33 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -34,4 +34,16 @@ public class TNTTracer_12 {
return material == Material.WATER || material == Material.STATIONARY_WATER; return material == Material.WATER || material == Material.STATIONARY_WATER;
} }
public static Material getTraceShowMaterial() {
return Material.CONCRETE;
}
public static Material getTraceHideMaterial() {
return Material.CONCRETE;
}
public static Material getTraceXZMaterial() {
return Material.STEP;
}
} }

Datei anzeigen

@ -44,4 +44,16 @@ public class TNTTracer_15 {
return ((Waterlogged) data).isWaterlogged(); return ((Waterlogged) data).isWaterlogged();
} }
public static Material getTraceShowMaterial() {
return Material.LIME_CONCRETE;
}
public static Material getTraceHideMaterial() {
return Material.RED_CONCRETE;
}
public static Material getTraceXZMaterial() {
return Material.QUARTZ_SLAB;
}
} }

Datei anzeigen

@ -22,9 +22,12 @@
package de.steamwar.bausystem.gui; package de.steamwar.bausystem.gui;
import de.steamwar.bausystem.BauSystem; 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.ShowModeParameter;
import de.steamwar.bausystem.tracer.show.TraceShowManager; import de.steamwar.bausystem.tracer.show.TraceShowManager;
import de.steamwar.bausystem.tracer.show.mode.EntityShowMode; import de.steamwar.bausystem.tracer.show.mode.EntityShowMode;
import de.steamwar.core.VersionedCallable;
import de.steamwar.inventory.SWInventory; import de.steamwar.inventory.SWInventory;
import de.steamwar.inventory.SWItem; import de.steamwar.inventory.SWItem;
import org.bukkit.Material; import org.bukkit.Material;
@ -61,7 +64,8 @@ public class GuiTraceShow {
swInventory.setItem(6, interpolateY); swInventory.setItem(6, interpolateY);
swInventory.setCallback(6, clickType -> toggleInterpolateYPosition(player, swInventory, 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, (byte) 7, "§eInterpolation §7XZ-Achse", Arrays.asList("§7Zeigt die Interpolation", "§7auf der XZ-Achse."), false, clickType -> {});
Veraltet
Review

Dies gibt nur eine Stone Slab und keine Quarz Slab

Dies gibt nur eine Stone Slab und keine Quarz Slab
swInventory.setItem(7, interpolateXZ); swInventory.setItem(7, interpolateXZ);
swInventory.setCallback(7, clickType -> toggleInterpolateXZPosition(player, swInventory, interpolateXZ)); swInventory.setCallback(7, clickType -> toggleInterpolateXZPosition(player, swInventory, interpolateXZ));
// Water Bucket (-water) // Water Bucket (-water)
@ -73,14 +77,16 @@ public class GuiTraceShow {
private static void setActiveShow(Player player, SWInventory swInventory) { private static void setActiveShow(Player player, SWInventory swInventory) {
if (TraceShowManager.hasActiveShow(player)) { 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); TraceShowManager.hide(player);
player.sendMessage(BauSystem.PREFIX + "§cAlle TNT-Positionen ausgeblendet"); player.sendMessage(BauSystem.PREFIX + "§cAlle TNT-Positionen ausgeblendet");
setActiveShow(player, swInventory); setActiveShow(player, swInventory);
}); });
swInventory.setItem(1, shown); swInventory.setItem(1, shown);
} else { } 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); show(player);
player.sendMessage(BauSystem.PREFIX + "§aAlle TNT-Positionen angezeigt"); player.sendMessage(BauSystem.PREFIX + "§aAlle TNT-Positionen angezeigt");
setActiveShow(player, swInventory); setActiveShow(player, swInventory);