Copper armor

This commit is contained in:
Emmanuel BENOîT 2016-06-17 09:30:22 +02:00
parent a4f21d38a1
commit ae8f8ff176
15 changed files with 140 additions and 4 deletions

View file

@ -32,8 +32,6 @@ food No Extra recipes
Pizza
Various mashes
-------------------------------------------------------------------------------------------------------
tech.tools No Copper armor
-------------------------------------------------------------------------------------------------------
??? ??? Sub-blocks
??? Yes Improved pistons
??? ??? Insulated redstone wires

View file

@ -0,0 +1,68 @@
package mmm.tech.tools;
import mmm.utils.I_URecipeRegistrar;
import mmm.utils.URegistry;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.registry.GameRegistry;
public class TTArmor
extends ItemArmor
implements I_URecipeRegistrar
{
public TTArmor( final ArmorMaterial materialIn , final EntityEquipmentSlot equipmentSlotIn )
{
super( materialIn , materialIn.ordinal( ) , equipmentSlotIn );
URegistry.setIdentifiers( this , "tech" , "tools" , "armor" , materialIn.toString( ).toLowerCase( ) ,
equipmentSlotIn.getName( ) );
}
@Override
public void registerRecipes( )
{
String l0 , l1 , l2;
switch ( this.getEquipmentSlot( ) ) {
case CHEST:
l0 = "I I";
l1 = "III";
l2 = "III";
break;
case FEET:
l0 = "I I";
l1 = "I I";
l2 = null;
break;
case HEAD:
l0 = "III";
l1 = "I I";
l2 = null;
break;
case LEGS:
l0 = "III";
l1 = "I I";
l2 = "I I";
break;
default:
throw new IllegalArgumentException( "unsupported armor slot '" + this.getEquipmentSlot( ) + "'" );
}
final ItemStack self = new ItemStack( this );
final ItemStack ingredient = new ItemStack( this.getArmorMaterial( ).getRepairItem( ) );
if ( l2 == null ) {
GameRegistry.addShapedRecipe( self , l0 , l1 , 'I' , ingredient );
} else {
GameRegistry.addShapedRecipe( self , l0 , l1 , l2 , 'I' , ingredient );
}
}
}

View file

@ -0,0 +1,36 @@
package mmm.tech.tools;
import mmm.utils.URegistry;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraft.util.SoundEvent;
import net.minecraftforge.common.util.EnumHelper;
public class TTArmorSet
{
public final ArmorMaterial ARMOR_MATERIAL;
public final TTArmor HELMET;
public final TTArmor CHESTPLATE;
public final TTArmor LEGGINGS;
public final TTArmor BOOTS;
public TTArmorSet( final String name , final Item material , final int durability , final int[] reductionAmounts ,
final int enchantability , final SoundEvent soundOnEquip , final float toughness )
{
this.ARMOR_MATERIAL = EnumHelper.addArmorMaterial( name.toUpperCase( ) , "mmm:" + name , durability ,
reductionAmounts , enchantability , soundOnEquip , toughness );
this.ARMOR_MATERIAL.customCraftingMaterial = material;
URegistry.addItem( this.HELMET = new TTArmor( this.ARMOR_MATERIAL , EntityEquipmentSlot.HEAD ) );
URegistry.addItem( this.CHESTPLATE = new TTArmor( this.ARMOR_MATERIAL , EntityEquipmentSlot.CHEST ) );
URegistry.addItem( this.LEGGINGS = new TTArmor( this.ARMOR_MATERIAL , EntityEquipmentSlot.LEGS ) );
URegistry.addItem( this.BOOTS = new TTArmor( this.ARMOR_MATERIAL , EntityEquipmentSlot.FEET ) );
}
}

View file

@ -2,15 +2,20 @@ package mmm.tech.tools;
import mmm.materials.Materials;
import net.minecraft.init.SoundEvents;
public class Tools
{
public static final TTToolSet COPPER;
public static final TTToolSet COPPER_TOOLS;
public static final TTArmorSet COPPER_ARMOR;
static {
COPPER = new TTToolSet( "copper" , Materials.COPPER.INGOT , 2 , 192 , 5.0f , 1.5f , 18 , 7 , -3 );
COPPER_TOOLS = new TTToolSet( "copper" , Materials.COPPER.INGOT , 2 , 192 , 5.0f , 1.5f , 18 , 7 , -3 );
COPPER_ARMOR = new TTArmorSet( "copper" , Materials.COPPER.INGOT , 10 , new int[] {
1 , 3 , 4 , 1
} , 20 , SoundEvents.ITEM_ARMOR_EQUIP_GENERIC , 0 );
}

View file

@ -36,3 +36,8 @@ item.mmm.tech.tools.shovel.copper.name=Copper Shovel
item.mmm.tech.tools.axe.copper.name=Copper Axe
item.mmm.tech.tools.pickaxe.copper.name=Copper Pickaxe
item.mmm.tech.tools.sword.copper.name=Copper Sword
item.mmm.tech.tools.armor.copper.feet.name=Copper Boots
item.mmm.tech.tools.armor.copper.legs.name=Copper Leggings
item.mmm.tech.tools.armor.copper.chest.name=Copper Chestplate
item.mmm.tech.tools.armor.copper.head.name=Copper Helmet

View file

@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "mmm:items/tech/tools/armor/copper/chest"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "mmm:items/tech/tools/armor/copper/feet"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "mmm:items/tech/tools/armor/copper/head"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "mmm:items/tech/tools/armor/copper/legs"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 938 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 564 B