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 BlockTropicraftPalmWood extends Block implements net.minecraft.src.forge.ITextureProvider
- {
- protected BlockTropicraftPalmWood(int i, int j)
- {
- super(i, j, Material.wood);
- setTickRandomly(true);
- Block.setBurnProperties(i, 5, 5);
- }
- public int quantityDropped(Random random)
- {
- return 1;
- }
- @Override
- public String getTextureFile() {
- return "/tropicalmod/tropiterrain.png";
- }
- @Override
- public int idDropped(int i, Random random, int j)
- {
- 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)
- {
- spawnCoconuts(world, i, j, k, random, 20);
- }
- public static void spawnCoconuts(World world, int i, int j, int k, Random random, int chance) {
- if ((world.getBlockId(i, j + 1, k) == mod_tropicraft.tropicLeaves.blockID && world.getBlockMetadata(i, j + 1, k) == 0) || (world.getBlockId(i, j + 2, k) == mod_tropicraft.tropicLeaves.blockID
- && world.getBlockMetadata(i, j + 2, k) == 0)) {
- if (world.isAirBlock(i + 1, j, k) && random.nextInt(chance) == 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(chance) == 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(chance) == 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(chance) == 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(chance) == 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, int metadata)
- {
- super.blockStrength(entityplayer, metadata);
- if(blockHardness < 0.0F)
- {
- return 0.0F;
- }
- if(!entityplayer.canHarvestBlock(this))
- {
- return 1.0F / blockHardness / 100F;
- } else
- {
- return entityplayer.getCurrentPlayerStrVsBlock(Block.wood, metadata) / 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.tropicLeaves.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);
- }
- }
- }
- }
- }
- }
- @Override
- public int getRenderType()
- {
- return mod_tropicraft.cubeRenderMode;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment