Advertisement
Guest User

Untitled

a guest
Dec 10th, 2013
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.65 KB | None | 0 0
  1. package educationalpurposes.blocks.crop;
  2.  
  3. import java.util.Random;
  4.  
  5. import net.minecraft.block.BlockCrops;
  6. import net.minecraft.world.World;
  7.  
  8. public class MyCrop extends BlockCrops
  9. {
  10.     public MyCrop(int ID)
  11.     {
  12.         super(ID);
  13.        
  14.         this.setTickRandomly(true);
  15.     }
  16.    
  17.     @Override
  18.     public void updateTick(World world, int x, int y, int z, Random random)
  19.     {
  20.         // Im not quite sure why you only would want this to get done on the server side
  21.         // Since we need the visual as well?
  22.         if(world.provider.dimensionId != 0)
  23.         {
  24.             this.dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), this.blockID);
  25.             world.setBlockToAir(x, y, z);
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement