Allow for SingleTypeGenerators to use only liquid. (#5900)

This commit is contained in:
Matthew Peng 2021-08-30 05:23:58 -07:00 committed by GitHub
parent 2f47f13ef7
commit 9b28eaa3b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,7 @@ package mindustry.world.blocks.power;
import mindustry.type.*;
public class SingleTypeGenerator extends ItemLiquidGenerator{
public boolean useItems = true;
public SingleTypeGenerator(String name){
super(name);
@ -11,11 +12,11 @@ public class SingleTypeGenerator extends ItemLiquidGenerator{
@Override
protected float getItemEfficiency(Item item){
return 1f;
return useItems ? 1f : 0f;
}
@Override
protected float getLiquidEfficiency(Liquid liquid){
return 0f;
return useItems ? 0f : 1f;
}
}