Merge remote-tracking branch 'origin/master'
Dieser Commit ist enthalten in:
Commit
c1012e6ac3
@ -45,13 +45,14 @@ public class NavWandBauGuiItem extends BauGuiItem {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getItem(Player player) {
|
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();
|
}).getItemStack();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean click(ClickType click, Player p) {
|
public boolean click(ClickType click, Player p) {
|
||||||
p.performCommand("/wand -n");
|
p.performCommand("/wand -n");
|
||||||
|
p.closeInventory();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,6 +52,7 @@ public class WorldEditBauGuiItem extends BauGuiItem {
|
|||||||
@Override
|
@Override
|
||||||
public boolean click(ClickType click, Player p) {
|
public boolean click(ClickType click, Player p) {
|
||||||
p.performCommand("/wand");
|
p.performCommand("/wand");
|
||||||
|
p.closeInventory();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,6 +76,7 @@ public class AutoShutdownListener implements Listener {
|
|||||||
Bukkit.getLogger().log(Level.WARNING, throwable.getMessage(), throwable);
|
Bukkit.getLogger().log(Level.WARNING, throwable.getMessage(), throwable);
|
||||||
Bukkit.shutdown();
|
Bukkit.shutdown();
|
||||||
}
|
}
|
||||||
|
count++;
|
||||||
}
|
}
|
||||||
}, 20, 20);
|
}, 20, 20);
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,8 @@ public class BauScoreboard implements Listener {
|
|||||||
private HashMap<String, Integer> sidebar(Player p) {
|
private HashMap<String, Integer> sidebar(Player p) {
|
||||||
Region region = Region.getRegion(p.getLocation());
|
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<String> strings = new ArrayList<>();
|
List<String> strings = new ArrayList<>();
|
||||||
strings.add("§1");
|
strings.add("§1");
|
||||||
|
@ -20,23 +20,30 @@
|
|||||||
package de.steamwar.bausystem.features.world;
|
package de.steamwar.bausystem.features.world;
|
||||||
|
|
||||||
import lombok.experimental.UtilityClass;
|
import lombok.experimental.UtilityClass;
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
|
|
||||||
import java.lang.management.ManagementFactory;
|
import java.io.*;
|
||||||
import java.util.logging.Level;
|
|
||||||
|
|
||||||
@UtilityClass
|
@UtilityClass
|
||||||
public class RamUsage {
|
public class RamUsage {
|
||||||
|
|
||||||
|
private File meminfo = new File("/proc/meminfo");
|
||||||
|
|
||||||
public static double getUsage() {
|
public static double getUsage() {
|
||||||
try {
|
try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(meminfo)))) {
|
||||||
long memorySize = ((com.sun.management.OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean()).getTotalPhysicalMemorySize();
|
String memTotal = bufferedReader.readLine().replaceAll(" +", " ");
|
||||||
long freeMemory = ((com.sun.management.OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean()).getFreePhysicalMemorySize();
|
bufferedReader.readLine();
|
||||||
return (memorySize - freeMemory) / (double) memorySize;
|
String memAvailable = bufferedReader.readLine().replaceAll(" +", " ");
|
||||||
} catch (Throwable throwable) {
|
|
||||||
Bukkit.getLogger().log(Level.WARNING, throwable.getMessage(), throwable);
|
long memTotalLong = getNumber(memTotal);
|
||||||
|
long memAvailableLong = getNumber(memAvailable);
|
||||||
|
return (memTotalLong - memAvailableLong) / (double) memTotalLong;
|
||||||
|
} catch (IOException e) {
|
||||||
return 1D;
|
return 1D;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static long getNumber(String s) {
|
||||||
|
return Long.parseLong(s.split(" ")[1]);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
@version(1)
|
|
||||||
wg{
|
wg{
|
||||||
displayName(WarGear)
|
displayName(WarGear)
|
||||||
schematic(sections4/WGArena.schem)
|
schematic(sections4/WGArena.schem)
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
@version(1)
|
|
||||||
wg11{
|
wg11{
|
||||||
minX(-188)
|
minX(-188)
|
||||||
minY(1)
|
minY(1)
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren