Fix alveary climate change calculations (#109)

Co-authored-by: Martin Robertz <dream-master@gmx.net>
Co-authored-by: UltraProdigy <187078471+UltraProdigy@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2026-03-14 08:12:51 +00:00
1 parent 88f50d91e1
commit 4844bc937b
1 file changed
+6 -4
@@ -250,8 +250,9 @@ public class AlvearyController extends RectangularMultiblockControllerBase
private float applyChange(float base, float currentChange, float extraChange, float boundaryDown, private float applyChange(float base, float currentChange, float extraChange, float boundaryDown,
float boundaryUp) { float boundaryUp) {
float boundedNewChange = Math.max(boundaryDown, Math.min(base + currentChange + (extraChange * 20), boundaryUp)) float boundedNewChange = Math.round(
- base; (Math.max(boundaryDown, Math.min(base + currentChange + (extraChange * 20), boundaryUp)) - base) * 100)
/ 100.0f;
if (extraChange > 0) { if (extraChange > 0) {
return Math.max(currentChange, boundedNewChange); return Math.max(currentChange, boundedNewChange);
} else { } else {
@@ -355,12 +356,13 @@ public class AlvearyController extends RectangularMultiblockControllerBase
@Override @Override
public float getExactTemperature() { public float getExactTemperature() {
ChunkCoordinates coords = getReferenceCoord(); ChunkCoordinates coords = getReferenceCoord();
return getBiome().getFloatTemperature(coords.posX, coords.posY, coords.posZ) + tempChange; return Math.round((getBiome().getFloatTemperature(coords.posX, coords.posY, coords.posZ) + tempChange) * 100)
/ 100.0f;
} }
@Override @Override
public float getExactHumidity() { public float getExactHumidity() {
return getBiome().rainfall + humidChange; return Math.round((getBiome().rainfall + humidChange) * 100) / 100.0f;
} }
@Override @Override