From 40aa6aca60ce3aff3d731174217e13426344cce8 Mon Sep 17 00:00:00 2001 From: zml2008 Date: Sat, 3 Mar 2012 16:46:51 -0800 Subject: [PATCH] Use the correct Map when writing enchantments --- .../com/sk89q/worldedit/blocks/ChestBlock.java | 4 ++-- .../com/sk89q/worldedit/blocks/DispenserBlock.java | 6 +++--- .../com/sk89q/worldedit/blocks/FurnaceBlock.java | 14 +++++++------- .../sk89q/worldedit/blocks/TileEntityBlock.java | 10 +++++----- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/blocks/ChestBlock.java b/src/main/java/com/sk89q/worldedit/blocks/ChestBlock.java index 6964347bd..2b78d0d0d 100644 --- a/src/main/java/com/sk89q/worldedit/blocks/ChestBlock.java +++ b/src/main/java/com/sk89q/worldedit/blocks/ChestBlock.java @@ -117,7 +117,7 @@ public class ChestBlock extends BaseBlock implements TileEntityBlock, ContainerB ListTag enchlist = new ListTag("ench", CompoundTag.class, list); for(Entry entry : item.getEnchantments().entrySet()) { Map enchantment = new HashMap(); - CompoundTag enchantcompound = new CompoundTag(null, ench); + CompoundTag enchantcompound = new CompoundTag(null, enchantment); enchantment.put("id", new ShortTag("id", entry.getKey().shortValue())); enchantment.put("lvl", new ShortTag("lvl", entry.getValue().shortValue())); list.add(enchantcompound); @@ -178,7 +178,7 @@ public class ChestBlock extends BaseBlock implements TileEntityBlock, ContainerB itemstack.getEnchantments().put((int) enchid, (int)enchlvl); } } - + newItems[slot] = itemstack; } } diff --git a/src/main/java/com/sk89q/worldedit/blocks/DispenserBlock.java b/src/main/java/com/sk89q/worldedit/blocks/DispenserBlock.java index d425f42f7..46d210f4a 100644 --- a/src/main/java/com/sk89q/worldedit/blocks/DispenserBlock.java +++ b/src/main/java/com/sk89q/worldedit/blocks/DispenserBlock.java @@ -85,7 +85,7 @@ public class DispenserBlock extends BaseBlock implements TileEntityBlock, Contai /** * Get the tile entity ID. - * + * * @return */ public String getTileEntityID() { @@ -117,7 +117,7 @@ public class DispenserBlock extends BaseBlock implements TileEntityBlock, Contai ListTag enchlist = new ListTag("ench", CompoundTag.class, list); for(Entry entry : item.getEnchantments().entrySet()) { Map enchantment = new HashMap(); - CompoundTag enchantcompound = new CompoundTag(null, ench); + CompoundTag enchantcompound = new CompoundTag(null, enchantment); enchantment.put("id", new ShortTag("id", entry.getKey().shortValue())); enchantment.put("lvl", new ShortTag("lvl", entry.getValue().shortValue())); list.add(enchantcompound); @@ -178,7 +178,7 @@ public class DispenserBlock extends BaseBlock implements TileEntityBlock, Contai itemstack.getEnchantments().put((int) enchid, (int)enchlvl); } } - + newItems[slot] = itemstack; } } diff --git a/src/main/java/com/sk89q/worldedit/blocks/FurnaceBlock.java b/src/main/java/com/sk89q/worldedit/blocks/FurnaceBlock.java index 73791b1df..af1e86489 100644 --- a/src/main/java/com/sk89q/worldedit/blocks/FurnaceBlock.java +++ b/src/main/java/com/sk89q/worldedit/blocks/FurnaceBlock.java @@ -50,8 +50,8 @@ public class FurnaceBlock extends BaseBlock implements TileEntityBlock, Containe /** * Construct the chest block. - * - * @param type + * + * @param type */ public FurnaceBlock(int type) { super(type); @@ -61,7 +61,7 @@ public class FurnaceBlock extends BaseBlock implements TileEntityBlock, Containe /** * Construct the chest block. * - * @param type + * @param type * @param data */ public FurnaceBlock(int type, int data) { @@ -72,7 +72,7 @@ public class FurnaceBlock extends BaseBlock implements TileEntityBlock, Containe /** * Construct the chest block. * - * @param type + * @param type * @param data * @param items */ @@ -127,7 +127,7 @@ public class FurnaceBlock extends BaseBlock implements TileEntityBlock, Containe /** * Get the tile entity ID. - * + * * @return */ public String getTileEntityID() { @@ -159,7 +159,7 @@ public class FurnaceBlock extends BaseBlock implements TileEntityBlock, Containe ListTag enchlist = new ListTag("ench", CompoundTag.class, list); for(Entry entry : item.getEnchantments().entrySet()) { Map enchantment = new HashMap(); - CompoundTag enchantcompound = new CompoundTag(null, ench); + CompoundTag enchantcompound = new CompoundTag(null, enchantment); enchantment.put("id", new ShortTag("id", entry.getKey().shortValue())); enchantment.put("lvl", new ShortTag("lvl", entry.getValue().shortValue())); list.add(enchantcompound); @@ -222,7 +222,7 @@ public class FurnaceBlock extends BaseBlock implements TileEntityBlock, Containe itemstack.getEnchantments().put((int) enchid, (int)enchlvl); } } - + newItems[slot] = itemstack; } } diff --git a/src/main/java/com/sk89q/worldedit/blocks/TileEntityBlock.java b/src/main/java/com/sk89q/worldedit/blocks/TileEntityBlock.java index 52d80af83..436afad79 100644 --- a/src/main/java/com/sk89q/worldedit/blocks/TileEntityBlock.java +++ b/src/main/java/com/sk89q/worldedit/blocks/TileEntityBlock.java @@ -32,7 +32,7 @@ public interface TileEntityBlock { /** * Return the name of the title entity ID. * - * @return title entity ID + * @return tile entity ID */ public String getTileEntityID(); @@ -40,16 +40,16 @@ public interface TileEntityBlock { * Store additional tile entity data. * * @return map of values - * @throws DataException + * @throws DataException When invalid data is encountered */ public Map toTileEntityNBT() throws DataException; /** - * Get additional information from the title entity data. + * Get additional information from the tile entity data. * - * @param values - * @throws DataException + * @param values map of data + * @throws DataException When invalid data is encountered */ public void fromTileEntityNBT(Map values) throws DataException;