示例#1
0
 public void updateTick(World world, int i, int j, int k, Random random) {
   if (world.isRemote) {
     return;
   }
   if (world.getBlockLightValue(i, j + 1, k) < 4
       && Block.lightOpacity[world.getBlockId(i, j + 1, k)] > 2) {
     world.setBlockWithNotify(i, j, k, Block.dirt.blockID);
   } else if (world.getBlockLightValue(i, j + 1, k) >= 9) {
     for (int l = 0; l < 4; l++) {
       int i1 = (i + random.nextInt(3)) - 1;
       int j1 = (j + random.nextInt(5)) - 3;
       int k1 = (k + random.nextInt(3)) - 1;
       int l1 = world.getBlockId(i1, j1 + 1, k1);
       if (world.getBlockId(i1, j1, k1) == Block.dirt.blockID
           && world.getBlockLightValue(i1, j1 + 1, k1) >= 4
           && Block.lightOpacity[l1] <= 2) {
         if (blockID == ZooDirts.savannah.blockID) {
           world.setBlockWithNotify(i1, j1, k1, ZooDirts.savannah.blockID);
         }
         if (blockID == ZooDirts.tropical.blockID) {
           world.setBlockWithNotify(i1, j1, k1, ZooDirts.tropical.blockID);
         }
         if (blockID == ZooDirts.coniferous.blockID) {
           world.setBlockWithNotify(i1, j1, k1, ZooDirts.coniferous.blockID);
         }
         if (blockID == ZooDirts.deciduous.blockID) {
           world.setBlockWithNotify(i1, j1, k1, ZooDirts.deciduous.blockID);
         }
       }
     }
   }
 }