if (Game.isHost(getWorld())) {
if (isMaster()) {
if (worldObj.provider.dimensionId != -1 && clock % REFILL_INTERVAL == 0) {
float rate = REFILL_RATE;
BiomeGenBase biome = worldObj.getBiomeGenForCoords(xCoord, zCoord);
float humidity = biome.rainfall;
rate *= humidity;
// String debug = "Biome=" + biome.biomeName + ", Humidity=" + humidity;
boolean outside = false;
for (int x = xCoord - 1; x <= xCoord + 1; x++) {
for (int z = zCoord - 1; z <= zCoord + 1; z++) {
outside = worldObj.canBlockSeeTheSky(x, yCoord + 3, z);
// System.out.println(x + ", " + (yCoord + 3) + ", " + z);
if (outside)
break;
}
}
// debug += ", Outside=" + outside;
if (!outside)
rate *= REFILL_PENALTY_INSIDE;
else if (worldObj.isRaining())
if (biome.getEnableSnow())
rate *= REFILL_PENALTY_SNOW; // debug += ", Snow=true";
else
rate *= REFILL_BOOST_RAIN; // debug += ", Rain=true";
int rateFinal = MathHelper.floor_float(rate);
if (rateFinal < REFILL_RATE_MIN)