SteamWar/BauSystem
Archiviert
13
0
Dieser Commit ist enthalten in:
jojo 2020-07-26 16:29:16 +02:00
Ursprung 03683fc0b6
Commit 8aee883a8e
3 geänderte Dateien mit 17 neuen und 30 gelöschten Zeilen

Datei anzeigen

@ -265,51 +265,53 @@ public class BauSystem extends JavaPlugin implements Listener {
attachment.setPermission("worldedit.calc", true);
attachment.setPermission("worldedit.fill", true);*/
if (Core.getVersion() == 15) ShowManager.add(p);
if (Core.getVersion() == 15) {
ShowManager.add(p);
}
}
@EventHandler
public void onLeave(PlayerQuitEvent e) {
Player player = e.getPlayer();
SWScoreboard.removeScoreboard(player);
if (Bukkit.getOnlinePlayers().isEmpty() || (Bukkit.getOnlinePlayers().size() == 1 && Bukkit.getOnlinePlayers().contains(player))) {
Player p = e.getPlayer();
SWScoreboard.removeScoreboard(p);
if (Bukkit.getOnlinePlayers().isEmpty() || (Bukkit.getOnlinePlayers().size() == 1 && Bukkit.getOnlinePlayers().contains(p))) {
Bukkit.shutdown();
return;
}
if (Core.getVersion() == 15) ShowManager.remove(e.getPlayer());
if (Core.getVersion() == 15) {
ShowManager.remove(p);
}
}
@EventHandler
public void onInventoryClick(InventoryClickEvent e) {
ItemStack stack = e.getCursor();
if (stack == null)
return;
if (!stack.hasItemMeta())
return;
if (stack == null) return;
if (!stack.hasItemMeta()) return;
if (stack.getItemMeta().hasEnchants()) {
for (Enchantment en : Enchantment.values()) {
if (stack.getEnchantmentLevel(en) > en.getMaxLevel())
stack.removeEnchantment(en);
}
}
Player p = (Player) e.getWhoClicked();
Material material = stack.getType();
if (material == Material.POTION || material == Material.SPLASH_POTION || material == Material.LINGERING_POTION)
if (material == Material.POTION || material == Material.SPLASH_POTION || material == Material.LINGERING_POTION) {
stack.setType(Material.MILK_BUCKET);
}
if(Core.getVersion() < 14){
if (Core.getVersion() < 14) {
e.setCurrentItem(stack);
return;
}
if (stack.getItemMeta().hasAttributeModifiers()) {
ItemMeta meta = stack.getItemMeta();
for (Attribute a : Attribute.values())
meta.removeAttributeModifier(a);
for (Attribute a : Attribute.values()) {
meta.removeAttributeModifier(a);
}
stack.setItemMeta(meta);
Bukkit.getLogger().log(Level.SEVERE, "Spieler " + p.getName() + " (" + p.getUniqueId().toString() + ") hat versucht ein Item mit einem Attribute-Modifier zu bekommen.");
}
e.setCurrentItem(stack);
}

Datei anzeigen

@ -39,21 +39,8 @@ public class ShowStatus {
PARTICLE
}
public boolean toggleShow() {
dirty = true;
if (show == Show.NONE) {
show = Show.ALL;
return true;
} else {
selected.clear();
show = Show.NONE;
return false;
}
}
public boolean toggleShow(int tntID) {
dirty = true;
if (show == Show.ALL) {
removeSelection(tntID);
return false;

Datei anzeigen

@ -15,7 +15,6 @@ public class TNTFrame {
private static int uniqueIdentifier = 0;
private long startTime = System.currentTimeMillis();
private long endTime = System.currentTimeMillis();
private Map<Integer, TNTTrace> positions = new HashMap<>();
private Map<TNTPrimed, TNTTrace> aliveTNT = new HashMap<>();
@ -87,7 +86,6 @@ public class TNTFrame {
entry.getValue().cleanUp();
delete(entry.getKey(), false);
}
endTime = System.currentTimeMillis();
aliveTNT.clear();
aliveTNT = null;
return positions.isEmpty();