Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 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, mod_palmLeaves, World,
- // EntityPlayer
- public class BlockCojoPalmWood extends Block
- {
- protected BlockCojoPalmWood(int i, int j)
- {
- super(i, j, Material.wood);
- setTickOnLoad(true);
- }
- public int quantityDropped(Random random)
- {
- return 1;
- }
- public int idDropped(int i, Random random)
- {
- return mod_tropicraft.palmWood.blockID;
- }
- public void harvestBlock(World world, EntityPlayer entityplayer, int i, int j, int k, int l)
- {
- super.harvestBlock(world, entityplayer, i, j, k, l);
- }
- public void updateTick(World world, int i, int j, int k, Random random)
- {
- if(world.getBlockId(i, j + 1, k) == mod_tropicraft.palmLeaves.blockID || world.getBlockId(i, j + 2, k) == mod_tropicraft.palmLeaves.blockID)
- {
- if(world.isAirBlock(i + 1, j, k) && random.nextInt(20) == 0)
- {
- world.setBlockWithNotify(i + 1, j , k, mod_tropicraft.coconut.blockID);
- world.setBlockMetadataWithNotify(i, j, k, 0);
- }
- if(world.isAirBlock(i - 1, j, k) && random.nextInt(20) == 0)
- {
- world.setBlockWithNotify(i - 1, j , k, mod_tropicraft.coconut.blockID);
- world.setBlockMetadataWithNotify(i, j, k, 0);
- }
- if(world.isAirBlock(i , j, k- 1) && random.nextInt(20) == 0)
- {
- world.setBlockWithNotify(i , j , k - 1, mod_tropicraft.coconut.blockID);
- world.setBlockMetadataWithNotify(i, j, k, 0);
- }
- if(world.isAirBlock(i , j, k + 1) && random.nextInt(20) == 0)
- {
- world.setBlockWithNotify(i , j , k + 1, mod_tropicraft.coconut.blockID);
- world.setBlockMetadataWithNotify(i, j, k, 0);
- }
- if(world.isAirBlock(i , j - 1, k) && random.nextInt(20) == 0)
- {
- world.setBlockWithNotify(i , j - 1, k , mod_tropicraft.coconut.blockID);
- world.setBlockMetadataWithNotify(i, j, k, 0);
- }
- }
- }
- public int getBlockTextureFromSideAndMetadata(int i, int j)
- {
- if(i == 1)
- {
- return mod_tropicraft.palmWoodBottom;
- }
- if(i == 0)
- {
- return mod_tropicraft.palmWoodBottom;
- } else
- {
- return mod_tropicraft.palmWood.blockIndexInTexture;
- }
- }
- protected int damageDropped(int i)
- {
- return i;
- }
- public float blockStrength(EntityPlayer entityplayer)
- {
- super.blockStrength(entityplayer);
- if(blockHardness < 0.0F)
- {
- return 0.0F;
- }
- if(!entityplayer.canHarvestBlock(this))
- {
- return 1.0F / blockHardness / 100F;
- } else
- {
- return entityplayer.getCurrentPlayerStrVsBlock(Block.wood) / blockHardness / 30F;
- }
- }
- public void onBlockRemoval(World world, int i, int j, int k)
- {
- byte byte0 = 4;
- int l = byte0 + 1;
- if(world.checkChunksExist(i - l, j - l, k - l, i + l, j + l, k + l))
- {
- for(int i1 = -byte0; i1 <= byte0; i1++)
- {
- for(int j1 = -byte0; j1 <= byte0; j1++)
- {
- for(int k1 = -byte0; k1 <= byte0; k1++)
- {
- int l1 = world.getBlockId(i + i1, j + j1, k + k1);
- if(l1 != mod_tropicraft.palmLeaves.blockID)
- {
- continue;
- }
- int i2 = world.getBlockMetadata(i + i1, j + j1, k + k1);
- if((i2 & 8) == 0)
- {
- world.setBlockMetadata(i + i1, j + j1, k + k1, i2 | 8);
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement