Generator fixes
This commit is contained in:
@@ -1045,7 +1045,7 @@ public class Blocks implements ContentList{
|
|||||||
size = 2;
|
size = 2;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
differentialGenerator = new ItemLiquidGenerator(true, true, "differential-generator"){{
|
differentialGenerator = new SingleTypeGenerator(true, false, "differential-generator"){{
|
||||||
requirements(Category.power, ItemStack.with(Items.copper, 140, Items.titanium, 100, Items.lead, 200, Items.silicon, 130, Items.metaglass, 100));
|
requirements(Category.power, ItemStack.with(Items.copper, 140, Items.titanium, 100, Items.lead, 200, Items.silicon, 130, Items.metaglass, 100));
|
||||||
powerProduction = 16f;
|
powerProduction = 16f;
|
||||||
itemDuration = 50f;
|
itemDuration = 50f;
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public class Mechs implements ContentList{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateAlt(Player player){
|
public void updateAlt(Player player){
|
||||||
player.healBy(Time.delta() * 0.4f);
|
player.healBy(Time.delta() * 0.1f);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -79,6 +79,11 @@ public class ItemLiquidGenerator extends PowerGenerator{
|
|||||||
//Power amount is delta'd by PowerGraph class already.
|
//Power amount is delta'd by PowerGraph class already.
|
||||||
float calculationDelta = entity.delta();
|
float calculationDelta = entity.delta();
|
||||||
|
|
||||||
|
if(!entity.cons.valid()){
|
||||||
|
entity.productionEfficiency = 0.0f;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Liquid liquid = null;
|
Liquid liquid = null;
|
||||||
for(Liquid other : content.liquids()){
|
for(Liquid other : content.liquids()){
|
||||||
if(hasLiquids && entity.liquids.get(other) >= 0.001f && getLiquidEfficiency(other) >= minLiquidEfficiency){
|
if(hasLiquids && entity.liquids.get(other) >= 0.001f && getLiquidEfficiency(other) >= minLiquidEfficiency){
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package io.anuke.mindustry.world.blocks.power;
|
||||||
|
|
||||||
|
import io.anuke.mindustry.type.Item;
|
||||||
|
import io.anuke.mindustry.type.Liquid;
|
||||||
|
|
||||||
|
public class SingleTypeGenerator extends ItemLiquidGenerator{
|
||||||
|
public SingleTypeGenerator(boolean hasItems, boolean hasLiquids, String name){
|
||||||
|
super(hasItems, hasLiquids, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected float getItemEfficiency(Item item){
|
||||||
|
return 1f;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected float getLiquidEfficiency(Liquid liquid){
|
||||||
|
return 0f;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user