Revert "Using trove collections for most internal stuff, using array access in BlockType and ItemType"

This reverts commit 410ac65c6a.
This has been causing compatibility issues with Spout. I haven't been ble to reproduce, but until somebody figures out why, this gets to go
This commit is contained in:
zml2008
2012-01-22 01:23:41 -08:00
parent 2aba54a30f
commit 9830d9d326
7 changed files with 48 additions and 88 deletions

View File

@ -22,7 +22,6 @@ package com.sk89q.worldedit.bukkit;
import java.util.HashMap;
import java.util.Map;
import gnu.trove.procedure.TIntIntProcedure;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.block.Furnace;
@ -684,20 +683,13 @@ public class BukkitWorld extends LocalWorld {
}
if (contents[i] != null) {
final ItemStack toAdd = new ItemStack(contents[i].getType(),
ItemStack toAdd = new ItemStack(contents[i].getType(),
contents[i].getAmount(),
contents[i].getDamage());
try {
contents[i].getEnchantments().forEachEntry(new TIntIntProcedure() {
@Override
public boolean execute(int key, int value) {
Enchantment ench = Enchantment.getById(key);
if (ench != null) {
toAdd.addEnchantment(ench, value);
}
return true;
}
});
for (Map.Entry<Integer, Integer> entry : contents[i].getEnchantments().entrySet()) {
toAdd.addEnchantment(Enchantment.getById(entry.getKey()), entry.getValue());
}
} catch (Throwable ignore) {}
inven.setItem(i, toAdd);
} else {