Disperse turret mostly done

This commit is contained in:
Anuken
2022-02-12 10:20:37 -05:00
parent e8c277d7b8
commit b079955b52
16 changed files with 14 additions and 18 deletions

View File

@@ -14,8 +14,7 @@ public class Stats{
/** Production time period in ticks. Used for crafters. **/
public float timePeriod = -1;
@Nullable
private OrderedMap<StatCat, OrderedMap<Stat, Seq<StatValue>>> map;
private @Nullable OrderedMap<StatCat, OrderedMap<Stat, Seq<StatValue>>> map;
private boolean dirty;
/** Adds a single float value with this stat, formatted to 2 decimal places. */
@@ -91,8 +90,8 @@ public class Stats{
public void remove(Stat stat){
if(map == null) map = new OrderedMap<>();
if(!map.containsKey(stat.category) || !map.get(stat.category).containsKey(stat)){
throw new RuntimeException("No stat entry found: \"" + stat + "\" in block.");
if(!map.containsKey(stat.category)){
return;
}
map.get(stat.category).remove(stat);