• 0

    posted a message on EnumArmorMaterial problems?
    If your files are in another package, you need to import ItemArmor and EnumArmorMaterial:
    import net.minecraft.src.EnumArmorMaterial;
    import net.minecraft.src.ItemArmor;
    public class mod_ItemArmor extends ItemArmor
    {
    //your code
    }

    This should fix your problem.

    Just a quick question, are you using an IDE or a text editor to write your code?
    Posted in: Modification Development
  • 0

    posted a message on EnumArmorMaterial problems?
    Could you please post both .java files? When I compile the files I don't get any errors. Perhaps some of your changes are the causing this to happen.
    Posted in: Modification Development
  • 0

    posted a message on EnumArmorMaterial problems?
    What I did to solve the problem:
    public class ItemModArmor extends ItemArmor
    {
    private static final int maxDamageArray[] =
    {
    	 11, 16, 15, 13
    };
    public final int ArmorType;
    public final int DamageReduceAmount;
    public final int RenderIndex;
    private final EnumModArmorMaterial Material;
    public ItemModArmor(int i, EnumModArmorMaterial enumarmormaterial, int j, int k)
    {
    	 super(i, EnumArmorMaterial.DIAMOND, j, k);
    	 Material = enumarmormaterial;
    	 ArmorType = k;
    	 RenderIndex = j;
    	 DamageReduceAmount = enumarmormaterial.getDamageReductionAmount(k);
    	 setMaxDamage(enumarmormaterial.getDurability(k));
    	 maxStackSize = 1;
    }
    @Override
    public int getItemEnchantability()
    {
    	 return Material.getEnchantability();
    }
    static int[] getMaxDamageArray()
    {
    	 return maxDamageArray;
    }
    }
    And Here is the EnumModArmorMaterial.java:
    public enum EnumModArmorMaterial
    {
    OBSIDIAN(36, new int[]{4, 9, 7, 4}, 12);
    private int maxDamageFactor;
    private int damageReductionAmountArray[];
    /**
    	 * Return the enchantability factor of the material
    	 */
    private int enchantability;
    private int colour;
    private EnumModArmorMaterial(int par3, int par4ArrayOfInteger[], int par5)
    {
    	 maxDamageFactor = par3;
    	 damageReductionAmountArray = par4ArrayOfInteger;
    	 enchantability = par5;
    }
    /**
    	 * Returns the durability for a armor slot of for this type.
    	 */
    public int getDurability(int par1)
    {
    	 return ItemModArmor.getMaxDamageArray()[par1] * maxDamageFactor;
    }
    /**
    	 * Return the damage reduction (each 1 point is a half a shield on gui) of
    	 * the piece index passed (0 = helmet, 1 = plate, 2 = legs and 3 = boots)
    	 */
    public int getDamageReductionAmount(int par1)
    {
    	 return damageReductionAmountArray[par1];
    }
    /**
    	 * Return the enchantability factor of the material.
    	 */
    public int getEnchantability()
    {
    	 return enchantability;
    }
    }
    Posted in: Modification Development
  • 0

    posted a message on [1.3.1]TMMods (Obsidian Stuff, Lamp Posts)
    New mod that adds lampposts! Unlike other mods I have seen, this one doesn't have a fixed length (although there is a maximum of 5 blocks high) and can be activated with redstone. Right now, the material is wood, but the next update will probably contain iron and a "nether" type lamp post.
    Posted in: Minecraft Mods
  • 0

    posted a message on [ModLoader]Zid's Tutorials - Not Just ModLoader[12/04/2011]
    Quote from damianwernert

    How do you do this on a mac?

    You need Python to use MCP and the Java SDK to compiler the .java files, which you create in a text editor or an IDE.
    Posted in: Tutorials
  • 0

    posted a message on Need help with spawning and timers :3 +1!
    You can also try using java.util.Timer instead of javax.swing.Timer
    Posted in: Mods Discussion
  • 0

    posted a message on New to modding, ANY HELP?
    Try this one.
    Posted in: Mods Discussion
  • 1

    posted a message on Need help with spawning and timers :3 +1!
    corrected now:
    package net.minecraft.src;
    import javax.swing.Timer;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.util.Random;
    public class BlockPlate extends Block {
    	public BlockPlate(int i, int j) {
    		super(i, j, Material.iron);
    	}
    	Timer timer;
    	public int idDropped(int i, int j) {
    		return dirt.blockID;
    	}
    	public int quantityDropped(Random random) {
    		return 1;
    	}
    	public void onEntityCollidedWithBlock(final World world, final int i, final int j, final int k, Entity entity) {
    		//checks that the entity that collided is the Player
    		if(entity != null && entity.equals(ModLoader.getMinecraftInstance().thePlayer)) {
    				ModLoader.getMinecraftInstance().thePlayer.addChatMessage("You Have Ten Seconds Until the Hunger Games begin!");
    		} else {
    				 return;
    		}
    		if (timer == null) {
    			ActionListener actionListener = new ActionListener() {
    				int x = i;
    				int y = j;
    				int z = k;
    				public void actionPerformed(ActionEvent e) {
    					//Spawning entity and setting location
    					Entity entity = new Entitycareertribute1m(world);
    					entity.posX = x;
    					entity.posY = y + 1;
    					entity.posZ = z;
    					world.spawnEntityInWorld(entity);
    				}
    			};
    			//timer will just run once
    			timer = new Timer(10000, actionListener);
    			timer.setRepeats(false);
    			timer.start();
    		} else {
    			timer.restart();
    		}
    	}
    }
    Posted in: Mods Discussion
  • 1

    posted a message on Need help with spawning and timers :3 +1!
    Try this:
    package net.minecraft.src;
    import javax.swing.Timer;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.util.Random;
    public class BlockPlate extends Block{
    public BlockPlate(int i, int j){
    super(i, j, Material.iron);
    }
    Timer timer;
    public int idDropped(int i, int j)
    {
    return dirt.blockID;
    }
    public int quantityDropped(Random random)
    {
    return 1;
    }
    public void onEntityCollidedWithBlock(World world, int i, int j, int k, EntityPlayer entity)
    {
    ModLoader.getMinecraftInstance().thePlayer.addChatMessage("You Have Ten Seconds Until the Hunger Games begin!");
    if (timer == null) {
    ActionListener actionListener = new ActionListener() {
    int x = i;
    int y = j;
    int z = k;
    public void actionPerformed(ActionEvent e)
    {
    Entity entity = new Entitycareertribute1m(world);
    entity.posX = x;
    entity.posY = y + 1;
    entity.posZ = z;
    worldObj.spawnEntityInWorld(entity);
    }
    }
    }
    timer = new Timer(10000, this);
    timer.setRepeats(false);
    timer.start();
    }
    else {
    timer.restart();
    }
    }
    }
    Posted in: Mods Discussion
  • 0

    posted a message on New to modding, ANY HELP?
    This is a good topic.
    Posted in: Mods Discussion
  • 0

    posted a message on Code Help! (Moved?)
    There are two fields in the EntityPlayer class which could be useful to you.
        /**
    	 * The total amount of experience the player has. This also includes the amount of experience within      	 * their Experience Bar.
    	 */
    	public int experienceTotal;
    	/**
    	 * The current amount of experience the player has within their Experience Bar.
    	 */
    	public float experience;

    Then you would only need to do:
    entityplayer.experienceTotal -= 2;

    or
    entityplayer.experience -= 2;
    Posted in: Mods Discussion
  • 0

    posted a message on Entity/Block targeted by the player
    With a mob, you can use EntityCreature.getEntityToAttack().
    Entity target = entitycreature.getEntityToAttack();


    I don't think there is a method that returns a targeted Block.
    Posted in: Mods Discussion
  • 0

    posted a message on [1.3.1]TMMods (Obsidian Stuff, Lamp Posts)
    Quote from raa1337

    Same to assume it's Gold's Enchantability level as well?

    No. It has diamond's enchantability.
    Quote from CustomMine

    Awesome mod would you mind if i had the source codes? for personal use im trying to learn coding.

    Link Removed are the sources.
    Posted in: Minecraft Mods
  • 0

    posted a message on [1.3.1]TMMods (Obsidian Stuff, Lamp Posts)
    Quote from NORB20XX

    hmm i like this idea, how strong/fast are they? :feather: :feather: :feather:


    The tools are as fast as gold tools and have 2048 uses (diamond has 1561). With full armor, a skeleton arrow does half a heart of damage on Hard. The sword can kill a spider on Hard with two hits.
    Posted in: Minecraft Mods
  • 0

    posted a message on [1.3.1]TMMods (Obsidian Stuff, Lamp Posts)
    Quote from ocomobock

    This has been made several times, but good job on the mod. Also, the pickaxe and the shovel look like hoes. (no pun intended)


    Thanks! I got confused with the image links, but it's fixed now.
    Posted in: Minecraft Mods
  • To post a comment, please .