From 0465c23ef7f5ac918d72d73620d58eef48bf263b Mon Sep 17 00:00:00 2001 From: Adubbz Date: Thu, 9 May 2013 20:33:50 +1000 Subject: [PATCH] Started work on hippy flower bands, still need recipes and item icons --- src/minecraft/biomesoplenty/api/Items.java | 2 + .../biomesoplenty/armor/ArmorFlowerBand.java | 77 ++++++++++++++++++ .../configuration/BOPConfiguration.java | 4 + .../biomesoplenty/configuration/BOPItems.java | 10 +++ .../textures/armor/dullflowerband.png | Bin .../textures/armor/exoticflowerband.png | Bin .../textures/armor/lushflowerband.png | Bin .../textures/armor/plainflowerband.png | Bin 8 files changed, 93 insertions(+) create mode 100644 src/minecraft/biomesoplenty/armor/ArmorFlowerBand.java rename flowerband.png => src/minecraft/mods/BiomesOPlenty/textures/armor/dullflowerband.png (100%) rename flowerband4.png => src/minecraft/mods/BiomesOPlenty/textures/armor/exoticflowerband.png (100%) rename flowerband3.png => src/minecraft/mods/BiomesOPlenty/textures/armor/lushflowerband.png (100%) rename flowerband2.png => src/minecraft/mods/BiomesOPlenty/textures/armor/plainflowerband.png (100%) diff --git a/src/minecraft/biomesoplenty/api/Items.java b/src/minecraft/biomesoplenty/api/Items.java index 4ef616fe6..b7c98e1fb 100644 --- a/src/minecraft/biomesoplenty/api/Items.java +++ b/src/minecraft/biomesoplenty/api/Items.java @@ -37,4 +37,6 @@ public class Items public static Optional poison = Optional.absent(); public static Optional dartBlower = Optional.absent(); public static Optional dart = Optional.absent(); + + public static Optional flowerBand = Optional.absent(); } diff --git a/src/minecraft/biomesoplenty/armor/ArmorFlowerBand.java b/src/minecraft/biomesoplenty/armor/ArmorFlowerBand.java new file mode 100644 index 000000000..6f3e13e8b --- /dev/null +++ b/src/minecraft/biomesoplenty/armor/ArmorFlowerBand.java @@ -0,0 +1,77 @@ +package biomesoplenty.armor; + +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.EnumArmorMaterial; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Icon; +import net.minecraftforge.common.IArmorTextureProvider; +import biomesoplenty.BiomesOPlenty; +import biomesoplenty.CommonProxy; +import biomesoplenty.api.Items; + +public class ArmorFlowerBand extends ItemArmor implements IArmorTextureProvider +{ + private static final String[] flowerBandTypes = new String[] {"dullflowerband", "plainflowerband", "lushflowerband", "exoticflowerband"}; + @SideOnly(Side.CLIENT) + private Icon[] textures; + + public ArmorFlowerBand(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) { + super(par1, par2EnumArmorMaterial, par3, par4); + setHasSubtypes(true); + setMaxDamage(0); + maxStackSize = 8; + } + + @Override + public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) + { + for (int i = 0; i < flowerBandTypes.length; ++i) + { + par3List.add(new ItemStack(par1, 1, i)); + } + } + + @Override + public String getUnlocalizedName(ItemStack itemStack) + { + return (new StringBuilder()).append(flowerBandTypes[itemStack.getItemDamage()]).toString(); + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IconRegister iconRegister) + { + textures = new Icon[flowerBandTypes.length]; + + for (int i = 0; i < flowerBandTypes.length; ++i) + textures[i] = iconRegister.registerIcon("BiomesOPlenty:" + flowerBandTypes[i]); + } + + @Override + public Icon getIconFromDamage(int meta) + { + return textures[meta]; + } + + public String getArmorTextureFile(ItemStack par1) + { + if (par1.getItemDamage() == 0) + return "/mods/BiomesOPlenty/textures/armor/dullflowerband.png"; + + if (par1.getItemDamage() == 1) + return "/mods/BiomesOPlenty/textures/armor/plainflowerband.png"; + + if (par1.getItemDamage() == 2) + return "/mods/BiomesOPlenty/textures/armor/lushflowerband.png"; + + if (par1.getItemDamage() == 3) + return "/mods/BiomesOPlenty/textures/armor/exoticflowerband.png"; + + return null; + } +} diff --git a/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java b/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java index 5b4c49cb7..65e1eda61 100644 --- a/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java +++ b/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java @@ -207,6 +207,8 @@ public class BOPConfiguration { public static int chestplateAmethystID; public static int leggingsAmethystID; public static int bootsAmethystID; + + public static int flowerBandID; //Biome IDS public static int alpsID; @@ -675,6 +677,8 @@ public class BOPConfiguration { chestplateAmethystID = config.getItem("Amethyst Chestplate ID", 21075, null).getInt(); leggingsAmethystID = config.getItem("Amethyst Leggings ID", 21076, null).getInt(); bootsAmethystID = config.getItem("Amethyst Boots ID", 21077, null).getInt(); + + flowerBandID = config.getItem("Flower Band ID", 21078, null).getInt(); //Mob IDs jungleSpiderID = config.get("Mob IDs", "Jungle Spider ID", 101, null).getInt(); diff --git a/src/minecraft/biomesoplenty/configuration/BOPItems.java b/src/minecraft/biomesoplenty/configuration/BOPItems.java index 1799f9c3c..00e6dc88d 100644 --- a/src/minecraft/biomesoplenty/configuration/BOPItems.java +++ b/src/minecraft/biomesoplenty/configuration/BOPItems.java @@ -13,6 +13,7 @@ import net.minecraftforge.common.MinecraftForge; import biomesoplenty.BiomesOPlenty; import biomesoplenty.api.Items; import biomesoplenty.armor.ArmorAmethyst; +import biomesoplenty.armor.ArmorFlowerBand; import biomesoplenty.armor.ArmorMuddy; import biomesoplenty.items.ItemBOP; import biomesoplenty.items.ItemBOPAncientStaff; @@ -45,6 +46,7 @@ public class BOPItems { public static EnumToolMaterial EnumToolMaterialMud; public static EnumArmorMaterial EnumArmorMaterialAmethyst; public static EnumToolMaterial EnumToolMaterialAmethyst; + public static EnumArmorMaterial EnumArmorMaterialFlowerBand; public static int clearItem(Item var1) { @@ -86,6 +88,7 @@ public class BOPItems { EnumToolMaterialMud = EnumHelper.addToolMaterial("MUD", 0, 32, 0.5F, 0, 1); EnumArmorMaterialAmethyst = EnumHelper.addArmorMaterial("AMETHYST", 40, new int[]{6, 12, 10, 6}, 20); EnumToolMaterialAmethyst = EnumHelper.addToolMaterial("AMETHYST", 4, 2013, 15.0F, 5, 16); + EnumArmorMaterialFlowerBand = EnumHelper.addArmorMaterial("FLOWERBAND", -1, new int[]{0, 0, 0, 0}, 0); //Override Items shears = (new ItemShears(clearItem(Item.shears))).setUnlocalizedName("shears").setCreativeTab(CreativeTabs.tabTools); @@ -134,6 +137,8 @@ public class BOPItems { Items.chestplateAmethyst = Optional.of((new ArmorAmethyst(BOPConfiguration.chestplateAmethystID, EnumArmorMaterialAmethyst, BiomesOPlenty.proxy.addArmor("amethyst"), 1)).setUnlocalizedName("chestplateAmethyst")); Items.leggingsAmethyst = Optional.of((new ArmorAmethyst(BOPConfiguration.leggingsAmethystID, EnumArmorMaterialAmethyst, BiomesOPlenty.proxy.addArmor("amethyst"), 2)).setUnlocalizedName("leggingsAmethyst")); Items.bootsAmethyst = Optional.of((new ArmorAmethyst(BOPConfiguration.bootsAmethystID, EnumArmorMaterialAmethyst, BiomesOPlenty.proxy.addArmor("amethyst"), 3)).setUnlocalizedName("bootsAmethyst")); + + Items.flowerBand = Optional.of((new ArmorFlowerBand(BOPConfiguration.flowerBandID, EnumArmorMaterialFlowerBand, BiomesOPlenty.proxy.addArmor("flowerBand"), 0)).setCreativeTab(BiomesOPlenty.tabBiomesOPlenty)); } private static void registerNames() @@ -176,5 +181,10 @@ public class BOPItems { LanguageRegistry.addName(Items.chestplateAmethyst.get(), "Amethyst Chestplate"); LanguageRegistry.addName(Items.leggingsAmethyst.get(), "Amethyst Leggings"); LanguageRegistry.addName(Items.bootsAmethyst.get(), "Amethyst Boots"); + + LanguageRegistry.addName(new ItemStack(Items.flowerBand.get(), 1, 0), "Dull Flower Band"); + LanguageRegistry.addName(new ItemStack(Items.flowerBand.get(), 1, 1), "Plain Flower Band"); + LanguageRegistry.addName(new ItemStack(Items.flowerBand.get(), 1, 2), "Lush Flower Band"); + LanguageRegistry.addName(new ItemStack(Items.flowerBand.get(), 1, 3), "Exotic Flower Band"); } } diff --git a/flowerband.png b/src/minecraft/mods/BiomesOPlenty/textures/armor/dullflowerband.png similarity index 100% rename from flowerband.png rename to src/minecraft/mods/BiomesOPlenty/textures/armor/dullflowerband.png diff --git a/flowerband4.png b/src/minecraft/mods/BiomesOPlenty/textures/armor/exoticflowerband.png similarity index 100% rename from flowerband4.png rename to src/minecraft/mods/BiomesOPlenty/textures/armor/exoticflowerband.png diff --git a/flowerband3.png b/src/minecraft/mods/BiomesOPlenty/textures/armor/lushflowerband.png similarity index 100% rename from flowerband3.png rename to src/minecraft/mods/BiomesOPlenty/textures/armor/lushflowerband.png diff --git a/flowerband2.png b/src/minecraft/mods/BiomesOPlenty/textures/armor/plainflowerband.png similarity index 100% rename from flowerband2.png rename to src/minecraft/mods/BiomesOPlenty/textures/armor/plainflowerband.png