~ Changed something to fix 580afb0.

This commit is contained in:
Steffion 2013-08-28 14:18:55 +02:00
parent 4d3467a259
commit 6d695775c1

View File

@ -22,35 +22,33 @@ public class OnInventoryCloseEvent implements Listener {
public void onInventoryCloseEvent(InventoryCloseEvent event) { public void onInventoryCloseEvent(InventoryCloseEvent event) {
Inventory inv = event.getInventory(); Inventory inv = event.getInventory();
if (inv.getType().equals(InventoryType.CHEST)) { if (inv.getType().equals(InventoryType.CHEST)) {
if (inv.getName().startsWith("\u00A7r")) { if (inv.getName().contains("DisguiseBlocks")) {
if (inv.getName().contains("DisguiseBlocks")) { String arenaname = inv
String arenaname = inv .getItem(0)
.getItem(0) .getItemMeta()
.getItemMeta() .getDisplayName()
.getDisplayName() .replaceAll(
.replaceAll( MessageM.replaceAll("%NDisguiseBlocks of arena: %A"),
MessageM.replaceAll("%NDisguiseBlocks of arena: %A"), "");
"");
Arena arena = null; Arena arena = null;
for (Arena arena2 : W.arenaList) { for (Arena arena2 : W.arenaList) {
if (arena2.arenaName.equalsIgnoreCase(arenaname)) { if (arena2.arenaName.equalsIgnoreCase(arenaname)) {
arena = arena2; arena = arena2;
}
} }
ArrayList<ItemStack> blocks = new ArrayList<ItemStack>();
for (ItemStack item : inv.getContents()) {
if (item != null) {
if (!item.getType().equals(Material.PAPER)) {
blocks.add(item);
}
}
}
arena.disguiseBlocks = blocks;
save(arena);
} }
ArrayList<ItemStack> blocks = new ArrayList<ItemStack>();
for (ItemStack item : inv.getContents()) {
if (item != null) {
if (!item.getType().equals(Material.PAPER)) {
blocks.add(item);
}
}
}
arena.disguiseBlocks = blocks;
save(arena);
} }
} }
} }