1

[HELP] EnumToolMaterial

xiFackx's Avatar xiFackx8/22/12 12:33 pm
1 emeralds 1.1k 10
8/25/2012 4:02 am
calibrix's Avatar calibrix
I want to know how can i include the new material i added to EnumToolMaterial with my mod files so i can share it
Posted by xiFackx's Avatar
xiFackx
Level 27 : Expert Modder
8

Create an account or sign in to comment.

10

1
08/25/2012 4:02 am
Level 1 : New Miner
calibrix
calibrix's Avatar
you don't need a ',' after where you put '[/b]', just the ';'!
Just copy and paste this into it instead:
COPPER(3, 250, 12F, 3, 15); (mess around with the numbers if you want)
So EnumToolMaterial.java should now look like this:
package net.minecraft.src;

public enum EnumToolMaterial
{
WOOD(0, 59, 2.0F, 0, 15),
STONE(1, 131, 4.0F, 1, 5),
IRON(2, 250, 6.0F, 2, 14),
EMERALD(3, 1561, 8.0F, 3, 10),
GOLD(0, 32, 12.0F, 0, 22),
BLOODY(3, 250, 12F, 3, 15);

/**
* The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD)
*/
private final int harvestLevel;

/**
* The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
*/
private final int maxUses;

/**
* The strength of this tool material against blocks which it is effective against.
*/
private final float efficiencyOnProperMaterial;

/** Damage versus entities. */
private final int damageVsEntity;

/** Defines the natural enchantability factor of the material. */
private final int enchantability;

private EnumToolMaterial(int par3, int par4, float par5, int par6, int par7)
{
this.harvestLevel = par3;
this.maxUses = par4;
this.efficiencyOnProperMaterial = par5;
this.damageVsEntity = par6;
this.enchantability = par7;
}

/**
* The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
*/
public int getMaxUses()
{
return this.maxUses;
}

/**
* The strength of this tool material against blocks which it is effective against.
*/
public float getEfficiencyOnProperMaterial()
{
return this.efficiencyOnProperMaterial;
}

/**
* Damage versus entities.
*/
public int getDamageVsEntity()
{
return this.damageVsEntity;
}

/**
* The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD)
*/
public int getHarvestLevel()
{
return this.harvestLevel;
}

/**
* Return the natural enchantability factor of the material.
*/
public int getEnchantability()
{
return this.enchantability;
}
}


You need to make 3 classes- "mod_Bloody", "BlockBloodyOre" and "ItemBloodyIngot"..and paste this into "mod_Bloody":
package net.minecraft.src;

import java.util.Map;
import java.util.Random;

public class mod_Bloody extends BaseMod{


//creates all of the variables for our tools new ItemPickaxe("item id", MaterialType)
public static final Item BloodySword = new ItemSword(406, EnumToolMaterial.BLOODY).setItemName("BloodySword");
//declares the BloodyIngot variable
public static final Item BloodyIngot = new ItemBloodyIngot(401).setItemName("BloodyIngot");
//declares the BloodyOre variable
public static final Block BloodyOre = new BlockBloodyOre(200, 0).setBlockName("BloodyOre").setHardness(3F).setResistance(2F).setLightValue(0F);

public void load(){

//sets the image path for the item
BloodyIngot.iconIndex = ModLoader.addOverride("/gui/items.png", "/BloodyIngot.png");
//sets the name for the item
ModLoader.addName(BloodyIngot, "Bloody Ingot");
//adds our smelting recipe
ModLoader.addSmelting(BloodyOre.blockID, new ItemStack(BloodyIngot), 0.5F);

ModLoader.registerBlock(BloodyOre);
BloodyOre.blockIndexInTexture = ModLoader.addOverride("/terrain.png","/BloodyOre.png");
ModLoader.addName(BloodyOre, "Bloody Ore");
/** Tools **/

//basic item declarations
BloodySword.iconIndex = ModLoader.addOverride("/gui/items.png",
"/BloodySword.png");
ModLoader.addName(BloodySword, "Bloody Sword");
ModLoader.addRecipe(new ItemStack(BloodySword, 1),
new Object[] { " # ", " # ", " @ ", Character.valueOf('#'),
BloodyIngot, Character.valueOf('@'), Item.stick });
}

//mod version
public String getVersion(){
return "Minecraft 1.3.2";
}

}


