From dbe39cf7e6ddc6c6fd1e639b495a8ac568e081a9 Mon Sep 17 00:00:00 2001 From: OnyxDarkKnight Date: Wed, 2 Apr 2014 17:44:09 +0300 Subject: Fixed some bugs! --- .../jewelrycraft/container/GuiHandler.java | 38 ++---- .../jewelrycraft/container/GuiTabBlocks.java | 11 +- .../jewelrycraft/container/GuiTabItems.java | 3 +- .../jewelrycraft/container/GuiTabNecklaces.java | 83 ++++++------- .../jewelrycraft/container/GuiTabRings.java | 131 +++++++++++---------- common/darkknight/jewelrycraft/container/Page.java | 9 +- common/darkknight/jewelrycraft/item/ItemGuide.java | 3 +- common/darkknight/jewelrycraft/item/ItemRing.java | 3 +- 8 files changed, 131 insertions(+), 150 deletions(-) (limited to 'common') diff --git a/common/darkknight/jewelrycraft/container/GuiHandler.java b/common/darkknight/jewelrycraft/container/GuiHandler.java index 6e1a78a..70ff5f7 100644 --- a/common/darkknight/jewelrycraft/container/GuiHandler.java +++ b/common/darkknight/jewelrycraft/container/GuiHandler.java @@ -11,13 +11,6 @@ import darkknight.jewelrycraft.client.GuiRingChest; public class GuiHandler implements IGuiHandler { - public static enum GuiId { - ringChest, - guide; - - public static final GuiId[] VALUES = GuiId.values(); - } - public GuiHandler() { NetworkRegistry.instance().registerGuiHandler(JewelrycraftMod.instance, this); @@ -25,38 +18,23 @@ public class GuiHandler implements IGuiHandler @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) - { - final GuiId guiId = getGuiId(ID); - if (guiId == null) return null; - switch(guiId) + { + switch(ID) { - case ringChest: return new ContainerRingChest(player.inventory, (TileEntityChest) world.getBlockTileEntity(x, y, z)); - case guide: return new ContainerGuide(); + case 0: return new ContainerRingChest(player.inventory, (TileEntityChest) world.getBlockTileEntity(x, y, z)); + case 1: return new ContainerGuide(); default: return null; } } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) - { - final GuiId guiId = getGuiId(ID); - if (guiId == null) return null; - switch(guiId) + { + switch(ID) { - case ringChest: return new GuiRingChest((ContainerRingChest) getServerGuiElement(ID, player, world, x, y, z)); - case guide: return new GuiGuide((ContainerGuide) getServerGuiElement(ID, player, world, x, y, z), world); + case 0: return new GuiRingChest((ContainerRingChest) getServerGuiElement(ID, player, world, x, y, z)); + case 1: return new GuiGuide((ContainerGuide) getServerGuiElement(ID, player, world, x, y, z), world); default: return null; } } - - private static GuiId getGuiId(int id) { - try - { - return GuiId.VALUES[id]; - } - catch (ArrayIndexOutOfBoundsException e) - { - return null; - } - } } diff --git a/common/darkknight/jewelrycraft/container/GuiTabBlocks.java b/common/darkknight/jewelrycraft/container/GuiTabBlocks.java index 614b6d4..5c24ad2 100644 --- a/common/darkknight/jewelrycraft/container/GuiTabBlocks.java +++ b/common/darkknight/jewelrycraft/container/GuiTabBlocks.java @@ -5,6 +5,7 @@ import java.util.ArrayList; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; import darkknight.jewelrycraft.block.BlockList; import darkknight.jewelrycraft.client.GuiGuide; import darkknight.jewelrycraft.item.ItemList; @@ -146,11 +147,11 @@ public class GuiTabBlocks extends GuiTab text.add("down. When it's done,"); text.add("left click on the"); text.add("molder to get the"); - text.add("jewellery. §4Be aware"); - text.add("§4that this block must be"); - text.add("§4placed directly in front"); - text.add("§4of the smelter,"); - text.add("§4otherwise it won't work!"); + text.add("jewellery. " + EnumChatFormatting.DARK_RED + "Be aware"); + text.add(EnumChatFormatting.DARK_RED + "that this block must be"); + text.add(EnumChatFormatting.DARK_RED + "placed directly in front"); + text.add(EnumChatFormatting.DARK_RED + "of the smelter,"); + text.add(EnumChatFormatting.DARK_RED + "otherwise it won't work!"); Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); break; case 10: diff --git a/common/darkknight/jewelrycraft/container/GuiTabItems.java b/common/darkknight/jewelrycraft/container/GuiTabItems.java index 2b99a0b..685d7dd 100644 --- a/common/darkknight/jewelrycraft/container/GuiTabItems.java +++ b/common/darkknight/jewelrycraft/container/GuiTabItems.java @@ -7,6 +7,7 @@ import java.util.ArrayList; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; import darkknight.jewelrycraft.block.BlockList; import darkknight.jewelrycraft.client.GuiGuide; import darkknight.jewelrycraft.item.ItemList; @@ -232,7 +233,7 @@ public class GuiTabItems extends GuiTab break; case 14: String link = "HERE"; - if(x >= gui.getLeft() + 138 && x <= gui.getLeft() + 168 && y >= gui.getTop() + 98 && y <= gui.getTop() + 108) link = "§1HERE§0"; + if(x >= gui.getLeft() + 138 && x <= gui.getLeft() + 168 && y >= gui.getTop() + 98 && y <= gui.getTop() + 108) link = EnumChatFormatting.DARK_BLUE + "HERE" + EnumChatFormatting.BLACK; text.add("see all the recipes."); text.add("Since you are reading"); text.add("this, how about making"); diff --git a/common/darkknight/jewelrycraft/container/GuiTabNecklaces.java b/common/darkknight/jewelrycraft/container/GuiTabNecklaces.java index 65b9721..1d1e233 100644 --- a/common/darkknight/jewelrycraft/container/GuiTabNecklaces.java +++ b/common/darkknight/jewelrycraft/container/GuiTabNecklaces.java @@ -5,6 +5,7 @@ import java.util.ArrayList; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; import darkknight.jewelrycraft.client.GuiGuide; import darkknight.jewelrycraft.item.ItemList; import darkknight.jewelrycraft.util.JewelryNBT; @@ -45,9 +46,9 @@ public class GuiTabNecklaces extends GuiTab JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values)); JewelryNBT.addJewel(item, new ItemStack(Item.enderPearl)); - text.add("§2Jewel: §0Ender Pearl"); - text.add("§2Modifier: §0None"); - text.add("§2Ingot: §0Any"); + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "Ender Pearl"); + text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "None"); + text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); text.add(" This ring teleports"); text.add("you and anyone around "); text.add("in any location from the"); @@ -60,7 +61,7 @@ public class GuiTabNecklaces extends GuiTab break; case 2: text.add("to teleport there."); - text.add("§4§nAltar Effect"); + text.add(EnumChatFormatting.DARK_RED + "\u00a7nAltar Effect"); text.add(" This teleports anyone"); text.add("or anything that steps"); text.add("or goes near the altar"); @@ -80,9 +81,9 @@ public class GuiTabNecklaces extends GuiTab JewelryNBT.addJewel(item, new ItemStack(Item.enderPearl)); JewelryNBT.addModifier(item, new ItemStack(Item.bed)); - text.add("§2Jewel: §0Ender Pearl"); - text.add("§2Modifier: §0Bed"); - text.add("§2Ingot: §0Any"); + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "Ender Pearl"); + text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Bed"); + text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); text.add(" Just like the other"); text.add("necklace this teleports"); text.add("you and anybody close"); @@ -94,7 +95,7 @@ public class GuiTabNecklaces extends GuiTab Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); break; case 4: - text.add("§4§nAltar Effect"); + text.add(EnumChatFormatting.DARK_RED + "\u00a7nAltar Effect"); text.add(" This teleports anyone"); text.add("or anything that step"); text.add("on or around the altar"); @@ -121,13 +122,13 @@ public class GuiTabNecklaces extends GuiTab JewelryNBT.addJewel(item, jewels.get(jValues)); JewelryNBT.addModifier(item, new ItemStack(Item.blazePowder)); - text.add("§2Jewel: §0None, Diamond"); + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "None, Diamond"); text.add("Emerald or Nether Star"); - text.add("§2Modifier: §0Blaze Powder"); - text.add("§2Ingot: §0Any"); + text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Blaze Powder"); + text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); text.add(" This necklace gives"); text.add("you and those around"); - text.add("you §4Fire Resistance§0"); + text.add("you " + EnumChatFormatting.DARK_RED + "Fire Resistance"); text.add("when activated and in"); text.add("your inventory. To"); text.add("deactivate it simply"); @@ -137,8 +138,8 @@ public class GuiTabNecklaces extends GuiTab case 6: text.add("Depending on the jewel"); text.add("used, you and the"); - text.add("others get §4Fire"); - text.add("§4Resistance§0 I if you"); + text.add("others get " + EnumChatFormatting.DARK_RED + "Fire"); + text.add(EnumChatFormatting.DARK_RED + "Resistance" + EnumChatFormatting.BLACK + " I if you"); text.add("haven't got any jewel,"); text.add("II for Diamond,"); text.add("III for Emerald and"); @@ -161,13 +162,13 @@ public class GuiTabNecklaces extends GuiTab JewelryNBT.addJewel(item, jewels.get(jValues)); JewelryNBT.addModifier(item, new ItemStack(Item.sugar)); - text.add("§2Jewel: §0None, Diamond"); + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "None, Diamond"); text.add("Emerald or Nether Star"); - text.add("§2Modifier: §0Sugar"); - text.add("§2Ingot: §0Any"); + text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Sugar"); + text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); text.add(" This necklace gives"); text.add("you and those around"); - text.add("you §4Speed§0 when"); + text.add("you " + EnumChatFormatting.DARK_RED + "Speed" + EnumChatFormatting.BLACK + " when"); text.add("activated and in your"); text.add("inventory. To"); text.add("deactivate it simply"); @@ -177,7 +178,7 @@ public class GuiTabNecklaces extends GuiTab case 8: text.add("Depending on the jewel"); text.add("used, you and the"); - text.add("others get §4Speed§0 I"); + text.add("others get " + EnumChatFormatting.DARK_RED + "Speed" + EnumChatFormatting.BLACK + " I"); text.add("if you haven't got any"); text.add("jewel, II for Diamond,"); text.add("III for Emerald and"); @@ -200,13 +201,13 @@ public class GuiTabNecklaces extends GuiTab JewelryNBT.addJewel(item, jewels.get(jValues)); JewelryNBT.addModifier(item, new ItemStack(Item.pickaxeIron)); - text.add("§2Jewel: §0None, Diamond"); + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "None, Diamond"); text.add("Emerald or Nether Star"); - text.add("§2Modifier: §0Iron Pickaxe"); - text.add("§2Ingot: §0Any"); + text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Iron Pickaxe"); + text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); text.add(" This necklace gives"); text.add("you and those around"); - text.add("you §4Haste§0 when"); + text.add("you " + EnumChatFormatting.DARK_RED + "Haste" + EnumChatFormatting.BLACK + " when"); text.add("activated and in your"); text.add("inventory. To"); text.add("deactivate it simply"); @@ -216,7 +217,7 @@ public class GuiTabNecklaces extends GuiTab case 10: text.add("Depending on the jewel"); text.add("used, you and the"); - text.add("others get §4Haste§0 I"); + text.add("others get " + EnumChatFormatting.DARK_RED + "Haste" + EnumChatFormatting.BLACK + " I"); text.add("if you haven't got any"); text.add("jewel, II for Diamond,"); text.add("III for Emerald and"); @@ -239,13 +240,13 @@ public class GuiTabNecklaces extends GuiTab JewelryNBT.addJewel(item, jewels.get(jValues)); JewelryNBT.addModifier(item, new ItemStack(Item.feather)); - text.add("§2Jewel: §0None, Diamond"); + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "None, Diamond"); text.add("Emerald or Nether Star"); - text.add("§2Modifier: §0Feather"); - text.add("§2Ingot: §0Any"); + text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Feather"); + text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); text.add(" This necklace gives"); text.add("you and those around"); - text.add("you §4Jump Boost§0 when"); + text.add("you " + EnumChatFormatting.DARK_RED + "Jump Boost" + EnumChatFormatting.BLACK + " when"); text.add("activated and in your"); text.add("inventory. To"); text.add("deactivate it simply"); @@ -255,7 +256,7 @@ public class GuiTabNecklaces extends GuiTab case 12: text.add("Depending on the jewel"); text.add("used, you and the"); - text.add("others get §4Jump Boost"); + text.add("others get " + EnumChatFormatting.DARK_RED + "Jump Boost"); text.add("I if you haven't got any"); text.add("jewel, II for Diamond,"); text.add("III for Emerald and"); @@ -278,14 +279,14 @@ public class GuiTabNecklaces extends GuiTab JewelryNBT.addJewel(item, jewels.get(jValues)); JewelryNBT.addModifier(item, new ItemStack(Item.potion, 1, 8270)); - text.add("§2Jewel: §0None, Diamond"); + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "None, Diamond"); text.add("Emerald or Nether Star"); - text.add("§2Modifier: §08min Potion of"); + text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "8min Potion of"); text.add("Invisibility"); - text.add("§2Ingot: §0Any"); + text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); text.add(" This necklace gives"); text.add("you and those around"); - text.add("you §4Invisibility§0 when"); + text.add("you " + EnumChatFormatting.DARK_RED + "Invisibility" + EnumChatFormatting.BLACK + " when"); text.add("activated and in your"); text.add("inventory. To"); text.add("deactivate it simply"); @@ -295,7 +296,7 @@ public class GuiTabNecklaces extends GuiTab text.add("right click with it."); text.add("Depending on the jewel"); text.add("used, you and the"); - text.add("others get §4Invisibility§0 I"); + text.add("others get " + EnumChatFormatting.DARK_RED + "Invisibility" + EnumChatFormatting.BLACK + " I"); text.add("if you haven't got any"); text.add("jewel, II for Diamond,"); text.add("III for Emerald and"); @@ -318,10 +319,10 @@ public class GuiTabNecklaces extends GuiTab JewelryNBT.addJewel(item, jewels.get(jValues)); JewelryNBT.addModifier(item, new ItemStack(Item.dyePowder, 1, 15)); - text.add("§2Jewel: §0None, Diamond"); + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "None, Diamond"); text.add("Emerald or Nether Star"); - text.add("§2Modifier: §0Bone Meal"); - text.add("§2Ingot: §0Any"); + text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Bone Meal"); + text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); text.add(" This hydrates the"); text.add("farm blocks under you"); text.add("in a defined area. If"); @@ -337,7 +338,7 @@ public class GuiTabNecklaces extends GuiTab text.add("area is a block, diamond"); text.add("is 3x3, emerald 5x5 and"); text.add("nether star 11x11."); - text.add("§4§nAltar Effect"); + text.add(EnumChatFormatting.DARK_RED + "\u00a7nAltar Effect"); text.add(" In the altar, this"); text.add("has the ability to"); text.add("hydrate any tilted land"); @@ -351,9 +352,9 @@ public class GuiTabNecklaces extends GuiTab JewelryNBT.addJewel(item, new ItemStack(Item.netherStar)); JewelryNBT.addModifier(item, new ItemStack(Item.pickaxeDiamond)); - text.add("§2Jewel: §0Nether Star"); - text.add("§2Modifier: §0Diamond Pick"); - text.add("§2Ingot: §0Shadow Ingot"); + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "Nether Star"); + text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Diamond Pick"); + text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Shadow Ingot"); text.add(" This will break all"); text.add("blocks in a 3x3x1 area."); text.add("Just right click on a"); diff --git a/common/darkknight/jewelrycraft/container/GuiTabRings.java b/common/darkknight/jewelrycraft/container/GuiTabRings.java index b821dd2..5357531 100644 --- a/common/darkknight/jewelrycraft/container/GuiTabRings.java +++ b/common/darkknight/jewelrycraft/container/GuiTabRings.java @@ -5,6 +5,7 @@ import java.util.ArrayList; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; import darkknight.jewelrycraft.client.GuiGuide; import darkknight.jewelrycraft.item.ItemList; import darkknight.jewelrycraft.util.JewelryNBT; @@ -45,9 +46,9 @@ public class GuiTabRings extends GuiTab JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values)); JewelryNBT.addJewel(item, new ItemStack(Item.enderPearl)); - text.add("§2Jewel: §0Ender Pearl"); - text.add("§2Modifier: §0None"); - text.add("§2Ingot: §0Any"); + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "Ender Pearl"); + text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "None"); + text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); text.add(" This ring allows you"); text.add("to teleport in any"); text.add("location from the same"); @@ -59,7 +60,7 @@ public class GuiTabRings extends GuiTab Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); break; case 2: - text.add("§4§nAltar Effect"); + text.add(EnumChatFormatting.DARK_RED + "\u00a7nAltar Effect"); text.add(" If this ring is placed"); text.add("in the altar and if the"); text.add("ring has coordonates"); @@ -83,9 +84,9 @@ public class GuiTabRings extends GuiTab JewelryNBT.addJewel(item, new ItemStack(Item.enderPearl)); JewelryNBT.addModifier(item, new ItemStack(Item.bed)); - text.add("§2Jewel: §0Ender Pearl"); - text.add("§2Modifier: §0Bed"); - text.add("§2Ingot: §0Any"); + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "Ender Pearl"); + text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Bed"); + text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); text.add(" Just like the other"); text.add("ring that had only an"); text.add("ender pearl as a jewel,"); @@ -96,7 +97,7 @@ public class GuiTabRings extends GuiTab Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); break; case 4: - text.add("§4§nAltar Effect"); + text.add(EnumChatFormatting.DARK_RED + "\u00a7nAltar Effect"); text.add(" Just like the other"); text.add("one, when in the altar"); text.add("if somebody steps on"); @@ -126,12 +127,12 @@ public class GuiTabRings extends GuiTab JewelryNBT.addJewel(item, jewels.get(jValues)); JewelryNBT.addModifier(item, new ItemStack(Item.blazePowder)); - text.add("§2Jewel: §0None, Diamond"); + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "None, Diamond"); text.add("Emerald or Nether Star"); - text.add("§2Modifier: §0Blaze Powder"); - text.add("§2Ingot: §0Any"); + text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Blaze Powder"); + text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); text.add(" This ring grants you"); - text.add("§4Fire Resistance§0 when"); + text.add(EnumChatFormatting.DARK_RED + "Fire Resistance" + EnumChatFormatting.BLACK + " when"); text.add("activated and in your"); text.add("inventory. To deactivate"); text.add("it simply right click with"); @@ -140,7 +141,7 @@ public class GuiTabRings extends GuiTab Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); break; case 6: - text.add("get §4Fire Resistance§0 I"); + text.add("get " + EnumChatFormatting.DARK_RED + "Fire Resistance" + EnumChatFormatting.BLACK + " I"); text.add("if you haven't got any"); text.add("jewel, II for Diamond,"); text.add("III for Emerald and"); @@ -163,12 +164,12 @@ public class GuiTabRings extends GuiTab JewelryNBT.addJewel(item, jewels.get(jValues)); JewelryNBT.addModifier(item, new ItemStack(Item.sugar)); - text.add("§2Jewel: §0None, Diamond"); + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "None, Diamond"); text.add("Emerald or Nether Star"); - text.add("§2Modifier: §0Sugar"); - text.add("§2Ingot: §0Any"); + text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Sugar"); + text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); text.add(" This ring grants you"); - text.add("§4Speed§0 when activated"); + text.add(EnumChatFormatting.DARK_RED + "Speed" + EnumChatFormatting.BLACK + " when activated"); text.add("and in your inventory."); text.add("To deactivate it simply"); text.add("right click with it."); @@ -177,7 +178,7 @@ public class GuiTabRings extends GuiTab Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); break; case 8: - text.add("get §4Speed§0 I if you"); + text.add("get " + EnumChatFormatting.DARK_RED + "Speed" + EnumChatFormatting.BLACK + " I if you"); text.add("haven't got any jewel,"); text.add("II for Diamond,"); text.add("III for Emerald and"); @@ -200,12 +201,12 @@ public class GuiTabRings extends GuiTab JewelryNBT.addJewel(item, jewels.get(jValues)); JewelryNBT.addModifier(item, new ItemStack(Item.pickaxeIron)); - text.add("§2Jewel: §0None, Diamond"); + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "None, Diamond"); text.add("Emerald or Nether Star"); - text.add("§2Modifier: §0Iron Pickaxe"); - text.add("§2Ingot: §0Any"); + text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Iron Pickaxe"); + text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); text.add(" This ring grants you"); - text.add("§4Haste§0 when activated"); + text.add(EnumChatFormatting.DARK_RED + "Haste" + EnumChatFormatting.BLACK + " when activated"); text.add("and in your inventory."); text.add("To deactivate it simply"); text.add("right click with it."); @@ -214,7 +215,7 @@ public class GuiTabRings extends GuiTab Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); break; case 10: - text.add("get §4Haste§0 I if you"); + text.add("get " + EnumChatFormatting.DARK_RED + "Haste" + EnumChatFormatting.BLACK + " I if you"); text.add("haven't got any jewel,"); text.add("II for Diamond,"); text.add("III for Emerald and"); @@ -237,12 +238,12 @@ public class GuiTabRings extends GuiTab JewelryNBT.addJewel(item, jewels.get(jValues)); JewelryNBT.addModifier(item, new ItemStack(Item.feather)); - text.add("§2Jewel: §0None, Diamond"); + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "None, Diamond"); text.add("Emerald or Nether Star"); - text.add("§2Modifier: §0Feather"); - text.add("§2Ingot: §0Any"); + text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Feather"); + text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); text.add(" This ring grants you"); - text.add("§4Jump Boost§0 when"); + text.add(EnumChatFormatting.DARK_RED + "Jump Boost" + EnumChatFormatting.BLACK + " when"); text.add("activated and in your"); text.add("inventory, as well as"); text.add("remove any fall damage."); @@ -253,7 +254,7 @@ public class GuiTabRings extends GuiTab case 12: text.add("Depending on the jewel"); text.add("you used, you get"); - text.add("§4Jump Boost§0 I if you"); + text.add(EnumChatFormatting.DARK_RED + "Jump Boost" + EnumChatFormatting.BLACK + " I if you"); text.add("haven't got any jewel,"); text.add("II for Diamond,"); text.add("III for Emerald and"); @@ -276,13 +277,13 @@ public class GuiTabRings extends GuiTab JewelryNBT.addJewel(item, jewels.get(jValues)); JewelryNBT.addModifier(item, new ItemStack(Item.potion, 1, 8270)); - text.add("§2Jewel: §0None, Diamond"); + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "None, Diamond"); text.add("Emerald or Nether Star"); - text.add("§2Modifier: §08min Potion of"); + text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "8min Potion of"); text.add("Invisibility"); - text.add("§2Ingot: §0Any"); + text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); text.add(" This ring grants you"); - text.add("§4Invisibility§0 when"); + text.add(EnumChatFormatting.DARK_RED + "Invisibility" + EnumChatFormatting.BLACK + " when"); text.add("activated and in your"); text.add("inventory, as well as"); text.add("remove any fall damage."); @@ -293,7 +294,7 @@ public class GuiTabRings extends GuiTab text.add("right click with it."); text.add("Depending on the jewel"); text.add("you used, you get"); - text.add("§4Invisibility§0 I if you"); + text.add(EnumChatFormatting.DARK_RED + "Invisibility" + EnumChatFormatting.BLACK + " I if you"); text.add("haven't got any jewel,"); text.add("II for Diamond,"); text.add("III for Emerald and"); @@ -310,13 +311,13 @@ public class GuiTabRings extends GuiTab JewelryNBT.addJewel(item, new ItemStack(Item.netherStar)); JewelryNBT.addModifier(item, new ItemStack(Item.book)); - text.add("§2Jewel: §0Nether Star"); - text.add("§2Modifier: §0Book"); - text.add("§2Ingot: §0Any"); + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "Nether Star"); + text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Book"); + text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); text.add(" This has the power"); - text.add("to §5Enchant§0, §5Disenchant§0"); - text.add("or even §5Transfer"); - text.add("§5Enchantments§0. To"); + text.add("to " + EnumChatFormatting.DARK_PURPLE + "Enchant" + EnumChatFormatting.BLACK + ", " + EnumChatFormatting.DARK_PURPLE + "Disenchant" + EnumChatFormatting.BLACK + ""); + text.add("or even" + EnumChatFormatting.DARK_PURPLE + " Transfer"); + text.add(EnumChatFormatting.DARK_PURPLE + "Enchantments" + EnumChatFormatting.BLACK + ". To"); text.add("change its mode simply"); text.add("right click it. However,"); text.add("this ring only works"); @@ -324,7 +325,7 @@ public class GuiTabRings extends GuiTab Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); break; case 16: - text.add("§5§nDisenchanting§0"); + text.add(EnumChatFormatting.DARK_PURPLE + "\u00a7nDisenchanting" + EnumChatFormatting.BLACK + ""); text.add(" If the ring is held"); text.add("and an enchanted item"); text.add("is placed beside it in"); @@ -354,7 +355,7 @@ public class GuiTabRings extends GuiTab Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); break; case 18: - text.add("§5§nEnchanting§0"); + text.add(EnumChatFormatting.DARK_PURPLE + "\u00a7nEnchanting" + EnumChatFormatting.BLACK + ""); text.add(" This mode allows you"); text.add("to give a random"); text.add("enchantment to an item"); @@ -382,7 +383,7 @@ public class GuiTabRings extends GuiTab Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); break; case 20: - text.add("§5§nEnchantment Transfer§0"); + text.add(EnumChatFormatting.DARK_PURPLE + "\u00a7nEnchantment Transfer" + EnumChatFormatting.BLACK + ""); text.add(" This mode is very"); text.add("special as it lets you"); text.add("transfer enchantments"); @@ -403,10 +404,10 @@ public class GuiTabRings extends GuiTab text.add("at a time, after each"); text.add("transfer it requiring a"); text.add("cooldown."); - text.add(" §4Again, this ring only"); - text.add("§4works when it is in the"); - text.add("§4players hotbar and"); - text.add("§4being held!"); + text.add(EnumChatFormatting.DARK_RED + " Again, this ring only"); + text.add(EnumChatFormatting.DARK_RED + "works when it is in the"); + text.add(EnumChatFormatting.DARK_RED + "players hotbar and"); + text.add(EnumChatFormatting.DARK_RED + "being held!"); Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); break; case 22: @@ -419,9 +420,9 @@ public class GuiTabRings extends GuiTab JewelryNBT.addJewel(item, new ItemStack(Item.enderPearl)); JewelryNBT.addModifier(item, new ItemStack(Block.chest)); - text.add("§2Jewel: §0Ender Pearl"); - text.add("§2Modifier: §0Chest"); - text.add("§2Ingot: §0Any"); + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "Ender Pearl"); + text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Chest"); + text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); text.add(" This ring can link"); text.add("to any chest and"); text.add("access its inventory."); @@ -457,9 +458,9 @@ public class GuiTabRings extends GuiTab JewelryNBT.addJewel(item, new ItemStack(Block.obsidian)); JewelryNBT.addModifier(item, new ItemStack(Item.eyeOfEnder)); - text.add("§2Jewel: §0Obsidian"); - text.add("§2Modifier: §0Eye of Ender"); - text.add("§2Ingot: §0Any"); + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "Obsidian"); + text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Eye of Ender"); + text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); text.add(" This ring is connected"); text.add("to your ender chest."); text.add("Just right click it"); @@ -477,9 +478,9 @@ public class GuiTabRings extends GuiTab JewelryNBT.addJewel(item, new ItemStack(Item.netherStar)); JewelryNBT.addModifier(item, new ItemStack(Block.chest)); - text.add("§2Jewel: §0Nether Star"); - text.add("§2Modifier: §0Chest"); - text.add("§2Ingot: §0Any"); + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "Nether Star"); + text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Chest"); + text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); text.add(" This ring can store"); text.add("any entity in it. To do"); text.add("that right click an"); @@ -507,9 +508,9 @@ public class GuiTabRings extends GuiTab JewelryNBT.addJewel(item, JewelrycraftUtil.jewel.get(jValues)); JewelryNBT.addModifier(item, new ItemStack(Item.dyePowder, 1, 15)); - text.add("§2Jewel: §0Any"); - text.add("§2Modifier: §0Bone Meal"); - text.add("§2Ingot: §0Any"); + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "Any"); + text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Bone Meal"); + text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); text.add(" While having it in"); text.add("the inventory it will"); text.add("hydrate any farmland"); @@ -523,7 +524,7 @@ public class GuiTabRings extends GuiTab case 28: text.add("clicking if you want to"); text.add("see an actual effect."); - text.add("§4§nAltar Effect"); + text.add(EnumChatFormatting.DARK_RED + "\u00a7nAltar Effect"); text.add(" In the altar, the ring"); text.add("has the ability to"); text.add("hydrate any tilted land"); @@ -542,9 +543,9 @@ public class GuiTabRings extends GuiTab JewelryNBT.addJewel(item, new ItemStack(Item.enderPearl)); JewelryNBT.addModifier(item, new ItemStack(Item.pickaxeDiamond)); - text.add("§2Jewel: §0Ender Pearl"); - text.add("§2Modifier: §0Diamond Pick"); - text.add("§2Ingot: §0Any"); + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "Ender Pearl"); + text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Diamond Pick"); + text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); text.add(" You can right click"); text.add("any block (or crouch"); text.add("right click) to store"); @@ -560,9 +561,9 @@ public class GuiTabRings extends GuiTab JewelryNBT.addJewel(item, new ItemStack(Item.netherStar)); JewelryNBT.addModifier(item, new ItemStack(Item.pickaxeDiamond)); - text.add("§2Jewel: §0Nether Star"); - text.add("§2Modifier: §0Diamond Pick"); - text.add("§2Ingot: §0Shadow Ingot"); + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "Nether Star"); + text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Diamond Pick"); + text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Shadow Ingot"); text.add(" Right clicking with"); text.add("this on any block will"); text.add("cause that block to"); diff --git a/common/darkknight/jewelrycraft/container/Page.java b/common/darkknight/jewelrycraft/container/Page.java index 7837b8d..da12663 100644 --- a/common/darkknight/jewelrycraft/container/Page.java +++ b/common/darkknight/jewelrycraft/container/Page.java @@ -6,6 +6,7 @@ import org.lwjgl.opengl.GL11; import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; import darkknight.jewelrycraft.client.GuiGuide; @@ -14,7 +15,7 @@ public class Page public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, ArrayList text, ArrayList items, int mouseX, int mouseY) { y+=5; - gui.getFont().drawString("§1§n" + items.get(0).getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items.get(0).getDisplayName())/2) - 10, y - 2, 0); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items.get(0).getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items.get(0).getDisplayName())/2) - 10, y - 2, 0); GL11.glColor4f(1, 1, 1, 1); Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png")); ArrayList name = new ArrayList(); @@ -127,7 +128,7 @@ public class Page public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, ArrayList text, ArrayList items, int mouseX, int mouseY) { ArrayList name = new ArrayList(); - gui.getFont().drawString("§1§n" + items.get(1).getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items.get(0).getDisplayName())/2), y + 2, 0); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items.get(1).getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items.get(0).getDisplayName())/2), y + 2, 0); GL11.glColor4f(1, 1, 1, 1); Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip" + ".png")); gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 46); @@ -147,7 +148,7 @@ public class Page public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, ArrayList text, float size) { y+=5; - gui.getFont().drawString("§1§n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName())/2) - 10, y + 2, 0); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName())/2) - 10, y + 2, 0); GL11.glColor4f(1, 1, 1, 1); gui.renderItem(item, x + 13, y + 18, size); for(int i = 0; i < text.size(); i++) gui.getFont().drawString(text.get(i), x, y + 30 + i*12, 0); @@ -156,7 +157,7 @@ public class Page public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, ArrayList text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY) { y+=5; - if(showName) gui.getFont().drawString("§1§n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName())/2) - 10, y + 2, 0); + if(showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName())/2) - 10, y + 2, 0); GL11.glColor4f(1, 1, 1, 1); gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size); for(int i = 0; i < text.size(); i++) gui.getFont().drawString(text.get(i), x + txtX, y + 30 + txtY + i*12, 0); diff --git a/common/darkknight/jewelrycraft/item/ItemGuide.java b/common/darkknight/jewelrycraft/item/ItemGuide.java index 7decf67..383ef7b 100644 --- a/common/darkknight/jewelrycraft/item/ItemGuide.java +++ b/common/darkknight/jewelrycraft/item/ItemGuide.java @@ -5,7 +5,6 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.container.GuiHandler; public class ItemGuide extends Item { @@ -20,7 +19,7 @@ public class ItemGuide extends Item { if (world.isRemote) { - player.openGui(JewelrycraftMod.instance, GuiHandler.GuiId.guide.ordinal(), player.worldObj, 0, 0, 0); + player.openGui(JewelrycraftMod.instance, 1, player.worldObj, 0, 0, 0); } return stack; diff --git a/common/darkknight/jewelrycraft/item/ItemRing.java b/common/darkknight/jewelrycraft/item/ItemRing.java index 92416f4..3824edb 100644 --- a/common/darkknight/jewelrycraft/item/ItemRing.java +++ b/common/darkknight/jewelrycraft/item/ItemRing.java @@ -14,7 +14,6 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import darkknight.jewelrycraft.JewelrycraftMod; import darkknight.jewelrycraft.block.BlockList; -import darkknight.jewelrycraft.container.GuiHandler; import darkknight.jewelrycraft.util.JewelryNBT; import net.minecraft.block.Block; @@ -203,7 +202,7 @@ public class ItemRing extends Item int id = world.getBlockId(i, j, k); if (id != 0 && Block.blocksList[id] != null && Block.blocksList[id].blockID == Block.chest.blockID){ TileEntity tile = world.getBlockTileEntity(i, j, k); - if (tile != null && tile instanceof TileEntityChest) FMLNetworkHandler.openGui(player, JewelrycraftMod.instance, GuiHandler.GuiId.ringChest.ordinal(), world, i, j, k); + if (tile != null && tile instanceof TileEntityChest) FMLNetworkHandler.openGui(player, JewelrycraftMod.instance, 0, world, i, j, k); } } else if(i != -1 && j != -1 && k != -1) player.addChatMessage("Chest out of range! You need to be " + ((int)player.getDistance(i + 0.5F, j + 0.5F, k + 0.5F) - 127) + " blocks closer."); -- cgit v1.2.3