diff --git a/resources/assets/tinker/lang/en_US.lang b/resources/assets/tinker/lang/en_US.lang index ac26a3bd..4d65adb2 100644 --- a/resources/assets/tinker/lang/en_US.lang +++ b/resources/assets/tinker/lang/en_US.lang @@ -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-Chest +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 diff --git a/resources/assets/tinker/textures/armor/enderpearl.png b/resources/assets/tinker/textures/armor/enderpearl.png deleted file mode 100644 index d1d08401..00000000 Binary files a/resources/assets/tinker/textures/armor/enderpearl.png and /dev/null differ diff --git a/resources/assets/tinker/textures/armor/exosuit_1.png b/resources/assets/tinker/textures/armor/exosuit_1.png new file mode 100644 index 00000000..cb47df04 Binary files /dev/null and b/resources/assets/tinker/textures/armor/exosuit_1.png differ diff --git a/resources/assets/tinker/textures/armor/exosuit_2.png b/resources/assets/tinker/textures/armor/exosuit_2.png new file mode 100644 index 00000000..c5a7b576 Binary files /dev/null and b/resources/assets/tinker/textures/armor/exosuit_2.png differ diff --git a/resources/assets/tinker/textures/items/armor/exosuit_boots.png b/resources/assets/tinker/textures/items/armor/exosuit_boots.png new file mode 100644 index 00000000..285f9514 Binary files /dev/null and b/resources/assets/tinker/textures/items/armor/exosuit_boots.png differ diff --git a/resources/assets/tinker/textures/items/armor/exosuit_chestplate.png b/resources/assets/tinker/textures/items/armor/exosuit_chestplate.png new file mode 100644 index 00000000..9e4504c8 Binary files /dev/null and b/resources/assets/tinker/textures/items/armor/exosuit_chestplate.png differ diff --git a/resources/assets/tinker/textures/items/armor/exosuit_helmet.png b/resources/assets/tinker/textures/items/armor/exosuit_helmet.png new file mode 100644 index 00000000..403190ac Binary files /dev/null and b/resources/assets/tinker/textures/items/armor/exosuit_helmet.png differ diff --git a/resources/assets/tinker/textures/items/armor/exosuit_leggings.png b/resources/assets/tinker/textures/items/armor/exosuit_leggings.png new file mode 100644 index 00000000..be402b4e Binary files /dev/null and b/resources/assets/tinker/textures/items/armor/exosuit_leggings.png differ diff --git a/src/main/java/tconstruct/client/TClientEvents.java b/src/main/java/tconstruct/client/TClientEvents.java index 0a0df728..a5c73585 100644 --- a/src/main/java/tconstruct/client/TClientEvents.java +++ b/src/main/java/tconstruct/client/TClientEvents.java @@ -15,8 +15,10 @@ 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.ForgeHooksClient; import net.minecraftforge.client.GuiIngameForge; import net.minecraftforge.client.event.*; import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; @@ -239,6 +241,35 @@ public class TClientEvents } double zLevel = 0; + + @ForgeSubscribe + public void fovModifier(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); diff --git a/src/main/java/tconstruct/common/TContent.java b/src/main/java/tconstruct/common/TContent.java index 02917eba..80ed0ff8 100644 --- a/src/main/java/tconstruct/common/TContent.java +++ b/src/main/java/tconstruct/common/TContent.java @@ -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.*; @@ -583,7 +584,10 @@ public class TContent implements IFuelHandler GameRegistry.registerItem(TRepo.leggingsWood, "leggingsWood"); GameRegistry.registerItem(TRepo.bootsWood, "bootsWood"); - // essenceCrystal = new EssenceCrystal(PHConstruct.essenceCrystal).setUnlocalizedName("tconstruct.crystal.essence"); + TRepo.exoGoggles = new ExoArmor(PHConstruct.exoGoggles, EnumArmorPart.HELMET, "exosuit").setUnlocalizedName("tconstruct.exoGoggles"); + TRepo.exoChest = new ExoArmor(PHConstruct.exoChest, EnumArmorPart.CHESTPLATE, "exosuit").setUnlocalizedName("tconstruct.exoChest"); + TRepo.exoPants = new ExoArmor(PHConstruct.exoPants, EnumArmorPart.LEGGINGS, "exosuit").setUnlocalizedName("tconstruct.exoPants"); + TRepo.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", diff --git a/src/main/java/tconstruct/common/TRepo.java b/src/main/java/tconstruct/common/TRepo.java index a621bc21..d87a3d70 100644 --- a/src/main/java/tconstruct/common/TRepo.java +++ b/src/main/java/tconstruct/common/TRepo.java @@ -257,7 +257,12 @@ public class TRepo public static Item leggingsWood; public static Item bootsWood; public static EnumArmorMaterial materialWood; - + + //Armor - exosuit + public static Item exoGoggles; + public static Item exoChest; + public static Item exoPants; + public static Item exoShoes; public static Fluid[] fluids = new Fluid[27]; public static Block[] fluidBlocks = new Block[26]; diff --git a/src/main/java/tconstruct/items/armor/ExoArmor.java b/src/main/java/tconstruct/items/armor/ExoArmor.java new file mode 100644 index 00000000..c9633ca5 --- /dev/null +++ b/src/main/java/tconstruct/items/armor/ExoArmor.java @@ -0,0 +1,73 @@ +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"); //These are temporary. Do not use them in release + 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 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; + } +} diff --git a/src/main/java/tconstruct/library/armor/ArmorCore.java b/src/main/java/tconstruct/library/armor/ArmorCore.java index 03ba0f05..7dbb487e 100644 --- a/src/main/java/tconstruct/library/armor/ArmorCore.java +++ b/src/main/java/tconstruct/library/armor/ArmorCore.java @@ -19,7 +19,7 @@ import cofh.api.energy.IEnergyContainerItem; public abstract class ArmorCore extends ItemArmor implements IEnergyContainerItem, 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; @@ -31,7 +31,7 @@ public abstract class ArmorCore extends ItemArmor implements IEnergyContainerIte public ArmorCore(int par1, int baseProtection, EnumArmorPart part) { - super(par1, EnumArmorMaterial.CHAIN, 0, 0); + super(par1, EnumArmorMaterial.CHAIN, 0, part.getPartId()); this.maxStackSize = 1; this.setMaxDamage(100); this.setUnlocalizedName(SET_NAME); diff --git a/src/main/java/tconstruct/util/config/PHConstruct.java b/src/main/java/tconstruct/util/config/PHConstruct.java index e3857273..58aec7ff 100644 --- a/src/main/java/tconstruct/util/config/PHConstruct.java +++ b/src/main/java/tconstruct/util/config/PHConstruct.java @@ -248,8 +248,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; @@ -406,9 +408,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; @@ -576,9 +575,11 @@ public class PHConstruct public static int knapsack; public static int heartCanister; - -// public static int spoolWire; -// public static int lengthWire; + + public static int exoGoggles; + public static int exoChest; + public static int exoPants; + public static int exoShoes; //Ore values public static boolean generateCopper;