I have ran into another problem, i was able to get the ice pick to drop ice when a pick picks it, but now i want to have it so if a pick picks it no water come out i.e the ice doesn't turn into water. and if the ice is hit with anything other then a pick then to turn into water. I know i must use a if esle statement but im not sure how.
any help would be great. heres my code that i have so far.
BlockIce.java
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode
package net.minecraft.src;
import java.util.Random;
// Referenced classes of package net.minecraft.src:
// Block, Material
public class BlockIce extends Block
{
public BlockIce(int i, int j)
{
super(i, j, Material.rock);
slipperiness = 1.0F;
setTickOnLoad(true);
}
public int idDropped(int i, Random random)
{
return Block.ice.blockID;
}
public int getRenderBlockPass()
{
return 1;
}
public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l)
{
return super.shouldSideBeRendered(iblockaccess, i, j, k, 1 - l);
}
// my code
public void onBlockRemoval(World world, int i, int j, int k)
{
Material material = world.getBlockMaterial(i, j - 1, k);
if(material.getIsLiquid () || material.getIsSolid())
{}
else
{
world.setBlockWithNotify(i, j, k, Block.waterMoving.blockID);
}
}
// old code
// public void onBlockRemoval(World world, int i, int j, int k)
// {
// Material material = world.getBlockMaterial(i, j - 1, k);
// if(material.getIsSolid() || material.getIsLiquid())
// {
// world.setBlockWithNotify(i, j, k, Block.waterMoving.blockID);
// }
// }
public void updateTick(World world, int i, int j, int k, Random random)
{
if(world.getSavedLightValue(EnumSkyBlock.Block, i, j, k) > 11 - Block.lightOpacity[blockID])
{
dropBlockAsItem(world, i, j, k, world.getBlockMetadata(i, j, k));
world.setBlockWithNotify(i, j, k, Block.waterStill.blockID);
}
}
}
I still want the ice to turn to water but just when it gets punched by hand and not by pick, so im thinking i need a if else statement saying something like: if return Block.ice.blockID do nothing esle world.setBlockWithNotify(i, j, k, Block.waterMoving.blockID); but im not sure how to word the if statement the else i can get i just need help with the if ):
any help would be great. heres my code that i have so far.
BlockIce.java