Fixed some tests failing

This commit is contained in:
Anuken
2019-03-10 00:10:33 -05:00
parent 671823b4fa
commit 6b074ed4b2
4 changed files with 13 additions and 6 deletions

View File

@@ -159,6 +159,9 @@ public class Vars{
Version.init();
content = new ContentLoader();
if(!headless){
content.setVerbose();
}
playerGroup = Entities.addGroup(Player.class).enableMapping();
tileGroup = Entities.addGroup(TileEntity.class, false);

View File

@@ -34,7 +34,7 @@ import static io.anuke.arc.Core.files;
@SuppressWarnings("unchecked")
public class ContentLoader{
private boolean loaded = false;
private boolean verbose = true;
private boolean verbose = false;
private ObjectMap<String, MappableContent>[] contentNameMap = new ObjectMap[ContentType.values().length];
private Array<Content>[] contentMap = new Array[ContentType.values().length];
@@ -57,6 +57,10 @@ public class ContentLoader{
new LegacyColorMapper(),
};
public void setVerbose(){
verbose = true;
}
/**Creates all content types.*/
public void load(){
if(loaded){

View File

@@ -106,7 +106,7 @@ public class PowerGraph{
public float chargeBatteries(float excess){
float capacity = getBatteryCapacity();
if(Mathf.isEqual(capacity, 0f)){ return 0f; }
if(Mathf.isEqual(capacity, 0f)) return 0f;
for(Tile battery : batteries){
Consumers consumes = battery.block().consumes;
@@ -123,7 +123,7 @@ public class PowerGraph{
public void distributePower(float needed, float produced){
//distribute even if not needed. this is because some might be requiring power but not requesting it; it updates consumers
float coverage = Math.min(1, produced / (Mathf.isZero(needed) ? 1f : needed));
float coverage = Mathf.isZero(needed) ? 1f : Math.min(1, produced / needed);
for(Tile consumer : consumers){
Consumers consumes = consumer.block().consumes;
if(consumes.has(ConsumePower.class)){