Cleanup
This commit is contained in:
@@ -7,7 +7,6 @@ import arc.math.geom.*;
|
||||
import arc.util.ArcAnnotate.*;
|
||||
import arc.util.*;
|
||||
import arc.util.io.*;
|
||||
import mindustry.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.entities.*;
|
||||
|
||||
@@ -6,7 +6,6 @@ import arc.math.*;
|
||||
import arc.util.ArcAnnotate.*;
|
||||
import arc.util.*;
|
||||
import arc.util.io.*;
|
||||
import mindustry.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
import mindustry.entities.*;
|
||||
import mindustry.gen.*;
|
||||
|
||||
@@ -251,7 +251,7 @@ public class MassDriver extends Block{
|
||||
data.to = target;
|
||||
int totalUsed = 0;
|
||||
for(int i = 0; i < content.items().size; i++){
|
||||
int maxTransfer = Math.min(items.get(content.item(i)), ((MassDriver)tile.block()).itemCapacity - totalUsed);
|
||||
int maxTransfer = Math.min(items.get(content.item(i)), tile.block().itemCapacity - totalUsed);
|
||||
data.items[i] = maxTransfer;
|
||||
totalUsed += maxTransfer;
|
||||
items.remove(content.item(i), maxTransfer);
|
||||
|
||||
@@ -19,7 +19,7 @@ public class PowerGraph{
|
||||
private final ObjectSet<Building> all = new ObjectSet<>();
|
||||
|
||||
private final WindowedMean powerBalance = new WindowedMean(60);
|
||||
private float lastPowerProduced, lastPowerNeeded, lastUsageFraction, lastPowerStored;
|
||||
private float lastPowerProduced, lastPowerNeeded, lastPowerStored;
|
||||
private float lastScaledPowerIn, lastScaledPowerOut, lastCapacity;
|
||||
|
||||
private long lastFrameUpdated = -1;
|
||||
@@ -201,7 +201,7 @@ public class PowerGraph{
|
||||
tile.power.status = 1f;
|
||||
}
|
||||
|
||||
lastPowerNeeded = lastPowerProduced = lastUsageFraction = 1f;
|
||||
lastPowerNeeded = lastPowerProduced = 1f;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -236,12 +236,6 @@ public class PowerGraph{
|
||||
|
||||
distributePower(powerNeeded, powerProduced);
|
||||
}
|
||||
|
||||
//overproducing: 10 / 20 = 0.5
|
||||
//underproducing: 20 / 10 = 2 -> clamp -> 1.0
|
||||
//nothing being produced: 20 / 0 -> 1.0
|
||||
//nothing being consumed: 0 / 20 -> 0.0
|
||||
lastUsageFraction = Mathf.zero(rawProduced) ? 1f : Mathf.clamp(powerNeeded / rawProduced);
|
||||
}
|
||||
|
||||
public void addGraph(PowerGraph graph){
|
||||
|
||||
@@ -13,7 +13,6 @@ import mindustry.content.*;
|
||||
import mindustry.entities.*;
|
||||
import mindustry.entities.units.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.graphics.*;
|
||||
import mindustry.ui.*;
|
||||
import mindustry.world.*;
|
||||
import mindustry.world.meta.*;
|
||||
|
||||
@@ -6,7 +6,6 @@ import arc.math.*;
|
||||
import arc.math.geom.*;
|
||||
import arc.struct.*;
|
||||
import arc.util.*;
|
||||
import mindustry.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
import mindustry.entities.*;
|
||||
import mindustry.gen.*;
|
||||
|
||||
Reference in New Issue
Block a user