SteamWar/MissileWars
Archiviert
13
0

Add Missile Lore #18

Manuell gemergt
Lixfel hat 7 Commits von Lore nach master 2020-09-26 21:51:38 +02:00 zusammengeführt
Nur Änderungen aus Commit 360b47e490 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -50,7 +50,6 @@ import java.util.Objects;
public class Missile extends SpecialItem { public class Missile extends SpecialItem {
private static final World world = new BukkitWorld(Bukkit.getWorlds().get(0)); private static final World world = new BukkitWorld(Bukkit.getWorlds().get(0));
private static final BlockType TNT = BlockTypes.TNT;
private static final int GRAPH_SIZE = 7; private static final int GRAPH_SIZE = 7;
private final Clipboard clipboard; private final Clipboard clipboard;
@ -76,7 +75,9 @@ public class Missile extends SpecialItem {
lore(lore, strings, 2, " §7Speed"); lore(lore, strings, 2, " §7Speed");
lore(lore, strings, 3, " §7Size"); lore(lore, strings, 3, " §7Size");
tntCount = count(); EditSession e = WorldEdit.getInstance().getEditSessionFactory().getEditSession(world, -1);
BlockTypeMask blockTypeMask = new BlockTypeMask(clipboard, BlockTypes.TNT);
tntCount = e.countBlocks(clipboard.getRegion(), blockTypeMask);
lore.add("§7TNT §8: §e" + tntCount); lore.add("§7TNT §8: §e" + tntCount);
item = createItem(itemType, "§c" + name, 1, lore, false); item = createItem(itemType, "§c" + name, 1, lore, false);
@ -116,16 +117,6 @@ public class Missile extends SpecialItem {
return st.toString(); return st.toString();
} }
private int count() {
try {
EditSession e = WorldEdit.getInstance().getEditSessionFactory().getEditSession(world, -1);
BlockTypeMask blockTypeMask = new BlockTypeMask(clipboard, TNT);
return e.countBlocks(clipboard.getRegion(), blockTypeMask);
} catch (Exception e) {
return 0;
}
}
@Override @Override
public ItemStack getItem() { public ItemStack getItem() {
return item; return item;