Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MOD_FILE CONTENTS:
- package net.minecraft.src;
- import java.util.Random;
- public class mod_tutorial extends BaseMod
- {
- //Blocks
- //Items
- public static final Item RHelmet = (new ItemArmorRedstone(1012,EnumArmorMaterial.DIAMOND, ModLoader.addArmor("redstone"), 0).setItemName("RHelmet"));
- public static final Item RChestplate = (new ItemArmorRedstone(1013,EnumArmorMaterial.DIAMOND, ModLoader.addArmor("redstone"), 1).setItemName("RChestplate"));
- public static final Item RLeggings = (new ItemArmorRedstone(1014,EnumArmorMaterial.DIAMOND, ModLoader.addArmor("redstone"), 2).setItemName("RLeggings"));
- public static final Item RBoots = (new ItemArmorRedstone(1015,EnumArmorMaterial.DIAMOND, ModLoader.addArmor("redstone"), 3).setItemName("RBoots"));
- public void load()
- {
- RHelmet.iconIndex = ModLoader.addOverride("/gui/items.png","/Items/redstonehelmet.png");
- RChestplate.iconIndex = ModLoader.addOverride("/gui/items.png","/Items/redstonechestplate.png");
- RLeggings.iconIndex = ModLoader.addOverride("/gui/items.png","/Items/redstoneleggings.png");
- RBoots.iconIndex = ModLoader.addOverride("/gui/items.png","/Items/redstoneboots.png");
- //Registering
- //Adding names
- ModLoader.addName(RHelmet, "Redstone Helmet");
- ModLoader.addName(RChestplate, "Redstone Chestplate");
- ModLoader.addName(RLeggings, "Redstone Leggings");
- ModLoader.addName(RBoots, "Redstone Boots");
- //Crafting Recipes
- //Smelting Recipes
- //Shapeless Recipes
- ModLoader.addShapelessRecipe(new ItemStack(mod_tutorial.RHelmet, 1), new Object[]
- {
- Item.seeds //Crafting Line
- });
- ModLoader.addShapelessRecipe(new ItemStack(mod_tutorial.RChestplate, 1), new Object[]
- {
- Item.seeds,Item.seeds //Crafting Line
- });
- ModLoader.addShapelessRecipe(new ItemStack(mod_tutorial.RLeggings, 1), new Object[]
- {
- Item.seeds,Item.seeds,Item.seeds //Crafting Line
- });
- ModLoader.addShapelessRecipe(new ItemStack(mod_tutorial.RBoots, 1), new Object[]
- {
- Item.seeds,Item.seeds,Item.seeds,Item.seeds //Crafting Line
- });
- }
- public String getVersion()
- {
- return "1.2.5";
- }
- }
- ITEMARMORREDSTONE FILE CONTENTS:
- package net.minecraft.src;
- public class ItemArmorRedstone extends ItemArmor
- {
- private static final int maxDamageArray[] =
- {
- 11, 16, 15, 13
- };
- /**
- * Stores the armor type: 0 is helmet, 1 is plate, 2 is legs and 3 is boots
- */
- public final int armorType;
- /** Holds the amount of damage that the armor reduces at full durability. */
- public final int damageReduceAmount;
- /**
- * Used on RenderPlayer to select the correspondent armor to be rendered on the player: 0 is cloth, 1 is chain, 2 is
- * iron, 3 is diamond and 4 is gold.
- */
- public final int renderIndex;
- /** The EnumArmorMaterial used for this ItemArmor */
- private final EnumArmorMaterial material;
- public ItemArmorRedstone(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4)
- {
- super(par1,par2EnumArmorMaterial,par3,par4);
- material = par2EnumArmorMaterial;
- armorType = par4;
- renderIndex = par3;
- damageReduceAmount = par2EnumArmorMaterial.getDamageReductionAmount(par4);
- setMaxDamage(par2EnumArmorMaterial.getDurability(par4));
- maxStackSize = 1;
- }
- /**
- * Return the enchantability factor of the item, most of the time is based on material.
- */
- public int getItemEnchantability()
- {
- return material.getEnchantability();
- }
- /**
- * Returns the 'max damage' factor array for the armor, each piece of armor have a durability factor (that gets
- * multiplied by armor material factor)
- */
- static int[] getMaxDamageArray()
- {
- return maxDamageArray;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement