Fixed bizzare single type generator initialization

This commit is contained in:
Anuken 2019-10-12 18:39:08 -04:00
parent dd3fd97b43
commit 0509c28576
4 changed files with 11 additions and 9 deletions

View File

@ -1083,11 +1083,12 @@ public class Blocks implements ContentList{
size = 2;
}};
differentialGenerator = new SingleTypeGenerator(true, false, "differential-generator"){{
differentialGenerator = new SingleTypeGenerator("differential-generator"){{
requirements(Category.power, ItemStack.with(Items.copper, 70, Items.titanium, 50, Items.lead, 100, Items.silicon, 65, Items.metaglass, 50));
powerProduction = 16f;
itemDuration = 120f;
hasLiquids = true;
hasItems = true;
size = 3;
consumes.item(Items.pyratite).optional(true, false);

View File

@ -289,9 +289,12 @@ public class ContentParser{
}
currentMod = mod;
boolean exists = Vars.content.getByName(type, name) != null;
Content c = parsers.get(type).parse(mod.name, name, value);
c.sourceFile = file;
c.mod = mod;
if(!exists){
c.sourceFile = file;
c.mod = mod;
}
checkNulls(c);
return c;
}

View File

@ -7,6 +7,7 @@ import io.anuke.arc.math.*;
import io.anuke.arc.util.*;
import io.anuke.mindustry.content.*;
import io.anuke.mindustry.entities.*;
import io.anuke.mindustry.entities.Effects.*;
import io.anuke.mindustry.entities.type.*;
import io.anuke.mindustry.type.*;
import io.anuke.mindustry.world.*;
@ -28,8 +29,8 @@ public class ItemLiquidGenerator extends PowerGenerator{
/** Maximum liquid used per frame. */
protected float maxLiquidGenerate = 0.4f;
protected Effects.Effect generateEffect = Fx.generatespark;
protected Effects.Effect explodeEffect = Fx.generatespark;
protected Effect generateEffect = Fx.generatespark;
protected Effect explodeEffect = Fx.generatespark;
protected Color heatColor = Color.valueOf("ff9b59");
protected TextureRegion topRegion, liquidRegion;
protected boolean randomlyExplode = true;

View File

@ -5,12 +5,9 @@ import io.anuke.mindustry.type.Liquid;
public class SingleTypeGenerator extends ItemLiquidGenerator{
public SingleTypeGenerator(boolean hasItems, boolean hasLiquids, String name){
super(hasItems, hasLiquids, name);
}
public SingleTypeGenerator(String name){
super(name);
defaults = true;
}
@Override