Parse singular consumes (#8466)

* Parse singular `Consume`s

* Proper coolant parsing

* Temporary manual update of ClassMap

Does not include all consume types.

I don't know what gradle command to run to update `ClassMap`. I've tried `tools:updateScripts` but that just cleared everything.
This commit is contained in:
MEEPofFaith
2023-04-02 16:53:19 -07:00
committed by GitHub
parent fa02d8d280
commit b322b1165f
4 changed files with 23 additions and 0 deletions

View File

@@ -925,6 +925,10 @@ public class Block extends UnlockableContent implements Senseable{
return consumers.length == 0 ? (T)consumeBuilder.find(filter) : (T)Structs.find(consumers, filter);
}
public boolean hasConsumer(Consume cons){
return consumeBuilder.contains(cons);
}
public void removeConsumer(Consume cons){
if(consumers.length > 0){
throw new IllegalStateException("You can only remove consumers before init(). After init(), all consumers have already been initialized.");

View File

@@ -51,6 +51,9 @@ public class BaseTurret extends Block{
coolant.update = false;
coolant.booster = true;
coolant.optional = true;
//json parsing does not add to consumes
if(!hasConsumer(coolant)) consume(coolant);
}
placeOverlapRange = Math.max(placeOverlapRange, range + placeOverlapMargin);