Bronze Tools and Armour

This commit is contained in:
Prospector 2016-03-27 21:20:27 -07:00
parent 877308a75c
commit a636da1882
15 changed files with 380 additions and 2 deletions

View file

@ -0,0 +1,65 @@
package techreborn.items.armor;
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.RebornCore;
import techreborn.lib.ModInfo;
/**
* Created by modmuss50 on 26/02/2016.
*/
public class ItemTRArmour extends ItemArmor implements ITexturedItem {
private ArmorMaterial material = ArmorMaterial.LEATHER;
private EntityEquipmentSlot slot = EntityEquipmentSlot.HEAD;
public ItemTRArmour(ArmorMaterial material, EntityEquipmentSlot slot) {
super(material, material.getDamageReductionAmount(slot), slot);
if (slot == EntityEquipmentSlot.HEAD)
setUnlocalizedName(material.name().toLowerCase()+"Helmet");
if (slot == EntityEquipmentSlot.CHEST)
setUnlocalizedName(material.name().toLowerCase()+"Chestplate");
if (slot == EntityEquipmentSlot.LEGS)
setUnlocalizedName(material.name().toLowerCase()+"Leggings");
if (slot == EntityEquipmentSlot.FEET)
setUnlocalizedName(material.name().toLowerCase()+"Boots");
RebornCore.jsonDestroyer.registerObject(this);
this.material = material;
this.slot = slot;
}
@Override
public String getTextureName(int damage) {
if (slot == EntityEquipmentSlot.HEAD)
return "techreborn:items/tool/" + material.name() + "_helmet";
if (slot == EntityEquipmentSlot.CHEST)
return "techreborn:items/tool/" + material.name() + "_chestplate";
if (slot == EntityEquipmentSlot.LEGS)
return "techreborn:items/tool/" + material.name() + "_leggings";
if (slot == EntityEquipmentSlot.FEET)
return "techreborn:items/tool/" + material.name() + "_boots";
return "techreborn:items/tool/" + material.name() + "_error";
}
@Override
public int getMaxMeta() {
return 1;
}
@Override
@SideOnly(Side.CLIENT)
public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) {
return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory");
}
@SideOnly(Side.CLIENT)
public boolean isFull3D() {
return true;
}
}