2013-05-25 02:33:57 +00:00
|
|
|
package biomesoplenty.liquids;
|
|
|
|
|
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
|
|
|
import net.minecraft.block.BlockStationary;
|
|
|
|
import net.minecraft.block.material.Material;
|
|
|
|
import net.minecraft.client.renderer.texture.IconRegister;
|
|
|
|
import net.minecraft.entity.Entity;
|
|
|
|
import net.minecraft.entity.EntityLiving;
|
2013-05-25 08:57:21 +00:00
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
2013-05-25 02:33:57 +00:00
|
|
|
import net.minecraft.potion.Potion;
|
|
|
|
import net.minecraft.potion.PotionEffect;
|
|
|
|
import net.minecraft.util.Icon;
|
2013-05-25 08:57:21 +00:00
|
|
|
import net.minecraft.world.IBlockAccess;
|
2013-05-25 02:33:57 +00:00
|
|
|
import net.minecraft.world.World;
|
|
|
|
|
|
|
|
import biomesoplenty.BiomesOPlenty;
|
2013-05-25 09:33:37 +00:00
|
|
|
import biomesoplenty.api.Potions;
|
2013-05-25 08:57:21 +00:00
|
|
|
import biomesoplenty.configuration.BOPPotions;
|
2013-05-25 02:33:57 +00:00
|
|
|
|
|
|
|
public class BlockSpringWaterStill extends BlockStationary
|
|
|
|
{
|
|
|
|
public BlockSpringWaterStill(int id)
|
|
|
|
{
|
|
|
|
super(id, Material.water);
|
|
|
|
|
|
|
|
this.blockHardness = 100F;
|
2013-05-25 04:08:06 +00:00
|
|
|
this.setLightOpacity(0);
|
2013-05-25 02:33:57 +00:00
|
|
|
this.disableStats();
|
|
|
|
}
|
|
|
|
|
2013-05-25 08:57:21 +00:00
|
|
|
@Override
|
|
|
|
public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
|
|
|
{
|
|
|
|
return 16777215;
|
|
|
|
}
|
|
|
|
|
2013-05-25 04:08:06 +00:00
|
|
|
@Override
|
|
|
|
public void onBlockAdded(World par1World, int x, int y, int z)
|
|
|
|
{
|
|
|
|
this.setSpringWaterNotStationary(par1World, x, y, z);;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setSpringWaterNotStationary(World par1World, int par2, int par3, int par4)
|
|
|
|
{
|
|
|
|
int l = par1World.getBlockMetadata(par2, par3, par4);
|
|
|
|
par1World.setBlock(par2, par3, par4, this.blockID - 1, l, 2);
|
|
|
|
par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID - 1, this.tickRate(par1World));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-05-25 02:33:57 +00:00
|
|
|
@Override
|
|
|
|
public void onEntityCollidedWithBlock(World par1World, int x, int y, int z, Entity par5Entity)
|
|
|
|
{
|
|
|
|
int meta = par1World.getBlockMetadata(x, y, z);
|
|
|
|
|
|
|
|
if (par5Entity instanceof EntityLiving)
|
2013-05-25 13:22:37 +00:00
|
|
|
((EntityLiving)par5Entity).addPotionEffect(new PotionEffect(Potion.regeneration.id, 100));
|
2013-05-25 08:57:21 +00:00
|
|
|
|
|
|
|
if (par5Entity instanceof EntityPlayer)
|
2013-05-25 13:22:37 +00:00
|
|
|
((EntityPlayer)par5Entity).addPotionEffect(new PotionEffect(Potions.nourishment.get().id, 100));
|
2013-05-25 02:33:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
public void registerIcons(IconRegister iconRegister)
|
|
|
|
{
|
|
|
|
this.theIcon = new Icon[]{iconRegister.registerIcon("BiomesOPlenty:spring_water_still"), iconRegister.registerIcon("BiomesOPlenty:spring_water_flowing")};
|
|
|
|
}
|
|
|
|
}
|