Copper armor
This commit is contained in:
parent
a4f21d38a1
commit
ae8f8ff176
15 changed files with 140 additions and 4 deletions
2
TODO.txt
2
TODO.txt
|
@ -32,8 +32,6 @@ food No Extra recipes
|
|||
Pizza
|
||||
Various mashes
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
tech.tools No Copper armor
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
??? ??? Sub-blocks
|
||||
??? Yes Improved pistons
|
||||
??? ??? Insulated redstone wires
|
||||
|
|
68
src/java/mmm/tech/tools/TTArmor.java
Normal file
68
src/java/mmm/tech/tools/TTArmor.java
Normal 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 );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
36
src/java/mmm/tech/tools/TTArmorSet.java
Normal file
36
src/java/mmm/tech/tools/TTArmorSet.java
Normal 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 ) );
|
||||
}
|
||||
}
|
|
@ -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 );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "mmm:items/tech/tools/armor/copper/chest"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "mmm:items/tech/tools/armor/copper/feet"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "mmm:items/tech/tools/armor/copper/head"
|
||||
}
|
||||
}
|
|
@ -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 |
Reference in a new issue