コード例 #1
0
 @SuppressWarnings("deprecation")
 private byte getSaturationData(Block b) {
   long now = System.currentTimeMillis();
   long delta = (now - SoilSaturation.getLastWatered(b)) / 1000;
   int saturation = SoilSaturation.getSaturationLevel(b);
   saturation = Math.max(0, saturation - (int) delta);
   if (saturation < 10) {
     return DyeColor.YELLOW.getWoolData();
   } else if (saturation < 30) {
     return DyeColor.BROWN.getWoolData();
   } else if (saturation < 50) {
     return DyeColor.GREEN.getWoolData();
   } else if (saturation < 70) {
     return DyeColor.LIGHT_BLUE.getWoolData();
   } else if (saturation < 90) {
     return DyeColor.CYAN.getWoolData();
   } else {
     return DyeColor.BLUE.getWoolData();
   }
 }