Jump to content

Wood Staff


ashtonr12

Recommended Posts

i have created this but the methods are out of date and i don't know how to update them. help appreciated :)

package ashtonsmod.common;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;


public class WoodStaff extends Item {
public WoodStaff(int par1) {
super(par1);
}

public boolean onItemUse(ItemStack is, EntityPlayer player, World w, int x, int y, int z, int l, float f, float f1, float f3){
if(w.getBlockId(x, y, z) == Block.planks.blockID){
w.setBlockMetadataWithNotify(x, y, z, w.getBlockMetadata(x, y, z)+1);

if(w.getBlockMetadata(x, y, z) == 4){
w.setBlockMetadata(x, y, z, 0);
}
else if(w.getBlockId(x, y, z) == Block.wood.blockID){
w.setBlockMetadataWithNotify(x, y, z, w.getBlockMetadata(x, y, z)+1);

if(w.getBlockMetadata(x, y, z) == 4){
w.setBlockMetadata(x, y, z, 0);
}
}else if(w.getBlockId(x, y, z) == Block.stairsWoodSpruce.blockID){
w.setBlockWithNotify(x, y, z, Block.stairsWoodBirch.blockID);
}else if(w.getBlockId(x, y, z) == Block.stairsWoodBirch.blockID){
w.setBlockWithNotify(x, y, z, Block.stairsWoodJungle.blockID); 
}else if(w.getBlockId(x, y, z) == Block.stairsWoodJungle.blockID){
w.setBlockWithNotify(x, y, z, Block.stairCompactPlanks.blockID); 
}else if(w.getBlockId(x, y, z) == Block.stairCompactPlanks.blockID){
w.setBlockWithNotify(x, y, z, Block.stairsWoodSpruce.blockID); 


return false;
		}
	}
}
}

 

the errors are under all of the .setBlockWithNotify and the .setBlockMetadataWithNotify

i know they updated these methods :)

Use examples, i have aspergers.

Examples make sense to me.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.