In the class "BlockBloodyOre" paste this in:
package net.minecraft.src;

import java.util.Random;

public class BlockBloodyOre extends Block{

public BlockBloodyOre(int i, int j){

super(i, j, Material.iron);

}

public int idDropped(int i, Random random, int j){
return mod_Bloody.BloodyOre.blockID;
}

public int quantityDropped(Random random){
return 1;
}
}


And this in the final class "ItemCopperIngot":
package net.minecraft.src;

public class ItemCopperIngot extends Item{
public ItemCopperIngot(int eye){
super(eye);
maxStackSize = 64;
}
}


Also remember to make the 3 images and call them: "BloodyIngot.png", "BloodySword.png" and "BloodyOre.png"
1
08/24/2012 1:28 pm
Level 1 : New Miner
EvenGu
EvenGu's Avatar
withtin
public void load()
{
<-------here
}
1
08/24/2012 1:27 pm
Level 1 : New Miner
EvenGu
EvenGu's Avatar
package net.minecraft.src;

import java.util.Random;

public class mod_*** extends BaseMod
{
public void load()
{

}

public String getVersion()
{
return "1.3.2";
}

}

put it in this
1
08/23/2012 5:27 am
Level 27 : Expert Modder
xiFackx
xiFackx's Avatar
The material works perfectly. and the [b] was from me trying to put that line in bold... everything works nicely i just need to be able to export this file so anyone who uses my mod can use it
1
08/23/2012 4:37 am
Level 1 : New Explorer
athallon
athallon's Avatar
also, remove the [b]
1
08/23/2012 4:36 am
Level 1 : New Explorer
athallon
athallon's Avatar
mate it has to be in capitals!
1
08/23/2012 4:22 am
Level 27 : Expert Modder
xiFackx
xiFackx's Avatar
Anyone?
1
08/23/2012 2:59 am
Level 27 : Expert Modder
xiFackx
xiFackx's Avatar
I need that to be included with my mod.. how can do that?
1
08/22/2012 9:58 pm
Level 17 : Journeyman Pony
_scrunch
_scrunch's Avatar
What do you mean?
1
08/23/2012 2:59 am
Level 27 : Expert Modder
xiFackx
xiFackx's Avatar
In EnumToolMaterial i added this

package net.minecraft.src;

public enum EnumToolMaterial
{
WOOD(0, 59, 2.0F, 0, 15),
STONE(1, 131, 4.0F, 1, 5),
IRON(2, 250, 6.0F, 2, 14),
EMERALD(3, 1561, 8.0F, 3, 10),
GOLD(0, 32, 12.0F, 0, 22),
[b]BloodyStoneSword(1, 131, 4.0F, 1, 5)[/b], ;

/**
* The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD)
*/
private final int harvestLevel;

/**
* The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
*/
private final int maxUses;

/**
* The strength of this tool material against blocks which it is effective against.
*/
private final float efficiencyOnProperMaterial;

/** Damage versus entities. */
private final int damageVsEntity;

/** Defines the natural enchantability factor of the material. */
private final int enchantability;

private EnumToolMaterial(int par3, int par4, float par5, int par6, int par7)
{
this.harvestLevel = par3;
this.maxUses = par4;
this.efficiencyOnProperMaterial = par5;
this.damageVsEntity = par6;
this.enchantability = par7;
}

/**
* The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32)
*/
public int getMaxUses()
{
return this.maxUses;
}

/**
* The strength of this tool material against blocks which it is effective against.
*/
public float getEfficiencyOnProperMaterial()
{
return this.efficiencyOnProperMaterial;
}

/**
* Damage versus entities.
*/
public int getDamageVsEntity()
{
return this.damageVsEntity;
}

/**
* The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD)
*/
public int getHarvestLevel()
{
return this.harvestLevel;
}

/**
* Return the natural enchantability factor of the material.
*/
public int getEnchantability()
{
return this.enchantability;
}
}
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome