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

@ -1,6 +1,7 @@
package techreborn.init; package techreborn.init;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
@ -32,6 +33,7 @@ import techreborn.items.ItemScrapBox;
import techreborn.items.ItemUUmatter; import techreborn.items.ItemUUmatter;
import techreborn.items.armor.ItemLapotronPack; import techreborn.items.armor.ItemLapotronPack;
import techreborn.items.armor.ItemLithiumBatpack; import techreborn.items.armor.ItemLithiumBatpack;
import techreborn.items.armor.ItemTRArmour;
import techreborn.items.tools.ItemAdvancedChainsaw; import techreborn.items.tools.ItemAdvancedChainsaw;
import techreborn.items.tools.ItemAdvancedDrill; import techreborn.items.tools.ItemAdvancedDrill;
import techreborn.items.tools.ItemCloakingDevice; import techreborn.items.tools.ItemCloakingDevice;
@ -48,9 +50,15 @@ import techreborn.items.tools.ItemNanosaber;
import techreborn.items.tools.ItemOmniTool; import techreborn.items.tools.ItemOmniTool;
import techreborn.items.tools.ItemRockCutter; import techreborn.items.tools.ItemRockCutter;
import techreborn.items.tools.ItemSteelJackhammer; import techreborn.items.tools.ItemSteelJackhammer;
import techreborn.items.tools.ItemTRAxe;
import techreborn.items.tools.ItemTRHoe;
import techreborn.items.tools.ItemTRPickaxe;
import techreborn.items.tools.ItemTRSpade;
import techreborn.items.tools.ItemTRSword;
import techreborn.items.tools.ItemTechManual; import techreborn.items.tools.ItemTechManual;
import techreborn.items.tools.ItemTreeTap; import techreborn.items.tools.ItemTreeTap;
import techreborn.items.tools.ItemWrench; import techreborn.items.tools.ItemWrench;
import techreborn.lib.Reference;
public class ModItems public class ModItems
{ {
@ -124,6 +132,17 @@ public class ModItems
public static Item energyCrystal; public static Item energyCrystal;
public static Item scrapBox; public static Item scrapBox;
public static Item bronzeSword;
public static Item bronzePickaxe;
public static Item bronzeSpade;
public static Item bronzeAxe;
public static Item bronzeHoe;
public static Item bronzeHelmet;
public static Item bronzeChestplate;
public static Item bronzeLeggings;
public static Item bronzeBoots;
public static Item upgrades; public static Item upgrades;
public static Item missingRecipe; public static Item missingRecipe;
@ -207,6 +226,26 @@ public class ModItems
diamondJackhammer = PoweredItem.createItem(ItemDiamondJackhammer.class); diamondJackhammer = PoweredItem.createItem(ItemDiamondJackhammer.class);
GameRegistry.registerItem(diamondJackhammer, "diamondjackhammer"); GameRegistry.registerItem(diamondJackhammer, "diamondjackhammer");
bronzeSword = new ItemTRSword(Reference.BRONZE);
GameRegistry.registerItem(bronzeSword, "bronzeSword");
bronzePickaxe = new ItemTRPickaxe(Reference.BRONZE);
GameRegistry.registerItem(bronzePickaxe, "bronzePickaxe");
bronzeSpade = new ItemTRSpade(Reference.BRONZE);
GameRegistry.registerItem(bronzeSpade, "bronzeSpade");
bronzeAxe = new ItemTRAxe(Reference.BRONZE);
GameRegistry.registerItem(bronzeAxe, "bronzeAxe");
bronzeHoe = new ItemTRHoe(Reference.BRONZE);
GameRegistry.registerItem(bronzeHoe, "bronzeHoe");
bronzeHelmet = new ItemTRArmour(Reference.BRONZE_ARMOUR, EntityEquipmentSlot.HEAD);
GameRegistry.registerItem(bronzeHelmet, "bronzeHelmet");
bronzeChestplate = new ItemTRArmour(Reference.BRONZE_ARMOUR, EntityEquipmentSlot.CHEST);
GameRegistry.registerItem(bronzeChestplate, "bronzeChestplate");
bronzeLeggings = new ItemTRArmour(Reference.BRONZE_ARMOUR, EntityEquipmentSlot.LEGS);
GameRegistry.registerItem(bronzeLeggings, "bronzeLeggings");
bronzeBoots = new ItemTRArmour(Reference.BRONZE_ARMOUR, EntityEquipmentSlot.FEET);
GameRegistry.registerItem(bronzeBoots, "bronzeBoots");
hammer = new ItemHammer(100); hammer = new ItemHammer(100);
GameRegistry.registerItem(hammer, "hammer"); GameRegistry.registerItem(hammer, "hammer");

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;
}
}

