From 186fbb98a2a12a50279153f9fd0de7653dface42 Mon Sep 17 00:00:00 2001 From: TomyLobo Date: Fri, 24 Aug 2012 13:39:52 +0200 Subject: [PATCH] Changed all references to BaseItem.getDamage to getData. --- src/main/java/com/sk89q/worldedit/LocalWorld.java | 2 +- src/main/java/com/sk89q/worldedit/blocks/ContainerBlock.java | 2 +- .../java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java | 4 ++-- src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java | 4 ++-- .../java/com/sk89q/worldedit/spout/SpoutPlayerBlockBag.java | 4 ++-- src/main/java/com/sk89q/worldedit/spout/SpoutWorld.java | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/LocalWorld.java b/src/main/java/com/sk89q/worldedit/LocalWorld.java index 73e4b8dbb..618395ca0 100644 --- a/src/main/java/com/sk89q/worldedit/LocalWorld.java +++ b/src/main/java/com/sk89q/worldedit/LocalWorld.java @@ -343,7 +343,7 @@ public abstract class LocalWorld implements World { final int amount = stack.getAmount(); if (amount > 1) { - dropItem(pt, new BaseItemStack(stack.getType(), 1, stack.getDamage()), amount); + dropItem(pt, new BaseItemStack(stack.getType(), 1, stack.getData()), amount); } else { dropItem(pt, stack, amount); } diff --git a/src/main/java/com/sk89q/worldedit/blocks/ContainerBlock.java b/src/main/java/com/sk89q/worldedit/blocks/ContainerBlock.java index 614dc4f59..60be36134 100644 --- a/src/main/java/com/sk89q/worldedit/blocks/ContainerBlock.java +++ b/src/main/java/com/sk89q/worldedit/blocks/ContainerBlock.java @@ -77,7 +77,7 @@ public abstract class ContainerBlock extends BaseBlock implements TileEntityBloc public Map serializeItem(BaseItemStack item) { Map data = new HashMap(); data.put("id", new ShortTag("id", (short) item.getType())); - data.put("Damage", new ShortTag("Damage", item.getDamage())); + data.put("Damage", new ShortTag("Damage", item.getData())); data.put("Count", new ByteTag("Count", (byte) item.getAmount())); if (item.getEnchantments().size() > 0) { List enchantmentList = new ArrayList(); diff --git a/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java b/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java index 6b97f2a52..ab66726b3 100644 --- a/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java +++ b/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java @@ -73,7 +73,7 @@ public class BukkitPlayerBlockBag extends BlockBag { @Override public void fetchItem(BaseItem item) throws BlockBagException { final int id = item.getType(); - final int damage = item.getDamage(); + final int damage = item.getData(); int amount = (item instanceof BaseItemStack) ? ((BaseItemStack) item).getAmount() : 1; assert(amount == 1); boolean usesDamageValue = ItemType.usesDamageValue(id); @@ -133,7 +133,7 @@ public class BukkitPlayerBlockBag extends BlockBag { @Override public void storeItem(BaseItem item) throws BlockBagException { final int id = item.getType(); - final int damage = item.getDamage(); + final int damage = item.getData(); int amount = (item instanceof BaseItemStack) ? ((BaseItemStack) item).getAmount() : 1; assert(amount <= 64); boolean usesDamageValue = ItemType.usesDamageValue(id); diff --git a/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java b/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java index 9c9c3bd10..bfd1c0105 100644 --- a/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java +++ b/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java @@ -596,7 +596,7 @@ public class BukkitWorld extends LocalWorld { @Override public void dropItem(Vector pt, BaseItemStack item) { ItemStack bukkitItem = new ItemStack(item.getType(), item.getAmount(), - item.getDamage()); + item.getData()); world.dropItemNaturally(BukkitUtil.toLocation(world, pt), bukkitItem); } @@ -843,7 +843,7 @@ public class BukkitWorld extends LocalWorld { if (contents[i] != null) { ItemStack toAdd = new ItemStack(contents[i].getType(), contents[i].getAmount(), - contents[i].getDamage()); + contents[i].getData()); try { for (Map.Entry entry : contents[i].getEnchantments().entrySet()) { toAdd.addEnchantment(Enchantment.getById(entry.getKey()), entry.getValue()); diff --git a/src/main/java/com/sk89q/worldedit/spout/SpoutPlayerBlockBag.java b/src/main/java/com/sk89q/worldedit/spout/SpoutPlayerBlockBag.java index 736c4850f..2658da996 100644 --- a/src/main/java/com/sk89q/worldedit/spout/SpoutPlayerBlockBag.java +++ b/src/main/java/com/sk89q/worldedit/spout/SpoutPlayerBlockBag.java @@ -81,7 +81,7 @@ public class SpoutPlayerBlockBag extends BlockBag { @Override public void fetchItem(BaseItem item) throws BlockBagException { final short id = (short)item.getType(); - final short damage = item.getDamage(); + final short damage = item.getData(); int amount = (item instanceof BaseItemStack) ? ((BaseItemStack) item).getAmount() : 1; assert(amount == 1); Material mat = VanillaMaterials.getMaterial(id); @@ -139,7 +139,7 @@ public class SpoutPlayerBlockBag extends BlockBag { @Override public void storeItem(BaseItem item) throws BlockBagException { final short id = (short) item.getType(); - final short damage = item.getDamage(); + final short damage = item.getData(); Material mat = VanillaMaterials.getMaterial(id); if (mat.hasSubMaterials()) { mat = mat.getSubMaterial(damage); diff --git a/src/main/java/com/sk89q/worldedit/spout/SpoutWorld.java b/src/main/java/com/sk89q/worldedit/spout/SpoutWorld.java index 05eb276af..6e67c2998 100644 --- a/src/main/java/com/sk89q/worldedit/spout/SpoutWorld.java +++ b/src/main/java/com/sk89q/worldedit/spout/SpoutWorld.java @@ -444,9 +444,9 @@ public class SpoutWorld extends LocalWorld { public void dropItem(Vector pt, BaseItemStack item) { Material mat = VanillaMaterials.getMaterial((short) item.getType()); if (mat.hasSubMaterials()) { - mat = mat.getSubMaterial(item.getDamage()); + mat = mat.getSubMaterial(item.getData()); } - ItemStack spoutItem = new ItemStack(mat, item.getDamage(), item.getAmount()); + ItemStack spoutItem = new ItemStack(mat, item.getData(), item.getAmount()); world.createAndSpawnEntity(SpoutUtil.toPoint(world, pt), new Item(spoutItem, new Vector3(pt.getX(), pt.getY(), pt.getZ()))); }