3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-12-25 18:40:05 +01:00

Allow copying item stacks with damage of > Byte.MAX_VALUE. Closes #972

Dieser Commit ist enthalten in:
zml2008 2012-01-08 21:31:57 -08:00
Ursprung 68c821d8a6
Commit 7922c437bf

Datei anzeigen

@ -457,7 +457,7 @@ public class BukkitWorld extends LocalWorld {
@Override @Override
public void dropItem(Vector pt, BaseItemStack item) { public void dropItem(Vector pt, BaseItemStack item) {
ItemStack bukkitItem = new ItemStack(item.getType(), item.getAmount(), ItemStack bukkitItem = new ItemStack(item.getType(), item.getAmount(),
(byte) item.getDamage()); item.getDamage());
world.dropItemNaturally(BukkitUtil.toLocation(world, pt), bukkitItem); world.dropItemNaturally(BukkitUtil.toLocation(world, pt), bukkitItem);
} }
@ -685,7 +685,7 @@ public class BukkitWorld extends LocalWorld {
if (contents[i] != null) { if (contents[i] != null) {
ItemStack toAdd = new ItemStack(contents[i].getType(), ItemStack toAdd = new ItemStack(contents[i].getType(),
contents[i].getAmount(), contents[i].getAmount(),
(byte) contents[i].getDamage()); contents[i].getDamage());
try { try {
for (Map.Entry<Integer, Integer> entry : contents[i].getEnchantments().entrySet()) { for (Map.Entry<Integer, Integer> entry : contents[i].getEnchantments().entrySet()) {
toAdd.addEnchantment(Enchantment.getById(entry.getKey()), entry.getValue()); toAdd.addEnchantment(Enchantment.getById(entry.getKey()), entry.getValue());