View file

@ -1,5 +1,7 @@
package techreborn.items.tools; package techreborn.items.tools;
import java.util.List;
import me.modmuss50.jsonDestroyer.api.ITexturedItem; import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.client.renderer.block.model.ModelResourceLocation;
@ -20,8 +22,6 @@ import techreborn.client.TechRebornCreativeTab;
import techreborn.config.ConfigTechReborn; import techreborn.config.ConfigTechReborn;
import techreborn.lib.ModInfo; import techreborn.lib.ModInfo;
import java.util.List;
public class ItemRockCutter extends ItemPickaxe implements IEnergyItemInfo, ITexturedItem public class ItemRockCutter extends ItemPickaxe implements IEnergyItemInfo, ITexturedItem
{ {

View file

@ -0,0 +1,63 @@
package techreborn.items.tools;
import java.util.Set;
import com.google.common.collect.Sets;
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemTool;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.RebornCore;
import techreborn.lib.ModInfo;
public class ItemTRAxe extends ItemTool implements ITexturedItem {
private ToolMaterial material = ToolMaterial.WOOD;
private static final Set<Block> EFFECTIVE_ON = Sets.newHashSet(new Block[] { Blocks.planks, Blocks.bookshelf,
Blocks.log, Blocks.log2, Blocks.chest, Blocks.pumpkin, Blocks.lit_pumpkin, Blocks.melon_block,
Blocks.ladder, Blocks.wooden_button, Blocks.wooden_pressure_plate });
public ItemTRAxe(ToolMaterial material) {
super(material, EFFECTIVE_ON);
this.damageVsEntity = material.getDamageVsEntity() + 5.75F;
this.attackSpeed = (material.getDamageVsEntity() + 6.75F) * -0.344444F;
setUnlocalizedName(material.name().toLowerCase() + "Axe");
RebornCore.jsonDestroyer.registerObject(this);
this.material = material;
}
public float getStrVsBlock(ItemStack stack, IBlockState state) {
Material material = state.getMaterial();
return material != Material.wood && material != Material.plants && material != Material.vine
? super.getStrVsBlock(stack, state) : this.efficiencyOnProperMaterial;
}
@Override
public String getTextureName(int damage) {
return "techreborn:items/tool/" + material.name().toLowerCase() + "_axe";
}
@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;
}
}

View file

@ -0,0 +1,49 @@
package techreborn.items.tools;
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemHoe;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.RebornCore;
import techreborn.lib.ModInfo;
public class ItemTRHoe extends ItemHoe implements ITexturedItem
{
private ToolMaterial material = ToolMaterial.WOOD;
public ItemTRHoe(ToolMaterial material) {
super(material);
setUnlocalizedName(material.name().toLowerCase()+"Hoe");
RebornCore.jsonDestroyer.registerObject(this);
this.material=material;
}
@Override
public String getTextureName(int damage)
{
return "techreborn:items/tool/"+material.name().toLowerCase()+"_hoe";
}
@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;
}
}

View file

@ -0,0 +1,49 @@
package techreborn.items.tools;
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemPickaxe;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.RebornCore;
import techreborn.lib.ModInfo;
public class ItemTRPickaxe extends ItemPickaxe implements ITexturedItem
{
private ToolMaterial material = ToolMaterial.WOOD;
public ItemTRPickaxe(ToolMaterial material) {
super(material);
setUnlocalizedName(material.name().toLowerCase()+"Pickaxe");
RebornCore.jsonDestroyer.registerObject(this);
this.material=material;
}
@Override
public String getTextureName(int damage)
{
return "techreborn:items/tool/"+material.name().toLowerCase()+"_pickaxe";
}
@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;
}
}

