Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.minecraft.src;
- public class BlockCactusPoison extends BlockCactus
- {
- protected BlockCactusPoison(int i, int j)
- {
- super(i, j); //Params %blockID%, %textureIndex%, Material.cactus
- setTickOnLoad(true);
- }
- @Override
- public void onEntityCollidedWithBlock(World world, int i, int j, int k, Entity entity)
- {
- //le EntityCaveSpider spork
- if (entity instanceof EntityLiving)
- {
- byte byte0 = 0;
- if (world.difficultySetting > 1)
- {
- if (world.difficultySetting == 2)
- {
- byte0 = 7;
- }
- else if (world.difficultySetting == 3)
- {
- byte0 = 15;
- }
- }
- if (byte0 > 0)
- {
- ((EntityLiving)entity).addPotionEffect(new PotionEffect(Potion.poison.id, byte0 * 20, 0));
- }
- }
- //end spork
- }
- @Override
- public int getBlockTextureFromSide(int i)
- {
- if (i == 1)
- {
- return mod_EvilMinecraft_Fragment.poisonCactusTextureIndexTop;
- }
- if (i == 0)
- {
- return mod_EvilMinecraft_Fragment.poisonCactusTextureIndexBottom;
- }
- else
- {
- return mod_EvilMinecraft_Fragment.poisonCactusTextureIndexSide;
- }
- }
- @Override
- public boolean canBlockStay(World world, int i, int j, int k)
- {
- if (world.getBlockMaterial(i - 1, j, k).isSolid())
- {
- return false;
- }
- if (world.getBlockMaterial(i + 1, j, k).isSolid())
- {
- return false;
- }
- if (world.getBlockMaterial(i, j, k - 1).isSolid())
- {
- return false;
- }
- if (world.getBlockMaterial(i, j, k + 1).isSolid())
- {
- return false;
- }
- else
- {
- int l = world.getBlockId(i, j - 1, k);
- return l == this.blockID || l == Block.sand.blockID;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement