package net.minecraft.src;
public class ItemTutorial extends ItemToolTutorial
{
private static Block blocksEffectiveAgainst[];
protected ItemTutorial(int i, EnumToolMaterialTutorial enumtoolmaterial)
{
super(i, 2, enumtoolmaterial, blocksEffectiveAgainst);
}
public boolean canHarvestBlock(Block block)
{
if (block == Block.obsidian)
{
return toolMaterial.getHarvestLevel() == 1;
}
if (block == Block.blockDiamond || block == Block.oreDiamond)
{
return toolMaterial.getHarvestLevel() >= 2;
}
if (block == Block.blockGold || block == Block.oreGold)
{
return toolMaterial.getHarvestLevel() >= 2;
}
if (block == Block.blockSteel || block == Block.oreIron)
{
return toolMaterial.getHarvestLevel() >= 1;
}
if (block == Block.blockLapis || block == Block.oreLapis)
{
return toolMaterial.getHarvestLevel() >= 1;
}
if (block == Block.oreRedstone || block == Block.oreRedstoneGlowing)
{
return toolMaterial.getHarvestLevel() >= 2;
}
if (block.blockMaterial == Material.rock)
{
return true;
}
if (block == block.leaves){
return Block.leaves != null;
}
if (block == block.ice){
return Block.ice != null;
}
return block.blockMaterial == Material.iron || block.blockID == Block.web.blockID || block.blockID == Block.leaves.blockID;
}
public boolean onItemUse(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer , EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7)
{
if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6))
{
return false;
}
int i = par3World.getBlockId(par4, par5, par6);
int j = par3World.getBlockId(par4, par5 + 1, par6);
if (par7 != 0 && j == 0 && i == Block.grass.blockID || i == Block.dirt.blockID)
{
Block block = Block.tilledField;
par3World.playSoundEffect((float)par4 + 0.5F, (float)par5 + 0.5F, (float)par6 + 0.5F, block.stepSound.getStepSound(), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F);
if (par3World.isRemote)
{
return true;
}
else
{
par3World.setBlockWithNotify(par4, par5, par6, block.blockID);
par1ItemStack.damageItem(1, par2EntityPlayer);
return true;
}
}
else
{
return false;
}
}
/**
* Returns True is the item is renderer in full 3D when hold.
*/
public boolean isFull3D()
{
return true;
}
public boolean onBlockDestroyed(ItemStack par1ItemStack, int par2, int par3, int par4, int par5, EntityLiving par6EntityLiving)
{
if (par2 == Block.leaves.blockID || par2 == Block.web.blockID || par2 == Block.tallGrass.blockID || par2 == Block.vine.blockID)
{
par1ItemStack.damageItem(1, par6EntityLiving);
return true;
}
else
{
return super.onBlockDestroyed(par1ItemStack, par2, par3, par4, par5, par6EntityLiving);
}
}
public float getStrVsBlock(ItemStack itemstack, Block block)
{
if (block != null && (block.blockMaterial == Material.iron || block.blockMaterial == Material.rock || block.blockMaterial == Material.wood || block.blockID == Block.leaves.blockID))
{
return efficiencyOnProperMaterial;
}
else
{
return super.getStrVsBlock(itemstack, block);
}
}
static
{
blocksEffectiveAgainst = (new Block[]
{
Block.cobblestone, Block.stairDouble, Block.stairSingle, Block.stone, Block.sandStone, Block.cobblestoneMossy, Block.oreIron, Block.blockSteel, Block.oreCoal, Block.blockGold,
Block.oreGold, Block.oreDiamond, Block.blockDiamond, Block.ice, Block.netherrack, Block.oreLapis, Block.blockLapis, Block.oreRedstone, Block.oreRedstoneGlowing, Block.rail,
Block.railDetector, Block.sand, Block.dirt, Block.grass, Block.gravel, Block.snow, Block.blockSnow, Block.blockClay, Block.tilledField, Block.slowSand, Block.mycelium, Block.planks, Block.bookShelf, Block.wood, Block.chest, Block.stairDouble, Block.stairSingle, Block.pumpkin, Block.pumpkinLantern
});
}
}
Info.: Ich habe mal ein wordpress theme erstellt und würde euch dieses gerne geben weis nicht wie viele Interesse haben ich würde es euch für 0.00€ geben hier ist mal ein Bild