diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/NavWandBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/NavWandBauGuiItem.java index 86a1deaf..067c24d4 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/NavWandBauGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/NavWandBauGuiItem.java @@ -45,13 +45,14 @@ public class NavWandBauGuiItem extends BauGuiItem { @Override public ItemStack getItem(Player player) { - return new SWItem(Material.WOODEN_AXE, "Navigation Wand", Arrays.asList("Left click: jump to location", "Right click: pass through walls"), false, clickType -> { + return new SWItem(Material.COMPASS, "Navigation Wand", Arrays.asList("Left click: jump to location", "Right click: pass through walls"), false, clickType -> { }).getItemStack(); } @Override public boolean click(ClickType click, Player p) { p.performCommand("/wand -n"); + p.closeInventory(); return false; } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/WorldEditBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/WorldEditBauGuiItem.java index 90c2575c..7d5d377e 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/WorldEditBauGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/WorldEditBauGuiItem.java @@ -52,6 +52,7 @@ public class WorldEditBauGuiItem extends BauGuiItem { @Override public boolean click(ClickType click, Player p) { p.performCommand("/wand"); + p.closeInventory(); return false; } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/world/AutoShutdownListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/world/AutoShutdownListener.java index 4e5d62e1..be994a49 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/world/AutoShutdownListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/world/AutoShutdownListener.java @@ -76,6 +76,7 @@ public class AutoShutdownListener implements Listener { Bukkit.getLogger().log(Level.WARNING, throwable.getMessage(), throwable); Bukkit.shutdown(); } + count++; } }, 20, 20); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/world/BauScoreboard.java b/BauSystem_Main/src/de/steamwar/bausystem/features/world/BauScoreboard.java index 7b66cdcb..30f7e0f8 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/world/BauScoreboard.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/world/BauScoreboard.java @@ -47,7 +47,8 @@ public class BauScoreboard implements Listener { private HashMap sidebar(Player p) { Region region = Region.getRegion(p.getLocation()); - String colorCode = BauSystem.MESSAGE.parse(region.get(Flag.COLOR).getChatValue(), p).substring(0, 2); + // String colorCode = BauSystem.MESSAGE.parse(region.get(Flag.COLOR).getChatValue(), p).substring(0, 2); + String colorCode = "§e"; List strings = new ArrayList<>(); strings.add("§1"); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/world/RamUsage.java b/BauSystem_Main/src/de/steamwar/bausystem/features/world/RamUsage.java index 4996b0aa..6859cff9 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/world/RamUsage.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/world/RamUsage.java @@ -20,23 +20,30 @@ package de.steamwar.bausystem.features.world; import lombok.experimental.UtilityClass; -import org.bukkit.Bukkit; -import java.lang.management.ManagementFactory; -import java.util.logging.Level; +import java.io.*; @UtilityClass public class RamUsage { + private File meminfo = new File("/proc/meminfo"); + public static double getUsage() { - try { - long memorySize = ((com.sun.management.OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean()).getTotalPhysicalMemorySize(); - long freeMemory = ((com.sun.management.OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean()).getFreePhysicalMemorySize(); - return (memorySize - freeMemory) / (double) memorySize; - } catch (Throwable throwable) { - Bukkit.getLogger().log(Level.WARNING, throwable.getMessage(), throwable); + try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(meminfo)))) { + String memTotal = bufferedReader.readLine().replaceAll(" +", " "); + bufferedReader.readLine(); + String memAvailable = bufferedReader.readLine().replaceAll(" +", " "); + + long memTotalLong = getNumber(memTotal); + long memAvailableLong = getNumber(memAvailable); + return (memTotalLong - memAvailableLong) / (double) memTotalLong; + } catch (IOException e) { return 1D; } } + private static long getNumber(String s) { + return Long.parseLong(s.split(" ")[1]); + } + } diff --git a/yapion/prototypes.yapion b/yapion/prototypes.yapion index 57a6c33d..ad109152 100644 --- a/yapion/prototypes.yapion +++ b/yapion/prototypes.yapion @@ -1,5 +1,4 @@ { - @version(1) wg{ displayName(WarGear) schematic(sections4/WGArena.schem) diff --git a/yapion/regions.yapion b/yapion/regions.yapion index 8a3875f9..0b7019db 100644 --- a/yapion/regions.yapion +++ b/yapion/regions.yapion @@ -1,5 +1,4 @@ { - @version(1) wg11{ minX(-188) minY(1)