mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-22 05:02:39 +00:00
Exo-Armor start
This commit is contained in:
1 parent
6efd8a83fd
commit
6dd171c27a
14 files changed
+131
-12
No files matched your search
@@ -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);
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user