コード例 #1
0
 public void onUpdate() {
   super.onUpdate();
   if (getPuffed()) {
     fallDistance = 0.0F;
     if (motionY < -0.050000000000000003D) {
       motionY = -0.050000000000000003D;
     }
   }
   if (rand.nextInt(100) == 0) {
     int i = MathHelper.floor_double(posX);
     int j = MathHelper.floor_double(posY);
     int k = MathHelper.floor_double(posZ);
     if (worldObj.getBlockId(i, j - 1, k) == AetherBlocks.Grass.blockID) {
       worldObj.setBlockWithNotify(i, j - 1, k, AetherBlocks.Dirt.blockID);
       amountEaten++;
     }
   }
   if (amountEaten == 5 && !getSheared() && !getPuffed()) {
     setPuffed(true);
     amountEaten = 0;
   }
   if (amountEaten == 10 && getSheared() && !getPuffed()) {
     setSheared(false);
     setFleeceColor(0);
     amountEaten = 0;
   }
 }