diff options
Diffstat (limited to 'src/main/java/lance5057/tDefense/armor')
41 files changed, 2757 insertions, 2685 deletions
diff --git a/src/main/java/lance5057/tDefense/armor/ArmorCore.java b/src/main/java/lance5057/tDefense/armor/ArmorCore.java index 63abd7f..f43cc46 100644 --- a/src/main/java/lance5057/tDefense/armor/ArmorCore.java +++ b/src/main/java/lance5057/tDefense/armor/ArmorCore.java @@ -1,7 +1,6 @@ package lance5057.tDefense.armor; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import lance5057.tDefense.armor.modifiers.ArmorMods; import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -9,95 +8,84 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ChatComponentText; import net.minecraft.util.DamageSource; -import net.minecraft.util.IChatComponent; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraftforge.common.ISpecialArmor; -import scala.Int; -import tconstruct.library.accessory.IAccessoryModel; import tconstruct.library.tools.AbilityHelper; import tconstruct.library.tools.ToolCore; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ArmorCore extends ToolCore implements ISpecialArmor +{ + int slot; + public float reductionPercent = 0f; + protected int maxReduction = 100; + ArmorMods amod; -public class ArmorCore extends ToolCore implements ISpecialArmor//, IAccessoryModel -{ - int slot; - protected Double reductionPercent = 0.0; - protected int maxReduction = 0; - - public ArmorCore(int baseProtection, int slot) { + public ArmorCore(int baseProtection, int slot) + { super(baseProtection); - + this.slot = slot; + amod = new ArmorMods(); } - -// @Override -// public void onUpdate(ItemStack stack, World world, Entity entity, int par4, -// boolean par5) { -// super.onUpdate(stack, world, entity, par4, par5); -// -// } @Override - public ArmorProperties getProperties(EntityLivingBase player, - ItemStack armor, DamageSource source, double damage, int slot) + public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) { - NBTTagCompound tags = armor.getTagCompound().getCompoundTag("InfiTool"); - - Double enhancedPercent = reductionPercent; - - if(tags.hasKey("Protection")) - enhancedPercent += (calcModifierDamage(tags.getInteger("Protection"), 0.75f, source) * 0.04); - - ArmorProperties armorp = new ArmorProperties(0, enhancedPercent, maxReduction); //0.04 per half shirt - ((EntityPlayer)player).addChatComponentMessage(new ChatComponentText(source.getDamageType() + - " - Max: " + Double.toString(damage) + - " - ReductPerc: " + Double.toString(reductionPercent) + - " - EnhancedPerc: " + Double.toString(enhancedPercent))); + ArmorProperties armorp; + if(!source.isUnblockable()) + { + armorp = new ArmorProperties(0, reductionPercent, maxReduction); // 0.04 + // per + // half + // shirt + } + else + armorp = new ArmorProperties(0, 0, 0); + return armorp; } - + @Override - public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) + public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) { - return 0; + return (int) ((int) reductionPercent / 0.04); } - + public int getSlot() { return slot; } - + @SideOnly(Side.CLIENT) public ModelBiped getModel(String[] color, NBTTagCompound tags) { return null; } - + @Override - public boolean isValidArmor(ItemStack stack, int armorType, Entity entity) + public boolean isValidArmor(ItemStack stack, int armorType, Entity entity) { return armorType == slot; } @Override - public void damageArmor(EntityLivingBase entity, ItemStack stack, - DamageSource source, int damage, int slot) { + public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) + { AbilityHelper.damageTool(stack, damage, entity, false); } - + @Override @SideOnly(Side.CLIENT) - public ModelBiped getArmorModel(EntityLivingBase entityLiving, - ItemStack itemStack, int armorSlot) + public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) { return null; } @Override - public Item getAccessoryItem() + public Item getAccessoryItem() { return null; } @@ -109,46 +97,34 @@ public class ArmorCore extends ToolCore implements ISpecialArmor//, IAccessoryMo } @Override - public String getEffectSuffix() + public String getEffectSuffix() { return null; } @Override - public Item getHeadItem() + public Item getHeadItem() { return null; } @Override - public String getIconSuffix(int arg0) + public String getIconSuffix(int arg0) { return null; } @Override - public String[] getTraits() { + public String[] getTraits() + { return new String[] {"armor"}; } -// @Override -// public ResourceLocation getWearbleTexture(Entity arg0, ItemStack arg1, -// int arg2) { -// // TODO Auto-generated method stub -// return null; -// } - - public int calcModifierDamage(int level, float typeMod, DamageSource source) - { - if (source.canHarmInCreative()) - { - return 0; - } - else - { - float f = (float)(6 + level * level) / 3.0F; - return MathHelper.floor_float(f * typeMod); - } - } + @Override + public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) + { + + amod.UpdateAll((ToolCore) itemStack.getItem(), itemStack, world, player, itemStack.getTagCompound().getCompoundTag("InfiTool")); + } } diff --git a/src/main/java/lance5057/tDefense/armor/blocks/GlowstoneCrumbs.java b/src/main/java/lance5057/tDefense/armor/blocks/GlowstoneCrumbs.java new file mode 100644 index 0000000..3bbe32e --- /dev/null +++ b/src/main/java/lance5057/tDefense/armor/blocks/GlowstoneCrumbs.java @@ -0,0 +1,120 @@ +package lance5057.tDefense.armor.blocks; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Random; +import java.util.Set; + +import lance5057.tDefense.Reference; +import lance5057.tDefense.TinkersDefense; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Direction; +import net.minecraft.util.IIcon; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class GlowstoneCrumbs extends Block +{ + public GlowstoneCrumbs() + { + super(Material.ground); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F); + this.setBlockName("glowstonecrumbs"); + this.setBlockTextureName(Reference.MOD_ID + ":glowstonecrumbs"); + this.setLightLevel(1f); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) + { + return null; + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 23; + } + + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) + { + return null; + } + + /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z + */ + public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) + { + return super.canPlaceBlockAt(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && this.canBlockStay(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_); + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) + { + super.onNeighborBlockChange(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, p_149695_5_); + this.checkAndDropBlock(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) + { + this.checkAndDropBlock(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_); + } + + /** + * checks if the block can stay, if not drop as item + */ + protected void checkAndDropBlock(World p_149855_1_, int p_149855_2_, int p_149855_3_, int p_149855_4_) + { + if(!this.canBlockStay(p_149855_1_, p_149855_2_, p_149855_3_, p_149855_4_)) + { + p_149855_1_.setBlock(p_149855_2_, p_149855_3_, p_149855_4_, getBlockById(0), 0, 2); + } + } + + /** + * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. + */ + public boolean canBlockStay(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_) + { + return p_149718_1_.getBlock(p_149718_2_, p_149718_3_ - 1, p_149718_4_).isNormalCube(p_149718_1_, p_149718_2_, p_149718_3_ - 1, p_149718_4_) && !p_149718_1_.getBlock(p_149718_2_, p_149718_3_ - 1, p_149718_4_).isAir(p_149718_1_, p_149718_2_, p_149718_3_ - 1, p_149718_4_); + } +} diff --git a/src/main/java/lance5057/tDefense/armor/blocks/UnstableBlock.java b/src/main/java/lance5057/tDefense/armor/blocks/UnstableBlock.java new file mode 100644 index 0000000..f98206e --- /dev/null +++ b/src/main/java/lance5057/tDefense/armor/blocks/UnstableBlock.java @@ -0,0 +1,103 @@ +package lance5057.tDefense.armor.blocks; + +import java.util.List; +import java.util.Random; + +import lance5057.tDefense.Reference; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class UnstableBlock extends Block +{ + public static final String[] types = {"ice", "obsidian"}; + public int timer; + + public static final String[] field_150096_a = new String[] {"ice", "obsidian"}; + @SideOnly(Side.CLIENT) + private IIcon[] field_150095_b; + + public UnstableBlock() + { + super(Material.rock); + this.setBlockName("unstable"); + this.setBlockTextureName("unstable"); + this.setTickRandomly(true); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int p_149691_1_, int p_149691_2_) + { + if(p_149691_2_ < 0 || p_149691_2_ >= this.field_150095_b.length) + { + p_149691_2_ = 0; + } + + return this.field_150095_b[p_149691_2_]; + } + + /** + * Determines the damage on the item the block drops. Used in cloth and + * wood. + */ + public int damageDropped(int p_149692_1_) + { + return p_149692_1_; + } + + /** + * returns a list of blocks with the same ID, but different meta (eg: wood + * returns 4 blocks) + */ + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) + { + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 0)); + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 1)); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister p_149651_1_) + { + this.field_150095_b = new IIcon[field_150096_a.length]; + + for(int i = 0; i < this.field_150095_b.length; ++i) + { + this.field_150095_b[i] = p_149651_1_.registerIcon(Reference.MOD_ID + ":" + this.getTextureName() + field_150096_a[i]); + } + } + + @SideOnly(Side.CLIENT) + public int getRenderBlockPass() + { + return 1; + } + + @Override + public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) + { + int meta = par1World.getBlockMetadata(par2, par3, par4); + + if(meta == 0) + { + par1World.setBlock(par2, par3, par4, Blocks.water, 0, 3); + } + if(meta == 1) + { + par1World.setBlock(par2, par3, par4, Blocks.lava, 0, 3); + } + par1World.notifyBlockOfNeighborChange(par2, par3, par4, par1World.getBlock(par2, par3, par4)); + } +} diff --git a/src/main/java/lance5057/tDefense/armor/blocks/UnstableItemBlock.java b/src/main/java/lance5057/tDefense/armor/blocks/UnstableItemBlock.java new file mode 100644 index 0000000..0b1c18d --- /dev/null +++ b/src/main/java/lance5057/tDefense/armor/blocks/UnstableItemBlock.java @@ -0,0 +1,21 @@ +package lance5057.tDefense.armor.blocks; + +import lance5057.tDefense.TinkersDefense; +import net.minecraft.block.Block; +import net.minecraft.item.ItemBlockWithMetadata; +import net.minecraft.item.ItemStack; + +public class UnstableItemBlock extends ItemBlockWithMetadata +{ + + public UnstableItemBlock(Block block) + { + super(block, block); + } + + @Override + public String getUnlocalizedName(ItemStack stack) + { + return this.getUnlocalizedName() + "_" + ((UnstableBlock) TinkersDefense.block_Unstable).types[stack.getItemDamage()]; + } +} diff --git a/src/main/java/lance5057/tDefense/armor/events/ArmorModEvents.java b/src/main/java/lance5057/tDefense/armor/events/ArmorModEvents.java index d077565..2db5a65 100644 --- a/src/main/java/lance5057/tDefense/armor/events/ArmorModEvents.java +++ b/src/main/java/lance5057/tDefense/armor/events/ArmorModEvents.java @@ -1,17 +1,93 @@ package lance5057.tDefense.armor.events; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import lance5057.tDefense.armor.ArmorCore; +import lance5057.tDefense.armor.modifiers.ArmorMods; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ChatComponentText; -import net.minecraftforge.client.event.RenderPlayerEvent; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; import net.minecraftforge.event.entity.living.LivingHurtEvent; +import tconstruct.library.tools.ToolCore; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.TickEvent; -public class ArmorModEvents +public class ArmorModEvents { @SubscribeEvent public void AddProtections(LivingHurtEvent event) { -// if(event.entityLiving instanceof EntityPlayer) -// ((EntityPlayer)event.entity).addChatComponentMessage(new ChatComponentText("Damage Recieved:" + Double.toString(event.ammount))); + int epf = 0; + + if(event.entityLiving instanceof EntityPlayer) + { + ((EntityPlayer) event.entityLiving).addChatComponentMessage(new ChatComponentText(event.source.getDamageType() + " - Max: " + Double.toString(event.ammount))); + } + + for(int i = 0; i < 4; i++) + { + ItemStack armor = event.entityLiving.getEquipmentInSlot(i + 1); + if(armor != null && armor.getItem() instanceof ArmorCore) + { + NBTTagCompound tags = armor.getTagCompound().getCompoundTag("InfiTool"); + + if(!event.source.isUnblockable()) + { + if(tags.hasKey("Protection")) + epf += (calcModifierDamage(tags.getInteger("Protection"), 1f, event.source)); + else if(tags.hasKey("Fire Protection") && event.source.isFireDamage()) + epf += (calcModifierDamage(tags.getInteger("Fire Protection"), 2f, event.source)); + else if(tags.hasKey("Blast Protection") && event.source.isExplosion()) + epf += (calcModifierDamage(tags.getInteger("Blast Protection"), 2f, event.source)); + else if(tags.hasKey("Projectile Protection") && event.source.isProjectile()) + epf += (calcModifierDamage(tags.getInteger("Projectile Protection"), 2f, event.source)); + } + else if(tags.hasKey("Featherfall") && event.source.getDamageType() == event.source.fall.getDamageType()) + epf += (calcModifierDamage(tags.getInteger("Featherfall"), 3f, event.source)); + } + } + + if(epf > 20) + epf = 20; + + float adjustedPerc = (float) (1f - (epf * 0.04)); + event.ammount = adjustedPerc * event.ammount; + + if(event.entityLiving instanceof EntityPlayer) + { + ((EntityPlayer) event.entityLiving).addChatComponentMessage(new ChatComponentText(event.source.getDamageType() + " - Adjusted: " + Double.toString(event.ammount))); + } + } + + // @SubscribeEvent + // public void playerTick(TickEvent.PlayerTickEvent event) + // { + // for(int i = 0; i < 4; i++) + // { + // EntityPlayer entity = event.player; + // World world = entity.worldObj; + // ItemStack stack = entity.getCurrentArmor(i); + // + // if(stack.getItem() instanceof ToolCore) + // { + // ToolCore tool = (ToolCore) stack.getItem(); + // NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); + // } + // } + // } + + public int calcModifierDamage(int level, float typeMod, DamageSource source) + { + if(source.canHarmInCreative()) + { + return 0; + } + else + { + float f = (float) (6 + level * level) / 3.0F; + return MathHelper.floor_float(f * typeMod); + } } } diff --git a/src/main/java/lance5057/tDefense/armor/events/ArmorRenderEvent.java b/src/main/java/lance5057/tDefense/armor/events/ArmorRenderEvent.java index 42810b1..9accd4f 100644 --- a/src/main/java/lance5057/tDefense/armor/events/ArmorRenderEvent.java +++ b/src/main/java/lance5057/tDefense/armor/events/ArmorRenderEvent.java @@ -3,6 +3,7 @@ package lance5057.tDefense.armor.events; import lance5057.tDefense.armor.ArmorCore; import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumAction; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.client.event.RenderPlayerEvent; @@ -15,51 +16,69 @@ public class ArmorRenderEvent @SideOnly(Side.CLIENT) @SubscribeEvent - public void renderArmorEvent(RenderPlayerEvent.SetArmorModel event) { - if (event.entityPlayer != null) + public void renderArmorEvent(RenderPlayerEvent.SetArmorModel event) + { + if(event.entityPlayer != null) { - for(int i = 0; i < 4 ; i++) + for(int i = 0; i < 4; i++) { if(event.entityPlayer.inventory.armorItemInSlot(i) != null) { ItemStack Armor = event.entityPlayer.inventory.armorItemInSlot(i); NBTTagCompound tags = Armor.getTagCompound(); - + if(Armor.getItem() instanceof ArmorCore) { - ArmorCore AArmor = (ArmorCore)Armor.getItem(); - String color[] = new String[10]; - - for(int j = 0; j<10; j++) - color[j] = Integer.toHexString(AArmor.getColorFromItemStack(Armor, j)); - - ModelBiped armorModel = AArmor.getModel(color, tags); - - if (armorModel != null) { + ArmorCore AArmor = (ArmorCore) Armor.getItem(); + ModelBiped armorModel = AArmor.getArmorModel(event.entityLiving, Armor, AArmor.getSlot()); + + if(armorModel != null) + { armorModel.isSneak = event.entityPlayer.isSneaking(); armorModel.isRiding = event.entityPlayer.isRiding(); armorModel.isChild = event.entityPlayer.isChild(); - armorModel.heldItemRight = event.entityPlayer.getHeldItem() != null ? 1 - : 0; - if (event.entityPlayer instanceof EntityPlayer) { - armorModel.aimedBow = ((EntityPlayer) event.entityPlayer) - .getItemInUseDuration() > 2; + armorModel.onGround = event.entityPlayer.getSwingProgress(event.partialRenderTick); + + if(event.entityPlayer instanceof EntityPlayer) + { + ItemStack itemstack = event.entityPlayer.inventory.getCurrentItem(); + armorModel.heldItemRight = 0; + armorModel.aimedBow = false; + if(itemstack != null) + { + if(event.entityPlayer.getItemInUseCount() > 0) + { + EnumAction enumaction = itemstack.getItemUseAction(); + + if(enumaction == EnumAction.block) + { + armorModel.heldItemRight = 3; + } + else if(enumaction == EnumAction.bow) + { + armorModel.aimedBow = true; + } + } + else + { + armorModel.heldItemRight = event.entityPlayer.getHeldItem() != null ? 1 : 0; + } + } } } - + float yaw = event.entityPlayer.prevRotationYawHead + (event.entityPlayer.rotationYawHead - event.entityPlayer.prevRotationYawHead) * event.partialRenderTick; float yawOffset = event.entityPlayer.prevRenderYawOffset + (event.entityPlayer.renderYawOffset - event.entityPlayer.prevRenderYawOffset) * event.partialRenderTick; - float limbs = event.entityPlayer.prevLimbSwingAmount + (event.entityPlayer.limbSwingAmount - event.entityPlayer.prevLimbSwingAmount) * event.partialRenderTick; - float limbSwing = event.entityPlayer.limbSwing - event.entityPlayer.limbSwingAmount * (1.0F - event.partialRenderTick); - - armorModel.render(event.entityPlayer, limbSwing, limbs,event.entityPlayer.ticksExisted , - yaw - yawOffset - , event.entityPlayer.rotationPitch, 0.1f); + float limbs = event.entityPlayer.prevLimbSwingAmount + (event.entityPlayer.limbSwingAmount - event.entityPlayer.prevLimbSwingAmount) * event.partialRenderTick; + float limbSwing = event.entityPlayer.limbSwing - event.entityPlayer.limbSwingAmount * (1.0F - event.partialRenderTick); + + armorModel.setRotationAngles(limbSwing, limbs, event.entityPlayer.ticksExisted, yaw - yawOffset, event.entityPlayer.rotationPitch, 0.1f, event.entityPlayer); + armorModel.render(event.entityPlayer, limbSwing, limbs, event.entityPlayer.ticksExisted, yaw - yawOffset, event.entityPlayer.rotationPitch, 0.1f); } } } } } - + } diff --git a/src/main/java/lance5057/tDefense/armor/items/Mask.java b/src/main/java/lance5057/tDefense/armor/items/Mask.java index da6ca4c..c9557a0 100644 --- a/src/main/java/lance5057/tDefense/armor/items/Mask.java +++ b/src/main/java/lance5057/tDefense/armor/items/Mask.java @@ -14,7 +14,7 @@ import tconstruct.library.tools.ToolCore; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class Mask extends ToolCore implements IAccessoryModel,IAccessory +public class Mask extends ToolCore implements IAccessoryModel, IAccessory { public Mask() @@ -23,86 +23,94 @@ public class Mask extends ToolCore implements IAccessoryModel,IAccessory } @Override - public boolean canEquipAccessory(ItemStack item, int slot) + public boolean canEquipAccessory(ItemStack item, int slot) { return slot == 0; } - + @Override - @SideOnly(Side.CLIENT) - public ModelBiped getArmorModel (EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) - { + @SideOnly(Side.CLIENT) + public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) + { String color[] = new String[10]; - - for(int i = 0; i<10; i++) + + for(int i = 0; i < 10; i++) color[i] = Integer.toHexString(this.getColorFromItemStack(itemStack, i)); - - return new ModelMask(color); - } - + + return new ModelMask(color); + } + @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, - String type) { + public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) + { return "tinkersdefense:textures/armor/Mask/_mask_face.png"; } - - ResourceLocation texture = new ResourceLocation("tinkersdefense", "textures/armor/Mask/_mask_face.png"); - + + ResourceLocation texture = new ResourceLocation("tinkersdefense", "textures/armor/Mask/_mask_face.png"); + @Override - @SideOnly(Side.CLIENT) - public ResourceLocation getWearbleTexture (Entity entity, ItemStack stack, int slot) - { - return texture; - } + @SideOnly(Side.CLIENT) + public ResourceLocation getWearbleTexture(Entity entity, ItemStack stack, int slot) + { + return texture; + } @Override - public Item getAccessoryItem() { + public Item getAccessoryItem() + { // TODO Auto-generated method stub return null; } @Override - public String getDefaultFolder() { + public String getDefaultFolder() + { // TODO Auto-generated method stub return "Armor/Mask"; } @Override - public String getEffectSuffix() { + public String getEffectSuffix() + { return "_mask_effect"; } @Override - public Item getHeadItem() { + public Item getHeadItem() + { // TODO Auto-generated method stub return null; } - + @SideOnly(Side.CLIENT) @Override - public int getPartAmount() { + public int getPartAmount() + { return 3; } @Override - public String getIconSuffix(int partType) { - switch (partType) { - case 0: - return "_mask_face"; - case 1: - return "hurdur"; //useless - case 2: - return "_mask_clasp"; - case 3: - return "_mask_strap"; - default: - return ""; + public String getIconSuffix(int partType) + { + switch(partType) + { + case 0: + return "_mask_face"; + case 1: + return "hurdur"; //useless + case 2: + return "_mask_clasp"; + case 3: + return "_mask_strap"; + default: + return ""; } } @Override - public String[] getTraits() { - return new String[] { "mask", "cosmetic" }; + public String[] getTraits() + { + return new String[] {"mask", "cosmetic"}; } } diff --git a/src/main/java/lance5057/tDefense/armor/items/Sheath.java b/src/main/java/lance5057/tDefense/armor/items/Sheath.java index f96d90a..b631d1b 100644 --- a/src/main/java/lance5057/tDefense/armor/items/Sheath.java +++ b/src/main/java/lance5057/tDefense/armor/items/Sheath.java @@ -13,7 +13,7 @@ import tconstruct.library.tools.ToolCore; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class Sheath extends ToolCore implements IAccessoryModel,IAccessory +public class Sheath extends ToolCore implements IAccessoryModel, IAccessory { public Sheath() @@ -22,88 +22,96 @@ public class Sheath extends ToolCore implements IAccessoryModel,IAccessory } @Override - public boolean canEquipAccessory(ItemStack item, int slot) + public boolean canEquipAccessory(ItemStack item, int slot) { return slot == 3; } - + @Override - @SideOnly(Side.CLIENT) - public ModelBiped getArmorModel (EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) - { + @SideOnly(Side.CLIENT) + public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) + { String color[] = new String[10]; - - for(int i = 0; i<10; i++) + + for(int i = 0; i < 10; i++) color[i] = Integer.toHexString(this.getColorFromItemStack(itemStack, i)); - - return new ModelSheath(color); - } - + + return new ModelSheath(color); + } + @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, - String type) { + public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) + { return "tinkersdefense:textures/armor/Sheath/_sheath_base.png"; } - - ResourceLocation texture = new ResourceLocation("tinkersdefense", "textures/armor/Sheath/_sheath_base.png"); - + + ResourceLocation texture = new ResourceLocation("tinkersdefense", "textures/armor/Sheath/_sheath_base.png"); + @Override - @SideOnly(Side.CLIENT) - public ResourceLocation getWearbleTexture (Entity entity, ItemStack stack, int slot) - { - return texture; - } + @SideOnly(Side.CLIENT) + public ResourceLocation getWearbleTexture(Entity entity, ItemStack stack, int slot) + { + return texture; + } @Override - public Item getAccessoryItem() { + public Item getAccessoryItem() + { // TODO Auto-generated method stub return null; } @Override - public String getDefaultFolder() { + public String getDefaultFolder() + { // TODO Auto-generated method stub return "Armor/Sheath"; } @Override - public String getEffectSuffix() { + public String getEffectSuffix() + { return "_sheath_effect"; } @Override - public Item getHeadItem() { + public Item getHeadItem() + { // TODO Auto-generated method stub return null; } - + @SideOnly(Side.CLIENT) @Override - public int getPartAmount() { + public int getPartAmount() + { return 4; } @Override - public String getIconSuffix(int partType) { - switch (partType) { - case 0: - return "_sheath_base"; - case 1: - return "_shield_base_broken"; //useless - case 2: - return "_sheath_filigree"; - case 3: - return "_sheath_belt"; - case 4: - return "_sheath_clasp"; - default: - return ""; + public String getIconSuffix(int partType) + { + switch(partType) + { + case 0: + return "_sheath_base"; + case 1: + return "_shield_base_broken"; //useless + case 2: + return "_sheath_filigree"; + case 3: + return "_sheath_belt"; + case 4: + return "_sheath_clasp"; + default: + return ""; } } @Override - public String[] getTraits() { - return new String[] { "sheath", "cosmetic" }; + public String[] getTraits() + { + return new String[] {"sheath", "cosmetic"}; } } diff --git a/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersHood.java b/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersHood.java index daa71f6..98a17bb 100644 --- a/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersHood.java +++ b/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersHood.java @@ -18,122 +18,131 @@ import net.minecraftforge.common.ISpecialArmor.ArmorProperties; import tconstruct.library.TConstructRegistry; import tconstruct.library.tools.CustomMaterial; -public class TinkersHood extends ArmorCore +public class TinkersHood extends ArmorCore { - public TinkersHood() { - super(0,0); + public TinkersHood() + { + super(0, 0); this.setUnlocalizedName("tinkershood"); } - + @Override - public Item getHeadItem() + public Item getHeadItem() { return TinkersDefense.partCloth; } - + @Override - public Item getHandleItem() { + public Item getHandleItem() + { return TinkersDefense.partCloth; } - + @Override - public Item getAccessoryItem() + public Item getAccessoryItem() { return TinkersDefense.partRivet; } - + @Override - public int durabilityTypeAccessory() { + public int durabilityTypeAccessory() + { return 1; } @Override - public float getRepairCost() { + public float getRepairCost() + { return 1.0f; } @Override - public float getDurabilityModifier() { + public float getDurabilityModifier() + { return 1f; } - + @Override - public float getDamageModifier() { + public float getDamageModifier() + { return 1f; } @Override - public int getPartAmount() { + public int getPartAmount() + { return 3; } - + @Override - public String getIconSuffix(int partType) - { - switch (partType) { - case 0: - return "_hood_cloth"; - case 1: - return "_hood_cloth_broken"; - case 2: - return "_hood_trim"; - case 3: - return "_hood_rivet"; - default: - return ""; + public String getIconSuffix(int partType) + { + switch(partType) + { + case 0: + return "_hood_cloth"; + case 1: + return "_hood_cloth_broken"; + case 2: + return "_hood_trim"; + case 3: + return "_hood_rivet"; + default: + return ""; } } - + @Override - public String getEffectSuffix() + public String getEffectSuffix() { return "_hood_effect"; } - + @Override public String getDefaultFolder() { return "armor/hood"; } - -// @Override -// public void onUpdate(ItemStack stack, World world, Entity entity, int par4, -// boolean par5) { -// super.onUpdate(stack, world, entity, par4, par5); -// -// } + + // @Override + // public void onUpdate(ItemStack stack, World world, Entity entity, int par4, + // boolean par5) { + // super.onUpdate(stack, world, entity, par4, par5); + // + // } @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, - String type) { + public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) + { return "tinkersdefense:textures/armor/TinkersHood.png"; } - + @Override - public String[] getTraits() { - return new String[] {"armor","helmet","hood","cloth"}; + public String[] getTraits() + { + return new String[] {"armor", "helmet", "hood", "cloth"}; } @Override @SideOnly(Side.CLIENT) - public ModelBiped getModel(String[] color,NBTTagCompound tags) + public ModelBiped getModel(String[] color, NBTTagCompound tags) { - String[] textures = {this.getIconSuffix(2),this.getIconSuffix(0),this.getIconSuffix(3)}; - + String[] textures = {this.getIconSuffix(2), this.getIconSuffix(0), this.getIconSuffix(3)}; + int HeadID = tags.getCompoundTag("InfiTool").getInteger("RenderHead"); int HandleID = tags.getCompoundTag("InfiTool").getInteger("RenderHandle"); - + CustomMaterial newColor = TConstructRegistry.getCustomMaterial(HeadID, ClothMaterial.class); color[1] = Integer.toHexString(newColor.color); - + newColor = TConstructRegistry.getCustomMaterial(HandleID, ClothMaterial.class); color[0] = Integer.toHexString(newColor.color); return new ModelTinkersHood(color, this.getDefaultFolder(), textures); } - + @Override - public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) + public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) { return 0; } diff --git a/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersRobe.java b/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersRobe.java index 0961b57..d963c1d 100644 --- a/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersRobe.java +++ b/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersRobe.java @@ -15,114 +15,123 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -public class TinkersRobe extends ArmorCore +public class TinkersRobe extends ArmorCore { - public TinkersRobe() { - super(0,2); + public TinkersRobe() + { + super(0, 2); this.setUnlocalizedName("tinkerrobe"); } - + @Override - public Item getHeadItem() + public Item getHeadItem() { return TinkersDefense.partCloth; } - + @Override - public Item getHandleItem() { + public Item getHandleItem() + { return TinkersDefense.partCloth; } - + @Override - public int durabilityTypeAccessory() { + public int durabilityTypeAccessory() + { return 1; } @Override - public float getRepairCost() { + public float getRepairCost() + { return 1.0f; } @Override - public float getDurabilityModifier() { + public float getDurabilityModifier() + { return 1f; } - + @Override - public float getDamageModifier() { + public float getDamageModifier() + { return 1f; } @Override - public int getPartAmount() { + public int getPartAmount() + { return 2; } - + @Override - public String getIconSuffix(int partType) + public String getIconSuffix(int partType) { - switch (partType) { - case 0: - return "_robe_cloth"; - case 1: - return "_robe_cloth_broken"; - case 2: - return "_robe_trim"; - default: - return ""; + switch(partType) + { + case 0: + return "_robe_cloth"; + case 1: + return "_robe_cloth_broken"; + case 2: + return "_robe_trim"; + default: + return ""; } } - + @Override - public String getEffectSuffix() + public String getEffectSuffix() { return "_robe_effect"; } - + @Override public String getDefaultFolder() { return "armor/robe"; } - -// @Override -// public void onUpdate(ItemStack stack, World world, Entity entity, int par4, -// boolean par5) { -// super.onUpdate(stack, world, entity, par4, par5); -// -// } + + // @Override + // public void onUpdate(ItemStack stack, World world, Entity entity, int par4, + // boolean par5) { + // super.onUpdate(stack, world, entity, par4, par5); + // + // } @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, - String type) { + public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) + { return "tinkersdefense:textures/armor/TinkersRobe.png"; } - + @Override - public String[] getTraits() { - return new String[] {"armor","pants","robe","cloth"}; + public String[] getTraits() + { + return new String[] {"armor", "pants", "robe", "cloth"}; } @Override @SideOnly(Side.CLIENT) - public ModelBiped getModel(String[] color,NBTTagCompound tags) + public ModelBiped getModel(String[] color, NBTTagCompound tags) { - String[] textures = {this.getIconSuffix(2),this.getIconSuffix(0)}; - + String[] textures = {this.getIconSuffix(2), this.getIconSuffix(0)}; + int HeadID = tags.getCompoundTag("InfiTool").getInteger("RenderHead"); int HandleID = tags.getCompoundTag("InfiTool").getInteger("RenderHandle"); CustomMaterial newColor = TConstructRegistry.getCustomMaterial(HeadID, ClothMaterial.class); color[1] = Integer.toHexString(newColor.color); - + newColor = TConstructRegistry.getCustomMaterial(HandleID, ClothMaterial.class); color[0] = Integer.toHexString(newColor.color); - + return new ModelTinkersRobe(color, this.getDefaultFolder(), textures); } - + @Override - public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) + public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) { return 0; } diff --git a/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersShawl.java b/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersShawl.java index 97341a1..76b5ae9 100644 --- a/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersShawl.java +++ b/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersShawl.java @@ -17,122 +17,131 @@ import tconstruct.library.TConstructRegistry; import tconstruct.library.tools.CustomMaterial; import tconstruct.tools.TinkerTools; -public class TinkersShawl extends ArmorCore +public class TinkersShawl extends ArmorCore { - public TinkersShawl() { - super(0,1); + public TinkersShawl() + { + super(0, 1); this.setUnlocalizedName("tinkersshawl"); } - + @Override - public Item getHeadItem() + public Item getHeadItem() { return TinkersDefense.partCloth; } - + @Override - public Item getHandleItem() { + public Item getHandleItem() + { return TinkersDefense.partCloth; } - + @Override - public Item getAccessoryItem() + public Item getAccessoryItem() { return TinkersDefense.partClasp; } - + @Override - public int durabilityTypeAccessory() { + public int durabilityTypeAccessory() + { return 1; } @Override - public float getRepairCost() { + public float getRepairCost() + { return 1f; } @Override - public float getDurabilityModifier() { + public float getDurabilityModifier() + { return 1f; } - + @Override - public float getDamageModifier() { + public float getDamageModifier() + { return 1f; } @Override - public int getPartAmount() { + public int getPartAmount() + { return 3; } - + @Override - public String getIconSuffix(int partType) - { - switch (partType) { - case 0: - return "_shawl_cloth"; - case 1: - return "_shawl_cloth_broken"; - case 2: - return "_shawl_trim"; - case 3: - return "_shawl_clasp"; - default: - return ""; + public String getIconSuffix(int partType) + { + switch(partType) + { + case 0: + return "_shawl_cloth"; + case 1: + return "_shawl_cloth_broken"; + case 2: + return "_shawl_trim"; + case 3: + return "_shawl_clasp"; + default: + return ""; } } - + @Override - public String getEffectSuffix() + public String getEffectSuffix() { return "_shawl_effect"; } - + @Override public String getDefaultFolder() { return "armor/shawl"; } - -// @Override -// public void onUpdate(ItemStack stack, World world, Entity entity, int par4, -// boolean par5) { -// super.onUpdate(stack, world, entity, par4, par5); -// -// } + + // @Override + // public void onUpdate(ItemStack stack, World world, Entity entity, int par4, + // boolean par5) { + // super.onUpdate(stack, world, entity, par4, par5); + // + // } @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, - String type) { + public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) + { return "tinkersdefense:textures/armor/TinkersShawl.png"; } - + @Override - public String[] getTraits() { - return new String[] {"armor","chest","shawl","cloth"}; + public String[] getTraits() + { + return new String[] {"armor", "chest", "shawl", "cloth"}; } @Override @SideOnly(Side.CLIENT) - public ModelBiped getModel(String[] color,NBTTagCompound tags) + public ModelBiped getModel(String[] color, NBTTagCompound tags) { - String[] textures = {this.getIconSuffix(2),this.getIconSuffix(0),this.getIconSuffix(3)}; - + String[] textures = {this.getIconSuffix(2), this.getIconSuffix(0), this.getIconSuffix(3)}; + int HeadID = tags.getCompoundTag("InfiTool").getInteger("RenderHead"); int HandleID = tags.getCompoundTag("InfiTool").getInteger("RenderHandle"); CustomMaterial newColor = TConstructRegistry.getCustomMaterial(HeadID, ClothMaterial.class); color[1] = Integer.toHexString(newColor.color); - + newColor = TConstructRegistry.getCustomMaterial(HandleID, ClothMaterial.class); color[0] = Integer.toHexString(newColor.color); - + return new ModelTinkersShawl(color, this.getDefaultFolder(), textures); } - + @Override - public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) + public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) { return 0; } diff --git a/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersShoes.java b/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersShoes.java index d842647..0ab18d1 100644 --- a/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersShoes.java +++ b/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersShoes.java @@ -15,118 +15,127 @@ import net.minecraft.nbt.NBTTagCompound; import tconstruct.library.TConstructRegistry; import tconstruct.library.tools.CustomMaterial; -public class TinkersShoes extends ArmorCore +public class TinkersShoes extends ArmorCore { - public TinkersShoes() { - super(0,3); + public TinkersShoes() + { + super(0, 3); this.setUnlocalizedName("tinkersshoes"); } - + @Override - public Item getHeadItem() + public Item getHeadItem() { return TinkersDefense.partCloth; } - + @Override - public Item getHandleItem() { + public Item getHandleItem() + { return TinkersDefense.partClasp; } - + @Override - public Item getAccessoryItem() + public Item getAccessoryItem() { return TinkersDefense.partRivet; } - + @Override - public int durabilityTypeAccessory() { + public int durabilityTypeAccessory() + { return 1; } @Override - public float getRepairCost() { + public float getRepairCost() + { return 1.0f; } @Override - public float getDurabilityModifier() { + public float getDurabilityModifier() + { return 1f; } - + @Override - public float getDamageModifier() { + public float getDamageModifier() + { return 1f; } @Override - public int getPartAmount() { + public int getPartAmount() + { return 3; } - + @Override - public String getIconSuffix(int partType) - { - switch (partType) { - case 0: - return "_shoes_cloth"; - case 1: - return "_shoes_cloth_broken"; - case 2: - return "_shoes_clasp"; - case 3: - return "_shoes_rivet"; - default: - return ""; + public String getIconSuffix(int partType) + { + switch(partType) + { + case 0: + return "_shoes_cloth"; + case 1: + return "_shoes_cloth_broken"; + case 2: + return "_shoes_clasp"; + case 3: + return "_shoes_rivet"; + default: + return ""; } } - + @Override - public String getEffectSuffix() + public String getEffectSuffix() { return "_shoes_effect"; } - + @Override public String getDefaultFolder() { return "armor/shoes"; } - -// @Override -// public void onUpdate(ItemStack stack, World world, Entity entity, int par4, -// boolean par5) { -// super.onUpdate(stack, world, entity, par4, par5); -// -// } + + // @Override + // public void onUpdate(ItemStack stack, World world, Entity entity, int par4, + // boolean par5) { + // super.onUpdate(stack, world, entity, par4, par5); + // + // } @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, - String type) { + public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) + { return "tinkersdefense:textures/armor/TinkersShoes.png"; } - + @Override - public String[] getTraits() { - return new String[] {"armor","helmet","shoes","cloth"}; + public String[] getTraits() + { + return new String[] {"armor", "feet", "shoes", "cloth"}; } @Override @SideOnly(Side.CLIENT) - public ModelBiped getModel(String[] color,NBTTagCompound tags) + public ModelBiped getModel(String[] color, NBTTagCompound tags) { - String[] textures = {this.getIconSuffix(2),this.getIconSuffix(0),this.getIconSuffix(3)}; - + String[] textures = {this.getIconSuffix(2), this.getIconSuffix(0), this.getIconSuffix(3)}; + int HeadID = tags.getCompoundTag("InfiTool").getInteger("RenderHead"); - + CustomMaterial newColor = TConstructRegistry.getCustomMaterial(HeadID, ClothMaterial.class); color[1] = Integer.toHexString(newColor.color); - + return (ModelBiped) new ModelTinkersBoots(color, this.getDefaultFolder(), textures); } - + @Override - public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) + public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) { return 0; } diff --git a/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersBreastplate.java b/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersBreastplate.java index d3fce5d..2195951 100644 --- a/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersBreastplate.java +++ b/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersBreastplate.java @@ -6,6 +6,7 @@ import lance5057.tDefense.TinkersDefense; import lance5057.tDefense.armor.ArmorCore; import lance5057.tDefense.armor.renderers.heavy.ModelTinkersBreastplate; import lance5057.tDefense.armor.renderers.heavy.ModelTinkersHelm; +import lance5057.tDefense.proxy.ClientProxy; import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -18,124 +19,133 @@ import net.minecraft.world.World; import net.minecraftforge.common.ISpecialArmor.ArmorProperties; import tconstruct.tools.TinkerTools; -public class TinkersBreastplate extends ArmorCore +public class TinkersBreastplate extends ArmorCore { - public TinkersBreastplate() { - super(2,1); - this.setUnlocalizedName("tinkershelm"); + public TinkersBreastplate() + { + super(2, 1); + this.setUnlocalizedName("tinkersbreastplate"); this.maxReduction = 100; - this.reductionPercent = 0.32; + reductionPercent = 8 * 0.04f; } - + @Override - public Item getHeadItem() + public Item getHeadItem() { return TinkerTools.largePlate; } - + @Override - public Item getHandleItem() { + public Item getHandleItem() + { return TinkerTools.toughRod; } - + @Override - public Item getAccessoryItem() + public Item getAccessoryItem() { return TinkersDefense.partArmorplate; } - + @Override public Item getExtraItem() { return TinkersDefense.partChainmaille; } - + @Override - public int durabilityTypeAccessory() { + public int durabilityTypeAccessory() + { return 2; } @Override - public float getRepairCost() { + public float getRepairCost() + { return 4.0f; } @Override - public float getDurabilityModifier() { + public float getDurabilityModifier() + { return 2.5f; } - + @Override - public float getDamageModifier() { + public float getDamageModifier() + { return 1.4f; } @Override - public int getPartAmount() { + public int getPartAmount() + { return 4; } - + @Override - public String getIconSuffix(int partType) - { - switch (partType) { - case 0: - return "_breastplate_plate"; - case 1: - return "_breastplate_plate_broken"; - case 2: - return "_breastplate_trim"; - case 3: - return "_breastplate_smallplate"; - case 4: - return "_breastplate_chain"; - default: - return ""; + public String getIconSuffix(int partType) + { + switch(partType) + { + case 0: + return "_breastplate_plate"; + case 1: + return "_breastplate_plate_broken"; + case 2: + return "_breastplate_trim"; + case 3: + return "_breastplate_smallplate"; + case 4: + return "_breastplate_chain"; + default: + return ""; } } - + @Override - public String getEffectSuffix() + public String getEffectSuffix() { return "_breastplate_effect"; } - + @Override public String getDefaultFolder() { return "armor/breastplate"; } - -// @Override -// public void onUpdate(ItemStack stack, World world, Entity entity, int par4, -// boolean par5) { -// super.onUpdate(stack, world, entity, par4, par5); -// -// } + + // @Override + // public void onUpdate(ItemStack stack, World world, Entity entity, int + // par4, + // boolean par5) { + // super.onUpdate(stack, world, entity, par4, par5); + // + // } @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, - String type) { + public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) + { return "tinkersdefense:textures/armor/Tinkersbreastplate.png"; } - - @Override - public String[] getTraits() { - return new String[] {"armor","chest","breastplate","heavyarmor"}; - } @Override - @SideOnly(Side.CLIENT) - public ModelBiped getModel(String[] color,NBTTagCompound tags) + public String[] getTraits() { - String[] textures = {this.getIconSuffix(2),this.getIconSuffix(0),this.getIconSuffix(3), this.getIconSuffix(4)}; - - return new ModelTinkersBreastplate(color, this.getDefaultFolder(), textures); + return new String[] {"armor", "chest", "breastplate", "heavyarmor"}; } - + @Override - public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) + @SideOnly(Side.CLIENT) + public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) { - return 8; + String[] color = new String[10]; + + for(int j = 0; j < 10; j++) + color[j] = Integer.toHexString(itemStack.getItem().getColorFromItemStack(itemStack, j)); + + String[] textures = {this.getIconSuffix(2), this.getIconSuffix(0), this.getIconSuffix(3), this.getIconSuffix(4)}; + ClientProxy.breastplate.SetColors(color, this.getDefaultFolder(), textures); + return ClientProxy.breastplate; } } diff --git a/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersGrieves.java b/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersGrieves.java index 747b0e7..b0913a1 100644 --- a/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersGrieves.java +++ b/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersGrieves.java @@ -5,6 +5,7 @@ import cpw.mods.fml.relauncher.SideOnly; import lance5057.tDefense.TinkersDefense; import lance5057.tDefense.armor.ArmorCore; import lance5057.tDefense.armor.renderers.heavy.ModelTinkersGrieves; +import lance5057.tDefense.proxy.ClientProxy; import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -17,124 +18,132 @@ import net.minecraft.world.World; import net.minecraftforge.common.ISpecialArmor.ArmorProperties; import tconstruct.tools.TinkerTools; -public class TinkersGrieves extends ArmorCore +public class TinkersGrieves extends ArmorCore { - public TinkersGrieves() { - super(2,2); + public TinkersGrieves() + { + super(2, 2); this.setUnlocalizedName("tinkergrieves"); this.maxReduction = 100; - this.reductionPercent = 0.24; + reductionPercent = 6 * 0.04f; } - + @Override - public Item getHeadItem() + public Item getHeadItem() { return TinkersDefense.partArmorplate; } - + @Override - public Item getHandleItem() { + public Item getHandleItem() + { return TinkerTools.toughRod; } - + @Override - public Item getAccessoryItem() + public Item getAccessoryItem() { return TinkersDefense.partChainmaille; } - + @Override public Item getExtraItem() { return TinkersDefense.partArmorplate; } - + @Override - public int durabilityTypeAccessory() { + public int durabilityTypeAccessory() + { return 2; } @Override - public float getRepairCost() { + public float getRepairCost() + { return 4.0f; } @Override - public float getDurabilityModifier() { + public float getDurabilityModifier() + { return 2.5f; } - + @Override - public float getDamageModifier() { + public float getDamageModifier() + { return 1.4f; } @Override - public int getPartAmount() { + public int getPartAmount() + { return 4; } - + @Override - public String getIconSuffix(int partType) - { - switch (partType) { - case 0: - return "_grieves_plate"; - case 1: - return "_grieves_plate_broken"; - case 2: - return "_grieves_trim"; - case 3: - return "_grieves_chain"; - case 4: - return "_grieves_cod"; - default: - return ""; + public String getIconSuffix(int partType) + { + switch(partType) + { + case 0: + return "_grieves_plate"; + case 1: + return "_grieves_plate_broken"; + case 2: + return "_grieves_trim"; + case 3: + return "_grieves_chain"; + case 4: + return "_grieves_cod"; + default: + return ""; } } - + @Override - public String getEffectSuffix() + public String getEffectSuffix() { return "_grieves_effect"; } - + @Override public String getDefaultFolder() { return "armor/grieves"; } - -// @Override -// public void onUpdate(ItemStack stack, World world, Entity entity, int par4, -// boolean par5) { -// super.onUpdate(stack, world, entity, par4, par5); -// -// } + + // @Override + // public void onUpdate(ItemStack stack, World world, Entity entity, int par4, + // boolean par5) { + // super.onUpdate(stack, world, entity, par4, par5); + // + // } @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, - String type) { + public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) + { return "tinkersdefense:textures/armor/TinkersGrieves.png"; } - - @Override - public String[] getTraits() { - return new String[] {"armor","pants","grieves","heavyarmor"}; - } @Override - @SideOnly(Side.CLIENT) - public ModelBiped getModel(String[] color,NBTTagCompound tags) + public String[] getTraits() { - String[] textures = {this.getIconSuffix(2),this.getIconSuffix(0),this.getIconSuffix(3), this.getIconSuffix(4)}; - - return new ModelTinkersGrieves(color, this.getDefaultFolder(), textures); + return new String[] {"armor", "pants", "grieves", "heavyarmor"}; } - + @Override - public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) + @SideOnly(Side.CLIENT) + public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) { - return 6; + String[] color = new String[10]; + + for(int j = 0; j < 10; j++) + color[j] = Integer.toHexString(itemStack.getItem().getColorFromItemStack(itemStack, j)); + + String[] textures = {this.getIconSuffix(2), this.getIconSuffix(0), this.getIconSuffix(3), this.getIconSuffix(4)}; + ClientProxy.grieves.SetColors(color, this.getDefaultFolder(), textures); + return ClientProxy.grieves; } } diff --git a/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersHelm.java b/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersHelm.java index a2ad9eb..5bd30f2 100644 --- a/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersHelm.java +++ b/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersHelm.java @@ -3,6 +3,7 @@ package lance5057.tDefense.armor.items.heavy; import lance5057.tDefense.TinkersDefense; import lance5057.tDefense.armor.ArmorCore; import lance5057.tDefense.armor.renderers.heavy.ModelTinkersHelm; +import lance5057.tDefense.proxy.ClientProxy; import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -16,116 +17,124 @@ import tconstruct.tools.TinkerTools; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class TinkersHelm extends ArmorCore +public class TinkersHelm extends ArmorCore { - public TinkersHelm() { - super(2,0); + public TinkersHelm() + { + super(2, 0); this.setUnlocalizedName("tinkershelm"); this.maxReduction = 100; - this.reductionPercent = 0.12; + reductionPercent = 3 * 0.04f; } - + @Override - public Item getHeadItem() + public Item getHeadItem() { return TinkerTools.frypanHead; } - + @Override - public Item getHandleItem() { + public Item getHandleItem() + { return TinkerTools.toughRod; } - + @Override - public Item getAccessoryItem() + public Item getAccessoryItem() { return TinkersDefense.partArmorplate; } - + @Override - public int durabilityTypeAccessory() { + public int durabilityTypeAccessory() + { return 2; } @Override - public float getRepairCost() { + public float getRepairCost() + { return 4.0f; } @Override - public float getDurabilityModifier() { + public float getDurabilityModifier() + { return 2.5f; } - + @Override - public float getDamageModifier() { + public float getDamageModifier() + { return 1.4f; } @Override - public int getPartAmount() { + public int getPartAmount() + { return 3; } - + @Override - public String getIconSuffix(int partType) + public String getIconSuffix(int partType) { - switch (partType) { - case 0: - return "_helm_top"; - case 1: - return "_helm_top_broken"; - case 2: - return "_helm_visor"; - case 3: - return "_helm_chain"; - default: - return ""; + switch(partType) + { + case 0: + return "_helm_top"; + case 1: + return "_helm_top_broken"; + case 2: + return "_helm_visor"; + case 3: + return "_helm_chain"; + default: + return ""; } } - + @Override - public String getEffectSuffix() + public String getEffectSuffix() { return "_helm_effect"; } - + @Override public String getDefaultFolder() { return "armor/helm"; } - -// @Override -// public void onUpdate(ItemStack stack, World world, Entity entity, int par4, -// boolean par5) { -// super.onUpdate(stack, world, entity, par4, par5); -// -// } + + // @Override + // public void onUpdate(ItemStack stack, World world, Entity entity, int par4, + // boolean par5) { + // super.onUpdate(stack, world, entity, par4, par5); + // + // } @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, - String type) { + public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) + { return "tinkersdefense:textures/armor/TinkersHelm.png"; } - - @Override - public String[] getTraits() { - return new String[] {"armor","helmet","helm","heavyarmor"}; - } @Override - @SideOnly(Side.CLIENT) - public ModelBiped getModel(String[] color,NBTTagCompound tags) + public String[] getTraits() { - String[] textures = {this.getIconSuffix(2),this.getIconSuffix(0),this.getIconSuffix(3)}; - - return new ModelTinkersHelm(color, this.getDefaultFolder(), textures); + return new String[] {"armor", "helmet", "helm", "heavyarmor"}; } - + @Override - public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) + @SideOnly(Side.CLIENT) + public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) { - return 3; + String[] color = new String[10]; + + for(int j = 0; j < 10; j++) + color[j] = Integer.toHexString(itemStack.getItem().getColorFromItemStack(itemStack, j)); + + String[] textures = {this.getIconSuffix(2), this.getIconSuffix(0), this.getIconSuffix(3), this.getIconSuffix(4)}; + ClientProxy.helm.SetColors(color, this.getDefaultFolder(), textures); + return ClientProxy.helm; } } diff --git a/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersSabatons.java b/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersSabatons.java index b3cb58a..48845ce 100644 --- a/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersSabatons.java +++ b/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersSabatons.java @@ -6,6 +6,7 @@ import lance5057.tDefense.TinkersDefense; import lance5057.tDefense.armor.ArmorCore; import lance5057.tDefense.armor.parts.ClothMaterial; import lance5057.tDefense.armor.renderers.heavy.ModelTinkersSabatons; +import lance5057.tDefense.proxy.ClientProxy; import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -20,131 +21,132 @@ import tconstruct.library.TConstructRegistry; import tconstruct.library.tools.CustomMaterial; import tconstruct.tools.TinkerTools; -public class TinkersSabatons extends ArmorCore +public class TinkersSabatons extends ArmorCore { - public TinkersSabatons() { - super(2,3); + public TinkersSabatons() + { + super(2, 3); this.setUnlocalizedName("tinkersabatons"); this.maxReduction = 100; - this.reductionPercent = 0.12; + reductionPercent = 3 * 0.04f; } - + @Override - public Item getHeadItem() + public Item getHeadItem() { return TinkersDefense.partArmorplate; } - + @Override - public Item getHandleItem() { + public Item getHandleItem() + { return TinkerTools.toughRod; } - + @Override - public Item getAccessoryItem() + public Item getAccessoryItem() { return TinkersDefense.partArmorplate; } - + @Override public Item getExtraItem() { return TinkersDefense.partCloth; } - + @Override - public int durabilityTypeAccessory() { + public int durabilityTypeAccessory() + { return 2; } @Override - public float getRepairCost() { + public float getRepairCost() + { return 4.0f; } @Override - public float getDurabilityModifier() { + public float getDurabilityModifier() + { return 2.5f; } - + @Override - public float getDamageModifier() { + public float getDamageModifier() + { return 1.4f; } @Override - public int getPartAmount() { + public int getPartAmount() + { return 4; } - + @Override - public String getIconSuffix(int partType) - { - switch (partType) { - case 0: - return "_sabatons_plates"; - case 1: - return "_sabatons_plate_broken"; - case 2: - return "_sabatons_trim"; - case 3: - return "_sabatons_caps"; - case 4: - return "_sabatons_soles"; - default: - return ""; + public String getIconSuffix(int partType) + { + switch(partType) + { + case 0: + return "_sabatons_plates"; + case 1: + return "_sabatons_plate_broken"; + case 2: + return "_sabatons_trim"; + case 3: + return "_sabatons_caps"; + case 4: + return "_sabatons_soles"; + default: + return ""; } } - + @Override - public String getEffectSuffix() + public String getEffectSuffix() { return "_sabatons_effect"; } - + @Override public String getDefaultFolder() { return "armor/sabatons"; } - -// @Override -// public void onUpdate(ItemStack stack, World world, Entity entity, int par4, -// boolean par5) { -// super.onUpdate(stack, world, entity, par4, par5); -// -// } + + // @Override + // public void onUpdate(ItemStack stack, World world, Entity entity, int par4, + // boolean par5) { + // super.onUpdate(stack, world, entity, par4, par5); + // + // } @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, - String type) { + public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) + { return "tinkersdefense:textures/armor/TinkersSabatons.png"; } - + @Override - public String[] getTraits() { - return new String[] {"armor","shoes","sabatons","heavyarmor"}; + public String[] getTraits() + { + return new String[] {"armor", "feet", "sabatons", "heavyarmor"}; } @Override @SideOnly(Side.CLIENT) - public ModelBiped getModel(String[] color, NBTTagCompound tags) - { - String[] textures = {this.getIconSuffix(2),this.getIconSuffix(0),this.getIconSuffix(3), this.getIconSuffix(4)}; - - int matID = tags.getCompoundTag("InfiTool").getInteger("RenderExtra"); - - - CustomMaterial newColor = TConstructRegistry.getCustomMaterial(matID, ClothMaterial.class); - - color[3] = Integer.toHexString(newColor.color); - - return new ModelTinkersSabatons(color, this.getDefaultFolder(), textures); - } - - @Override - public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) + public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) { - return 3; + String[] color = new String[10]; + + for(int j = 0; j < 10; j++) + color[j] = Integer.toHexString(itemStack.getItem().getColorFromItemStack(itemStack, j)); + + String[] textures = {this.getIconSuffix(2), this.getIconSuffix(0), this.getIconSuffix(3), this.getIconSuffix(4)}; + ClientProxy.sabatons.SetColors(color, this.getDefaultFolder(), textures); + return ClientProxy.sabatons; } } diff --git a/src/main/java/lance5057/tDefense/armor/items/light/TinkersBoots.java b/src/main/java/lance5057/tDefense/armor/items/light/TinkersBoots.java index afe0368..ce972ea 100644 --- a/src/main/java/lance5057/tDefense/armor/items/light/TinkersBoots.java +++ b/src/main/java/lance5057/tDefense/armor/items/light/TinkersBoots.java @@ -19,120 +19,129 @@ import net.minecraftforge.common.ISpecialArmor.ArmorProperties; import tconstruct.library.TConstructRegistry; import tconstruct.library.tools.CustomMaterial; -public class TinkersBoots extends ArmorCore +public class TinkersBoots extends ArmorCore { - public TinkersBoots() { - super(1,3); + public TinkersBoots() + { + super(1, 3); this.setUnlocalizedName("tinkersboots"); this.maxReduction = 100; - this.reductionPercent = 0.08; + this.reductionPercent = 0.08f; } - + @Override - public Item getHeadItem() + public Item getHeadItem() { return TinkersDefense.partChainmaille; } - + @Override - public Item getHandleItem() { + public Item getHandleItem() + { return TinkersDefense.partCloth; } - + @Override - public Item getAccessoryItem() + public Item getAccessoryItem() { return TinkersDefense.partRivet; } - + @Override - public int durabilityTypeAccessory() { + public int durabilityTypeAccessory() + { return 1; } @Override - public float getRepairCost() { + public float getRepairCost() + { return 1.0f; } @Override - public float getDurabilityModifier() { + public float getDurabilityModifier() + { return 1f; } - + @Override - public float getDamageModifier() { + public float getDamageModifier() + { return 1f; } @Override - public int getPartAmount() { + public int getPartAmount() + { return 3; } - + @Override - public String getIconSuffix(int partType) - { - switch (partType) { - case 0: - return "_boots_chain"; - case 1: - return "_boots_chain_broken"; - case 2: - return "_boots_cloth"; - case 3: - return "_boots_rivet"; - default: - return ""; + public String getIconSuffix(int partType) + { + switch(partType) + { + case 0: + return "_boots_chain"; + case 1: + return "_boots_chain_broken"; + case 2: + return "_boots_cloth"; + case 3: + return "_boots_rivet"; + default: + return ""; } } - + @Override - public String getEffectSuffix() + public String getEffectSuffix() { return "_boots_effect"; } - + @Override public String getDefaultFolder() { return "armor/boots"; } - -// @Override -// public void onUpdate(ItemStack stack, World world, Entity entity, int par4, -// boolean par5) { -// super.onUpdate(stack, world, entity, par4, par5); -// -// } + + // @Override + // public void onUpdate(ItemStack stack, World world, Entity entity, int par4, + // boolean par5) { + // super.onUpdate(stack, world, entity, par4, par5); + // + // } @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, - String type) { + public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) + { return "tinkersdefense:textures/armor/TinkersBoots.png"; } - + @Override - public String[] getTraits() { - return new String[] {"armor","feet","boots","lightarmor"}; + public String[] getTraits() + { + return new String[] {"armor", "feet", "boots", "lightarmor"}; } @Override @SideOnly(Side.CLIENT) - public ModelBiped getModel(String[] color,NBTTagCompound tags) + public ModelBiped getModel(String[] color, NBTTagCompound tags) { - String[] textures = {this.getIconSuffix(2),this.getIconSuffix(0),this.getIconSuffix(3)}; - + String[] textures = {this.getIconSuffix(2), this.getIconSuffix(0), this.getIconSuffix(3)}; + int HandleID = tags.getCompoundTag("InfiTool").getInteger("RenderHandle"); - + CustomMaterial newColor = TConstructRegistry.getCustomMaterial(HandleID, ClothMaterial.class); color[0] = Integer.toHexString(newColor.color); - + return new ModelTinkersBoots(color, this.getDefaultFolder(), textures); } - + @Override - public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) + public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) { return 2; } diff --git a/src/main/java/lance5057/tDefense/armor/items/light/TinkersChausses.java b/src/main/java/lance5057/tDefense/armor/items/light/TinkersChausses.java index 203535d..c552584 100644 --- a/src/main/java/lance5057/tDefense/armor/items/light/TinkersChausses.java +++ b/src/main/java/lance5057/tDefense/armor/items/light/TinkersChausses.java @@ -18,114 +18,122 @@ import net.minecraftforge.common.ISpecialArmor.ArmorProperties; import tconstruct.library.TConstructRegistry; import tconstruct.library.tools.CustomMaterial; -public class TinkersChausses extends ArmorCore +public class TinkersChausses extends ArmorCore { - public TinkersChausses() { - super(1,2); + public TinkersChausses() + { + super(1, 2); this.setUnlocalizedName("tinkerschausses"); this.maxReduction = 100; - this.reductionPercent = 0.2; + this.reductionPercent = 0.2f; } - + @Override - public Item getHeadItem() + public Item getHeadItem() { return TinkersDefense.partChainmaille; } - + @Override - public Item getHandleItem() { + public Item getHandleItem() + { return TinkersDefense.partArmorplate; } - + @Override - public int durabilityTypeAccessory() { + public int durabilityTypeAccessory() + { return 1; } @Override - public float getRepairCost() { + public float getRepairCost() + { return 1.0f; } @Override - public float getDurabilityModifier() { + public float getDurabilityModifier() + { return 1f; } - + @Override - public float getDamageModifier() { + public float getDamageModifier() + { return 1f; } @Override - public int getPartAmount() { + public int getPartAmount() + { return 2; } - + @Override - public String getIconSuffix(int partType) - { - switch (partType) { - case 0: - return "_chausses_chain"; - case 1: - return "_chausses_chain_broken"; - case 2: - return "_chausses_plate"; - default: - return ""; + public String getIconSuffix(int partType) + { + switch(partType) + { + case 0: + return "_chausses_chain"; + case 1: + return "_chausses_chain_broken"; + case 2: + return "_chausses_plate"; + default: + return ""; } } - + @Override - public String getEffectSuffix() + public String getEffectSuffix() { return "_chausses_effect"; } - + @Override public String getDefaultFolder() { return "armor/chausses"; } - -// @Override -// public void onUpdate(ItemStack stack, World world, Entity entity, int par4, -// boolean par5) { -// super.onUpdate(stack, world, entity, par4, par5); -// -// } + + // @Override + // public void onUpdate(ItemStack stack, World world, Entity entity, int par4, + // boolean par5) { + // super.onUpdate(stack, world, entity, par4, par5); + // + // } @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, - String type) { + public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) + { return "tinkersdefense:textures/armor/TinkersChausses.png"; } - + @Override - public String[] getTraits() { - return new String[] {"armor","feet","chausses","lightarmor"}; + public String[] getTraits() + { + return new String[] {"armor", "feet", "chausses", "lightarmor"}; } @Override @SideOnly(Side.CLIENT) - public ModelBiped getModel(String[] color,NBTTagCompound tags) + public ModelBiped getModel(String[] color, NBTTagCompound tags) { - String[] textures = {this.getIconSuffix(2),this.getIconSuffix(0)}; - + String[] textures = {this.getIconSuffix(2), this.getIconSuffix(0)}; + return new ModelTinkersChausses(color, this.getDefaultFolder(), textures); } - + @Override - public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) + public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) { return 5; } - + @Override - public ArmorProperties getProperties(EntityLivingBase player, - ItemStack armor, DamageSource source, double damage, int slot) + public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) { ArmorProperties armorp = new ArmorProperties(0, 0.2, 100); //0.04 per half shirt //((EntityPlayer)player).addChatComponentMessage(new ChatComponentText(Double.toString(damage))); diff --git a/src/main/java/lance5057/tDefense/armor/items/light/TinkersCoif.java b/src/main/java/lance5057/tDefense/armor/items/light/TinkersCoif.java index 47dbf27..98a77c6 100644 --- a/src/main/java/lance5057/tDefense/armor/items/light/TinkersCoif.java +++ b/src/main/java/lance5057/tDefense/armor/items/light/TinkersCoif.java @@ -20,127 +20,135 @@ import tconstruct.library.TConstructRegistry; import tconstruct.library.tools.CustomMaterial; import tconstruct.tools.TinkerTools; -public class TinkersCoif extends ArmorCore +public class TinkersCoif extends ArmorCore { - public TinkersCoif() { - super(1,0); + public TinkersCoif() + { + super(1, 0); this.setUnlocalizedName("tinkerscoif"); this.maxReduction = 100; - this.reductionPercent = 0.08; + this.reductionPercent = 0.08f; } - + @Override - public Item getHeadItem() + public Item getHeadItem() { return TinkersDefense.partChainmaille; } - + @Override - public Item getHandleItem() { + public Item getHandleItem() + { return TinkersDefense.partCloth; } - + @Override public Item getAccessoryItem() { return TinkerTools.toughRod; } - + @Override - public int durabilityTypeAccessory() { + public int durabilityTypeAccessory() + { return 1; } @Override - public float getRepairCost() { + public float getRepairCost() + { return 1.0f; } @Override - public float getDurabilityModifier() { + public float getDurabilityModifier() + { return 1f; } - + @Override - public float getDamageModifier() { + public float getDamageModifier() + { return 1f; } @Override - public int getPartAmount() { + public int getPartAmount() + { return 3; } - - @Override - public String getIconSuffix(int partType) - { - switch (partType) { - case 0: - return "_coif_chain"; - case 1: - return "_coif_chain_broken"; - case 2: - return "_coif_cloth"; - case 3: - return "_coif_circlet"; - default: - return ""; + + @Override + public String getIconSuffix(int partType) + { + switch(partType) + { + case 0: + return "_coif_chain"; + case 1: + return "_coif_chain_broken"; + case 2: + return "_coif_cloth"; + case 3: + return "_coif_circlet"; + default: + return ""; } } - + @Override - public String getEffectSuffix() + public String getEffectSuffix() { return "_coif_effect"; } - + @Override public String getDefaultFolder() { return "armor/coif"; } - -// @Override -// public void onUpdate(ItemStack stack, World world, Entity entity, int par4, -// boolean par5) { -// super.onUpdate(stack, world, entity, par4, par5); -// -// } + + // @Override + // public void onUpdate(ItemStack stack, World world, Entity entity, int par4, + // boolean par5) { + // super.onUpdate(stack, world, entity, par4, par5); + // + // } @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, - String type) { + public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) + { return "tinkersdefense:textures/armor/TinkersCoif.png"; } - + @Override - public String[] getTraits() { - return new String[] {"armor","head","coif","lightarmor"}; + public String[] getTraits() + { + return new String[] {"armor", "head", "coif", "lightarmor"}; } @Override @SideOnly(Side.CLIENT) - public ModelBiped getModel(String[] color,NBTTagCompound tags) + public ModelBiped getModel(String[] color, NBTTagCompound tags) { - String[] textures = {this.getIconSuffix(2),this.getIconSuffix(0),this.getIconSuffix(3)}; - + String[] textures = {this.getIconSuffix(2), this.getIconSuffix(0), this.getIconSuffix(3)}; + int HandleID = tags.getCompoundTag("InfiTool").getInteger("RenderHandle"); - + CustomMaterial newColor = TConstructRegistry.getCustomMaterial(HandleID, ClothMaterial.class); color[0] = Integer.toHexString(newColor.color); return new ModelTinkersCoif(color, this.getDefaultFolder(), textures); } - + @Override - public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) + public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) { return 2; } - + @Override - public ArmorProperties getProperties(EntityLivingBase player, - ItemStack armor, DamageSource source, double damage, int slot) + public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) { ArmorProperties armorp = new ArmorProperties(0, 0.08, 100); //0.04 per half shirt //((EntityPlayer)player).addChatComponentMessage(new ChatComponentText(Double.toString(damage))); diff --git a/src/main/java/lance5057/tDefense/armor/items/light/TinkersHalberd.java b/src/main/java/lance5057/tDefense/armor/items/light/TinkersHalberd.java index 739e6e0..b71d719 100644 --- a/src/main/java/lance5057/tDefense/armor/items/light/TinkersHalberd.java +++ b/src/main/java/lance5057/tDefense/armor/items/light/TinkersHalberd.java @@ -7,6 +7,7 @@ import lance5057.tDefense.armor.ArmorCore; import lance5057.tDefense.armor.parts.ClothMaterial; import lance5057.tDefense.armor.renderers.cloth.ModelTinkersHood; import lance5057.tDefense.armor.renderers.light.ModelTinkersHalberd; +import lance5057.tDefense.proxy.ClientProxy; import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -20,115 +21,129 @@ import tconstruct.library.TConstructRegistry; import tconstruct.library.tools.CustomMaterial; import tconstruct.tools.TinkerTools; -public class TinkersHalberd extends ArmorCore +public class TinkersHalberd extends ArmorCore { - public TinkersHalberd() { - super(1,1); + public TinkersHalberd() + { + super(1, 1); this.setUnlocalizedName("tinkershalberd"); this.maxReduction = 100; - this.reductionPercent = 0.24; + this.reductionPercent = 0.24f; } - + @Override - public Item getHeadItem() + public Item getHeadItem() { return TinkersDefense.partChainmaille; } - + @Override - public Item getHandleItem() { + public Item getHandleItem() + { return TinkersDefense.partArmorplate; } - + @Override public Item getAccessoryItem() { return TinkersDefense.partRivet; } - + @Override - public int durabilityTypeAccessory() { + public int durabilityTypeAccessory() + { return 1; } @Override - public float getRepairCost() { + public float getRepairCost() + { return 1.0f; } @Override - public float getDurabilityModifier() { + public float getDurabilityModifier() + { return 1f; } - + @Override - public float getDamageModifier() { + public float getDamageModifier() + { return 1f; } @Override - public int getPartAmount() { + public int getPartAmount() + { return 3; } - + @Override - public String getIconSuffix(int partType) - { - switch (partType) { - case 0: - return "_halberd_chain"; - case 1: - return "_halberd_chain_broken"; - case 2: - return "_halberd_plate"; - case 3: - return "_halberd_rivet"; - default: - return ""; + public String getIconSuffix(int partType) + { + switch(partType) + { + case 0: + return "_halberd_chain"; + case 1: + return "_halberd_chain_broken"; + case 2: + return "_halberd_plate"; + case 3: + return "_halberd_rivet"; + default: + return ""; } } - + @Override - public String getEffectSuffix() + public String getEffectSuffix() { return "_halberd_effect"; } - + @Override public String getDefaultFolder() { return "armor/halberd"; } - -// @Override -// public void onUpdate(ItemStack stack, World world, Entity entity, int par4, -// boolean par5) { -// super.onUpdate(stack, world, entity, par4, par5); -// -// } + + // @Override + // public void onUpdate(ItemStack stack, World world, Entity entity, int par4, + // boolean par5) { + // super.onUpdate(stack, world, entity, par4, par5); + // + // } @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, - String type) { + public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) + { return "tinkersdefense:textures/armor/TinkersHalberd.png"; } - + @Override - public String[] getTraits() { - return new String[] {"armor","chest","halberd","lightarmor"}; + public String[] getTraits() + { + return new String[] {"armor", "chest", "halberd", "lightarmor"}; } @Override @SideOnly(Side.CLIENT) - public ModelBiped getModel(String[] color,NBTTagCompound tags) + public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) { - String[] textures = {this.getIconSuffix(2),this.getIconSuffix(0),this.getIconSuffix(3)}; - - return new ModelTinkersHalberd(color, this.getDefaultFolder(), textures); + String[] color = new String[10]; + + for(int j = 0; j < 10; j++) + color[j] = Integer.toHexString(itemStack.getItem().getColorFromItemStack(itemStack, j)); + + String[] textures = {this.getIconSuffix(2), this.getIconSuffix(0), this.getIconSuffix(3), this.getIconSuffix(4)}; + ClientProxy.breastplate.SetColors(color, this.getDefaultFolder(), textures); + return ClientProxy.breastplate; } - + @Override - public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) + public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) { return 6; } diff --git a/src/main/java/lance5057/tDefense/armor/modifiers/ArmorMods.java b/src/main/java/lance5057/tDefense/armor/modifiers/ArmorMods.java index 1ee7b1f..b59f789 100644 --- a/src/main/java/lance5057/tDefense/armor/modifiers/ArmorMods.java +++ b/src/main/java/lance5057/tDefense/armor/modifiers/ArmorMods.java @@ -1,22 +1,22 @@ package lance5057.tDefense.armor.modifiers; -import java.util.List; - -import cpw.mods.fml.common.registry.GameRegistry; import lance5057.tDefense.TinkersDefense; +import net.minecraft.block.Block; +import net.minecraft.block.BlockLiquid; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; import net.minecraft.init.Blocks; import net.minecraft.init.Items; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import tconstruct.armor.TinkerArmor; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; import tconstruct.library.TConstructRegistry; import tconstruct.library.client.TConstructClientRegistry; import tconstruct.library.crafting.ModifyBuilder; import tconstruct.library.tools.ToolCore; -public class ArmorMods +public class ArmorMods { - Item protKit; public ArmorMods() { @@ -24,29 +24,100 @@ public class ArmorMods RegisterRecipes(); RegisterModifiers(); } - + public void LoadItems() { - protKit = new Item() - .setUnlocalizedName("protectionkit") - .setCreativeTab(TinkersDefense.tabName) - .setTextureName("tinkersdefense:protectionkit"); - - GameRegistry.registerItem(protKit, "protectionkit"); + // protKit = new Item() + // .setUnlocalizedName("protectionkit") + // .setCreativeTab(TinkersDefense.tabName) + // .setTextureName("tinkersdefense:protectionkit"); + // + // GameRegistry.registerItem(protKit, "protectionkit"); } - + public void RegisterRecipes() { - GameRegistry.addShapelessRecipe(new ItemStack(protKit,1), new ItemStack(TinkersDefense.partArmorplate,1,2), TinkerArmor.heartCanister, Items.iron_ingot); + // GameRegistry.addShapelessRecipe(new ItemStack(protKit,1), new + // ItemStack(TinkersDefense.partArmorplate,1,2), + // TinkerArmor.heartCanister, Items.iron_ingot); } - + public void RegisterModifiers() - { - ModifyBuilder.registerModifier(new modifierProtection(new ItemStack[] {new ItemStack(protKit,1)}, TinkersDefense.config.ArmorProtectionID, 1, "\u00A77")); - - for (ToolCore tool : TConstructRegistry.getToolMapping()) - { + { + ModifyBuilder.registerModifier(new modifierProtection(new ItemStack[] {new ItemStack(TinkersDefense.partArmorplate, 1, 2)}, TinkersDefense.config.ArmorProtectionID, 1, "\u00A77", "Protection")); + ModifyBuilder.registerModifier(new modifierProtection(new ItemStack[] {new ItemStack(Items.magma_cream, 1)}, TinkersDefense.config.ArmorFireProtectionID, 1, "\u00A7c", "Fire Protection")); + ModifyBuilder.registerModifier(new modifierProtection(new ItemStack[] {new ItemStack(Blocks.wool, 1)}, TinkersDefense.config.ArmorBlastProtectionID, 1, "\u00A72", "Blast Protection")); + ModifyBuilder.registerModifier(new modifierProtection(new ItemStack[] {new ItemStack(TinkersDefense.partRivet, 1, 2)}, TinkersDefense.config.ArmorProjectileProtectionID, 1, "\u00A7f", "Projectile Protection")); + ModifyBuilder.registerModifier(new modifierProtection(new ItemStack[] {new ItemStack(Blocks.hay_block)}, TinkersDefense.config.FeatherfallID, 1, "\u00A7f", "Featherfall")); + + for(ToolCore tool : TConstructRegistry.getToolMapping()) + { TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.ArmorProtectionID, "tinker", "protection", true); - } + TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.ArmorFireProtectionID, "tinker", "fireprotection", true); + TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.ArmorBlastProtectionID, "tinker", "blastprotection", true); + TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.ArmorProjectileProtectionID, "tinker", "projprotection", true); + TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.FeatherfallID, "tinker", "featherfall", true); + } + } + + public void UpdateAll(ToolCore tool, ItemStack stack, World world, Entity entity, NBTTagCompound tags) + { + if(!world.isRemote) + { + UpdateWalker(tool, stack, world, entity, Material.water, TinkersDefense.block_Unstable, 0); + UpdateWalker(tool, stack, world, entity, Material.lava, TinkersDefense.block_Unstable, 1); + UpdateGlowstep(tool, stack, world, entity); + } + } + + public void UpdateWalker(ToolCore tool, ItemStack stack, World world, Entity entity, Material mat, Block replacement, int meta) + { + int x = (int) Math.floor(entity.posX); + int y = (int) (entity.posY - entity.getYOffset()); + int z = (int) Math.floor(entity.posZ); + + Block block; + + for(int i = 0; i < 5; i++) + for(int j = 0; j < 5; j++) + { + block = world.getBlock(x + (i - 2), y - 1, z + (j - 2)); + if(block instanceof BlockLiquid) + { + if(((BlockLiquid) block).getMaterial() == mat && world.getBlockMetadata(x + (i - 2), y - 1, z + (j - 2)) == 0) + { + world.setBlock(x + (i - 2), y - 1, z + (j - 2), replacement, meta, 3); + world.notifyBlocksOfNeighborChange(x + (i - 2), y - 1, z + (j - 2), world.getBlock(x + (i - 2), y - 1, z + (j - 2))); + } + } + } + } + + int glowTimer = 8; + int prevX = 0; + int prevZ = 0; + + public void UpdateGlowstep(ToolCore tool, ItemStack stack, World world, Entity entity) + { + int x = (int) Math.floor(entity.posX); + int y = (int) (entity.posY - entity.getYOffset()); + int z = (int) Math.floor(entity.posZ); + + if(glowTimer == 0) + { + if(world.getBlock(x, y, z) == Blocks.air && world.getBlock(x, y - 1, z).isNormalCube()) + { + world.setBlock(x, y, z, TinkersDefense.block_GlowCrumbs, 0, 3); + //world.notifyBlocksOfNeighborChange(x + (i - 2), y - 1, z + (j - 2), world.getBlock(x + (i - 2), y - 1, z + (j - 2))); + } + glowTimer = 8; + } + else if(Math.abs(x - prevX) >= 1 || Math.abs(z - prevZ) >= 1) + { + glowTimer--; + } + + prevX = x; + prevZ = z; } } diff --git a/src/main/java/lance5057/tDefense/armor/modifiers/modifierProtection.java b/src/main/java/lance5057/tDefense/armor/modifiers/modifierProtection.java index bd781cd..f691adf 100644 --- a/src/main/java/lance5057/tDefense/armor/modifiers/modifierProtection.java +++ b/src/main/java/lance5057/tDefense/armor/modifiers/modifierProtection.java @@ -11,88 +11,114 @@ import tconstruct.library.tools.AbilityHelper; import tconstruct.library.tools.ToolCore; import tconstruct.modifiers.tools.ModInteger; - public class modifierProtection extends ModInteger { - String color; - String tooltipName = ""; - int initialIncrease; - int secondaryIncrease; - - public modifierProtection(ItemStack[] items, int effect, int increase, String c) - { - super(items, effect, "Protection", increase, c, "Protection"); - color = c; - } + String color; + String type; + String tooltipName = ""; + int initialIncrease; + int secondaryIncrease; + String[] types = {"Protection", "Fire Protection", "Blast Protection", "Projectile Protection", "Featherfall"}; + + public modifierProtection(ItemStack[] items, int effect, int increase, String c, String t) + { + super(items, effect, t, increase, c, t); + color = c; + type = t; + } + + @Override + protected boolean canModify(ItemStack tool, ItemStack[] input) + { + if(tool.getItem() instanceof ToolCore) + { + List list = Arrays.asList(((ToolCore) tool.getItem()).getTraits()); + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + + if(list.contains("heavyarmor") || list.contains("lightarmor")) + { + if(type != types[4]) + { + for(int i = 0; i < 4; i++) + { + if(tags.hasKey(types[i])) + { + if(types[i] != type) + return false; + if(types[i] == type && tags.getInteger(types[i]) > 5) + return false; + } + } + return true; + } + else if(type == types[4] && tags.getInteger(types[4]) < 5) + { + if(list.contains("feet")) + { + return true; + } + return false; + } + } + + } + return false; + } - @Override - protected boolean canModify (ItemStack tool, ItemStack[] input) - { - if (tool.getItem() instanceof ToolCore) - { - List list = Arrays.asList(((ToolCore)tool.getItem()).getTraits()); - if (list.contains("heavyarmor") || list.contains("lightarmor")) - { - return true; - } - } - return false; - } - - @Override - public void modify (ItemStack[] input, ItemStack tool) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - if (tags.hasKey(key)) - { - int increase = tags.getInteger(key); - increase += secondaryIncrease; - tags.setInteger(key, increase); - } - else - { - tags.setInteger(key, initialIncrease); - } + @Override + public void modify(ItemStack[] input, ItemStack tool) + { + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + if(tags.hasKey(key)) + { + int increase = tags.getInteger(key); + increase += secondaryIncrease; + tags.setInteger(key, increase); + } + else + { + tags.setInteger(key, initialIncrease); + } - int modifiers = tags.getInteger("Modifiers"); - modifiers -= 1; - tags.setInteger("Modifiers", modifiers); + int modifiers = tags.getInteger("Modifiers"); + modifiers -= 1; + tags.setInteger("Modifiers", modifiers); - int prot = tags.getInteger("Protection"); - prot += 1; - tags.setInteger("Protection", prot); + int prot = tags.getInteger(type); + prot += 1; + tags.setInteger(type, prot); - addToolTip(tool, color + tooltipName, color + key); - } + addToolTip(tool, color + tooltipName, color + key); + } - protected int addToolTip (ItemStack tool, String tooltip, String modifierTip) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - int tipNum = 0; - while (true) - { - tipNum++; - String tip = "Tooltip" + tipNum; - if (!tags.hasKey(tip)) - { - tags.setString(tip, ""); - String modTip = "ModifierTip" + tipNum; - String tag = tags.getString(modTip); - tags.setString(modTip, getProperName(modifierTip, tag)); - return tipNum; - } - else - { - String modTip = "ModifierTip" + tipNum; - String tag = tags.getString(modTip); - if (tag.contains(modifierTip)) - { - tags.setString(tip, ""); - tag = tags.getString(modTip); - tags.setString(modTip, getProperName(modifierTip, tag)); - return tipNum; - } - } - } - } -}
\ No newline at end of file + protected int addToolTip(ItemStack tool, String tooltip, String modifierTip) + { + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + int tipNum = 0; + while(true) + { + tipNum++; + String tip = "Tooltip" + tipNum; + if(!tags.hasKey(tip)) + { + tags.setString(tip, ""); + String modTip = "ModifierTip" + tipNum; + String tag = tags.getString(modTip); + tags.setString(modTip, getProperName(modifierTip, tag)); + return tipNum; + } + else + { + String modTip = "ModifierTip" + tipNum; + String tag = tags.getString(modTip); + if(tag.contains(modifierTip)) + { + tags.setString(tip, ""); + tag = tags.getString(modTip); + tags.setString(modTip, getProperName(modifierTip, tag)); + return tipNum; + } + } + } + } +} diff --git a/src/main/java/lance5057/tDefense/armor/parts/Cloth.java b/src/main/java/lance5057/tDefense/armor/parts/Cloth.java index 5613157..021a607 100644 --- a/src/main/java/lance5057/tDefense/armor/parts/Cloth.java +++ b/src/main/java/lance5057/tDefense/armor/parts/Cloth.java @@ -7,34 +7,34 @@ import tconstruct.library.util.IToolPart; public class Cloth extends CraftingItem implements IToolPart { - public Cloth() - { - super(toolMaterialNames, buildTextureNames("_cloth"), "parts/", "tinker", TConstructRegistry.materialTab); - this.setHasSubtypes(true); - this.setMaxDamage(0); - } + public Cloth() + { + super(toolMaterialNames, buildTextureNames("_cloth"), "parts/", "tinker", TConstructRegistry.materialTab); + this.setHasSubtypes(true); + this.setMaxDamage(0); + } - private static String[] buildTextureNames (String textureType) - { - String[] names = new String[toolMaterialNames.length]; - for (int i = 0; i < toolMaterialNames.length; i++) - { - if (toolTextureNames[i].equals("")) - names[i] = ""; - else - names[i] = toolTextureNames[i] + textureType; - } - return names; - } + private static String[] buildTextureNames(String textureType) + { + String[] names = new String[toolMaterialNames.length]; + for(int i = 0; i < toolMaterialNames.length; i++) + { + if(toolTextureNames[i].equals("")) + names[i] = ""; + else + names[i] = toolTextureNames[i] + textureType; + } + return names; + } - public static final String[] toolMaterialNames = new String[] { "white", "orange", "magenta", "lightblue", "yellow", "lime", "pink", "gray", "lightgray", "cyan", "purple", "blue", "brown", "green", "red", "black" }; - public static final String[] toolTextureNames = new String[] { "white", "orange", "magenta", "lightblue", "yellow", "lime", "pink", "gray", "lightgray", "cyan", "purple", "blue", "brown", "green", "red", "black" }; + public static final String[] toolMaterialNames = new String[] {"white", "orange", "magenta", "lightblue", "yellow", "lime", "pink", "gray", "lightgray", "cyan", "purple", "blue", "brown", "green", "red", "black"}; + public static final String[] toolTextureNames = new String[] {"white", "orange", "magenta", "lightblue", "yellow", "lime", "pink", "gray", "lightgray", "cyan", "purple", "blue", "brown", "green", "red", "black"}; - @Override - public int getMaterialID (ItemStack stack) - { - if (stack.getItemDamage() >= toolMaterialNames.length) - return -1; - return stack.getItemDamage(); - } -}
\ No newline at end of file + @Override + public int getMaterialID(ItemStack stack) + { + if(stack.getItemDamage() >= toolMaterialNames.length) + return -1; + return stack.getItemDamage(); + } +} diff --git a/src/main/java/lance5057/tDefense/armor/parts/ClothMaterial.java b/src/main/java/lance5057/tDefense/armor/parts/ClothMaterial.java index 40bf260..4b1733d 100644 --- a/src/main/java/lance5057/tDefense/armor/parts/ClothMaterial.java +++ b/src/main/java/lance5057/tDefense/armor/parts/ClothMaterial.java @@ -6,8 +6,8 @@ import tconstruct.library.tools.CustomMaterial; public class ClothMaterial extends CustomMaterial { - public ClothMaterial(int materialID, int value, ItemStack input, - ItemStack craftingItem, int color) { + public ClothMaterial(int materialID, int value, ItemStack input, ItemStack craftingItem, int color) + { super(materialID, value, input, craftingItem, color); } diff --git a/src/main/java/lance5057/tDefense/armor/renderers/ArmorRenderer.java b/src/main/java/lance5057/tDefense/armor/renderers/ArmorRenderer.java new file mode 100644 index 0000000..01a5983 --- /dev/null +++ b/src/main/java/lance5057/tDefense/armor/renderers/ArmorRenderer.java @@ -0,0 +1,24 @@ +package lance5057.tDefense.armor.renderers; + +import net.minecraft.client.model.ModelBiped; +import net.minecraft.entity.Entity; + +public class ArmorRenderer extends ModelBiped +{ + public String[] colors; + + public String[] textures; + public String defaultFolder; + + public ArmorRenderer(float a, float b, int c, int d) + { + super(a, b, c, d); + } + + public void SetColors(String[] colors, String defaultFolder, String[] textures) + { + this.colors = colors; + this.textures = textures; + this.defaultFolder = defaultFolder; + } +} diff --git a/src/main/java/lance5057/tDefense/armor/renderers/ModelChainArmor.java b/src/main/java/lance5057/tDefense/armor/renderers/ModelChainArmor.java deleted file mode 100644 index baca0f1..0000000 --- a/src/main/java/lance5057/tDefense/armor/renderers/ModelChainArmor.java +++ /dev/null @@ -1,168 +0,0 @@ -package lance5057.tDefense.armor.renderers; - -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelChainArmor extends ModelBiped -{ - public ModelRenderer Pauldron1R; - public ModelRenderer Pauldron2R; - public ModelRenderer Pauldron3R; - public ModelRenderer ArmR; - public ModelRenderer Belt; - public ModelRenderer BeltBuckle; - public ModelRenderer Body; - public ModelRenderer Coif; - public ModelRenderer Head; - public ModelRenderer LegR; - public ModelRenderer FootR; - public ModelRenderer HipGuardR; - public ModelRenderer HipGuardBR; - public ModelRenderer Pauldron1L; - public ModelRenderer Pauldron2L; - public ModelRenderer Pauldron3L; - public ModelRenderer ArmL; - public ModelRenderer LegL; - public ModelRenderer FootL; - public ModelRenderer HipGuardL; - public ModelRenderer HipGuardBL; - - public ModelChainArmor(float f) { - super(f, 0, 64,96); - - this.textureWidth = 64; - this.textureHeight = 96; - - this.BeltBuckle = new ModelRenderer(this, 0, 32); - this.BeltBuckle.setRotationPoint(0.0F, 0.0F, 0.0F); - this.BeltBuckle.addBox(-1.0F, 10.0F, -2.4F, 2, 2, 1, 0.2F); - this.bipedBody.addChild(BeltBuckle); - - this.Pauldron3L = new ModelRenderer(this, 16, 64); - this.Pauldron3L.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Pauldron3L.addBox(-1.3F, -1.3F, -2.5F, 2, 2, 5, 0.1F); - this.setRotateAngle(Pauldron3L, 0.0F, 3.141592653589793F, 0.2617993877991494F); - this.bipedLeftArm.addChild(Pauldron3L); - - this.LegL = new ModelRenderer(this, 0, 48); - this.LegL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.LegL.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.1F); - this.bipedLeftLeg.addChild(LegL); - - this.LegR = new ModelRenderer(this, 0, 48); - this.LegR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.LegR.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.1F); - this.bipedRightLeg.addChild(LegR); - - this.FootR = new ModelRenderer(this, 0, 75); - this.FootR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.FootR.addBox(-2.0F, 10.0F, -3.0F, 4, 2, 1, 0.0F); - this.bipedRightLeg.addChild(FootR); - - this.Pauldron1R = new ModelRenderer(this, 30, 64); - this.Pauldron1R.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Pauldron1R.addBox(-3.5F, -1.6F, -2.5F, 3, 4, 5, 0.0F); - this.setRotateAngle(Pauldron1R, 0.0F, 0.0F, 0.2617993877991494F); - this.bipedRightArm.addChild(Pauldron1R); - - this.ArmR = new ModelRenderer(this, 40, 48); - this.ArmR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.ArmR.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, 0.1F); - this.bipedRightArm.addChild(ArmR); - - this.ArmL = new ModelRenderer(this, 40, 48); - this.ArmL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.ArmL.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, 0.1F); - this.setRotateAngle(ArmL, 0.0F, 3.141592653589793F, 0.0F); - this.bipedLeftArm.addChild(ArmL); - - this.HipGuardL = new ModelRenderer(this, 24, 32); - this.HipGuardL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.HipGuardL.addBox(-2.1F, 0.0F, 1.5F, 4, 6, 1, -0.1F); - this.setRotateAngle(HipGuardL, 0.17453292519943295F, 1.5707963267948966F, 0.0F); - this.bipedLeftLeg.addChild(HipGuardL); - - this.Pauldron2R = new ModelRenderer(this, 0, 64); - this.Pauldron2R.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Pauldron2R.addBox(-2.4F, -2.7F, -2.5F, 3, 3, 5, -0.1F); - this.setRotateAngle(Pauldron2R, 0.0F, 0.0F, -0.2617993877991494F); - this.bipedRightArm.addChild(Pauldron2R); - - this.Body = new ModelRenderer(this, 16, 48); - this.Body.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Body.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, 0.1F); - this.bipedBody.addChild(Body); - - this.Pauldron2L = new ModelRenderer(this, 0, 64); - this.Pauldron2L.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Pauldron2L.addBox(-2.4F, -2.7F, -2.5F, 3, 3, 5, -0.1F); - this.setRotateAngle(Pauldron2L, 0.0F, 3.141592653589793F, 0.2617993877991494F); - this.bipedLeftArm.addChild(Pauldron2L); - - this.Coif = new ModelRenderer(this, 0, 78); - this.Coif.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Coif.addBox(-4.0F, -8.0F, -4.0F, 8, 10, 8, 0.5F); - this.bipedHead.addChild(Coif); - - this.HipGuardBR = new ModelRenderer(this, 24, 32); - this.HipGuardBR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.HipGuardBR.addBox(-2.0F, 0.0F, 1.0F, 4, 6, 1, 0.0F); - this.setRotateAngle(HipGuardBR, 0.17453292519943295F, 0.0F, 0.0F); - this.bipedRightLeg.addChild(HipGuardBR); - - this.Pauldron3R = new ModelRenderer(this, 16, 64); - this.Pauldron3R.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Pauldron3R.addBox(-1.3F, -1.3F, -2.5F, 2, 2, 5, 0.1F); - this.setRotateAngle(Pauldron3R, 0.0F, 0.0F, -0.2617993877991494F); - this.bipedRightArm.addChild(Pauldron3R); - - this.Head = new ModelRenderer(this, 0, 32); - this.Head.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Head.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0.1F); - this.bipedHead.addChild(Head); - - this.FootL = new ModelRenderer(this, 0, 75); - this.FootL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.FootL.addBox(-2.0F, 10.0F, -3.0F, 4, 2, 1, 0.0F); - this.bipedLeftLeg.addChild(FootL); - - this.Belt = new ModelRenderer(this, 32, 90); - this.Belt.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Belt.addBox(-4.0F, 10.0F, -2.0F, 8, 2, 4, 0.2F); - this.bipedBody.addChild(Belt); - - this.HipGuardBL = new ModelRenderer(this, 24, 32); - this.HipGuardBL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.HipGuardBL.addBox(-2.0F, 0.0F, 1.0F, 4, 6, 1, 0.0F); - this.setRotateAngle(HipGuardBL, 0.17453292519943295F, 0.0F, 0.0F); - this.bipedLeftLeg.addChild(HipGuardBL); - - this.Pauldron1L = new ModelRenderer(this, 30, 64); - this.Pauldron1L.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Pauldron1L.addBox(-3.5F, -1.6F, -2.5F, 3, 4, 5, 0.0F); - this.setRotateAngle(Pauldron1L, 0.0F, 3.141592653589793F, -0.2617993877991494F); - this.bipedLeftArm.addChild(Pauldron1L); - - this.HipGuardR = new ModelRenderer(this, 24, 32); - this.HipGuardR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.HipGuardR.addBox(-2.1F, 0.0F, -2.5F, 4, 6, 1, -0.1F); - this.setRotateAngle(HipGuardR, -0.17453292519943295F, 1.5707963267948966F, 0.0F); - this.bipedRightLeg.addChild(HipGuardR); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/src/main/java/lance5057/tDefense/armor/renderers/ModelClothArmor.java b/src/main/java/lance5057/tDefense/armor/renderers/ModelClothArmor.java deleted file mode 100644 index bf58d45..0000000 --- a/src/main/java/lance5057/tDefense/armor/renderers/ModelClothArmor.java +++ /dev/null @@ -1,259 +0,0 @@ -package lance5057.tDefense.armor.renderers; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -/** - * ModelBiped - Either Mojang or a mod author - * Created using Tabula 4.1.1 - */ -public class ModelClothArmor extends ModelBiped { - public ModelRenderer Collar; - public ModelRenderer Top; - public ModelRenderer Left; - public ModelRenderer Right; - public ModelRenderer TrimLeft2; - public ModelRenderer TrimLeft3; - public ModelRenderer TrimLeft4; - public ModelRenderer TrimRight3; - public ModelRenderer TrimRight2; - public ModelRenderer TrimRight4; - public ModelRenderer Flop; - public ModelRenderer ArmLeft; - public ModelRenderer ArmRight; - public ModelRenderer Chest; - public ModelRenderer ShawlLeft1; - public ModelRenderer ShawlLeft2; - public ModelRenderer ShawlRight1; - public ModelRenderer ShawlRight2; - public ModelRenderer Belt; - public ModelRenderer Button; - public ModelRenderer TopLeft; - public ModelRenderer Back; - public ModelRenderer TopRight; - public ModelRenderer LeftFront; - public ModelRenderer RightFront; - public ModelRenderer LeftFS; - public ModelRenderer LeftF; - public ModelRenderer LeftBS; - public ModelRenderer LeftB; - public ModelRenderer LeftB2; - public ModelRenderer LeftBA; - public ModelRenderer RightFS; - public ModelRenderer RightF; - public ModelRenderer RightBS; - public ModelRenderer RightB; - public ModelRenderer RightB2; - public ModelRenderer RightBA; - - public ModelClothArmor() { - super(1f, 0, 64,96); - - this.textureWidth = 64; - this.textureHeight = 96; - - this.TrimLeft2 = new ModelRenderer(this, 0, 65); - this.TrimLeft2.setRotationPoint(0.0F, 0.0F, 0.0F); - this.TrimLeft2.addBox(-3.1F, 1.1F, -6.0F, 2, 2, 1, 0.0F); - this.setRotateAngle(TrimLeft2, 0.0F, 0.0F, 0.7853981633974483F); - this.ShawlLeft2 = new ModelRenderer(this, 42, 43); - this.ShawlLeft2.mirror = true; - this.ShawlLeft2.setRotationPoint(-2.5F, -1.8F, 0.1F); - this.ShawlLeft2.addBox(-1.5F, -1.6F, -3.0F, 6, 3, 5, 0.0F); - this.setRotateAngle(ShawlLeft2, 0.0F, 0.0F, 0.9424777960769379F); - this.Back = new ModelRenderer(this, 46, 72); - this.Back.setRotationPoint(0.0F, 1.2F, 2.02F); - this.Back.addBox(-4.0F, 0.0F, 0.0F, 8, 5, 1, 0.0F); - this.Collar = new ModelRenderer(this, 0, 65); - this.Collar.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Collar.addBox(-5.5F, -1.0F, -5.5F, 11, 2, 11, 0.0F); - this.LeftFS = new ModelRenderer(this, 36, 83); - this.LeftFS.setRotationPoint(0.0F, 0.0F, 0.0F); - this.LeftFS.addBox(1.75F, 0.0F, -1.35F, 1, 11, 2, 0.0F); - this.setRotateAngle(LeftFS, 0.0F, 0.7853981633974483F, 0.0F); - this.TopLeft = new ModelRenderer(this, 0, 49); - this.TopLeft.setRotationPoint(0.0F, 0.0F, 0.0F); - this.TopLeft.addBox(-8.5F, -0.3F, -3.0F, 9, 2, 6, 0.0F); - this.setRotateAngle(TopLeft, 0.0F, 3.141592653589793F, 0.0F); - this.LeftB = new ModelRenderer(this, 34, 82); - this.LeftB.setRotationPoint(0.0F, 0.0F, 0.0F); - this.LeftB.addBox(1.9F, 0.0F, -1.0F, 1, 11, 3, 0.0F); - this.setRotateAngle(LeftB, 0.0F, 4.71238898038469F, 0.0F); - this.RightFS = new ModelRenderer(this, 35, 83); - this.RightFS.setRotationPoint(0.0F, 0.0F, 0.0F); - this.RightFS.addBox(1.75F, 0.0F, -0.65F, 1, 11, 2, 0.0F); - this.setRotateAngle(RightFS, 0.0F, -0.7853981633974483F, 0.0F); - this.RightBS = new ModelRenderer(this, 34, 83); - this.RightBS.setRotationPoint(0.0F, 0.0F, 0.0F); - this.RightBS.addBox(1.75F, 0.0F, -1.35F, 1, 11, 2, 0.0F); - this.setRotateAngle(RightBS, 0.0F, 0.7853981633974483F, 0.0F); - this.RightFront = new ModelRenderer(this, 31, 82); - this.RightFront.setRotationPoint(0.0F, 0.0F, 0.0F); - this.RightFront.addBox(1.4F, 0.0F, -1.5F, 1, 11, 3, 0.0F); - this.setRotateAngle(RightFront, 0.0F, 3.141592653589793F, 0.08726646259971647F); - this.TrimLeft3 = new ModelRenderer(this, 0, 32); - this.TrimLeft3.setRotationPoint(-2.3F, 0.0F, -5.5F); - this.TrimLeft3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(TrimLeft3, 0.009773843811168246F, 3.141592653589793F, 0.7853981633974483F); - this.TrimRight4 = new ModelRenderer(this, 0, 78); - this.TrimRight4.mirror = true; - this.TrimRight4.setRotationPoint(0.0F, 0.0F, 0.0F); - this.TrimRight4.addBox(2.6F, -4.5F, -5.0F, 1, 3, 11, 0.0F); - this.setRotateAngle(TrimRight4, 0.0F, 3.141592653589793F, -0.5235987755982988F); - this.RightBA = new ModelRenderer(this, 33, 80); - this.RightBA.setRotationPoint(0.0F, 0.0F, 0.0F); - this.RightBA.addBox(2.9F, 0.1F, -3.9F, 1, 11, 5, 0.0F); - this.setRotateAngle(RightBA, 0.0F, 2.6179938779914944F, 0.08726646259971647F); - this.ArmLeft = new ModelRenderer(this, 44, 62); - this.ArmLeft.setRotationPoint(0.0F, 0.0F, 0.0F); - this.ArmLeft.addBox(-1.5F, -2.0F, -2.5F, 5, 11, 5, 0.0F); - this.RightB2 = new ModelRenderer(this, 33, 83); - this.RightB2.setRotationPoint(0.0F, 0.0F, 0.0F); - this.RightB2.addBox(1.91F, 0.1F, -2.8F, 1, 11, 2, 0.0F); - this.setRotateAngle(RightB2, 0.0F, 1.5707963267948966F, 0.08726646259971647F); - this.LeftB2 = new ModelRenderer(this, 34, 83); - this.LeftB2.setRotationPoint(0.0F, 0.0F, 0.0F); - this.LeftB2.addBox(1.91F, 0.1F, 1.0F, 1, 11, 2, 0.0F); - this.setRotateAngle(LeftB2, 0.0F, 4.71238898038469F, 0.08726646259971647F); - this.LeftFront = new ModelRenderer(this, 33, 82); - this.LeftFront.setRotationPoint(0.0F, 0.0F, 0.0F); - this.LeftFront.addBox(1.4F, 0.0F, -1.5F, 1, 11, 3, 0.0F); - this.setRotateAngle(LeftFront, 0.0F, 0.0F, -0.08726646259971647F); - this.TopRight = new ModelRenderer(this, 0, 49); - this.TopRight.setRotationPoint(0.0F, 0.0F, 0.0F); - this.TopRight.addBox(-8.5F, -0.3F, -3.0F, 9, 2, 6, 0.0F); - this.LeftBA = new ModelRenderer(this, 35, 80); - this.LeftBA.setRotationPoint(0.0F, 0.0F, 0.0F); - this.LeftBA.addBox(3.1F, 0.1F, -1.0F, 1, 11, 5, 0.0F); - this.setRotateAngle(LeftBA, 0.0F, 3.6651914291880923F, 0.08726646259971647F); - this.Left = new ModelRenderer(this, 0, 78); - this.Left.mirror = true; - this.Left.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Left.addBox(4.5F, -8.6F, -5.0F, 1, 7, 11, 0.0F); - this.setRotateAngle(Left, 0.0F, 3.141592653589793F, 0.08726646259971647F); - this.Flop = new ModelRenderer(this, 2, 32); - this.Flop.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Flop.addBox(-4.5F, -10.0F, -4.0F, 9, 7, 4, 0.0F); - this.setRotateAngle(Flop, 0.5235987755982988F, 3.141592653589793F, 0.0F); - this.Top = new ModelRenderer(this, 24, 84); - this.Top.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Top.addBox(-4.5F, -9.0F, -6.0F, 9, 1, 11, 0.0F); - this.Button = new ModelRenderer(this, 0, 32); - this.Button.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Button.addBox(0.0F, 0.0F, -3.5F, 2, 2, 1, 0.0F); - this.setRotateAngle(Button, 0.0F, 0.0F, 0.7853981633974483F); - this.Right = new ModelRenderer(this, 0, 78); - this.Right.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Right.addBox(-5.5F, -8.6F, -5.0F, 1, 7, 11, 0.0F); - this.setRotateAngle(Right, 0.0F, 3.141592653589793F, -0.08726646259971647F); - this.RightB = new ModelRenderer(this, 34, 82); - this.RightB.setRotationPoint(0.0F, 0.0F, 0.0F); - this.RightB.addBox(1.9F, 0.0F, -2.0F, 1, 11, 3, 0.0F); - this.setRotateAngle(RightB, 0.0F, 1.5707963267948966F, 0.0F); - this.ShawlLeft1 = new ModelRenderer(this, 40, 32); - this.ShawlLeft1.setRotationPoint(-0.6F, 1.4F, 0.0F); - this.ShawlLeft1.addBox(-0.9F, -2.3F, -3.0F, 6, 5, 6, 0.0F); - this.setRotateAngle(ShawlLeft1, 0.0F, 0.0F, -0.2792526803190927F); - this.TrimRight3 = new ModelRenderer(this, 0, 32); - this.TrimRight3.setRotationPoint(3.7F, 0.0F, -5.5F); - this.TrimRight3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F); - this.setRotateAngle(TrimRight3, 0.0F, 3.141592653589793F, 0.7853981633974483F); - this.ShawlRight1 = new ModelRenderer(this, 40, 32); - this.ShawlRight1.mirror = true; - this.ShawlRight1.setRotationPoint(-0.6F, 1.4F, 0.0F); - this.ShawlRight1.addBox(-0.9F, -2.3F, -3.0F, 6, 5, 6, 0.0F); - this.setRotateAngle(ShawlRight1, 0.0F, 0.0F, -0.2792526803190927F); - this.ArmRight = new ModelRenderer(this, 44, 62); - this.ArmRight.setRotationPoint(0.0F, 0.0F, 0.0F); - this.ArmRight.addBox(-1.5F, -2.0F, -2.5F, 5, 11, 5, 0.0F); - this.setRotateAngle(ArmRight, 0.0F, 3.141592653589793F, 0.0F); - this.LeftF = new ModelRenderer(this, 32, 82); - this.LeftF.setRotationPoint(0.0F, 0.0F, 0.0F); - this.LeftF.addBox(1.9F, 0.0F, -2.0F, 1, 11, 3, 0.0F); - this.setRotateAngle(LeftF, 0.0F, 1.5707963267948966F, 0.0F); - this.TrimRight2 = new ModelRenderer(this, 0, 65); - this.TrimRight2.setRotationPoint(3.0F, -1.5F, -6.0F); - this.TrimRight2.addBox(0.0F, 0.0F, 0.0F, 2, 2, 1, 0.0F); - this.setRotateAngle(TrimRight2, 0.0F, 0.0F, 0.7853981633974483F); - this.Belt = new ModelRenderer(this, 0, 69); - this.Belt.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Belt.addBox(-6.8F, 10.0F, -3.0F, 10, 3, 6, 0.0F); - this.setRotateAngle(Belt, 0.0F, 0.0F, -0.13962634015954636F); - this.ShawlRight2 = new ModelRenderer(this, 42, 43); - this.ShawlRight2.mirror = true; - this.ShawlRight2.setRotationPoint(-2.5F, -1.8F, -0.1F); - this.ShawlRight2.addBox(-1.5F, -1.6F, -2.0F, 6, 3, 5, 0.0F); - this.setRotateAngle(ShawlRight2, 0.0F, 0.0F, 0.9424777960769379F); - this.LeftBS = new ModelRenderer(this, 33, 83); - this.LeftBS.setRotationPoint(0.0F, 0.0F, 0.0F); - this.LeftBS.addBox(1.75F, 0.0F, -0.65F, 1, 11, 2, 0.0F); - this.setRotateAngle(LeftBS, 0.0F, -0.7853981633974483F, 0.0F); - this.TrimLeft4 = new ModelRenderer(this, 0, 78); - this.TrimLeft4.setRotationPoint(0.0F, 0.0F, 0.0F); - this.TrimLeft4.addBox(-3.6F, -4.5F, -5.0F, 1, 3, 11, 0.0F); - this.setRotateAngle(TrimLeft4, 0.0F, 3.141592653589793F, 0.5235987755982988F); - this.Chest = new ModelRenderer(this, 0, 32); - this.Chest.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Chest.addBox(-4.5F, 0.0F, -2.5F, 9, 12, 5, 0.0F); - this.RightF = new ModelRenderer(this, 32, 82); - this.RightF.setRotationPoint(0.0F, 0.0F, 0.0F); - this.RightF.addBox(1.9F, 0.0F, -1.0F, 1, 11, 3, 0.0F); - this.setRotateAngle(RightF, 0.0F, -1.5707963267948966F, 0.0F); - this.Collar.addChild(this.TrimLeft2); - this.ShawlLeft1.addChild(this.ShawlLeft2); - this.Chest.addChild(this.Back); - this.LeftFront.addChild(this.LeftFS); - this.Chest.addChild(this.TopLeft); - this.LeftFront.addChild(this.LeftB); - this.RightFront.addChild(this.RightFS); - this.RightFront.addChild(this.RightBS); - this.Collar.addChild(this.TrimLeft3); - this.Collar.addChild(this.TrimRight4); - this.RightFront.addChild(this.RightBA); - this.RightFront.addChild(this.RightB2); - this.LeftFront.addChild(this.LeftB2); - this.Chest.addChild(this.TopRight); - this.LeftFront.addChild(this.LeftBA); - this.Collar.addChild(this.Left); - this.Collar.addChild(this.Flop); - this.Collar.addChild(this.Top); - this.Chest.addChild(this.Button); - this.Collar.addChild(this.Right); - this.RightFront.addChild(this.RightB); - this.ArmLeft.addChild(this.ShawlLeft1); - this.Collar.addChild(this.TrimRight3); - this.ArmRight.addChild(this.ShawlRight1); - this.LeftFront.addChild(this.LeftF); - this.Collar.addChild(this.TrimRight2); - this.Chest.addChild(this.Belt); - this.ShawlRight1.addChild(this.ShawlRight2); - this.LeftFront.addChild(this.LeftBS); - this.Collar.addChild(this.TrimLeft4); - this.RightFront.addChild(this.RightF); - - this.bipedHead.addChild(Collar); - this.bipedLeftArm.addChild(ArmLeft); - this.bipedRightArm.addChild(ArmRight); - this.bipedLeftLeg.addChild(LeftFront); - this.bipedRightLeg.addChild(RightFront); - this.bipedBody.addChild(Chest); - this.bipedBody.addChild(Belt); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/src/main/java/lance5057/tDefense/armor/renderers/ModelMask.java b/src/main/java/lance5057/tDefense/armor/renderers/ModelMask.java index 055e0c6..aee3b9e 100644 --- a/src/main/java/lance5057/tDefense/armor/renderers/ModelMask.java +++ b/src/main/java/lance5057/tDefense/armor/renderers/ModelMask.java @@ -11,64 +11,67 @@ import net.minecraft.entity.Entity; */ public class ModelMask extends ModelBiped { - public ModelRenderer Plate; - public ModelRenderer Band; - public ModelRenderer HornTipR; - public ModelRenderer HornTipL; - public ModelRenderer HornBaseR; - public ModelRenderer HornBaseL; + public ModelRenderer Plate; + public ModelRenderer Band; + public ModelRenderer HornTipR; + public ModelRenderer HornTipL; + public ModelRenderer HornBaseR; + public ModelRenderer HornBaseL; - String Color[]; - int rgbColors[]; - - public ModelMask(String color[] /*3*/) { - this.textureWidth = 64; - this.textureHeight = 64; - this.HornBaseR = new ModelRenderer(this, 0, 35); - this.HornBaseR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.HornBaseR.addBox(-3.5F, -6.1F, -7.5F, 2, 2, 2, 0.0F); - this.setRotateAngle(HornBaseR, -0.17453292519943295F, 0.0F, 0.0F); - this.HornTipL = new ModelRenderer(this, 0, 39); - this.HornTipL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.HornTipL.addBox(2.0F, -0.5F, -10.8F, 1, 1, 2, 0.1F); - this.setRotateAngle(HornTipL, -0.7853981633974483F, 0.0F, 0.0F); - this.HornTipR = new ModelRenderer(this, 0, 39); - this.HornTipR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.HornTipR.addBox(-3.0F, -0.5F, -10.8F, 1, 1, 2, 0.1F); - this.setRotateAngle(HornTipR, -0.7853981633974483F, 0.0F, 0.0F); - this.Plate = new ModelRenderer(this, 0, 32); - this.Plate.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Plate.addBox(-4.0F, -7.0F, -5.0F, 8, 2, 1, 0.0F); - this.Band = new ModelRenderer(this, 0, 39); - this.Band.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Band.addBox(-4.0F, -6.5F, -4.0F, 8, 1, 8, 0.1F); - this.HornBaseL = new ModelRenderer(this, 0, 35); - this.HornBaseL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.HornBaseL.addBox(1.5F, -6.1F, -7.5F, 2, 2, 2, 0.0F); - this.setRotateAngle(HornBaseL, -0.17453292519943295F, 0.0F, 0.0F); - this.Plate.addChild(this.HornBaseR); - this.Plate.addChild(this.HornBaseL); - - this.bipedHead.addChild(this.Plate); - this.bipedHead.addChild(this.HornTipL); - this.bipedHead.addChild(this.HornTipR); - this.bipedHead.addChild(this.Band); - - Color = color; - } + String Color[]; + int rgbColors[]; - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - } + public ModelMask(String color[] /*3*/) + { + this.textureWidth = 64; + this.textureHeight = 64; + this.HornBaseR = new ModelRenderer(this, 0, 35); + this.HornBaseR.setRotationPoint(0.0F, 0.0F, 0.0F); + this.HornBaseR.addBox(-3.5F, -6.1F, -7.5F, 2, 2, 2, 0.0F); + this.setRotateAngle(HornBaseR, -0.17453292519943295F, 0.0F, 0.0F); + this.HornTipL = new ModelRenderer(this, 0, 39); + this.HornTipL.setRotationPoint(0.0F, 0.0F, 0.0F); + this.HornTipL.addBox(2.0F, -0.5F, -10.8F, 1, 1, 2, 0.1F); + this.setRotateAngle(HornTipL, -0.7853981633974483F, 0.0F, 0.0F); + this.HornTipR = new ModelRenderer(this, 0, 39); + this.HornTipR.setRotationPoint(0.0F, 0.0F, 0.0F); + this.HornTipR.addBox(-3.0F, -0.5F, -10.8F, 1, 1, 2, 0.1F); + this.setRotateAngle(HornTipR, -0.7853981633974483F, 0.0F, 0.0F); + this.Plate = new ModelRenderer(this, 0, 32); + this.Plate.setRotationPoint(0.0F, 0.0F, 0.0F); + this.Plate.addBox(-4.0F, -7.0F, -5.0F, 8, 2, 1, 0.0F); + this.Band = new ModelRenderer(this, 0, 39); + this.Band.setRotationPoint(0.0F, 0.0F, 0.0F); + this.Band.addBox(-4.0F, -6.5F, -4.0F, 8, 1, 8, 0.1F); + this.HornBaseL = new ModelRenderer(this, 0, 35); + this.HornBaseL.setRotationPoint(0.0F, 0.0F, 0.0F); + this.HornBaseL.addBox(1.5F, -6.1F, -7.5F, 2, 2, 2, 0.0F); + this.setRotateAngle(HornBaseL, -0.17453292519943295F, 0.0F, 0.0F); + this.Plate.addChild(this.HornBaseR); + this.Plate.addChild(this.HornBaseL); - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } + this.bipedHead.addChild(this.Plate); + this.bipedHead.addChild(this.HornTipL); + this.bipedHead.addChild(this.HornTipR); + this.bipedHead.addChild(this.Band); + + Color = color; + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + } + + /** + * This is a helper function from Tabula to set the rotation of model parts + */ + public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) + { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } } diff --git a/src/main/java/lance5057/tDefense/armor/renderers/ModelScarf.java b/src/main/java/lance5057/tDefense/armor/renderers/ModelScarf.java index 56d085e..1158394 100644 --- a/src/main/java/lance5057/tDefense/armor/renderers/ModelScarf.java +++ b/src/main/java/lance5057/tDefense/armor/renderers/ModelScarf.java @@ -11,39 +11,42 @@ import net.minecraft.entity.Entity; */ public class ModelScarf extends ModelBiped { - public ModelRenderer ScarfNeck; - public ModelRenderer ScarfExtra1; - public ModelRenderer ScarfExtra1_1; + public ModelRenderer ScarfNeck; + public ModelRenderer ScarfExtra1; + public ModelRenderer ScarfExtra1_1; - public ModelScarf() { - this.textureWidth = 64; - this.textureHeight = 64; - this.ScarfExtra1_1 = new ModelRenderer(this, 0, 32); - this.ScarfExtra1_1.setRotationPoint(0.0F, 1.0F, 3.5F); - this.ScarfExtra1_1.addBox(-3.0F, 0.0F, 0.0F, 3, 11, 1, 0.0F); - this.setRotateAngle(ScarfExtra1_1, 0.0F, 0.0F, 0.17453292519943295F); - this.ScarfNeck = new ModelRenderer(this, 8, 32); - this.ScarfNeck.setRotationPoint(0.0F, 0.0F, 0.0F); - this.ScarfNeck.addBox(-4.0F, -2.0F, -4.0F, 8, 3, 8, 0.6F); - this.ScarfExtra1 = new ModelRenderer(this, 8, 32); - this.ScarfExtra1.setRotationPoint(0.0F, 1.0F, 3.5F); - this.ScarfExtra1.addBox(-0.5F, 0.0F, 0.0F, 3, 7, 1, 0.0F); - this.setRotateAngle(ScarfExtra1, 0.0F, 0.0F, -0.17453292519943295F); - this.ScarfNeck.addChild(this.ScarfExtra1_1); - this.ScarfNeck.addChild(this.ScarfExtra1); - } + public ModelScarf() + { + this.textureWidth = 64; + this.textureHeight = 64; + this.ScarfExtra1_1 = new ModelRenderer(this, 0, 32); + this.ScarfExtra1_1.setRotationPoint(0.0F, 1.0F, 3.5F); + this.ScarfExtra1_1.addBox(-3.0F, 0.0F, 0.0F, 3, 11, 1, 0.0F); + this.setRotateAngle(ScarfExtra1_1, 0.0F, 0.0F, 0.17453292519943295F); + this.ScarfNeck = new ModelRenderer(this, 8, 32); + this.ScarfNeck.setRotationPoint(0.0F, 0.0F, 0.0F); + this.ScarfNeck.addBox(-4.0F, -2.0F, -4.0F, 8, 3, 8, 0.6F); + this.ScarfExtra1 = new ModelRenderer(this, 8, 32); + this.ScarfExtra1.setRotationPoint(0.0F, 1.0F, 3.5F); + this.ScarfExtra1.addBox(-0.5F, 0.0F, 0.0F, 3, 7, 1, 0.0F); + this.setRotateAngle(ScarfExtra1, 0.0F, 0.0F, -0.17453292519943295F); + this.ScarfNeck.addChild(this.ScarfExtra1_1); + this.ScarfNeck.addChild(this.ScarfExtra1); + } - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - this.ScarfNeck.render(f5); - } + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + this.ScarfNeck.render(f5); + } - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } + /** + * This is a helper function from Tabula to set the rotation of model parts + */ + public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) + { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } } diff --git a/src/main/java/lance5057/tDefense/armor/renderers/ModelSheath.java b/src/main/java/lance5057/tDefense/armor/renderers/ModelSheath.java index ba2b101..609908d 100644 --- a/src/main/java/lance5057/tDefense/armor/renderers/ModelSheath.java +++ b/src/main/java/lance5057/tDefense/armor/renderers/ModelSheath.java @@ -14,92 +14,96 @@ import cpw.mods.fml.client.FMLClientHandler; * ModelBiped - Either Mojang or a mod author * Created using Tabula 4.1.1 */ -public class ModelSheath extends ModelBiped { - public ModelRenderer sheath; - public ModelRenderer belt; - - String Color[]; - int rgbColors[]; - - public ModelSheath(String color[] /*4*/) { - this.textureWidth = 32; - this.textureHeight = 32; - this.belt = new ModelRenderer(this, 16, 0); - this.belt.setRotationPoint(-4.5F, 0.0F, 0.5F); - this.belt.addBox(0.0F, 0.0F, -3.0F, 1, 12, 5, 0.0F); - this.setRotateAngle(belt, 0.0F, 0.0F, -0.7853981633974483F); - this.sheath = new ModelRenderer(this, 0, 0); - this.sheath.setRotationPoint(-0.3F, 3.5F, 2.0F); - this.sheath.addBox(-3.0F, 0.0F, 0.0F, 6, 24, 2, 0.0F); - this.setRotateAngle(sheath, 0.0F, 0.0F, -0.45F); - - Color = color; - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - - GL11.glPushMatrix(); - - //Sheath Base - GL11.glPushMatrix(); - rgbColors = TinkersDefense.hexToRGB(Color[1]); - GL11.glColor3d((float)rgbColors[0]/255, (float)rgbColors[1]/255, (float)rgbColors[2]/255); - - GL11.glTranslatef(this.sheath.offsetX, this.sheath.offsetY, this.sheath.offsetZ); - GL11.glTranslatef(this.sheath.rotationPointX * f5, this.sheath.rotationPointY * f5, this.sheath.rotationPointZ * f5); - GL11.glScaled(0.65D, 0.65D, 0.5D); - GL11.glTranslatef(-this.sheath.offsetX, -this.sheath.offsetY, -this.sheath.offsetZ); - GL11.glTranslatef(-this.sheath.rotationPointX * f5, -this.sheath.rotationPointY * f5, -this.sheath.rotationPointZ * f5); - - this.sheath.render(f5); - GL11.glPopMatrix(); - - //Belt - GL11.glPushMatrix(); - FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("tinkersdefense:textures/armor/Sheath/_sheath_belt.png")); - - rgbColors = TinkersDefense.hexToRGB(Color[2]); - GL11.glColor3d((float)rgbColors[0]/255, (float)rgbColors[1]/255, (float)rgbColors[2]/255); - - this.belt.render(f5); - GL11.glPopMatrix(); - - //Buckle - GL11.glPushMatrix(); - FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("tinkersdefense:textures/armor/Sheath/_sheath_clasp.png")); - - rgbColors = TinkersDefense.hexToRGB(Color[3]); - GL11.glColor3d((float)rgbColors[0]/255, (float)rgbColors[1]/255, (float)rgbColors[2]/255); - - this.belt.render(f5); - GL11.glPopMatrix(); - - //Filigree - GL11.glPushMatrix(); - FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("tinkersdefense:textures/armor/Sheath/_sheath_filigree.png")); - - rgbColors = TinkersDefense.hexToRGB(Color[0]); - GL11.glColor3d((float)rgbColors[0]/255, (float)rgbColors[1]/255, (float)rgbColors[2]/255); - - GL11.glTranslatef(this.sheath.offsetX, this.sheath.offsetY, this.sheath.offsetZ); - GL11.glTranslatef(this.sheath.rotationPointX * f5, this.sheath.rotationPointY * f5, this.sheath.rotationPointZ * f5); - GL11.glScaled(0.65D, 0.65D, 0.5D); - GL11.glTranslatef(-this.sheath.offsetX, -this.sheath.offsetY, -this.sheath.offsetZ); - GL11.glTranslatef(-this.sheath.rotationPointX * f5, -this.sheath.rotationPointY * f5, -this.sheath.rotationPointZ * f5); - - this.sheath.render(f5); - GL11.glPopMatrix(); - - GL11.glPopMatrix(); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } +public class ModelSheath extends ModelBiped +{ + public ModelRenderer sheath; + public ModelRenderer belt; + + String Color[]; + int rgbColors[]; + + public ModelSheath(String color[] /*4*/) + { + this.textureWidth = 32; + this.textureHeight = 32; + this.belt = new ModelRenderer(this, 16, 0); + this.belt.setRotationPoint(-4.5F, 0.0F, 0.5F); + this.belt.addBox(0.0F, 0.0F, -3.0F, 1, 12, 5, 0.0F); + this.setRotateAngle(belt, 0.0F, 0.0F, -0.7853981633974483F); + this.sheath = new ModelRenderer(this, 0, 0); + this.sheath.setRotationPoint(-0.3F, 3.5F, 2.0F); + this.sheath.addBox(-3.0F, 0.0F, 0.0F, 6, 24, 2, 0.0F); + this.setRotateAngle(sheath, 0.0F, 0.0F, -0.45F); + + Color = color; + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + + GL11.glPushMatrix(); + + //Sheath Base + GL11.glPushMatrix(); + rgbColors = TinkersDefense.hexToRGB(Color[1]); + GL11.glColor3d((float) rgbColors[0] / 255, (float) rgbColors[1] / 255, (float) rgbColors[2] / 255); + + GL11.glTranslatef(this.sheath.offsetX, this.sheath.offsetY, this.sheath.offsetZ); + GL11.glTranslatef(this.sheath.rotationPointX * f5, this.sheath.rotationPointY * f5, this.sheath.rotationPointZ * f5); + GL11.glScaled(0.65D, 0.65D, 0.5D); + GL11.glTranslatef(-this.sheath.offsetX, -this.sheath.offsetY, -this.sheath.offsetZ); + GL11.glTranslatef(-this.sheath.rotationPointX * f5, -this.sheath.rotationPointY * f5, -this.sheath.rotationPointZ * f5); + + this.sheath.render(f5); + GL11.glPopMatrix(); + + //Belt + GL11.glPushMatrix(); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("tinkersdefense:textures/armor/Sheath/_sheath_belt.png")); + + rgbColors = TinkersDefense.hexToRGB(Color[2]); + GL11.glColor3d((float) rgbColors[0] / 255, (float) rgbColors[1] / 255, (float) rgbColors[2] / 255); + + this.belt.render(f5); + GL11.glPopMatrix(); + + //Buckle + GL11.glPushMatrix(); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("tinkersdefense:textures/armor/Sheath/_sheath_clasp.png")); + + rgbColors = TinkersDefense.hexToRGB(Color[3]); + GL11.glColor3d((float) rgbColors[0] / 255, (float) rgbColors[1] / 255, (float) rgbColors[2] / 255); + + this.belt.render(f5); + GL11.glPopMatrix(); + + //Filigree + GL11.glPushMatrix(); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("tinkersdefense:textures/armor/Sheath/_sheath_filigree.png")); + + rgbColors = TinkersDefense.hexToRGB(Color[0]); + GL11.glColor3d((float) rgbColors[0] / 255, (float) rgbColors[1] / 255, (float) rgbColors[2] / 255); + + GL11.glTranslatef(this.sheath.offsetX, this.sheath.offsetY, this.sheath.offsetZ); + GL11.glTranslatef(this.sheath.rotationPointX * f5, this.sheath.rotationPointY * f5, this.sheath.rotationPointZ * f5); + GL11.glScaled(0.65D, 0.65D, 0.5D); + GL11.glTranslatef(-this.sheath.offsetX, -this.sheath.offsetY, -this.sheath.offsetZ); + GL11.glTranslatef(-this.sheath.rotationPointX * f5, -this.sheath.rotationPointY * f5, -this.sheath.rotationPointZ * f5); + + this.sheath.render(f5); + GL11.glPopMatrix(); + + GL11.glPopMatrix(); + } + + /** + * This is a helper function from Tabula to set the rotation of model parts + */ + public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) + { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } } diff --git a/src/main/java/lance5057/tDefense/armor/renderers/cloth/ModelTinkersHood.java b/src/main/java/lance5057/tDefense/armor/renderers/cloth/ModelTinkersHood.java index 0ae93c0..077b6ca 100644 --- a/src/main/java/lance5057/tDefense/armor/renderers/cloth/ModelTinkersHood.java +++ b/src/main/java/lance5057/tDefense/armor/renderers/cloth/ModelTinkersHood.java @@ -1,82 +1,76 @@ package lance5057.tDefense.armor.renderers.cloth; import lance5057.tDefense.TinkersDefense; +import lance5057.tDefense.armor.renderers.ArmorRenderer; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import cpw.mods.fml.client.FMLClientHandler; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; /** * ModelBiped - Either Mojang or a mod author * Created using Tabula 4.1.1 */ -public class ModelTinkersHood extends ModelBiped { - public ModelRenderer Hood; - public ModelRenderer Flop; +public class ModelTinkersHood extends ArmorRenderer +{ + public ModelRenderer Hood; + public ModelRenderer Flop; + + public ModelTinkersHood(String[] colors, String defaultFolder, String[] textures) + { + super(1.1f, 0, 64, 64); + + this.textureWidth = 64; + this.textureHeight = 64; + + this.Hood = new ModelRenderer(this, 0, 44); + this.Hood.setRotationPoint(0.0F, 0.0F, 0.0F); + this.Hood.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0.5F); + this.bipedHead.addChild(this.Hood); + + this.Flop = new ModelRenderer(this, 0, 32); + this.Flop.setRotationPoint(0.0F, 0.0F, 0.0F); + this.Flop.addBox(-4.0F, -9.6F, 0.3F, 8, 8, 4, 0.0F); + this.setRotateAngle(Flop, -0.4553564018453205F, 0.0F, 0.0F); + this.bipedHead.addChild(this.Flop); + + this.bipedHeadwear.isHidden = true; + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + GL11.glPushMatrix(); + for(int i = 0; i < 3; i++) + { + GL11.glPushMatrix(); + + FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("tinkersdefense:textures/" + defaultFolder + "/" + textures[i] + ".png")); + + float size = 2.25f; + GL11.glScalef(1.5F / size, 1.5F / size, 1.5F / size); + GL11.glTranslatef(0.0F, 0F * f5, 0.0F); - public String[] colors; - - public String[] textures; - public String defaultFolder; - - public ModelTinkersHood(String[] colors, String defaultFolder, String[] textures) - { - super(1.1f, 0, 64,64); - - this.textureWidth = 64; - this.textureHeight = 64; - - this.colors = colors; - this.textures = textures; - this.defaultFolder = defaultFolder; - - this.Hood = new ModelRenderer(this, 0, 44); - this.Hood.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Hood.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0.5F); - this.bipedHead.addChild(this.Hood); - - this.Flop = new ModelRenderer(this, 0, 32); - this.Flop.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Flop.addBox(-4.0F, -9.6F, 0.3F, 8, 8, 4, 0.0F); - this.setRotateAngle(Flop, -0.4553564018453205F, 0.0F, 0.0F); - this.bipedHead.addChild(this.Flop); - - this.bipedHeadwear.isHidden = true; - } + int[] intColors = TinkersDefense.hexToRGB(colors[i]); + GL11.glColor3d((float) intColors[0] / 255, (float) intColors[1] / 255, (float) intColors[2] / 255); - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - GL11.glPushMatrix(); - for(int i = 0; i<3; i++) - { - GL11.glPushMatrix(); - - FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("tinkersdefense:textures/" + defaultFolder + "/" + textures[i] + ".png")); - - float size = 2.25f; - GL11.glScalef(1.5F / size, 1.5F / size, 1.5F / size); - GL11.glTranslatef(0.0F, 0F*f5, 0.0F); - - int[] intColors = TinkersDefense.hexToRGB(colors[i]); - GL11.glColor3d((float)intColors[0]/255, (float)intColors[1]/255, (float)intColors[2]/255); - - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - GL11.glPopMatrix(); - } - GL11.glPopMatrix(); - } + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + GL11.glPopMatrix(); + } + GL11.glPopMatrix(); + } - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } + /** + * This is a helper function from Tabula to set the rotation of model parts + */ + public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) + { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } } diff --git a/src/main/java/lance5057/tDefense/armor/renderers/cloth/ModelTinkersRobe.java b/src/main/java/lance5057/tDefense/armor/renderers/cloth/ModelTinkersRobe.java index 63634c8..024738d 100644 --- a/src/main/java/lance5057/tDefense/armor/renderers/cloth/ModelTinkersRobe.java +++ b/src/main/java/lance5057/tDefense/armor/renderers/cloth/ModelTinkersRobe.java @@ -1,7 +1,7 @@ package lance5057.tDefense.armor.renderers.cloth; import lance5057.tDefense.TinkersDefense; -import net.minecraft.client.model.ModelBiped; +import lance5057.tDefense.armor.renderers.ArmorRenderer; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; @@ -14,114 +14,108 @@ import cpw.mods.fml.client.FMLClientHandler; * ClothRobes - Undefined * Created using Tabula 4.1.1 */ -public class ModelTinkersRobe extends ModelBiped { - public ModelRenderer Left; - public ModelRenderer Right; - public ModelRenderer RightBack; - public ModelRenderer LeftFront; - public ModelRenderer RightFront; - public ModelRenderer Belt; - public ModelRenderer LeftBack; - - public String[] colors; - - public String[] textures; - public String defaultFolder; - - public ModelTinkersRobe(String[] colors, String defaultFolder, String[] textures) - { - super(1f, 0, 64,64); - - this.colors = colors; - this.textures = textures; - this.defaultFolder = defaultFolder; - - this.textureWidth = 64; - this.textureHeight = 64; - - this.Right = new ModelRenderer(this, 18, 41); - this.Right.mirror = true; - this.Right.setRotationPoint(0F, 0F, 0F); - this.Right.addBox(-2.5F, 0.0F, -2.5F, 6, 11, 5, 0.01F); - this.setRotateAngle(Right, 0.0F, 0.0F, 0.08726646259971647F); - this.bipedRightLeg.addChild(this.Right); - - this.RightBack = new ModelRenderer(this, 40, 43); - this.RightBack.mirror = true; - this.RightBack.setRotationPoint(0F, 0F, 0F); - this.RightBack.addBox(-2.5F, 0.27F, -0.6F, 6, 11, 3, 0.0F); - this.setRotateAngle(RightBack, 0.2617993877991494F, 0.0F, 0.08726646259971647F); - this.bipedRightLeg.addChild(this.RightBack); - - this.LeftBack = new ModelRenderer(this, 40, 43); - this.LeftBack.setRotationPoint(0F, 0F, 0F); - this.LeftBack.addBox(-3.5F, 0.27F, -0.6F, 6, 11, 3, 0.0F); - this.setRotateAngle(LeftBack, 0.2617993877991494F, 0.0F, -0.08726646259971647F); - this.bipedLeftLeg.addChild(this.LeftBack); - - this.Belt = new ModelRenderer(this, 0, 32); - this.Belt.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Belt.addBox(-6.8F, 10.0F, -3.0F, 10, 3, 6, 0.0F); - this.setRotateAngle(Belt, 0.0F, 0.0F, -0.13962634015954636F); - this.bipedBody.addChild(this.Belt); - - this.Left = new ModelRenderer(this, 18, 41); - this.Left.setRotationPoint(0F, 0F, 0F); - this.Left.addBox(-3.5F, 0.0F, -2.5F, 6, 11, 5, 0.01F); - this.setRotateAngle(Left, 0.0F, 0.0F, -0.08726646259971647F); - this.bipedLeftLeg.addChild(this.Left); - - this.LeftFront = new ModelRenderer(this, 0, 43); - this.LeftFront.setRotationPoint(0F, 0F, 0F); - this.LeftFront.addBox(-3.5F, 0.27F, -2.4F, 6, 11, 3, 0.0F); - this.setRotateAngle(LeftFront, -0.2617993877991494F, 0.0F, -0.08726646259971647F); - this.bipedLeftLeg.addChild(this.LeftFront); - - this.RightFront = new ModelRenderer(this, 0, 43); - this.RightFront.mirror = true; - this.RightFront.setRotationPoint(0F, 0F, 0F); - this.RightFront.addBox(-2.5F, 0.27F, -2.4F, 6, 11, 3, 0.0F); - this.setRotateAngle(RightFront, -0.2617993877991494F, 0.0F, 0.08726646259971647F); - this.bipedRightLeg.addChild(this.RightFront); - - //this.bipedBody.isHidden = true; - this.bipedHead.isHidden = true; - this.bipedHeadwear.isHidden = true; - //this.bipedRightLeg.isHidden = true; - //this.bipedLeftLeg.isHidden = true; - this.bipedRightArm.isHidden = true; - this.bipedLeftArm.isHidden = true; - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - GL11.glPushMatrix(); - for(int i = 0; i<2; i++) - { - GL11.glPushMatrix(); - - FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("tinkersdefense:textures/" + defaultFolder + "/" + textures[i] + ".png")); - - float size = 1.45f; - GL11.glScalef(1.0F / size, 1.0F / size, 1.0F / size); - GL11.glTranslatef(0F, -1.5F*f5, -0F); - - int[] intColors = TinkersDefense.hexToRGB(colors[i]); - GL11.glColor3d((float)intColors[0]/255, (float)intColors[1]/255, (float)intColors[2]/255); - - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - GL11.glPopMatrix(); - } - GL11.glPopMatrix(); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } +public class ModelTinkersRobe extends ArmorRenderer +{ + public ModelRenderer Left; + public ModelRenderer Right; + public ModelRenderer RightBack; + public ModelRenderer LeftFront; + public ModelRenderer RightFront; + public ModelRenderer Belt; + public ModelRenderer LeftBack; + + public ModelTinkersRobe(String[] colors, String defaultFolder, String[] textures) + { + super(1f, 0, 64, 64); + + this.textureWidth = 64; + this.textureHeight = 64; + + this.Right = new ModelRenderer(this, 18, 41); + this.Right.mirror = true; + this.Right.setRotationPoint(0F, 0F, 0F); + this.Right.addBox(-2.5F, 0.0F, -2.5F, 6, 11, 5, 0.01F); + this.setRotateAngle(Right, 0.0F, 0.0F, 0.08726646259971647F); + this.bipedRightLeg.addChild(this.Right); + + this.RightBack = new ModelRenderer(this, 40, 43); + this.RightBack.mirror = true; + this.RightBack.setRotationPoint(0F, 0F, 0F); + this.RightBack.addBox(-2.5F, 0.27F, -0.6F, 6, 11, 3, 0.0F); + this.setRotateAngle(RightBack, 0.2617993877991494F, 0.0F, 0.08726646259971647F); + this.bipedRightLeg.addChild(this.RightBack); + + this.LeftBack = new ModelRenderer(this, 40, 43); + this.LeftBack.setRotationPoint(0F, 0F, 0F); + this.LeftBack.addBox(-3.5F, 0.27F, -0.6F, 6, 11, 3, 0.0F); + this.setRotateAngle(LeftBack, 0.2617993877991494F, 0.0F, -0.08726646259971647F); + this.bipedLeftLeg.addChild(this.LeftBack); + + this.Belt = new ModelRenderer(this, 0, 32); + this.Belt.setRotationPoint(0.0F, 0.0F, 0.0F); + this.Belt.addBox(-6.8F, 10.0F, -3.0F, 10, 3, 6, 0.0F); + this.setRotateAngle(Belt, 0.0F, 0.0F, -0.13962634015954636F); + this.bipedBody.addChild(this.Belt); + + this.Left = new ModelRenderer(this, 18, 41); + this.Left.setRotationPoint(0F, 0F, 0F); + this.Left.addBox(-3.5F, 0.0F, -2.5F, 6, 11, 5, 0.01F); + this.setRotateAngle(Left, 0.0F, 0.0F, -0.08726646259971647F); + this.bipedLeftLeg.addChild(this.Left); + + this.LeftFront = new ModelRenderer(this, 0, 43); + this.LeftFront.setRotationPoint(0F, 0F, 0F); + this.LeftFront.addBox(-3.5F, 0.27F, -2.4F, 6, 11, 3, 0.0F); + this.setRotateAngle(LeftFront, -0.2617993877991494F, 0.0F, -0.08726646259971647F); + this.bipedLeftLeg.addChild(this.LeftFront); + + this.RightFront = new ModelRenderer(this, 0, 43); + this.RightFront.mirror = true; + this.RightFront.setRotationPoint(0F, 0F, 0F); + this.RightFront.addBox(-2.5F, 0.27F, -2.4F, 6, 11, 3, 0.0F); + this.setRotateAngle(RightFront, -0.2617993877991494F, 0.0F, 0.08726646259971647F); + this.bipedRightLeg.addChild(this.RightFront); + + //this.bipedBody.isHidden = true; + this.bipedHead.isHidden = true; + this.bipedHeadwear.isHidden = true; + //this.bipedRightLeg.isHidden = true; + //this.bipedLeftLeg.isHidden = true; + this.bipedRightArm.isHidden = true; + this.bipedLeftArm.isHidden = true; + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + GL11.glPushMatrix(); + for(int i = 0; i < 2; i++) + { + GL11.glPushMatrix(); + + FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("tinkersdefense:textures/" + defaultFolder + "/" + textures[i] + ".png")); + + float size = 1.45f; + GL11.glScalef(1.0F / size, 1.0F / size, 1.0F / size); + GL11.glTranslatef(0F, -1.5F * f5, -0F); + + int[] intColors = TinkersDefense.hexToRGB(colors[i]); + GL11.glColor3d((float) intColors[0] / 255, (float) intColors[1] / 255, (float) intColors[2] / 255); + + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + GL11.glPopMatrix(); + } + GL11.glPopMatrix(); + } + + /** + * This is a helper function from Tabula to set the rotation of model parts + */ + public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) + { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } } diff --git a/src/main/java/lance5057/tDefense/armor/renderers/cloth/ModelTinkersShawl.java b/src/main/java/lance5057/tDefense/armor/renderers/cloth/ModelTinkersShawl.java index 8ddb70b..37519b2 100644 --- a/src/main/java/lance5057/tDefense/armor/renderers/cloth/ModelTinkersShawl.java +++ b/src/main/java/lance5057/tDefense/armor/renderers/cloth/ModelTinkersShawl.java @@ -1,140 +1,134 @@ package lance5057.tDefense.armor.renderers.cloth; import lance5057.tDefense.TinkersDefense; +import lance5057.tDefense.armor.renderers.ArmorRenderer; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import cpw.mods.fml.client.FMLClientHandler; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; /** * ModelBiped - Either Mojang or a mod author * Created using Tabula 4.1.1 */ -public class ModelTinkersShawl extends ModelBiped { - public ModelRenderer ShawlLeft1; - public ModelRenderer ShawlLeft2; - public ModelRenderer ShawlRight1; - public ModelRenderer ShawlRight2; - public ModelRenderer Button; - public ModelRenderer TopLeft; - public ModelRenderer TopRight; - public ModelRenderer ArmLeft; - public ModelRenderer ArmRight; - public ModelRenderer Chest; - - public String[] colors; - - public String[] textures; - public String defaultFolder; - - public ModelTinkersShawl(String[] colors, String defaultFolder, String[] textures) - { - super(1f, 0, 64,64); - - this.colors = colors; - this.textures = textures; - this.defaultFolder = defaultFolder; - - this.textureWidth = 64; - this.textureHeight = 64; - - this.ArmLeft = new ModelRenderer(this, 48, 48); - this.ArmLeft.mirror = true; - this.ArmLeft.setRotationPoint(0.0F, 0.0F, 0.0F); - this.ArmLeft.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, 0.0F); - this.bipedLeftArm.addChild(this.ArmLeft); - - this.ArmRight = new ModelRenderer(this, 48, 48); - this.ArmRight.setRotationPoint(0.0F, 0.0F, 0.0F); - this.ArmRight.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, 0.0F); - this.bipedRightArm.addChild(this.ArmRight); - - this.Chest = new ModelRenderer(this, 40, 32); - this.Chest.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Chest.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, 0.0F); - this.bipedBody.addChild(this.Chest); - - this.TopRight = new ModelRenderer(this, 0, 52); - this.TopRight.mirror = true; - this.TopRight.setRotationPoint(0.0F, 0.0F, 0.0F); - this.TopRight.addBox(-3.5F, -2.3F, -3.0F, 9, 3, 6, -0.01F); - this.bipedRightArm.addChild(this.TopRight); - - this.Button = new ModelRenderer(this, 0, 61); - this.Button.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Button.addBox(0.0F, 0.0F, -3.5F, 2, 2, 1, 0.0F); - this.setRotateAngle(Button, 0.0F, 0.0F, 0.7853981633974483F); - this.bipedBody.addChild(this.Button); - - this.TopLeft = new ModelRenderer(this, 0, 52); - this.TopLeft.setRotationPoint(0.0F, 0.0F, 0.0F); - this.TopLeft.addBox(-5.5F, -2.3F, -3.0F, 9, 3, 6, -0.01F); - this.bipedLeftArm.addChild(this.TopLeft); - - this.ShawlRight1 = new ModelRenderer(this, 0, 32); - this.ShawlRight1.mirror = true; - this.ShawlRight1.setRotationPoint(0.0F, 0.0F, 0.0F); - this.ShawlRight1.addBox(-4.0F, -1.3F, -3.0F, 6, 5, 6, 0.0F); - this.setRotateAngle(ShawlRight1, 0.0F, 0.0F, 0.2617993877991494F); - this.bipedRightArm.addChild(this.ShawlRight1); - - this.ShawlRight2 = new ModelRenderer(this, 0, 43); - this.ShawlRight2.mirror = true; - this.ShawlRight2.setRotationPoint(0.0F, 0.0F, 0.0F); - this.ShawlRight2.addBox(-1.9F, 0.8F, -3.0F, 6, 3, 6, 0.01F); - this.setRotateAngle(ShawlRight2, 0.0F, 0.0F, -0.6981317007977318F); - this.bipedRightArm.addChild(this.ShawlRight2); - - this.ShawlLeft1 = new ModelRenderer(this, 0, 32); - this.ShawlLeft1.setRotationPoint(0.0F, 0.0F, 0.0F); - this.ShawlLeft1.addBox(-2.0F, -1.3F, -3.0F, 6, 5, 6, 0.0F); - this.setRotateAngle(ShawlLeft1, 0.0F, 0.0F, -0.2617993877991494F); - this.bipedLeftArm.addChild(this.ShawlLeft1); - - this.ShawlLeft2 = new ModelRenderer(this, 0, 43); - this.ShawlLeft2.setRotationPoint(0.0F, 0.0F, 0.0F); - this.ShawlLeft2.addBox(-4.1F, 0.8F, -3.0F, 6, 3, 6, 0.1F); - this.setRotateAngle(ShawlLeft2, 0.0F, 0.0F, 0.6981317007977318F); - this.bipedLeftArm.addChild(this.ShawlLeft2); - - this.bipedHead.isHidden = true; - this.bipedHeadwear.isHidden = true; - this.bipedCloak.isHidden = true; - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - GL11.glPushMatrix(); - for(int i = 0; i<3; i++) - { - GL11.glPushMatrix(); - - FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("tinkersdefense:textures/" + defaultFolder + "/" + textures[i] + ".png")); - - float size = 1.5f; - GL11.glScalef(1.0F / size, 1.0F / size, 1.0F / size); - GL11.glTranslatef(0F, -0F*f5, -0F); - - int[] intColors = TinkersDefense.hexToRGB(colors[i]); - GL11.glColor3d((float)intColors[0]/255, (float)intColors[1]/255, (float)intColors[2]/255); - - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - GL11.glPopMatrix(); - } - GL11.glPopMatrix(); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } +public class ModelTinkersShawl extends ArmorRenderer +{ + public ModelRenderer ShawlLeft1; + public ModelRenderer ShawlLeft2; + public ModelRenderer ShawlRight1; + public ModelRenderer ShawlRight2; + public ModelRenderer Button; + public ModelRenderer TopLeft; + public ModelRenderer TopRight; + public ModelRenderer ArmLeft; + public ModelRenderer ArmRight; + public ModelRenderer Chest; + + public ModelTinkersShawl(String[] colors, String defaultFolder, String[] textures) + { + super(1f, 0, 64, 64); + + this.textureWidth = 64; + this.textureHeight = 64; + + this.ArmLeft = new ModelRenderer(this, 48, 48); + this.ArmLeft.mirror = true; + this.ArmLeft.setRotationPoint(0.0F, 0.0F, 0.0F); + this.ArmLeft.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, 0.0F); + this.bipedLeftArm.addChild(this.ArmLeft); + + this.ArmRight = new ModelRenderer(this, 48, 48); + this.ArmRight.setRotationPoint(0.0F, 0.0F, 0.0F); + this.ArmRight.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, 0.0F); + this.bipedRightArm.addChild(this.ArmRight); + + this.Chest = new ModelRenderer(this, 40, 32); + this.Chest.setRotationPoint(0.0F, 0.0F, 0.0F); + this.Chest.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, 0.0F); + this.bipedBody.addChild(this.Chest); + + this.TopRight = new ModelRenderer(this, 0, 52); + this.TopRight.mirror = true; + this.TopRight.setRotationPoint(0.0F, 0.0F, 0.0F); + this.TopRight.addBox(-3.5F, -2.3F, -3.0F, 9, 3, 6, -0.01F); + this.bipedRightArm.addChild(this.TopRight); + + this.Button = new ModelRenderer(this, 0, 61); + this.Button.setRotationPoint(0.0F, 0.0F, 0.0F); + this.Button.addBox(0.0F, 0.0F, -3.5F, 2, 2, 1, 0.0F); + this.setRotateAngle(Button, 0.0F, 0.0F, 0.7853981633974483F); + this.bipedBody.addChild(this.Button); + + this.TopLeft = new ModelRenderer(this, 0, 52); + this.TopLeft.setRotationPoint(0.0F, 0.0F, 0.0F); + this.TopLeft.addBox(-5.5F, -2.3F, -3.0F, 9, 3, 6, -0.01F); + this.bipedLeftArm.addChild(this.TopLeft); + + this.ShawlRight1 = new ModelRenderer(this, 0, 32); + this.ShawlRight1.mirror = true; + this.ShawlRight1.setRotationPoint(0.0F, 0.0F, 0.0F); + this.ShawlRight1.addBox(-4.0F, -1.3F, -3.0F, 6, 5, 6, 0.0F); + this.setRotateAngle(ShawlRight1, 0.0F, 0.0F, 0.2617993877991494F); + this.bipedRightArm.addChild(this.ShawlRight1); + + this.ShawlRight2 = new ModelRenderer(this, 0, 43); + this.ShawlRight2.mirror = true; + this.ShawlRight2.setRotationPoint(0.0F, 0.0F, 0.0F); + this.ShawlRight2.addBox(-1.9F, 0.8F, -3.0F, 6, 3, 6, 0.01F); + this.setRotateAngle(ShawlRight2, 0.0F, 0.0F, -0.6981317007977318F); + this.bipedRightArm.addChild(this.ShawlRight2); + + this.ShawlLeft1 = new ModelRenderer(this, 0, 32); + this.ShawlLeft1.setRotationPoint(0.0F, 0.0F, 0.0F); + this.ShawlLeft1.addBox(-2.0F, -1.3F, -3.0F, 6, 5, 6, 0.0F); + this.setRotateAngle(ShawlLeft1, 0.0F, 0.0F, -0.2617993877991494F); + this.bipedLeftArm.addChild(this.ShawlLeft1); + + this.ShawlLeft2 = new ModelRenderer(this, 0, 43); + this.ShawlLeft2.setRotationPoint(0.0F, 0.0F, 0.0F); + this.ShawlLeft2.addBox(-4.1F, 0.8F, -3.0F, 6, 3, 6, 0.1F); + this.setRotateAngle(ShawlLeft2, 0.0F, 0.0F, 0.6981317007977318F); + this.bipedLeftArm.addChild(this.ShawlLeft2); + + this.bipedHead.isHidden = true; + this.bipedHeadwear.isHidden = true; + this.bipedCloak.isHidden = true; + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + GL11.glPushMatrix(); + for(int i = 0; i < 3; i++) + { + GL11.glPushMatrix(); + + FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("tinkersdefense:textures/" + defaultFolder + "/" + textures[i] + ".png")); + + float size = 1.5f; + GL11.glScalef(1.0F / size, 1.0F / size, 1.0F / size); + GL11.glTranslatef(0F, -0F * f5, -0F); + + int[] intColors = TinkersDefense.hexToRGB(colors[i]); + GL11.glColor3d((float) intColors[0] / 255, (float) intColors[1] / 255, (float) intColors[2] / 255); + + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + GL11.glPopMatrix(); + } + GL11.glPopMatrix(); + } + + /** + * This is a helper function from Tabula to set the rotation of model parts + */ + public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) + { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } } diff --git a/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersBreastplate.java b/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersBreastplate.java index d1c3fd5..fa4ee35 100644 --- a/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersBreastplate.java +++ b/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersBreastplate.java @@ -1,141 +1,136 @@ package lance5057.tDefense.armor.renderers.heavy; import lance5057.tDefense.TinkersDefense; +import lance5057.tDefense.armor.renderers.ArmorRenderer; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import cpw.mods.fml.client.FMLClientHandler; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; /** * ModelBiped - Either Mojang or a mod author * Created using Tabula 4.1.1 */ -public class ModelTinkersBreastplate extends ModelBiped +public class ModelTinkersBreastplate extends ArmorRenderer { - public ModelRenderer BackPlate; - public ModelRenderer BreastPlate; - public ModelRenderer Plackart; - public ModelRenderer PauldronR; - public ModelRenderer ArmGuardR; - public ModelRenderer PauldronL; - public ModelRenderer ArmGuardL; - public ModelRenderer ArmL; - public ModelRenderer ArmR; - public ModelRenderer BreastPlateFront; - - public String[] colors; - - public String[] textures; - public String defaultFolder; - - public ModelTinkersBreastplate(String[] colors, String defaultFolder, String[] textures) - { - super(1.1f, 0, 64,64); - - this.colors = colors; - this.textures = textures; - this.defaultFolder = defaultFolder; - - this.textureWidth = 64; - this.textureHeight = 64; - - this.BreastPlate = new ModelRenderer(this, 0, 32); - this.BreastPlate.setRotationPoint(0.0F, 0.0F, 0.0F); - this.BreastPlate.addBox(-4.0F, 0.1F, -3.6F, 8, 6, 4, 0.1F); - this.bipedBody.addChild(this.BreastPlate); - - this.BreastPlateFront = new ModelRenderer(this, 22, 56); - this.BreastPlateFront.setRotationPoint(0.0F, 0.0F, 0.0F); - this.BreastPlateFront.addBox(-3.0F, 0.5F, -4.2F, 6, 4, 4, 0.1F); - this.bipedBody.addChild(this.BreastPlateFront); - - this.Plackart = new ModelRenderer(this, 0, 42); - this.Plackart.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Plackart.addBox(-4.0F, 5.0F, -3.0F, 8, 7, 6, 0.0F); - this.bipedBody.addChild(this.Plackart); - - this.ArmGuardR = new ModelRenderer(this, 28, 44); - this.ArmGuardR.mirror = true; - this.ArmGuardR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.ArmGuardR.addBox(-4.0F, -2.1F, -3.0F, 5, 6, 6, 0.0F); - this.bipedRightArm.addChild(this.ArmGuardR); - - this.ArmGuardL = new ModelRenderer(this, 28, 44); - this.ArmGuardL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.ArmGuardL.addBox(-1.0F, -2.1F, -3.0F, 5, 6, 6, 0.0F); - this.bipedLeftArm.addChild(this.ArmGuardL); - - this.PauldronR = new ModelRenderer(this, 24, 32); - this.PauldronR.mirror = true; - this.PauldronR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.PauldronR.addBox(-4.6F, -2.0F, -3.5F, 4, 5, 7, 0.0F); - this.setRotateAngle(PauldronR, 0.0F, -0.0F, 0.4363323129985824F); - this.bipedRightArm.addChild(this.PauldronR); - - this.ArmL = new ModelRenderer(this, 48, 34); - this.ArmL.mirror = true; - this.ArmL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.ArmL.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, 0.0F); - this.setRotateAngle(ArmL, 0.0F, 0.0F, 0.0017453292519943296F); - this.bipedLeftArm.addChild(this.ArmL); - - this.ArmR = new ModelRenderer(this, 48, 34); - this.ArmR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.ArmR.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, 0.0F); - this.bipedRightArm.addChild(this.ArmR); - - this.BackPlate = new ModelRenderer(this, 0, 56); - this.BackPlate.setRotationPoint(0.0F, 0.0F, 0.0F); - this.BackPlate.addBox(-4.0F, 0.0F, 1.0F, 8, 5, 3, 0.0F); - this.setRotateAngle(BackPlate, -0.08726646006107329F, -0.0F, 0.0F); - this.bipedBody.addChild(this.BackPlate); - - this.PauldronL = new ModelRenderer(this, 24, 32); - this.PauldronL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.PauldronL.addBox(0.5F, -2.0F, -3.5F, 4, 5, 7, 0.0F); - this.setRotateAngle(PauldronL, 0.0F, -0.0F, -0.4363323129985824F); - this.bipedLeftArm.addChild(this.PauldronL); - - // this.ArmR.offsetX = this.ArmR.offsetX + 0.04f; - - this.bipedHead.isHidden = true; - this.bipedHeadwear.isHidden = true; - this.bipedCloak.isHidden = true; - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - GL11.glPushMatrix(); - for(int i = 0; i<4; i++) - { - GL11.glPushMatrix(); - - FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("tinkersdefense:textures/" + defaultFolder + "/" + textures[i] + ".png")); - - float size =1.5f; - GL11.glScalef(1.0F / size, 1.0F / size, 1.0F / size); - GL11.glTranslatef(0.0F, -0F*f5, 0.0F); - - int[] intColors = TinkersDefense.hexToRGB(colors[i]); - GL11.glColor3d((float)intColors[0]/255, (float)intColors[1]/255, (float)intColors[2]/255); - - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - GL11.glPopMatrix(); - } - GL11.glPopMatrix(); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } + public ModelRenderer BackPlate; + public ModelRenderer BreastPlate; + public ModelRenderer Plackart; + public ModelRenderer PauldronR; + public ModelRenderer ArmGuardR; + public ModelRenderer PauldronL; + public ModelRenderer ArmGuardL; + public ModelRenderer ArmL; + public ModelRenderer ArmR; + public ModelRenderer BreastPlateFront; + + public ModelTinkersBreastplate() + { + super(1f, 0, 64, 64); + + this.textureWidth = 64; + this.textureHeight = 64; + + this.BreastPlate = new ModelRenderer(this, 0, 32); + this.BreastPlate.setRotationPoint(0.0F, 0.0F, 0.0F); + this.BreastPlate.addBox(-4.0F, 0.1F, -3.6F, 8, 6, 4, 0.1F); + this.bipedBody.addChild(this.BreastPlate); + + this.BreastPlateFront = new ModelRenderer(this, 22, 56); + this.BreastPlateFront.setRotationPoint(0.0F, 0.0F, 0.0F); + this.BreastPlateFront.addBox(-3.0F, 0.5F, -4.2F, 6, 4, 4, 0.1F); + this.bipedBody.addChild(this.BreastPlateFront); + + this.Plackart = new ModelRenderer(this, 0, 42); + this.Plackart.setRotationPoint(0.0F, 0.0F, 0.0F); + this.Plackart.addBox(-4.0F, 5.0F, -3.0F, 8, 7, 6, 0.0F); + this.bipedBody.addChild(this.Plackart); + + this.ArmGuardR = new ModelRenderer(this, 28, 44); + this.ArmGuardR.mirror = true; + this.ArmGuardR.setRotationPoint(0.0F, 0.0F, 0.0F); + this.ArmGuardR.addBox(-4.0F, -2.0F, -3.0F, 5, 6, 6, 0.0F); + this.bipedRightArm.addChild(this.ArmGuardR); + + this.ArmGuardL = new ModelRenderer(this, 28, 44); + this.ArmGuardL.setRotationPoint(0.0F, 0.0F, 0.0F); + this.ArmGuardL.addBox(-1.0F, -2.0F, -3.0F, 5, 6, 6, 0.0F); + this.bipedLeftArm.addChild(this.ArmGuardL); + + this.PauldronR = new ModelRenderer(this, 24, 32); + this.PauldronR.mirror = true; + this.PauldronR.setRotationPoint(0.0F, 0.0F, 0.0F); + this.PauldronR.addBox(-4.6F, -2.0F, -3.5F, 4, 5, 7, 0.0F); + this.setRotateAngle(PauldronR, 0.0F, -0.0F, 0.4363323129985824F); + this.bipedRightArm.addChild(this.PauldronR); + + this.ArmL = new ModelRenderer(this, 48, 34); + this.ArmL.mirror = true; + this.ArmL.setRotationPoint(0.0F, 0.0F, 0.0F); + this.ArmL.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, 0.1F); + this.setRotateAngle(ArmL, 0.0F, 0.0F, 0.0017453292519943296F); + this.bipedLeftArm.addChild(this.ArmL); + + this.ArmR = new ModelRenderer(this, 48, 34); + this.ArmR.setRotationPoint(0.0F, 0.0F, 0.0F); + this.ArmR.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, 0.1F); + this.bipedRightArm.addChild(this.ArmR); + + this.BackPlate = new ModelRenderer(this, 0, 56); + this.BackPlate.setRotationPoint(0.0F, 0.0F, 0.0F); + this.BackPlate.addBox(-4.0F, 0.0F, 1.0F, 8, 5, 3, 0.0F); + this.setRotateAngle(BackPlate, -0.08726646006107329F, -0.0F, 0.0F); + this.bipedBody.addChild(this.BackPlate); + + this.PauldronL = new ModelRenderer(this, 24, 32); + this.PauldronL.setRotationPoint(0.0F, 0.0F, 0.0F); + this.PauldronL.addBox(0.5F, -2.0F, -3.5F, 4, 5, 7, 0.0F); + this.setRotateAngle(PauldronL, 0.0F, -0.0F, -0.4363323129985824F); + this.bipedLeftArm.addChild(this.PauldronL); + + // this.ArmR.offsetX = this.ArmR.offsetX + 0.04f; + + this.bipedHead.isHidden = true; + this.bipedHeadwear.isHidden = true; + this.bipedCloak.isHidden = true; + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + GL11.glPushMatrix(); + for(int i = 0; i < 4; i++) + { + GL11.glPushMatrix(); + + FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("tinkersdefense:textures/" + defaultFolder + "/" + textures[i] + ".png")); + + float size = 1.6f; + GL11.glScalef(1.0F / size, 1.0F / size, 1.0F / size); + GL11.glTranslatef(0.0F, -0.01F, 0.0F); + + int[] intColors = TinkersDefense.hexToRGB(colors[i]); + GL11.glColor3d((float) intColors[0] / 255, (float) intColors[1] / 255, (float) intColors[2] / 255); + + //setLivingAnimations((EntityLivingBase) entity, f,f1, f5); + super.render(entity, f, f1, f2, f3, f4, f5); + + GL11.glPopMatrix(); + } + GL11.glPopMatrix(); + } + + /** + * This is a helper function from Tabula to set the rotation of model parts + */ + public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) + { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } } diff --git a/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersGrieves.java b/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersGrieves.java index ecc00da..c5f59ff 100644 --- a/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersGrieves.java +++ b/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersGrieves.java @@ -1,122 +1,116 @@ package lance5057.tDefense.armor.renderers.heavy; import lance5057.tDefense.TinkersDefense; +import lance5057.tDefense.armor.renderers.ArmorRenderer; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import cpw.mods.fml.client.FMLClientHandler; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; /** * TinkersGrieves - Either Mojang or a mod author * Created using Tabula 4.1.1 */ -public class ModelTinkersGrieves extends ModelBiped { - public ModelRenderer LegPlateL; - public ModelRenderer CodPiece; - public ModelRenderer LegPlateBackL; - public ModelRenderer LegPlateBackR; - public ModelRenderer LegPlateR; - public ModelRenderer Belt; - public ModelRenderer LeftLeg; - public ModelRenderer RightLeg; - - public String[] colors; - - public String[] textures; - public String defaultFolder; - - public ModelTinkersGrieves(String[] colors, String defaultFolder, String[] textures) - { - super(1f, 0, 64,64); - - this.colors = colors; - this.textures = textures; - this.defaultFolder = defaultFolder; - - this.textureWidth = 64; - this.textureHeight = 64; - - this.LegPlateBackL = new ModelRenderer(this, 0, 43); - this.LegPlateBackL.mirror = true; - this.LegPlateBackL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.LegPlateBackL.addBox(-2.0F, 0.0F, 1.2F, 4, 5, 1, 0.1F); - this.setRotateAngle(LegPlateBackL, 0.2617993877991494F, 0.0F, 0.0F); - this.bipedLeftLeg.addChild(this.LegPlateBackL); - - this.LegPlateR = new ModelRenderer(this, 0, 32); - this.LegPlateR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.LegPlateR.addBox(1.1F, 0.0F, -1.9F, 1, 5, 4, 0.1F); - this.setRotateAngle(LegPlateR, 0.0F, 3.141592653589793F, 0.2617993877991494F); - this.bipedRightLeg.addChild(this.LegPlateR); - - this.LeftLeg = new ModelRenderer(this, 32, 32); - this.LeftLeg.mirror = true; - this.LeftLeg.setRotationPoint(0.0F, 0.0F, 0.0F); - this.LeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.0F); - this.bipedLeftLeg.addChild(this.LeftLeg); - - this.LegPlateL = new ModelRenderer(this, 0, 32); - this.LegPlateL.mirror = true; - this.LegPlateL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.LegPlateL.addBox(1.1F, 0.0F, -2.1F, 1, 5, 4, 0.1F); - this.setRotateAngle(LegPlateL, 0.0F, 0.0F, -0.2617993877991494F); - this.bipedLeftLeg.addChild(this.LegPlateL); - - this.CodPiece = new ModelRenderer(this, 0, 50); - this.CodPiece.setRotationPoint(0.0F, 0.0F, 0.0F); - this.CodPiece.addBox(-2.0F, 10.0F, -2.8F, 4, 4, 3, -0.4F); - this.bipedBody.addChild(this.CodPiece); - - this.LegPlateBackR = new ModelRenderer(this, 0, 43); - this.LegPlateBackR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.LegPlateBackR.addBox(-2.0F, 0.0F, 1.2F, 4, 5, 1, 0.1F); - this.setRotateAngle(LegPlateBackR, 0.2617993877991494F, 0.0F, 0.0F); - this.bipedRightLeg.addChild(this.LegPlateBackR); - - this.RightLeg = new ModelRenderer(this, 32, 32); - this.RightLeg.setRotationPoint(0.0F, 0.0F, 0.0F); - this.RightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.0F); - this.bipedRightLeg.addChild(this.RightLeg); - - this.Belt = new ModelRenderer(this, 0, 57); - this.Belt.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Belt.addBox(-4.5F, 10.0F, -2.5F, 9, 2, 5, -0.25F); - this.bipedBody.addChild(this.Belt); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - GL11.glPushMatrix(); - for(int i = 0; i<4; i++) - { - GL11.glPushMatrix(); - - FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("tinkersdefense:textures/" + defaultFolder + "/" + textures[i] + ".png")); - - float size =1.45f; - GL11.glScalef(1.0F / size, 1.0F / size, 1.0F / size); - GL11.glTranslatef(0F, -1F*f5, -0F); - - int[] intColors = TinkersDefense.hexToRGB(colors[i]); - GL11.glColor3d((float)intColors[0]/255, (float)intColors[1]/255, (float)intColors[2]/255); - - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - GL11.glPopMatrix(); - } - GL11.glPopMatrix(); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } +public class ModelTinkersGrieves extends ArmorRenderer +{ + public ModelRenderer LegPlateL; + public ModelRenderer CodPiece; + public ModelRenderer LegPlateBackL; + public ModelRenderer LegPlateBackR; + public ModelRenderer LegPlateR; + public ModelRenderer Belt; + public ModelRenderer LeftLeg; + public ModelRenderer RightLeg; + + public ModelTinkersGrieves() + { + super(1f, 0, 64, 64); + + this.textureWidth = 64; + this.textureHeight = 64; + + this.LegPlateBackL = new ModelRenderer(this, 0, 43); + this.LegPlateBackL.mirror = true; + this.LegPlateBackL.setRotationPoint(0.0F, 0.0F, 0.0F); + this.LegPlateBackL.addBox(-2.0F, 0.0F, 1.2F, 4, 5, 1, 0.1F); + this.setRotateAngle(LegPlateBackL, 0.2617993877991494F, 0.0F, 0.0F); + this.bipedLeftLeg.addChild(this.LegPlateBackL); + + this.LegPlateR = new ModelRenderer(this, 0, 32); + this.LegPlateR.setRotationPoint(0.0F, 0.0F, 0.0F); + this.LegPlateR.addBox(1.1F, 0.0F, -1.9F, 1, 5, 4, 0.1F); + this.setRotateAngle(LegPlateR, 0.0F, 3.141592653589793F, 0.2617993877991494F); + this.bipedRightLeg.addChild(this.LegPlateR); + + this.LeftLeg = new ModelRenderer(this, 32, 32); + this.LeftLeg.mirror = true; + this.LeftLeg.setRotationPoint(0.0F, 0.0F, 0.0F); + this.LeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.05F); + this.bipedLeftLeg.addChild(this.LeftLeg); + + this.LegPlateL = new ModelRenderer(this, 0, 32); + this.LegPlateL.mirror = true; + this.LegPlateL.setRotationPoint(0.0F, 0.0F, 0.0F); + this.LegPlateL.addBox(1.1F, 0.0F, -2.1F, 1, 5, 4, 0.1F); + this.setRotateAngle(LegPlateL, 0.0F, 0.0F, -0.2617993877991494F); + this.bipedLeftLeg.addChild(this.LegPlateL); + + this.CodPiece = new ModelRenderer(this, 0, 50); + this.CodPiece.setRotationPoint(0.0F, 0.0F, 0.0F); + this.CodPiece.addBox(-2.0F, 10.0F, -2.8F, 4, 4, 3, 0.2F); + this.bipedBody.addChild(this.CodPiece); + + this.LegPlateBackR = new ModelRenderer(this, 0, 43); + this.LegPlateBackR.setRotationPoint(0.0F, 0.0F, 0.0F); + this.LegPlateBackR.addBox(-2.0F, 0.0F, 1.2F, 4, 5, 1, 0.1F); + this.setRotateAngle(LegPlateBackR, 0.2617993877991494F, 0.0F, 0.0F); + this.bipedRightLeg.addChild(this.LegPlateBackR); + + this.RightLeg = new ModelRenderer(this, 32, 32); + this.RightLeg.setRotationPoint(0.0F, 0.0F, 0.0F); + this.RightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.05F); + this.bipedRightLeg.addChild(this.RightLeg); + + this.Belt = new ModelRenderer(this, 8, 56); + this.Belt.setRotationPoint(0.0F, 0.0F, 0.0F); + this.Belt.addBox(-4F, 10.0F, -3F, 8, 2, 6, 0.25F); + this.bipedBody.addChild(this.Belt); + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + GL11.glPushMatrix(); + for(int i = 0; i < 4; i++) + { + GL11.glPushMatrix(); + + FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("tinkersdefense:textures/" + defaultFolder + "/" + textures[i] + ".png")); + + float size = 1.6f; + GL11.glScalef(1.0F / size, 1.0F / size, 1.0F / size); + GL11.glTranslatef(0F, -0F * f5, -0F); + + int[] intColors = TinkersDefense.hexToRGB(colors[i]); + GL11.glColor3d((float) intColors[0] / 255, (float) intColors[1] / 255, (float) intColors[2] / 255); + + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + GL11.glPopMatrix(); + } + GL11.glPopMatrix(); + } + + /** + * This is a helper function from Tabula to set the rotation of model parts + */ + public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) + { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } } diff --git a/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersHelm.java b/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersHelm.java index 5c87cdb..78a0c83 100644 --- a/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersHelm.java +++ b/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersHelm.java @@ -1,92 +1,84 @@ package lance5057.tDefense.armor.renderers.heavy; import lance5057.tDefense.TinkersDefense; +import lance5057.tDefense.armor.renderers.ArmorRenderer; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import cpw.mods.fml.client.FMLClientHandler; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; /** * TinkerHelm - Either Mojang or a mod author * Created using Tabula 4.1.1 */ -public class ModelTinkersHelm extends ModelBiped +public class ModelTinkersHelm extends ArmorRenderer { - public ModelRenderer Visor; - public ModelRenderer Helm; - public ModelRenderer Trim; - - public String[] colors; - - public String[] textures; - public String defaultFolder; + public ModelRenderer Visor; + public ModelRenderer Helm; + public ModelRenderer Trim; + + public ModelTinkersHelm() + { + super(1.5f, 0, 64, 64); + + this.textureWidth = 64; + this.textureHeight = 64; + this.Helm = new ModelRenderer(this, 0, 47); + this.Helm.setRotationPoint(0.0F, 0.0F, 0.0F); + this.Helm.addBox(-4.0F, -8.0F, -4.0F, 8, 9, 8, 0.5F); + this.bipedHead.addChild(this.Helm); + + this.Visor = new ModelRenderer(this, 0, 32); + this.Visor.setRotationPoint(0.0F, 0.0F, 0.0F); + this.Visor.addBox(-4.5F, -6.5F, -4.7F, 9, 5, 8, 0.1F); + this.bipedHead.addChild(this.Visor); + + this.Trim = new ModelRenderer(this, 44, 47); + this.Trim.setRotationPoint(0.0F, 0.0F, 0.0F); + this.Trim.addBox(-1.0F, -8.3F, -4.0F, 2, 9, 8, 0.7F); + this.bipedHead.addChild(this.Trim); + + this.bipedBody.isHidden = true; + this.bipedCloak.isHidden = true; + this.bipedLeftArm.isHidden = true; + this.bipedLeftLeg.isHidden = true; + this.bipedRightArm.isHidden = true; + this.bipedRightLeg.isHidden = true; + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + GL11.glPushMatrix(); + for(int i = 0; i < 3; i++) + { + GL11.glPushMatrix(); + + FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("tinkersdefense:textures/" + defaultFolder + "/" + textures[i] + ".png")); - public ModelTinkersHelm(String[] colors, String defaultFolder, String[] textures) - { - super(1.5f, 0, 64,64); - - this.colors = colors; - this.textures = textures; - this.defaultFolder = defaultFolder; - - this.textureWidth = 64; - this.textureHeight = 64; - this.Helm = new ModelRenderer(this, 0, 47); - this.Helm.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Helm.addBox(-4.0F, -8.0F, -4.0F, 8, 9, 8, 0.5F); - this.bipedHead.addChild(this.Helm); - - this.Visor = new ModelRenderer(this, 0, 32); - this.Visor.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Visor.addBox(-4.5F, -6.5F, -4.7F, 9, 5, 8, 0.1F); - this.bipedHead.addChild(this.Visor); - - this.Trim = new ModelRenderer(this, 44, 47); - this.Trim.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Trim.addBox(-1.0F, -8.3F, -4.0F, 2, 9, 8, 0.7F); - this.bipedHead.addChild(this.Trim); - - this.bipedBody.isHidden = true; - this.bipedCloak.isHidden = true; - this.bipedLeftArm.isHidden = true; - this.bipedLeftLeg.isHidden = true; - this.bipedRightArm.isHidden = true; - this.bipedRightLeg.isHidden = true; - } + float size = 2.5f; + GL11.glScalef(1.5F / size, 1.5F / size, 1.5F / size); + GL11.glTranslatef(0.0F, -0F * f5, 0.0F); + int[] intColors = TinkersDefense.hexToRGB(colors[i]); + GL11.glColor3d((float) intColors[0] / 255, (float) intColors[1] / 255, (float) intColors[2] / 255); - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glPushMatrix(); - for(int i = 0; i<3; i++) - { - GL11.glPushMatrix(); - - FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("tinkersdefense:textures/" + defaultFolder + "/" + textures[i] + ".png")); - - float size = 2.5f; - GL11.glScalef(1.5F / size, 1.5F / size, 1.5F / size); - GL11.glTranslatef(0.0F, -0F * f5, 0.0F); - int[] intColors = TinkersDefense.hexToRGB(colors[i]); - GL11.glColor3d((float)intColors[0]/255, (float)intColors[1]/255, (float)intColors[2]/255); - - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - GL11.glPopMatrix(); - } - GL11.glPopMatrix(); - } + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + GL11.glPopMatrix(); + } + GL11.glPopMatrix(); + } - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } + /** + * This is a helper function from Tabula to set the rotation of model parts + */ + public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) + { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } } diff --git a/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersSabatons.java b/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersSabatons.java index e8f8963..1a948aa 100644 --- a/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersSabatons.java +++ b/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersSabatons.java @@ -1,159 +1,148 @@ package lance5057.tDefense.armor.renderers.heavy; -import java.io.File; - import lance5057.tDefense.TinkersDefense; +import lance5057.tDefense.armor.renderers.ArmorRenderer; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; -import tconstruct.library.TConstructRegistry; import cpw.mods.fml.client.FMLClientHandler; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; /** * ModelBiped - Either Mojang or a mod author * Created using Tabula 4.1.1 */ -public class ModelTinkersSabatons extends ModelBiped +public class ModelTinkersSabatons extends ArmorRenderer { - public ModelRenderer BootL; - public ModelRenderer KneeGuardR; - public ModelRenderer ShinGuardL; - public ModelRenderer KneeGuardCapL; - public ModelRenderer LegBackL; - public ModelRenderer BootR; - public ModelRenderer ShinGuardR; - public ModelRenderer BootCapR; - public ModelRenderer BootCapL; - public ModelRenderer LegBackR; - public ModelRenderer KneeGuardL; - public ModelRenderer KneeGuardCapR; - - public String[] colors; - - public String[] textures; - public String defaultFolder; - - public ModelTinkersSabatons(String[] colors, String defaultFolder, String[] textures) - { - super(1f, 0, 64,64); - - this.colors = colors; - this.textures = textures; - this.defaultFolder = defaultFolder; - - this.textureWidth = 64; - this.textureHeight = 64; - - this.ShinGuardL = new ModelRenderer(this, 0, 48); - this.ShinGuardL.mirror = true; - this.ShinGuardL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.ShinGuardL.addBox(-2.0F, 4.0F, -2.6F, 4, 5, 3, 0.11F); - this.setRotateAngle(ShinGuardL, 0.05759586531581287F, 0.0F, 0.0F); - this.bipedLeftLeg.addChild(this.ShinGuardL); - - this.KneeGuardL = new ModelRenderer(this, 6, 32); - this.KneeGuardL.mirror = true; - this.KneeGuardL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.KneeGuardL.addBox(-2.0F, 3.0F, -2.5F, 4, 3, 4, 0.2F); - this.bipedLeftLeg.addChild(this.KneeGuardL); - - this.BootL = new ModelRenderer(this, 0, 56); - this.BootL.mirror = true; - this.BootL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.BootL.addBox(-2.0F, 9.0F, -3.0F, 4, 3, 5, 0.2F); - this.bipedLeftLeg.addChild(this.BootL); - - this.KneeGuardCapL = new ModelRenderer(this, 0, 37); - this.KneeGuardCapL.mirror = true; - this.KneeGuardCapL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.KneeGuardCapL.addBox(-1.0F, 2.4F, -3.0F, 2, 2, 1, 0.2F); - this.bipedLeftLeg.addChild(this.KneeGuardCapL); - - this.KneeGuardR = new ModelRenderer(this, 6, 32); - this.KneeGuardR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.KneeGuardR.addBox(-2.0F, 3.0F, -2.5F, 4, 3, 4, 0.2F); - this.bipedRightLeg.addChild(this.KneeGuardR); - - this.LegBackL = new ModelRenderer(this, 0, 40); - this.LegBackL.mirror = true; - this.LegBackL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.LegBackL.addBox(-2.0F, 3.0F, -2.6F, 4, 6, 2, 0.1F); - this.setRotateAngle(LegBackL, 0.05759586531581287F, 3.141592653589793F, 0.0F); - this.bipedLeftLeg.addChild(this.LegBackL); - - this.BootCapL = new ModelRenderer(this, 0, 33); - this.BootCapL.mirror = true; - this.BootCapL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.BootCapL.addBox(-1.0F, 9.1F, -5.2F, 2, 2, 1, 0.2F); - this.setRotateAngle(BootCapL, 0.17453292519943295F, 0.0F, 0.0F); - this.bipedLeftLeg.addChild(this.BootCapL); - - this.KneeGuardCapR = new ModelRenderer(this, 0, 37); - this.KneeGuardCapR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.KneeGuardCapR.addBox(-1.0F, 2.4F, -3.0F, 2, 2, 1, 0.2F); - this.bipedRightLeg.addChild(this.KneeGuardCapR); - - this.BootR = new ModelRenderer(this, 0, 56); - this.BootR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.BootR.addBox(-2.0F, 9.0F, -3.0F, 4, 3, 5, 0.2F); - this.bipedRightLeg.addChild(this.BootR); - - this.ShinGuardR = new ModelRenderer(this, 0, 48); - this.ShinGuardR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.ShinGuardR.addBox(-2.0F, 4.0F, -2.6F, 4, 5, 3, 0.11F); - this.setRotateAngle(ShinGuardR, 0.05759586531581287F, 0.0F, 0.0F); - this.bipedRightLeg.addChild(this.ShinGuardR); - - this.LegBackR = new ModelRenderer(this, 0, 40); - this.LegBackR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.LegBackR.addBox(-2.0F, 3.0F, -2.6F, 4, 6, 2, 0.1F); - this.setRotateAngle(LegBackR, 0.05759586531581287F, 3.141592653589793F, 0.0F); - this.bipedRightLeg.addChild(this.LegBackR); - - this.BootCapR = new ModelRenderer(this, 0, 33); - this.BootCapR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.BootCapR.addBox(-1.0F, 9.1F, -5.2F, 2, 2, 1, 0.2F); - this.setRotateAngle(BootCapR, 0.17453292519943295F, 0.0F, 0.0F); - this.bipedRightLeg.addChild(this.BootCapR); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - GL11.glPushMatrix(); - - for(int i = 0; i<4; i++) - { - //TConstructRegistry.getCustomMaterial(arg0, arg1) - GL11.glPushMatrix(); - ResourceLocation texture = new ResourceLocation("tinkersdefense:textures/" + defaultFolder + "/" + textures[i] + ".png"); - //Boolean exists = new File(texture.getResourceDomain() + ":" + texture.getResourcePath()).exists(); - FMLClientHandler.instance().getClient().renderEngine.bindTexture(texture); - - - float size =1.5f; - GL11.glScalef(1.0F / size, 1.0F / size, 1.0F / size); - GL11.glTranslatef(0.0F, -1F*f5, 0.0F); - - int[] intColors = TinkersDefense.hexToRGB(colors[i]); - GL11.glColor3d((float)intColors[0]/255, (float)intColors[1]/255, (float)intColors[2]/255); - - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - GL11.glPopMatrix(); - } - GL11.glPopMatrix(); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } + public ModelRenderer BootL; + public ModelRenderer KneeGuardR; + public ModelRenderer ShinGuardL; + public ModelRenderer KneeGuardCapL; + public ModelRenderer LegBackL; + public ModelRenderer BootR; + public ModelRenderer ShinGuardR; + public ModelRenderer BootCapR; + public ModelRenderer BootCapL; + public ModelRenderer LegBackR; + public ModelRenderer KneeGuardL; + public ModelRenderer KneeGuardCapR; + + public ModelTinkersSabatons() + { + super(1f, 0, 64, 64); + + this.textureWidth = 64; + this.textureHeight = 64; + + this.ShinGuardL = new ModelRenderer(this, 0, 48); + this.ShinGuardL.mirror = true; + this.ShinGuardL.setRotationPoint(0.0F, 0.0F, 0.0F); + this.ShinGuardL.addBox(-2.0F, 4.0F, -2.6F, 4, 5, 3, 0.11F); + this.setRotateAngle(ShinGuardL, 0.05759586531581287F, 0.0F, 0.0F); + this.bipedLeftLeg.addChild(this.ShinGuardL); + + this.KneeGuardL = new ModelRenderer(this, 6, 32); + this.KneeGuardL.mirror = true; + this.KneeGuardL.setRotationPoint(0.0F, 0.0F, 0.0F); + this.KneeGuardL.addBox(-2.0F, 3.0F, -2.5F, 4, 3, 4, 0.2F); + this.bipedLeftLeg.addChild(this.KneeGuardL); + + this.BootL = new ModelRenderer(this, 0, 56); + this.BootL.mirror = true; + this.BootL.setRotationPoint(0.0F, 0.0F, 0.0F); + this.BootL.addBox(-2.0F, 9.0F, -3.0F, 4, 3, 5, 0.2F); + this.bipedLeftLeg.addChild(this.BootL); + + this.KneeGuardCapL = new ModelRenderer(this, 0, 37); + this.KneeGuardCapL.mirror = true; + this.KneeGuardCapL.setRotationPoint(0.0F, 0.0F, 0.0F); + this.KneeGuardCapL.addBox(-1.0F, 2.4F, -3.0F, 2, 2, 1, 0.2F); + this.bipedLeftLeg.addChild(this.KneeGuardCapL); + + this.KneeGuardR = new ModelRenderer(this, 6, 32); + this.KneeGuardR.setRotationPoint(0.0F, 0.0F, 0.0F); + this.KneeGuardR.addBox(-2.0F, 3.0F, -2.5F, 4, 3, 4, 0.2F); + this.bipedRightLeg.addChild(this.KneeGuardR); + + this.LegBackL = new ModelRenderer(this, 0, 40); + this.LegBackL.mirror = true; + this.LegBackL.setRotationPoint(0.0F, 0.0F, 0.0F); + this.LegBackL.addBox(-2.0F, 3.0F, -2.6F, 4, 6, 2, 0.1F); + this.setRotateAngle(LegBackL, 0.05759586531581287F, 3.141592653589793F, 0.0F); + this.bipedLeftLeg.addChild(this.LegBackL); + + this.BootCapL = new ModelRenderer(this, 0, 33); + this.BootCapL.mirror = true; + this.BootCapL.setRotationPoint(0.0F, 0.0F, 0.0F); + this.BootCapL.addBox(-1.0F, 9.1F, -5.2F, 2, 2, 1, 0.2F); + this.setRotateAngle(BootCapL, 0.17453292519943295F, 0.0F, 0.0F); + this.bipedLeftLeg.addChild(this.BootCapL); + + this.KneeGuardCapR = new ModelRenderer(this, 0, 37); + this.KneeGuardCapR.setRotationPoint(0.0F, 0.0F, 0.0F); + this.KneeGuardCapR.addBox(-1.0F, 2.4F, -3.0F, 2, 2, 1, 0.2F); + this.bipedRightLeg.addChild(this.KneeGuardCapR); + + this.BootR = new ModelRenderer(this, 0, 56); + this.BootR.setRotationPoint(0.0F, 0.0F, 0.0F); + this.BootR.addBox(-2.0F, 9.0F, -3.0F, 4, 3, 5, 0.2F); + this.bipedRightLeg.addChild(this.BootR); + + this.ShinGuardR = new ModelRenderer(this, 0, 48); + this.ShinGuardR.setRotationPoint(0.0F, 0.0F, 0.0F); + this.ShinGuardR.addBox(-2.0F, 4.0F, -2.6F, 4, 5, 3, 0.11F); + this.setRotateAngle(ShinGuardR, 0.05759586531581287F, 0.0F, 0.0F); + this.bipedRightLeg.addChild(this.ShinGuardR); + + this.LegBackR = new ModelRenderer(this, 0, 40); + this.LegBackR.setRotationPoint(0.0F, 0.0F, 0.0F); + this.LegBackR.addBox(-2.0F, 3.0F, -2.6F, 4, 6, 2, 0.1F); + this.setRotateAngle(LegBackR, 0.05759586531581287F, 3.141592653589793F, 0.0F); + this.bipedRightLeg.addChild(this.LegBackR); + + this.BootCapR = new ModelRenderer(this, 0, 33); + this.BootCapR.setRotationPoint(0.0F, 0.0F, 0.0F); + this.BootCapR.addBox(-1.0F, 9.1F, -5.2F, 2, 2, 1, 0.2F); + this.setRotateAngle(BootCapR, 0.17453292519943295F, 0.0F, 0.0F); + this.bipedRightLeg.addChild(this.BootCapR); + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + GL11.glPushMatrix(); + + for(int i = 0; i < 4; i++) + { + //TConstructRegistry.getCustomMaterial(arg0, arg1) + GL11.glPushMatrix(); + ResourceLocation texture = new ResourceLocation("tinkersdefense:textures/" + defaultFolder + "/" + textures[i] + ".png"); + //Boolean exists = new File(texture.getResourceDomain() + ":" + texture.getResourcePath()).exists(); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(texture); + + float size = 1.6f; + GL11.glScalef(1.0F / size, 1.0F / size, 1.0F / size); + GL11.glTranslatef(0.0F, -0F * f5, 0.0F); + + int[] intColors = TinkersDefense.hexToRGB(colors[i]); + GL11.glColor3d((float) intColors[0] / 255, (float) intColors[1] / 255, (float) intColors[2] / 255); + + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + GL11.glPopMatrix(); + } + GL11.glPopMatrix(); + } + + /** + * This is a helper function from Tabula to set the rotation of model parts + */ + public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) + { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } } diff --git a/src/main/java/lance5057/tDefense/armor/renderers/light/ModelTinkersBoots.java b/src/main/java/lance5057/tDefense/armor/renderers/light/ModelTinkersBoots.java index 9144d38..d10ea48 100644 --- a/src/main/java/lance5057/tDefense/armor/renderers/light/ModelTinkersBoots.java +++ b/src/main/java/lance5057/tDefense/armor/renderers/light/ModelTinkersBoots.java @@ -1,7 +1,7 @@ package lance5057.tDefense.armor.renderers.light; import lance5057.tDefense.TinkersDefense; -import net.minecraft.client.model.ModelBiped; +import lance5057.tDefense.armor.renderers.ArmorRenderer; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; @@ -14,78 +14,72 @@ import cpw.mods.fml.client.FMLClientHandler; * ModelBiped - Either Mojang or a mod author * Created using Tabula 4.1.1 */ -public class ModelTinkersBoots extends ModelBiped +public class ModelTinkersBoots extends ArmorRenderer { - public ModelRenderer LegR; - public ModelRenderer LegL; - public ModelRenderer FootL; - public ModelRenderer FootR; - - public String[] colors; - - public String[] textures; - public String defaultFolder; - - public ModelTinkersBoots(String[] colors, String defaultFolder, String[] textures) { - super(1.1f, 0, 64,64); - - this.textureWidth = 64; - this.textureHeight = 64; - - this.colors = colors; - this.textures = textures; - this.defaultFolder = defaultFolder; - - this.FootL = new ModelRenderer(this, 0, 43); - this.FootL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.FootL.addBox(-2.0F, 10.0F, -3.0F, 4, 2, 1, 0.0F); - this.bipedLeftLeg.addChild(this.FootL); - - this.LegL = new ModelRenderer(this, 0, 48); - this.LegL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.LegL.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.0F); - this.bipedLeftLeg.addChild(this.LegL); - - this.FootR = new ModelRenderer(this, 0, 43); - this.FootR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.FootR.addBox(-2.0F, 10.0F, -3.0F, 4, 2, 1, 0.0F); - this.bipedRightLeg.addChild(this.FootR); - - this.LegR = new ModelRenderer(this, 0, 48); - this.LegR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.LegR.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.0F); - this.bipedRightLeg.addChild(this.LegR); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - GL11.glPushMatrix(); - for(int i = 0; i<3; i++) - { - GL11.glPushMatrix(); - - FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("tinkersdefense:textures/" + defaultFolder + "/" + textures[i] + ".png")); - - float size =1.45f; - GL11.glScalef(1.0F / size, 1.0F / size, 1.0F / size); - GL11.glTranslatef(0.0F, -1F*f5, 0.0F); - - int[] intColors = TinkersDefense.hexToRGB(colors[i]); - GL11.glColor3d((float)intColors[0]/255, (float)intColors[1]/255, (float)intColors[2]/255); - - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - GL11.glPopMatrix(); - } - GL11.glPopMatrix(); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } + public ModelRenderer LegR; + public ModelRenderer LegL; + public ModelRenderer FootL; + public ModelRenderer FootR; + + public ModelTinkersBoots(String[] colors, String defaultFolder, String[] textures) + { + super(1.1f, 0, 64, 64); + + this.textureWidth = 64; + this.textureHeight = 64; + + this.FootL = new ModelRenderer(this, 0, 43); + this.FootL.setRotationPoint(0.0F, 0.0F, 0.0F); + this.FootL.addBox(-2.0F, 10.0F, -3.0F, 4, 2, 1, 0.0F); + this.bipedLeftLeg.addChild(this.FootL); + + this.LegL = new ModelRenderer(this, 0, 48); + this.LegL.setRotationPoint(0.0F, 0.0F, 0.0F); + this.LegL.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.0F); + this.bipedLeftLeg.addChild(this.LegL); + + this.FootR = new ModelRenderer(this, 0, 43); + this.FootR.setRotationPoint(0.0F, 0.0F, 0.0F); + this.FootR.addBox(-2.0F, 10.0F, -3.0F, 4, 2, 1, 0.0F); + this.bipedRightLeg.addChild(this.FootR); + + this.LegR = new ModelRenderer(this, 0, 48); + this.LegR.setRotationPoint(0.0F, 0.0F, 0.0F); + this.LegR.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.0F); + this.bipedRightLeg.addChild(this.LegR); + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + GL11.glPushMatrix(); + for(int i = 0; i < 3; i++) + { + GL11.glPushMatrix(); + + FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("tinkersdefense:textures/" + defaultFolder + "/" + textures[i] + ".png")); + + float size = 1.45f; + GL11.glScalef(1.0F / size, 1.0F / size, 1.0F / size); + GL11.glTranslatef(0.0F, -1F * f5, 0.0F); + + int[] intColors = TinkersDefense.hexToRGB(colors[i]); + GL11.glColor3d((float) intColors[0] / 255, (float) intColors[1] / 255, (float) intColors[2] / 255); + + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + GL11.glPopMatrix(); + } + GL11.glPopMatrix(); + } + + /** + * This is a helper function from Tabula to set the rotation of model parts + */ + public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) + { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } } diff --git a/src/main/java/lance5057/tDefense/armor/renderers/light/ModelTinkersChausses.java b/src/main/java/lance5057/tDefense/armor/renderers/light/ModelTinkersChausses.java index c9326e7..6936d01 100644 --- a/src/main/java/lance5057/tDefense/armor/renderers/light/ModelTinkersChausses.java +++ b/src/main/java/lance5057/tDefense/armor/renderers/light/ModelTinkersChausses.java @@ -1,7 +1,7 @@ package lance5057.tDefense.armor.renderers.light; import lance5057.tDefense.TinkersDefense; -import net.minecraft.client.model.ModelBiped; +import lance5057.tDefense.armor.renderers.ArmorRenderer; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; @@ -14,104 +14,99 @@ import cpw.mods.fml.client.FMLClientHandler; * ModelBiped - Either Mojang or a mod author * Created using Tabula 4.1.1 */ -public class ModelTinkersChausses extends ModelBiped { - public ModelRenderer LegL; - public ModelRenderer FrontL; - public ModelRenderer HipGuardL; - public ModelRenderer HipGuardR; - public ModelRenderer LegR; - public ModelRenderer BackL; - public ModelRenderer FrontR; - public ModelRenderer BackR; - - public String[] colors; - - public String[] textures; - public String defaultFolder; - - public ModelTinkersChausses(String[] colors, String defaultFolder, String[] textures) { - super(1.1f, 0, 64,64); - - this.textureWidth = 64; - this.textureHeight = 64; - - this.colors = colors; - this.textures = textures; - this.defaultFolder = defaultFolder; - - this.HipGuardR = new ModelRenderer(this, 10, 37); - this.HipGuardR.setRotationPoint(0F, 0F, 0F); - this.HipGuardR.addBox(-2.5F, 0.0F, -2.5F, 4, 6, 5, 0.0F); - this.setRotateAngle(HipGuardR, 0.0F, 0.0F, 0.17453292519943295F); - this.bipedRightLeg.addChild(this.HipGuardR); - - this.LegL = new ModelRenderer(this, 0, 48); - this.LegL.setRotationPoint(0F, 0F, 0F); - this.LegL.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.0F); - this.bipedLeftLeg.addChild(this.LegL); - - this.BackR = new ModelRenderer(this, 0, 40); - this.BackR.setRotationPoint(0F, 0F, 0F); - this.BackR.addBox(-0.1F, 0.0F, 1.7F, 4, 7, 1, 0.01F); - this.bipedRightLeg.addChild(this.BackR); - - this.FrontL = new ModelRenderer(this, 0, 40); - this.FrontL.setRotationPoint(0F, 0F, 0F); - this.FrontL.addBox(-4.0F, 0.0F, -2.7F, 4, 7, 1, 0.0F); - this.bipedLeftLeg.addChild(this.FrontL); - - this.LegR = new ModelRenderer(this, 0, 48); - this.LegR.setRotationPoint(0F, 0F, 0F); - this.LegR.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.0F); - this.bipedRightLeg.addChild(this.LegR); - - this.BackL = new ModelRenderer(this, 0, 40); - this.BackL.setRotationPoint(0F, 0F, 0F); - this.BackL.addBox(-4.0F, 0.0F, 1.7F, 4, 7, 1, 0.0F); - this.bipedLeftLeg.addChild(this.BackL); - - this.FrontR = new ModelRenderer(this, 0, 40); - this.FrontR.setRotationPoint(0F, 0F, 0F); - this.FrontR.addBox(-0.1F, 0.0F, -2.7F, 4, 7, 1, 0.01F); - this.bipedRightLeg.addChild(this.FrontR); - - this.HipGuardL = new ModelRenderer(this, 10, 37); - this.HipGuardL.mirror = true; - this.HipGuardL.setRotationPoint(0F, 0F, 0F); - this.HipGuardL.addBox(-1.5F, 0.0F, -2.5F, 4, 6, 5, 0.0F); - this.setRotateAngle(HipGuardL, 0.0F, 0.0F, -0.17453292519943295F); - this.bipedLeftLeg.addChild(this.HipGuardL); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - GL11.glPushMatrix(); - for(int i = 0; i<2; i++) - { - GL11.glPushMatrix(); - - FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("tinkersdefense:textures/" + defaultFolder + "/" + textures[i] + ".png")); - - float size =1.5f; - GL11.glScalef(1.0F / size, 1.0F / size, 1.0F / size); - GL11.glTranslatef(0F, -1F*f5, -0F); - - int[] intColors = TinkersDefense.hexToRGB(colors[i]); - GL11.glColor3d((float)intColors[0]/255, (float)intColors[1]/255, (float)intColors[2]/255); - - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - GL11.glPopMatrix(); - } - GL11.glPopMatrix(); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } +public class ModelTinkersChausses extends ArmorRenderer +{ + public ModelRenderer LegL; + public ModelRenderer FrontL; + public ModelRenderer HipGuardL; + public ModelRenderer HipGuardR; + public ModelRenderer LegR; + public ModelRenderer BackL; + public ModelRenderer FrontR; + public ModelRenderer BackR; + + public ModelTinkersChausses(String[] colors, String defaultFolder, String[] textures) + { + super(1.1f, 0, 64, 64); + + this.textureWidth = 64; + this.textureHeight = 64; + + this.HipGuardR = new ModelRenderer(this, 10, 37); + this.HipGuardR.setRotationPoint(0F, 0F, 0F); + this.HipGuardR.addBox(-2.5F, 0.0F, -2.5F, 4, 6, 5, 0.0F); + this.setRotateAngle(HipGuardR, 0.0F, 0.0F, 0.17453292519943295F); + this.bipedRightLeg.addChild(this.HipGuardR); + + this.LegL = new ModelRenderer(this, 0, 48); + this.LegL.setRotationPoint(0F, 0F, 0F); + this.LegL.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.0F); + this.bipedLeftLeg.addChild(this.LegL); + + this.BackR = new ModelRenderer(this, 0, 40); + this.BackR.setRotationPoint(0F, 0F, 0F); + this.BackR.addBox(-0.1F, 0.0F, 1.7F, 4, 7, 1, 0.01F); + this.bipedRightLeg.addChild(this.BackR); + + this.FrontL = new ModelRenderer(this, 0, 40); + this.FrontL.setRotationPoint(0F, 0F, 0F); + this.FrontL.addBox(-4.0F, 0.0F, -2.7F, 4, 7, 1, 0.0F); + this.bipedLeftLeg.addChild(this.FrontL); + + this.LegR = new ModelRenderer(this, 0, 48); + this.LegR.setRotationPoint(0F, 0F, 0F); + this.LegR.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.0F); + this.bipedRightLeg.addChild(this.LegR); + + this.BackL = new ModelRenderer(this, 0, 40); + this.BackL.setRotationPoint(0F, 0F, 0F); + this.BackL.addBox(-4.0F, 0.0F, 1.7F, 4, 7, 1, 0.0F); + this.bipedLeftLeg.addChild(this.BackL); + + this.FrontR = new ModelRenderer(this, 0, 40); + this.FrontR.setRotationPoint(0F, 0F, 0F); + this.FrontR.addBox(-0.1F, 0.0F, -2.7F, 4, 7, 1, 0.01F); + this.bipedRightLeg.addChild(this.FrontR); + + this.HipGuardL = new ModelRenderer(this, 10, 37); + this.HipGuardL.mirror = true; + this.HipGuardL.setRotationPoint(0F, 0F, 0F); + this.HipGuardL.addBox(-1.5F, 0.0F, -2.5F, 4, 6, 5, 0.0F); + this.setRotateAngle(HipGuardL, 0.0F, 0.0F, -0.17453292519943295F); + this.bipedLeftLeg.addChild(this.HipGuardL); + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + GL11.glPushMatrix(); + for(int i = 0; i < 2; i++) + { + GL11.glPushMatrix(); + + FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("tinkersdefense:textures/" + defaultFolder + "/" + textures[i] + ".png")); + + float size = 1.5f; + GL11.glScalef(1.0F / size, 1.0F / size, 1.0F / size); + GL11.glTranslatef(0F, -1F * f5, -0F); + + int[] intColors = TinkersDefense.hexToRGB(colors[i]); + GL11.glColor3d((float) intColors[0] / 255, (float) intColors[1] / 255, (float) intColors[2] / 255); + + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + GL11.glPopMatrix(); + } + GL11.glPopMatrix(); + } + + /** + * This is a helper function from Tabula to set the rotation of model parts + */ + public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) + { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } } diff --git a/src/main/java/lance5057/tDefense/armor/renderers/light/ModelTinkersCoif.java b/src/main/java/lance5057/tDefense/armor/renderers/light/ModelTinkersCoif.java index 0589ccc..d631c08 100644 --- a/src/main/java/lance5057/tDefense/armor/renderers/light/ModelTinkersCoif.java +++ b/src/main/java/lance5057/tDefense/armor/renderers/light/ModelTinkersCoif.java @@ -1,7 +1,7 @@ package lance5057.tDefense.armor.renderers.light; import lance5057.tDefense.TinkersDefense; -import net.minecraft.client.model.ModelBiped; +import lance5057.tDefense.armor.renderers.ArmorRenderer; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; @@ -14,65 +14,60 @@ import cpw.mods.fml.client.FMLClientHandler; * ModelBiped - Either Mojang or a mod author * Created using Tabula 4.1.1 */ -public class ModelTinkersCoif extends ModelBiped { - public ModelRenderer Coif; - public ModelRenderer Head; - - public String[] colors; - - public String[] textures; - public String defaultFolder; +public class ModelTinkersCoif extends ArmorRenderer +{ + public ModelRenderer Coif; + public ModelRenderer Head; - public ModelTinkersCoif(String[] colors, String defaultFolder, String[] textures) { - super(1.1f, 0, 64,64); - - this.textureWidth = 64; - this.textureHeight = 64; - - this.colors = colors; - this.textures = textures; - this.defaultFolder = defaultFolder; - - this.Head = new ModelRenderer(this, 32, 48); - this.Head.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Head.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0.0F); - this.bipedHead.addChild(this.Head); - - this.Coif = new ModelRenderer(this, 0, 46); - this.Coif.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Coif.addBox(-4.0F, -8.0F, -4.0F, 8, 10, 8, 0.5F); - this.bipedHead.addChild(this.Coif); - } + public ModelTinkersCoif(String[] colors, String defaultFolder, String[] textures) + { + super(1.1f, 0, 64, 64); - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - GL11.glPushMatrix(); - for(int i = 0; i<3; i++) - { - GL11.glPushMatrix(); - - FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("tinkersdefense:textures/" + defaultFolder + "/" + textures[i] + ".png")); - - float size = 2.25f; - GL11.glScalef(1.5F / size, 1.5F / size, 1.5F / size); - GL11.glTranslatef(0.0F, 0F*f5, 0.0F); - - int[] intColors = TinkersDefense.hexToRGB(colors[i]); - GL11.glColor3d((float)intColors[0]/255, (float)intColors[1]/255, (float)intColors[2]/255); - - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - GL11.glPopMatrix(); - } - GL11.glPopMatrix(); - } + this.textureWidth = 64; + this.textureHeight = 64; - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } + this.Head = new ModelRenderer(this, 32, 48); + this.Head.setRotationPoint(0.0F, 0.0F, 0.0F); + this.Head.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0.0F); + this.bipedHead.addChild(this.Head); + + this.Coif = new ModelRenderer(this, 0, 46); + this.Coif.setRotationPoint(0.0F, 0.0F, 0.0F); + this.Coif.addBox(-4.0F, -8.0F, -4.0F, 8, 10, 8, 0.5F); + this.bipedHead.addChild(this.Coif); + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + GL11.glPushMatrix(); + for(int i = 0; i < 3; i++) + { + GL11.glPushMatrix(); + + FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("tinkersdefense:textures/" + defaultFolder + "/" + textures[i] + ".png")); + + float size = 2.25f; + GL11.glScalef(1.5F / size, 1.5F / size, 1.5F / size); + GL11.glTranslatef(0.0F, 0F * f5, 0.0F); + + int[] intColors = TinkersDefense.hexToRGB(colors[i]); + GL11.glColor3d((float) intColors[0] / 255, (float) intColors[1] / 255, (float) intColors[2] / 255); + + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + GL11.glPopMatrix(); + } + GL11.glPopMatrix(); + } + + /** + * This is a helper function from Tabula to set the rotation of model parts + */ + public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) + { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } } diff --git a/src/main/java/lance5057/tDefense/armor/renderers/light/ModelTinkersHalberd.java b/src/main/java/lance5057/tDefense/armor/renderers/light/ModelTinkersHalberd.java index 4d4b46b..7de3ccd 100644 --- a/src/main/java/lance5057/tDefense/armor/renderers/light/ModelTinkersHalberd.java +++ b/src/main/java/lance5057/tDefense/armor/renderers/light/ModelTinkersHalberd.java @@ -1,7 +1,7 @@ package lance5057.tDefense.armor.renderers.light; import lance5057.tDefense.TinkersDefense; -import net.minecraft.client.model.ModelBiped; +import lance5057.tDefense.armor.renderers.ArmorRenderer; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; @@ -14,117 +14,112 @@ import cpw.mods.fml.client.FMLClientHandler; * ModelBiped - Either Mojang or a mod author * Created using Tabula 4.1.1 */ -public class ModelTinkersHalberd extends ModelBiped { - public ModelRenderer Pauldron1; - public ModelRenderer Pauldron2; - public ModelRenderer Pauldron3; - public ModelRenderer ArmR; - public ModelRenderer Body; - public ModelRenderer Pauldron1_1; - public ModelRenderer Pauldron2_1; - public ModelRenderer Pauldron3_1; - public ModelRenderer ArmL; - - public String[] colors; - - public String[] textures; - public String defaultFolder; - - public ModelTinkersHalberd(String[] colors, String defaultFolder, String[] textures) { - super(1.1f, 0, 64,64); - - this.textureWidth = 64; - this.textureHeight = 64; - - this.colors = colors; - this.textures = textures; - this.defaultFolder = defaultFolder; - - this.Pauldron2_1 = new ModelRenderer(this, 0, 32); - this.Pauldron2_1.mirror = true; - this.Pauldron2_1.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Pauldron2_1.addBox(-0.7F, -2.7F, -2.0F, 3, 3, 4, 0.1F); - this.setRotateAngle(Pauldron2_1, 0.0F, 0.0F, 0.2617993877991494F); - this.bipedLeftArm.addChild(this.Pauldron2_1); - - this.Body = new ModelRenderer(this, 16, 48); - this.Body.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Body.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, 0.0F); - this.bipedBody.addChild(this.Body); - - this.Pauldron1_1 = new ModelRenderer(this, 30, 32); - this.Pauldron1_1.mirror = true; - this.Pauldron1_1.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Pauldron1_1.addBox(0.5F, -1.9F, -2.5F, 3, 4, 5, 0.0F); - this.setRotateAngle(Pauldron1_1, 0.0F, 0.0F, -0.2617993877991494F); - this.bipedLeftArm.addChild(this.Pauldron1_1); - - this.Pauldron3 = new ModelRenderer(this, 16, 32); - this.Pauldron3.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Pauldron3.addBox(-1.2F, -1.5F, -2.5F, 2, 2, 5, 0.1F); - this.setRotateAngle(Pauldron3, 0.0F, 0.0F, -0.2617993877991494F); - this.bipedRightArm.addChild(this.Pauldron3); - - this.ArmL = new ModelRenderer(this, 0, 48); - this.ArmL.mirror = true; - this.ArmL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.ArmL.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, 0.0F); - this.bipedLeftArm.addChild(this.ArmL); - - this.Pauldron1 = new ModelRenderer(this, 30, 32); - this.Pauldron1.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Pauldron1.addBox(-3.5F, -1.9F, -2.5F, 3, 4, 5, 0.0F); - this.setRotateAngle(Pauldron1, 0.0F, 0.0F, 0.2617993877991494F); - this.bipedRightArm.addChild(this.Pauldron1); - - this.Pauldron3_1 = new ModelRenderer(this, 16, 32); - this.Pauldron3_1.mirror = true; - this.Pauldron3_1.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Pauldron3_1.addBox(-0.8F, -1.5F, -2.5F, 2, 2, 5, 0.1F); - this.setRotateAngle(Pauldron3_1, 0.0F, 0.0F, 0.2617993877991494F); - this.bipedLeftArm.addChild(this.Pauldron3_1); - - this.Pauldron2 = new ModelRenderer(this, 0, 32); - this.Pauldron2.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Pauldron2.addBox(-2.3F, -2.7F, -2.0F, 3, 3, 4, 0.1F); - this.setRotateAngle(Pauldron2, 0.0F, 0.0F, -0.2617993877991494F); - this.bipedRightArm.addChild(this.Pauldron2); - - this.ArmR = new ModelRenderer(this, 0, 48); - this.ArmR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.ArmR.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, 0.0F); - this.bipedRightArm.addChild(this.ArmR); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - GL11.glPushMatrix(); - for(int i = 0; i<3; i++) - { - GL11.glPushMatrix(); - - FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("tinkersdefense:textures/" + defaultFolder + "/" + textures[i] + ".png")); - - float size = 2.25f; - GL11.glScalef(1.5F / size, 1.5F / size, 1.5F / size); - GL11.glTranslatef(0.0F, 0F*f5, 0.0F); - - int[] intColors = TinkersDefense.hexToRGB(colors[i]); - GL11.glColor3d((float)intColors[0]/255, (float)intColors[1]/255, (float)intColors[2]/255); - - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - GL11.glPopMatrix(); - } - GL11.glPopMatrix(); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } +public class ModelTinkersHalberd extends ArmorRenderer +{ + public ModelRenderer Pauldron1; + public ModelRenderer Pauldron2; + public ModelRenderer Pauldron3; + public ModelRenderer ArmR; + public ModelRenderer Body; + public ModelRenderer Pauldron1_1; + public ModelRenderer Pauldron2_1; + public ModelRenderer Pauldron3_1; + public ModelRenderer ArmL; + + public ModelTinkersHalberd() + { + super(1.1f, 0, 64, 64); + + this.textureWidth = 64; + this.textureHeight = 64; + + this.Pauldron2_1 = new ModelRenderer(this, 0, 32); + this.Pauldron2_1.mirror = true; + this.Pauldron2_1.setRotationPoint(0.0F, 0.0F, 0.0F); + this.Pauldron2_1.addBox(-0.7F, -2.7F, -2.0F, 3, 3, 4, 0.1F); + this.setRotateAngle(Pauldron2_1, 0.0F, 0.0F, 0.2617993877991494F); + this.bipedLeftArm.addChild(this.Pauldron2_1); + + this.Body = new ModelRenderer(this, 16, 48); + this.Body.setRotationPoint(0.0F, 0.0F, 0.0F); + this.Body.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, 0.0F); + this.bipedBody.addChild(this.Body); + + this.Pauldron1_1 = new ModelRenderer(this, 30, 32); + this.Pauldron1_1.mirror = true; + this.Pauldron1_1.setRotationPoint(0.0F, 0.0F, 0.0F); + this.Pauldron1_1.addBox(0.5F, -1.9F, -2.5F, 3, 4, 5, 0.0F); + this.setRotateAngle(Pauldron1_1, 0.0F, 0.0F, -0.2617993877991494F); + this.bipedLeftArm.addChild(this.Pauldron1_1); + + this.Pauldron3 = new ModelRenderer(this, 16, 32); + this.Pauldron3.setRotationPoint(0.0F, 0.0F, 0.0F); + this.Pauldron3.addBox(-1.2F, -1.5F, -2.5F, 2, 2, 5, 0.1F); + this.setRotateAngle(Pauldron3, 0.0F, 0.0F, -0.2617993877991494F); + this.bipedRightArm.addChild(this.Pauldron3); + + this.ArmL = new ModelRenderer(this, 0, 48); + this.ArmL.mirror = true; + this.ArmL.setRotationPoint(0.0F, 0.0F, 0.0F); + this.ArmL.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, 0.0F); + this.bipedLeftArm.addChild(this.ArmL); + + this.Pauldron1 = new ModelRenderer(this, 30, 32); + this.Pauldron1.setRotationPoint(0.0F, 0.0F, 0.0F); + this.Pauldron1.addBox(-3.5F, -1.9F, -2.5F, 3, 4, 5, 0.0F); + this.setRotateAngle(Pauldron1, 0.0F, 0.0F, 0.2617993877991494F); + this.bipedRightArm.addChild(this.Pauldron1); + + this.Pauldron3_1 = new ModelRenderer(this, 16, 32); + this.Pauldron3_1.mirror = true; + this.Pauldron3_1.setRotationPoint(0.0F, 0.0F, 0.0F); + this.Pauldron3_1.addBox(-0.8F, -1.5F, -2.5F, 2, 2, 5, 0.1F); + this.setRotateAngle(Pauldron3_1, 0.0F, 0.0F, 0.2617993877991494F); + this.bipedLeftArm.addChild(this.Pauldron3_1); + + this.Pauldron2 = new ModelRenderer(this, 0, 32); + this.Pauldron2.setRotationPoint(0.0F, 0.0F, 0.0F); + this.Pauldron2.addBox(-2.3F, -2.7F, -2.0F, 3, 3, 4, 0.1F); + this.setRotateAngle(Pauldron2, 0.0F, 0.0F, -0.2617993877991494F); + this.bipedRightArm.addChild(this.Pauldron2); + + this.ArmR = new ModelRenderer(this, 0, 48); + this.ArmR.setRotationPoint(0.0F, 0.0F, 0.0F); + this.ArmR.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, 0.0F); + this.bipedRightArm.addChild(this.ArmR); + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + GL11.glPushMatrix(); + for(int i = 0; i < 3; i++) + { + GL11.glPushMatrix(); + + FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("tinkersdefense:textures/" + defaultFolder + "/" + textures[i] + ".png")); + + float size = 2.25f; + GL11.glScalef(1.5F / size, 1.5F / size, 1.5F / size); + GL11.glTranslatef(0.0F, 0F * f5, 0.0F); + + int[] intColors = TinkersDefense.hexToRGB(colors[i]); + GL11.glColor3d((float) intColors[0] / 255, (float) intColors[1] / 255, (float) intColors[2] / 255); + + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + GL11.glPopMatrix(); + } + GL11.glPopMatrix(); + } + + /** + * This is a helper function from Tabula to set the rotation of model parts + */ + public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) + { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } } |
