From 677648b441627bf45a80a2be7b5bc298109c4db3 Mon Sep 17 00:00:00 2001 From: chochem <40274384+chochem@users.noreply.github.com> Date: Mon, 17 Apr 2023 22:02:56 +0100 Subject: [PATCH] fix naming and fix bug --- .../wailaplugins/plugins/PluginRailcraft.java | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main/java/tterrag/wailaplugins/plugins/PluginRailcraft.java b/src/main/java/tterrag/wailaplugins/plugins/PluginRailcraft.java index d9d29e8..d7159d5 100644 --- a/src/main/java/tterrag/wailaplugins/plugins/PluginRailcraft.java +++ b/src/main/java/tterrag/wailaplugins/plugins/PluginRailcraft.java @@ -54,7 +54,7 @@ final class WaterTankRateCalculator { private final float BASE_HUMIDITY_RATE = 10F; - private final float OUTSIDE_RATE = 0.5F; + private final float INSIDE_RATE = 0.5F; private final float SNOW_RATE = 0.5F; private final float RAIN_RATE = 3.0F; @@ -70,7 +70,7 @@ final class WaterTankRateCalculator { private float humidityRate; - private float outsideRate; + private float insideRate; private float snowingOrRainingRate; @@ -87,10 +87,10 @@ public static float convertRateToLitersPerSecond(float rate) { public WaterTankRateCalculator init() { humidityRate = calculateHumidityRate(); - outsideRate = calculateOutsideRate(); + insideRate = calculateInsideRate(); snowingOrRainingRate = calculateSnowingOrRainingRate(); - rate = Math.max(MathHelper.floor_float(humidityRate * outsideRate * snowingOrRainingRate), ONE); + rate = Math.max(MathHelper.floor_float(humidityRate * insideRate * snowingOrRainingRate), ONE); return this; } @@ -98,12 +98,12 @@ private float calculateHumidityRate() { return BASE_HUMIDITY_RATE * world.getBiomeGenForCoords(x, z).rainfall; } - private float calculateOutsideRate() { + private float calculateInsideRate() { IntStream streamX = IntStream.rangeClosed(x - 1, x + 1); return streamX.anyMatch(eachX -> { IntStream streamZ = IntStream.rangeClosed(z - 1, z + 1); - return streamZ.anyMatch(eachZ -> !world.canBlockSeeTheSky(eachX, y + 3, eachZ)); - }) ? OUTSIDE_RATE : ONE; + return streamZ.anyMatch(eachZ -> world.canBlockSeeTheSky(eachX, y + 3, eachZ)); + }) ? ONE : INSIDE_RATE; } private float calculateSnowingOrRainingRate() { @@ -119,8 +119,8 @@ public float getHumidityRate() { return humidityRate; } - public float getOutsideRate() { - return outsideRate; + public float getInsideRate() { + return insideRate; } public float getSnowingOrRainingRate() { @@ -135,8 +135,8 @@ public boolean getIsRaining() { return snowingOrRainingRate == RAIN_RATE; } - public boolean getIsOutside() { - return outsideRate == OUTSIDE_RATE; + public boolean getIsInside() { + return insideRate == INSIDE_RATE; } } @@ -216,8 +216,8 @@ protected void getBody(ItemStack stack, List currenttip, IWailaDataAcces currenttip.add(lang.localize("snowingRate", snowingOrRainingRate)); } - if (waterTankRateCalculator.getIsOutside()) { - currenttip.add(lang.localize("cantSeeTheSkyRate", waterTankRateCalculator.getOutsideRate())); + if (waterTankRateCalculator.getIsInside()) { + currenttip.add(lang.localize("cantSeeTheSkyRate", waterTankRateCalculator.getInsideRate())); } }