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

View File

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