From 3528af77433117e40459351d61b848faefb4c9c7 Mon Sep 17 00:00:00 2001 From: kappa_maintainer Date: Wed, 2 Feb 2022 16:51:57 +0800 Subject: [PATCH] Fix #2, #5 --- .../industrialwires/mech_mb/MechPartSpeedometer.java | 6 +++--- .../industrialwires/mech_mb/MechPartTwoElectrodes.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/malte0811/industrialwires/mech_mb/MechPartSpeedometer.java b/src/main/java/malte0811/industrialwires/mech_mb/MechPartSpeedometer.java index fb71f54..45c3a9e 100644 --- a/src/main/java/malte0811/industrialwires/mech_mb/MechPartSpeedometer.java +++ b/src/main/java/malte0811/industrialwires/mech_mb/MechPartSpeedometer.java @@ -94,15 +94,15 @@ private void update(boolean changedMax) { } private int roundHysteresis(int old, double newExact) { - double mod = newExact%1; final double THRESHOLD = .1; int floor = (int) Math.floor(newExact); if (floor == old) { return old; } - if (oldTHRESHOLD) { + if(old < 0) { return floor; - } else if (old>newExact && mod<1-THRESHOLD) { + } + if (newExact > old + 1 + THRESHOLD || newExact < old - THRESHOLD) { return floor; } return old; diff --git a/src/main/java/malte0811/industrialwires/mech_mb/MechPartTwoElectrodes.java b/src/main/java/malte0811/industrialwires/mech_mb/MechPartTwoElectrodes.java index 19430ea..4729afa 100644 --- a/src/main/java/malte0811/industrialwires/mech_mb/MechPartTwoElectrodes.java +++ b/src/main/java/malte0811/industrialwires/mech_mb/MechPartTwoElectrodes.java @@ -79,7 +79,7 @@ public List getEnergyConnections() { } protected double getMaxBuffer() { - return 10e3;//200kW + return 87148.9361702F;//4096RF } protected boolean has4Phases() {