From a62cf3a05991376de90bca85dc388013abda64cd Mon Sep 17 00:00:00 2001 From: zml2008 Date: Thu, 1 Mar 2012 20:28:09 -0800 Subject: [PATCH] Updated for new 1.2 blocks --- .../java/com/sk89q/worldedit/blocks/BlockID.java | 4 +++- .../java/com/sk89q/worldedit/blocks/BlockType.java | 12 +++++++++--- src/main/java/com/sk89q/worldedit/blocks/ItemID.java | 4 +++- .../java/com/sk89q/worldedit/blocks/ItemType.java | 11 ++++++++--- 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/blocks/BlockID.java b/src/main/java/com/sk89q/worldedit/blocks/BlockID.java index 1fbde4df9..883268824 100644 --- a/src/main/java/com/sk89q/worldedit/blocks/BlockID.java +++ b/src/main/java/com/sk89q/worldedit/blocks/BlockID.java @@ -21,7 +21,7 @@ package com.sk89q.worldedit.blocks; /** * List of block IDs. - * + * * @author sk89q */ public final class BlockID { @@ -149,4 +149,6 @@ public final class BlockID { public static final int END_PORTAL_FRAME = 120; public static final int END_STONE = 121; public static final int DRAGON_EGG = 122; + public static final int REDSTONE_LAMP_OFF = 123; + public static final int REDSTONE_LAMP_ON = 124; } diff --git a/src/main/java/com/sk89q/worldedit/blocks/BlockType.java b/src/main/java/com/sk89q/worldedit/blocks/BlockType.java index 7667b6a0f..9c40f8299 100644 --- a/src/main/java/com/sk89q/worldedit/blocks/BlockType.java +++ b/src/main/java/com/sk89q/worldedit/blocks/BlockType.java @@ -157,7 +157,9 @@ public enum BlockType { END_PORTAL(BlockID.END_PORTAL, "End Portal", "endportal", "blackstuff", "airportal", "weirdblackstuff"), END_PORTAL_FRAME(BlockID.END_PORTAL_FRAME, "End Portal Frame", "endportalframe", "airportalframe", "crystalblock"), END_STONE(BlockID.END_STONE, "End Stone", "endstone", "enderstone", "endersand"), - DRAGON_EGG(BlockID.DRAGON_EGG, "Dragon Egg", "dragonegg", "dragons"); + DRAGON_EGG(BlockID.DRAGON_EGG, "Dragon Egg", "dragonegg", "dragons"), + REDSTONE_LAMP_OFF(BlockID.REDSTONE_LAMP_OFF, "Redstone lamp (off)", "redstonelamp", "redstonelampoff", "rslamp", "rslampoff", "rsglow", "rsglowoff"), + REDSTONE_LAMP_ON(BlockID.REDSTONE_LAMP_ON, "Redstone lamp (on)", "redstonelampon", "rslampon", "rsglowon"); /** * Stores a map of the IDs for fast access. @@ -746,6 +748,7 @@ public enum BlockType { emitsLight.add(BlockID.BROWN_MUSHROOM_CAP); emitsLight.add(BlockID.RED_MUSHROOM_CAP); emitsLight.add(BlockID.END_PORTAL); + emitsLight.add(BlockID.REDSTONE_LAMP_ON); } /** @@ -848,7 +851,7 @@ public enum BlockType { static { /* * rules: - * + * * 1. block yields itself => addIdentity * 2. block is part of a 2-block object => drop an appropriate item for one of the 2 blocks * 3. block can be placed by right-clicking an obtainable item on the ground => use that item @@ -981,6 +984,9 @@ public enum BlockType { nonDataBlockBagItems.put(BlockID.END_PORTAL, doNotDestroy); nonDataBlockBagItems.put(BlockID.END_PORTAL_FRAME, doNotDestroy); addIdentity(BlockID.END_STONE); + + addIdentity(BlockID.REDSTONE_LAMP_OFF); + nonDataBlockBagItems.put(BlockID.REDSTONE_LAMP_ON, new BaseItem(BlockID.REDSTONE_LAMP_OFF)); } /** @@ -1278,7 +1284,7 @@ public enum BlockType { /** * Returns the direction to the block(B) this block(A) is attached to. - * Attached means that if block B is destroyed, block A will pop off. + * Attached means that if block B is destroyed, block A will pop off. * * @param type The block id of block A * @param data The data value of block A diff --git a/src/main/java/com/sk89q/worldedit/blocks/ItemID.java b/src/main/java/com/sk89q/worldedit/blocks/ItemID.java index 86cf4211f..446efc929 100644 --- a/src/main/java/com/sk89q/worldedit/blocks/ItemID.java +++ b/src/main/java/com/sk89q/worldedit/blocks/ItemID.java @@ -21,7 +21,7 @@ package com.sk89q.worldedit.blocks; /** * List of item IDs. - * + * * @author sk89q */ public final class ItemID { @@ -153,6 +153,8 @@ public final class ItemID { public static final int EYE_OF_ENDER = 381; public static final int GLISTERING_MELON = 382; public static final int SPAWN_EGG = 383; + public static final int BOTTLE_O_ENCHANTING = 384; + public static final int FIRE_CHARGE = 385; @Deprecated public static final int GOLD_RECORD = 2256; // deprecated, but leave it there @Deprecated public static final int GREEN_RECORD = 2257; // deprecated, but leave it there public static final int DISC_13 = 2256; diff --git a/src/main/java/com/sk89q/worldedit/blocks/ItemType.java b/src/main/java/com/sk89q/worldedit/blocks/ItemType.java index c5295d365..b11673c89 100644 --- a/src/main/java/com/sk89q/worldedit/blocks/ItemType.java +++ b/src/main/java/com/sk89q/worldedit/blocks/ItemType.java @@ -158,6 +158,8 @@ public enum ItemType { END_PORTAL_FRAME(BlockID.END_PORTAL_FRAME, "End Portal Frame", "endportalframe", "airportalframe", "crystalblock"), END_STONE(BlockID.END_STONE, "End Stone", "endstone", "enderstone", "endersand"), DRAGON_EGG(BlockID.DRAGON_EGG, "Dragon Egg", "dragonegg", "dragons"), + REDSTONE_LAMP_OFF(BlockID.REDSTONE_LAMP_OFF, "Redstone lamp (off)", "redstonelamp", "redstonelampoff", "rslamp", "rslampoff", "rsglow", "rsglowoff"), + REDSTONE_LAMP_ON(BlockID.REDSTONE_LAMP_ON, "Redstone lamp (on)", "redstonelampon", "rslampon", "rsglowon"), // Items IRON_SHOVEL(ItemID.IRON_SHOVEL, "Iron shovel", "ironshovel"), @@ -287,6 +289,8 @@ public enum ItemType { CAULDRON_ITEM(ItemID.CAULDRON, "Cauldron", "cauldron"), EYE_OF_ENDER(ItemID.EYE_OF_ENDER, "Eye of Ender", "eyeofender", "endereye"), GLISTERING_MELON(ItemID.GLISTERING_MELON, "Glistering Melon", "glisteringmelon", "goldmelon"), + BOTTLE_O_ENCHANTING(ItemID.BOTTLE_O_ENCHANTING, "Bottle o' Enchanting", "expbottle", "bottleoenchanting", "experiencebottle", "exppotion", "experiencepotion"), + FIRE_CHARGE(ItemID.FIRE_CHARGE, "Fire Charge", "firecharge", "firestarter", "firerock"), SPAWN_EGG(ItemID.SPAWN_EGG, "Spawn Egg", "spawnegg", "spawn", "mobspawnegg"), DISC_13(ItemID.DISC_13, "Music Disc - 13", "disc_13"), DISC_CAT(ItemID.DISC_CAT, "Music Disc - Cat", "disc_cat"), @@ -439,7 +443,7 @@ public enum ItemType { /** * Get a list of aliases. - * + * * @return */ public String[] getAliases() { @@ -528,7 +532,7 @@ public enum ItemType { /** * Returns true if an item should not be stacked. - * + * * @param id * @return */ @@ -609,12 +613,13 @@ public enum ItemType { usesDamageValue.add(ItemID.POTION); usesDamageValue.add(ItemID.GLASS_BOTTLE); usesDamageValue.add(ItemID.SPAWN_EGG); + usesDamageValue.add(ItemID.MAP); } /** * Returns true if an item uses its damage value for something * other than damage. - * + * * @param id * @return */