mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-10-26 14:23:57 +00:00
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:
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
|
||||||
|
|||||||
Reference in new issue
Block a user