Started work on hippy flower bands, still need recipes and item icons

This commit is contained in:
Adubbz 2013-05-09 20:33:50 +10:00
parent 96ea682660
commit 0465c23ef7
8 changed files with 93 additions and 0 deletions

View file

@ -37,4 +37,6 @@ public class Items
public static Optional<? extends Item> poison = Optional.absent();
public static Optional<? extends Item> dartBlower = Optional.absent();
public static Optional<? extends Item> dart = Optional.absent();
public static Optional<? extends Item> flowerBand = Optional.absent();
}

View file

@ -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;
}
}

View file

@ -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();

View file

@ -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");
}
}

View file

Before

Width:  |  Height:  |  Size: 315 B

After

Width:  |  Height:  |  Size: 315 B

View file

Before

Width:  |  Height:  |  Size: 376 B

After

Width:  |  Height:  |  Size: 376 B

View file

Before

Width:  |  Height:  |  Size: 362 B

After

Width:  |  Height:  |  Size: 362 B

View file

Before

Width:  |  Height:  |  Size: 335 B

After

Width:  |  Height:  |  Size: 335 B