Advertisement
Corosus

Untitled

Oct 16th, 2011
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 4.41 KB | None | 0 0
  1. // Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
  2. // Jad home page: http://www.kpdus.com/jad.html
  3. // Decompiler options: packimports(3) braces deadcode
  4.  
  5. package net.minecraft.src;
  6.  
  7. import java.util.Random;
  8.  
  9. // Referenced classes of package net.minecraft.src:
  10. //            Block, Material, mod_palmLeaves, World,
  11. //            EntityPlayer
  12.  
  13. public class BlockCojoPalmWood extends Block
  14. {
  15.  
  16.     protected BlockCojoPalmWood(int i, int j)
  17.     {
  18.         super(i, j, Material.wood);
  19.         setTickOnLoad(true);
  20.     }
  21.  
  22.     public int quantityDropped(Random random)
  23.     {
  24.         return 1;
  25.     }
  26.  
  27.     public int idDropped(int i, Random random)
  28.     {
  29.         return mod_tropicraft.palmWood.blockID;
  30.     }
  31.  
  32.     public void harvestBlock(World world, EntityPlayer entityplayer, int i, int j, int k, int l)
  33.     {
  34.         super.harvestBlock(world, entityplayer, i, j, k, l);
  35.     }
  36.  
  37.     public void updateTick(World world, int i, int j, int k, Random random)
  38.     {
  39.         if(world.getBlockId(i, j + 1, k) == mod_tropicraft.palmLeaves.blockID || world.getBlockId(i, j + 2, k) == mod_tropicraft.palmLeaves.blockID)
  40.         {
  41.            
  42.            
  43.             if(world.isAirBlock(i + 1, j, k) && random.nextInt(20) == 0)
  44.             {            
  45.                     world.setBlockWithNotify(i + 1, j , k, mod_tropicraft.coconut.blockID);
  46.                     world.setBlockMetadataWithNotify(i, j, k, 0);        
  47.                        
  48.             }
  49.             if(world.isAirBlock(i - 1, j, k) && random.nextInt(20) == 0)
  50.                 {          
  51.                   world.setBlockWithNotify(i - 1, j , k, mod_tropicraft.coconut.blockID);
  52.                  world.setBlockMetadataWithNotify(i, j, k, 0);
  53.                
  54.            
  55.                 }
  56.             if(world.isAirBlock(i , j, k- 1) && random.nextInt(20) == 0)
  57.             {                    
  58.                     world.setBlockWithNotify(i , j , k - 1, mod_tropicraft.coconut.blockID);
  59.                  world.setBlockMetadataWithNotify(i, j, k, 0);
  60.                
  61.            
  62.             }
  63.             if(world.isAirBlock(i , j, k + 1) && random.nextInt(20) == 0)
  64.             {                  
  65.                  world.setBlockWithNotify(i , j , k + 1, mod_tropicraft.coconut.blockID);
  66.                  world.setBlockMetadataWithNotify(i, j, k, 0);              
  67.            
  68.             }
  69.        
  70.             if(world.isAirBlock(i , j - 1, k) && random.nextInt(20) == 0)
  71.             {      
  72.                  world.setBlockWithNotify(i , j - 1, k , mod_tropicraft.coconut.blockID);
  73.                  world.setBlockMetadataWithNotify(i, j, k, 0);
  74.                
  75.             }
  76.        
  77.         }
  78.        
  79.     }
  80.     public int getBlockTextureFromSideAndMetadata(int i, int j)
  81.     {
  82.         if(i == 1)
  83.         {
  84.             return mod_tropicraft.palmWoodBottom;
  85.         }
  86.         if(i == 0)
  87.         {
  88.             return mod_tropicraft.palmWoodBottom;
  89.         } else
  90.         {
  91.             return mod_tropicraft.palmWood.blockIndexInTexture;
  92.         }
  93.     }
  94.  
  95.     protected int damageDropped(int i)
  96.     {
  97.         return i;
  98.     }
  99.     public float blockStrength(EntityPlayer entityplayer)
  100.     {
  101.         super.blockStrength(entityplayer);
  102.          if(blockHardness < 0.0F)
  103.          {
  104.              return 0.0F;
  105.          }
  106.          if(!entityplayer.canHarvestBlock(this))
  107.          {
  108.              return 1.0F / blockHardness / 100F;
  109.          } else
  110.          {
  111.              return entityplayer.getCurrentPlayerStrVsBlock(Block.wood) / blockHardness / 30F;
  112.          }
  113.     }
  114.    
  115.     public void onBlockRemoval(World world, int i, int j, int k)
  116.     {
  117.         byte byte0 = 4;
  118.         int l = byte0 + 1;
  119.         if(world.checkChunksExist(i - l, j - l, k - l, i + l, j + l, k + l))
  120.         {
  121.             for(int i1 = -byte0; i1 <= byte0; i1++)
  122.             {
  123.                 for(int j1 = -byte0; j1 <= byte0; j1++)
  124.                 {
  125.                     for(int k1 = -byte0; k1 <= byte0; k1++)
  126.                     {
  127.                         int l1 = world.getBlockId(i + i1, j + j1, k + k1);
  128.                         if(l1 != mod_tropicraft.palmLeaves.blockID)
  129.                         {
  130.                             continue;
  131.                         }
  132.                         int i2 = world.getBlockMetadata(i + i1, j + j1, k + k1);
  133.                         if((i2 & 8) == 0)
  134.                         {
  135.                             world.setBlockMetadata(i + i1, j + j1, k + k1, i2 | 8);
  136.                         }
  137.                     }
  138.  
  139.                 }
  140.  
  141.             }
  142.  
  143.         }
  144.     }
  145. }
  146.  
  147.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement