Exo-Armor start

This commit is contained in:
mDiyo committed 2013-12-04 23:08:36 -08:00
1 parent 2e9969729b
commit 384d1e0a48
17 files changed
+152 -343

No files matched your search

+5
View File
@@ -257,6 +257,11 @@ item.tconstruct.chestplateWood.name=Wooden Chestplate
item.tconstruct.leggingsWood.name=Wooden Leggings
item.tconstruct.bootsWood.name=Wooden Boots
item.tconstruct.exoGoggles.name=Exo-Goggles
item.tconstruct.exoChest.name=Exo-Chestpiece
item.tconstruct.exoPants.name=Exo-Legs
item.tconstruct.exoShoes.name=Exo-Shoes
item.tconstruct.jerky.beef.name=Beef Jerky
item.tconstruct.jerky.pig.name=Bacon Jerky
item.tconstruct.jerky.chicken.name=Chicken Jerky
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 582 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 586 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 486 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 564 B

+30
View File
@@ -13,6 +13,7 @@ import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.entity.*;
import net.minecraft.entity.ai.attributes.AttributeInstance;
import net.minecraft.item.Item;
import net.minecraft.potion.*;
import net.minecraft.util.*;
import net.minecraftforge.client.GuiIngameForge;
@@ -237,6 +238,35 @@ public class TClientEvents
double zLevel = 0;
@ForgeSubscribe
public void getFOV(FOVUpdateEvent event)
{
float f = 1.0F;
if (event.entity.capabilities.isFlying)
{
f *= 1.1F;
}
if (event.entity.isUsingItem() && event.entity.getItemInUse().itemID == Item.bow.itemID)
{
int i = event.entity.getItemInUseDuration();
float f1 = (float) i / 20.0F;
if (f1 > 1.0F)
{
f1 = 1.0F;
}
else
{
f1 *= f1;
}
f *= 1.0F - f1 * 0.15F;
}
event.newfov = f;
}
/* Armor */
ModelBiped model = new ModelBiped(5f);
WingModel wings = new WingModel();
+16 -18
View File
@@ -2,6 +2,7 @@ package tconstruct.common;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import tconstruct.library.armor.EnumArmorPart;
import tconstruct.library.crafting.ToolBuilder;
import cpw.mods.fml.common.*;
@@ -266,10 +267,6 @@ public class TContent implements IFuelHandler
public static ModLapis modL;
//Wearables
public static Item heavyHelmet;
public static Item heavyChestplate;
public static Item heavyPants;
public static Item heavyBoots;
public static Item glove;
public static Item knapsack;
@@ -289,13 +286,12 @@ public class TContent implements IFuelHandler
public static Item leggingsWood;
public static Item bootsWood;
public static EnumArmorMaterial materialWood;
//Signal & Logic
public static Block signalBus;
public static Block signalTerminal;
public static Item spoolWire;
public static Item lengthWire;
//Armor - exosuit
public static Item exoGoggles;
public static Item exoChest;
public static Item exoPants;
public static Item exoShoes;
//Temporary items
//public static Item armorTest = new ArmorStandard(2445, 4, EnumArmorPart.HELMET).setCreativeTab(CreativeTabs.tabAllSearch);
@@ -961,16 +957,10 @@ public class TContent implements IFuelHandler
GameRegistry.registerItem(jerky, "jerky");
//Wearables
//heavyHelmet = new TArmorBase(PHConstruct.heavyHelmet, 0).setUnlocalizedName("tconstruct.HeavyHelmet");
heartCanister = new HeartCanister(PHConstruct.heartCanister).setUnlocalizedName("tconstruct.canister");
//heavyBoots = new TArmorBase(PHConstruct.heavyBoots, 3).setUnlocalizedName("tconstruct.HeavyBoots");
//glove = new Glove(PHConstruct.glove).setUnlocalizedName("tconstruct.Glove");
knapsack = new Knapsack(PHConstruct.knapsack).setUnlocalizedName("tconstruct.storage");
goldHead = new GoldenHead(PHConstruct.goldHead, 4, 1.2F, false).setAlwaysEdible().setPotionEffect(Potion.regeneration.id, 10, 0, 1.0F).setUnlocalizedName("goldenhead");
//GameRegistry.registerItem(heavyHelmet, "heavyHelmet");
GameRegistry.registerItem(heartCanister, "heartCanister");
//GameRegistry.registerItem(heavyBoots, "heavyBoots");
//GameRegistry.registerItem(glove, "glove");
GameRegistry.registerItem(knapsack, "knapsack");
GameRegistry.registerItem(goldHead, "goldHead");
@@ -985,7 +975,10 @@ public class TContent implements IFuelHandler
GameRegistry.registerItem(leggingsWood, "leggingsWood");
GameRegistry.registerItem(bootsWood, "bootsWood");
// essenceCrystal = new EssenceCrystal(PHConstruct.essenceCrystal).setUnlocalizedName("tconstruct.crystal.essence");
exoGoggles = new ExoArmor(PHConstruct.exoGoggles, EnumArmorPart.HELMET, "exosuit").setUnlocalizedName("tconstruct.exoGoggles");
exoChest = new ExoArmor(PHConstruct.exoChest, EnumArmorPart.CHESTPLATE, "exosuit").setUnlocalizedName("tconstruct.exoChest");
exoPants = new ExoArmor(PHConstruct.exoPants, EnumArmorPart.LEGGINGS, "exosuit").setUnlocalizedName("tconstruct.exoPants");
exoShoes = new ExoArmor(PHConstruct.exoShoes, EnumArmorPart.BOOTS, "exosuit").setUnlocalizedName("tconstruct.exoShoes");
String[] materialStrings = { "paperStack", "greenSlimeCrystal", "searedBrick", "ingotCobalt", "ingotArdite", "ingotManyullyn", "mossBall", "lavaCrystal", "necroticBone", "ingotCopper",
"ingotTin", "ingotAluminum", "rawAluminum", "ingotBronze", "ingotAluminumBrass", "ingotAlumite", "ingotSteel", "blueSlimeCrystal", "ingotObsidian", "nuggetIron", "nuggetCopper",
@@ -1241,6 +1234,11 @@ public class TContent implements IFuelHandler
GameRegistry.addRecipe(new ShapedOreRecipe(chestplateWood, new Object[] { "w w", "www", "www", 'w', "logWood" }));
GameRegistry.addRecipe(new ShapedOreRecipe(leggingsWood, new Object[] { "www", "w w", "w w", 'w', "logWood" }));
GameRegistry.addRecipe(new ShapedOreRecipe(bootsWood, new Object[] { "w w", "w w", 'w', "logWood" }));
//Exosuit recipes, bronze = 14
/*exoGoggles = new ExoArmor(PHConstruct.exoGoggles, EnumArmorPart.HELMET, "exosuit").setUnlocalizedName("tconstruct.exoGoggles");
exoChest = new ExoArmor(PHConstruct.exoChest, EnumArmorPart.CHESTPLATE, "exosuit").setUnlocalizedName("tconstruct.exoChest");
exoPants = new ExoArmor(PHConstruct.exoPants, EnumArmorPart.LEGGINGS, "exosuit").setUnlocalizedName("tconstruct.exoPants");
exoShoes = new ExoArmor(PHConstruct.exoShoes, EnumArmorPart.BOOTS, "exosuit").setUnlocalizedName("tconstruct.exoShoes");*/
// Metal conversion Recipes
GameRegistry.addRecipe(new ItemStack(metalBlock, 1, 3), patBlock, '#', new ItemStack(materials, 1, 9)); // Copper
GameRegistry.addRecipe(new ItemStack(metalBlock, 1, 5), patBlock, '#', new ItemStack(materials, 1, 10)); // Tin
+80
View File
@@ -0,0 +1,80 @@
package tconstruct.items.armor;
import java.util.List;
import java.util.UUID;
import com.google.common.collect.Multimap;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.*;
import tconstruct.library.TConstructRegistry;
import tconstruct.library.armor.ArmorCore;
import tconstruct.library.armor.EnumArmorPart;
public class ExoArmor extends ArmorCore
{
String textureName;
protected static final UUID speed = UUID.fromString("CB3F55A9-629C-4F38-A497-9C13A33DB5CF");
protected static final UUID attack = UUID.fromString("CB3F55A9-629C-4F38-A497-9C13A33DB5CE");
protected static final UUID health = UUID.fromString("CB3F55A9-629C-4F38-A497-9C13A33DB5CD");
protected static final UUID knockback = UUID.fromString("CB3F55A9-629C-4F38-A497-9C13A33DB5CC");
public ExoArmor(int id, EnumArmorPart part, String texture)
{
super(id, 0, part);
this.textureName = texture;
this.setCreativeTab(TConstructRegistry.materialTab);
}
@Override
public void registerIcons (IconRegister par1IconRegister)
{
this.itemIcon = par1IconRegister.registerIcon("tinker:armor/" + textureName + "_"
+ (this.armorType == 0 ? "helmet" : this.armorType == 1 ? "chestplate" : this.armorType == 2 ? "leggings" : this.armorType == 3 ? "boots" : "helmet"));
}
@Override
public String getArmorTexture (ItemStack stack, Entity entity, int slot, int layer)
{
return "tinker:textures/armor/" + textureName + "_" + layer + ".png";
}
/*public Multimap getItemAttributeModifiers ()
{
Multimap multimap = super.getItemAttributeModifiers();
multimap.put(SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(), new AttributeModifier(speed, "Exosuit speed", (double) 0.5, 0));
return multimap;
}*/
public void getSubItems (int par1, CreativeTabs par2CreativeTabs, List par3List)
{
ItemStack armor = new ItemStack(par1, 1, 0);
NBTTagCompound baseTag = new NBTTagCompound();
NBTTagList list = new NBTTagList();
list.appendTag(getAttributeTag("generic.attackDamage", "ExoAttack", 10.0, true, knockback));
list.appendTag(getAttributeTag("generic.movementSpeed", "ExoSpeed", 1.5, false, speed));
list.appendTag(getAttributeTag("generic.maxHealth", "ExoHealth", 10.0, true, health));
list.appendTag(getAttributeTag("generic.knockbackResistance", "ExoKnockback", 0.5, false, knockback));
baseTag.setTag("AttributeModifiers", list);
armor.setTagCompound(baseTag);
par3List.add(armor);
}
private NBTTagCompound getAttributeTag(String attributeType, String modifierName, double amount, boolean flat, UUID uuid)
{
NBTTagCompound knockbackTag = new NBTTagCompound();
knockbackTag.setString("AttributeName", attributeType);
knockbackTag.setString("Name", modifierName);
knockbackTag.setDouble("Amount", amount);
knockbackTag.setInteger("Operation", flat ? 0 : 1);//0 = flat increase, 1 = % increase
knockbackTag.setLong("UUIDMost", uuid.getMostSignificantBits());
knockbackTag.setLong("UUIDLeast", uuid.getLeastSignificantBits());
return knockbackTag;
}
}
-124
View File
@@ -1,124 +0,0 @@
package tconstruct.items.armor;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class TArmorBase extends ItemArmor
//implements ISpecialArmor
{
Icon[] icons;
String[] iconNames = { "wood_boots" };
//static Minecraft mc = Minecraft.getMinecraft();
//private ModelBiped modelArmor;
public TArmorBase(int id, int armorSlot)
{
super(id, EnumArmorMaterial.CLOTH, 0, armorSlot);
this.maxStackSize = 1;
this.setMaxDamage(100);
setNoRepair();
canRepair = false;
this.setCreativeTab(CreativeTabs.tabMisc);
//this.modelArmor = new ModelBiped(0.75F);
//this.setCreativeTab(TConstructRegistry.toolTab);
}
public void onArmorTickUpdate (World world, EntityPlayer player, ItemStack itemStack)
{
}
/**
* Called by RenderBiped and RenderPlayer to determine the armor texture that
* should be use for the currently equiped item.
* This will only be called on instances of ItemArmor.
*
* Returning null from this function will use the default value.
*
* @param stack ItemStack for the equpt armor
* @param entity The entity wearing the armor
* @param slot The slot the armor is in
* @param layer The render layer, either 1 or 2, 2 is only used for CLOTH armor by default
* @return Path of texture to bind, or null to use default
*/
@Override
@SideOnly(Side.CLIENT)
public String getArmorTexture (ItemStack stack, Entity entity, int slot, int layer)
{
return "/mods/tinker/textures/armor/wood_1.png";
}
/**
* Override this method to have an item handle its own armor rendering.
*
* @param entityLiving The entity wearing the armor
* @param itemStack The itemStack to render the model of
* @param armorSlot 0=head, 1=torso, 2=legs, 3=feet
*
* @return A ModelBiped to render instead of the default
*/
@Override
@SideOnly(Side.CLIENT)
public ModelBiped getArmorModel (EntityLivingBase par1EntityLiving, ItemStack itemStack, int armorSlot)
{
return null;
}
@SideOnly(Side.CLIENT)
public boolean requiresMultipleRenderPasses ()
{
return false;
}
@SideOnly(Side.CLIENT)
@Override
public Icon getIconFromDamage (int meta)
{
return icons[0];
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons (IconRegister iconRegister)
{
this.icons = new Icon[iconNames.length];
for (int i = 0; i < this.icons.length; ++i)
{
this.icons[i] = iconRegister.registerIcon("tinker:armor/" + iconNames[i]);
}
}
/*@Override
public ArmorProperties getProperties (EntityLiving player, ItemStack armor, DamageSource source, double damage, int slot)
{
// TODO Auto-generated method stub
return null;
}
@Override
public int getArmorDisplay (EntityPlayer player, ItemStack armor, int slot)
{
// TODO Auto-generated method stub
return 0;
}
@Override
public void damageArmor (EntityLiving entity, ItemStack stack, DamageSource source, int damage, int slot)
{
// TODO Auto-generated method stub
}*/
}
+7 -193
View File
@@ -1,6 +1,5 @@
package tconstruct.library.armor;
import ic2.api.item.*;
import net.minecraft.block.BlockDispenser;
import net.minecraft.dispenser.IBehaviorDispenseItem;
import net.minecraft.entity.*;
@@ -11,24 +10,18 @@ import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import net.minecraftforge.common.ISpecialArmor;
/**
* NBTTags
* Main tag - InfiArmor
*/
public abstract class ArmorCore extends ItemArmor implements ICustomElectricItem, IBoxable, ISpecialArmor
public abstract class ArmorCore extends ItemArmor implements ISpecialArmor
{
public static final String SET_NAME = "InfiArmor";
public static final String SET_NAME = "TinkerArmor";
public final EnumArmorPart armorPart;
private static final IBehaviorDispenseItem dispenserBehavior = new BehaviorDispenseArmorCopy();
public final int baseProtection;
public ArmorCore(int par1, int baseProtection, EnumArmorPart part)
public ArmorCore(int id, int baseProtection, EnumArmorPart part)
{
super(par1, EnumArmorMaterial.CHAIN, 0, 0);
super(id, EnumArmorMaterial.CHAIN, 0, part.getPartId());
this.maxStackSize = 1;
this.setMaxDamage(100);
this.setUnlocalizedName(SET_NAME);
this.armorPart = part;
this.baseProtection = baseProtection;
BlockDispenser.dispenseBehaviorRegistry.putObject(this, dispenserBehavior);
@@ -93,170 +86,9 @@ public abstract class ArmorCore extends ItemArmor implements ICustomElectricItem
}
data = tags.getCompoundTag(SET_NAME);
if (tags.hasKey("charge"))
{
int charge = tags.getInteger("charge");
if (charge > damage)
{
charge -= damage;
tags.setInteger("charge", charge);
return;
}
else
{
damage -= charge;
tags.setInteger("charge", 0);
int dmg = data.getInteger("Damage");
dmg += damage;
data.setInteger("Damage", dmg);
}
}
else
{
int dmg = data.getInteger("Damage");
dmg += damage;
data.setInteger("Damage", dmg);
}
}
/*
* IC2 API support
*/
@Override
public boolean canBeStoredInToolbox (ItemStack stack)
{
return true;
}
@Override
public boolean canProvideEnergy (ItemStack stack)
{
NBTTagCompound tags = stack.getTagCompound();
return tags.hasKey("charge");
}
@Override
public int getChargedItemId (ItemStack stack)
{
return this.itemID;
}
@Override
public int getEmptyItemId (ItemStack stack)
{
return this.itemID;
}
@Override
public int getMaxCharge (ItemStack stack)
{
NBTTagCompound tags = stack.getTagCompound();
return tags.hasKey("charge") ? 10000 : 0;
}
@Override
public int getTier (ItemStack stack)
{
return 0;
}
@Override
public int getTransferLimit (ItemStack stack)
{
NBTTagCompound tags = stack.getTagCompound();
return tags.hasKey("charge") ? 32 : 0;
}
@Override
public int charge (ItemStack stack, int amount, int tier, boolean ignoreTransferLimit, boolean simulate)
{
NBTTagCompound tags = stack.getTagCompound();
if (!tags.hasKey("charge"))
{
return 0;
}
if (amount > 0)
{
if (amount > getTransferLimit(stack) && !ignoreTransferLimit)
{
amount = getTransferLimit(stack);
}
int charge = tags.getInteger("charge");
if (amount > getMaxCharge(stack))
{
amount = getMaxCharge(stack);
}
charge += amount;
if (!simulate)
{
tags.setInteger("charge", charge);
stack.setItemDamage(1 + (getMaxCharge(stack) - charge) * (stack.getMaxDamage() - 2) / getMaxCharge(stack));
}
return amount;
}
else
return 0;
}
@Override
public int discharge (ItemStack stack, int amount, int tier, boolean ignoreTransferLimit, boolean simulate)
{
NBTTagCompound tags = stack.getTagCompound();
if (!tags.hasKey("charge"))
{
return 0;
}
if (amount > 0)
{
if (amount > getTransferLimit(stack))
{
amount = getTransferLimit(stack);
}
int charge = tags.getInteger("charge");
if (amount > charge)
{
amount = charge;
}
charge -= amount;
if (!simulate)
{
tags.setInteger("charge", charge);
stack.setItemDamage(1 + (getMaxCharge(stack) - charge) * (stack.getMaxDamage() - 1) / getMaxCharge(stack));
}
return charge;
}
else
return 0;
}
@Override
public boolean canUse (ItemStack stack, int amount)
{
return false;
}
@Override
public boolean canShowChargeToolTip (ItemStack stack)
{
return false;
int dmg = data.getInteger("Damage");
dmg += damage;
data.setInteger("Damage", dmg);
}
// Vanilla overrides
@@ -300,15 +132,6 @@ public abstract class ArmorCore extends ItemArmor implements ICustomElectricItem
return 0;
}
if (tags.hasKey("charge"))
{
int charge = tags.getInteger("charge");
if (charge > 0)
{
return this.getMaxCharge(stack);
}
}
return tags.getCompoundTag(SET_NAME).getInteger("TotalDurability");
}
@@ -320,15 +143,6 @@ public abstract class ArmorCore extends ItemArmor implements ICustomElectricItem
return 0;
}
if (tags.hasKey("charge"))
{
int charge = tags.getInteger("charge");
if (charge > 0)
{
return this.getMaxCharge(stack) - charge;
}
}
return tags.getCompoundTag(SET_NAME).getInteger("Damage");
}
@@ -12,6 +12,7 @@ import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.enchantment.EnchantmentThorns;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.monster.EntityGhast;
@@ -77,7 +78,9 @@ public class AbilityHelper
{
NBTTagCompound tags = stack.getTagCompound();
NBTTagCompound toolTags = stack.getTagCompound().getCompoundTag("InfiTool");
int damage = toolTags.getInteger("Attack") + baseDamage;
float attribute = (float) player.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue();
int damage = toolTags.getInteger("Attack") + baseDamage + 1;
damage *= attribute;
boolean broken = toolTags.getBoolean("Broken");
int durability = tags.getCompoundTag("InfiTool").getInteger("Damage");
+1
View File
@@ -234,6 +234,7 @@ public class TEventHandler
@ForgeSubscribe
public void onHurt (LivingHurtEvent event)
{
//System.out.println("Damage: "+event.ammount);
if (event.entityLiving instanceof EntityPlayer)
{
EntityPlayer player = (EntityPlayer) event.entityLiving;
+9 -7
View File
@@ -265,8 +265,10 @@ public class PHConstruct
goldHead = config.getItem("Patterns and Misc", "Golden Head", 14113).getInt(14113);
jerky = config.getItem("Patterns and Misc", "Jerky", 14115).getInt(14115);
// spoolWire = config.getItem("Logic", "SpoolWire", 14120).getInt(14120);
// lengthWire = config.getItem("Logic", "LengthWire", 14121).getInt(14121);
exoGoggles = config.getItem("Equipables", "Exo-Goggles", 14116).getInt(14116);
exoChest = config.getItem("Equipables", "Exo-Chestpiece", 14117).getInt(14117);
exoPants = config.getItem("Equipables", "Exo-Legs", 14118).getInt(14118);
exoShoes = config.getItem("Equipables", "Exo-Boots", 14119).getInt(14119);
boolean ic2 = true;
boolean xycraft = true;
@@ -422,9 +424,6 @@ public class PHConstruct
public static int woodenRail;
// public static int signalBus;
// public static int signalTerminal;
//Crops
public static int oreBerry;
public static int oreBerrySecond;
@@ -592,9 +591,12 @@ public class PHConstruct
public static int knapsack;
public static int heartCanister;
public static int exoGoggles;
public static int exoChest;
public static int exoPants;
public static int exoShoes;
// public static int spoolWire;
// public static int lengthWire;
//Ore values
public static boolean generateCopper;