View file

@ -0,0 +1,49 @@
package techreborn.items.tools;
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemSpade;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.RebornCore;
import techreborn.lib.ModInfo;
public class ItemTRSpade extends ItemSpade implements ITexturedItem
{
private ToolMaterial material = ToolMaterial.WOOD;
public ItemTRSpade(ToolMaterial material) {
super(material);
setUnlocalizedName(material.name().toLowerCase()+"Spade");
RebornCore.jsonDestroyer.registerObject(this);
this.material=material;
}
@Override
public String getTextureName(int damage)
{
return "techreborn:items/tool/"+material.name().toLowerCase()+"_shovel";
}
@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;
}
}

View file

@ -0,0 +1,49 @@
package techreborn.items.tools;
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.RebornCore;
import techreborn.lib.ModInfo;
public class ItemTRSword extends ItemSword implements ITexturedItem
{
private ToolMaterial material = ToolMaterial.WOOD;
public ItemTRSword(ToolMaterial material) {
super(material);
setUnlocalizedName(material.name().toLowerCase()+"Sword");
RebornCore.jsonDestroyer.registerObject(this);
this.material=material;
}
@Override
public String getTextureName(int damage)
{
return "techreborn:items/tool/"+material.name().toLowerCase()+"_sword";
}
@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;
}
}

View file

@ -1,9 +1,15 @@
package techreborn.lib; package techreborn.lib;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraft.util.text.translation.I18n; import net.minecraft.util.text.translation.I18n;
import net.minecraftforge.common.util.EnumHelper;
public class Reference public class Reference
{ {
public static ToolMaterial BRONZE = EnumHelper.addToolMaterial("BRONZE", 2, 375, 6.0F, 2.25F, 8);
public static ArmorMaterial BRONZE_ARMOUR = EnumHelper.addArmorMaterial("BRONZE", ModInfo.MOD_ID+":bronze", 17, new int[] {3,6,5,2}, 8, null/*TODO: SoundEvent*/);
public static String alloySmelteRecipe = I18n.translateToLocal("techreborn.recipe.alloysmelter"); public static String alloySmelteRecipe = I18n.translateToLocal("techreborn.recipe.alloysmelter");
public static String assemblingMachineRecipe = I18n.translateToLocal("techreborn.recipe.assemblingmachine"); public static String assemblingMachineRecipe = I18n.translateToLocal("techreborn.recipe.assemblingmachine");
public static String blastFurnaceRecipe = I18n.translateToLocal("techreborn.recipe.blastfurnace"); public static String blastFurnaceRecipe = I18n.translateToLocal("techreborn.recipe.blastfurnace");

View file

@ -644,6 +644,15 @@ item.techreborn.hammer.name=Iron Hammer
item.techreborn.ironJackhammer.name=Iron Jackhammer item.techreborn.ironJackhammer.name=Iron Jackhammer
item.techreborn.steelJackhammer.name=Steel Jackhammer item.techreborn.steelJackhammer.name=Steel Jackhammer
item.techreborn.diamondJackhammer.name=Diamond Jackhammer item.techreborn.diamondJackhammer.name=Diamond Jackhammer
item.bronzeSword.name=Bronze Sword
item.bronzePickaxe.name=Bronze Pickaxe
item.bronzeSpade.name=Bronze Shovel
item.bronzeAxe.name=Bronze Axe
item.bronzeHoe.name=Bronze Hoe
item.bronzeHelmet.name=Bronze Helmet
item.bronzeChestplate.name=Bronze Chestplate
item.bronzeLeggings.name=Bronze Leggings
item.bronzeBoots.name=Bronze Boots
#Buckets #Buckets
item.bucketberylium.name=Berylium Bucket item.bucketberylium.name=Berylium Bucket

Binary file not shown.

Before

Width:  |  Height:  |  Size: 151 B

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 284 B

After

Width:  |  Height:  |  Size: 271 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 735 B