Minor bugfixes & compatibility fixes
This commit is contained in:
@@ -8,8 +8,9 @@ import arc.struct.*;
|
||||
import arc.util.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.ctype.*;
|
||||
import mindustry.game.EventType.*;
|
||||
import mindustry.entities.bullet.*;
|
||||
import mindustry.game.EventType.*;
|
||||
import mindustry.io.*;
|
||||
import mindustry.mod.Mods.*;
|
||||
import mindustry.type.*;
|
||||
import mindustry.world.*;
|
||||
@@ -211,10 +212,16 @@ public class ContentLoader{
|
||||
}
|
||||
|
||||
public <T extends MappableContent> T getByName(ContentType type, String name){
|
||||
if(contentNameMap[type.ordinal()] == null){
|
||||
return null;
|
||||
var map = contentNameMap[type.ordinal()];
|
||||
|
||||
if(map == null) return null;
|
||||
|
||||
//load fallbacks
|
||||
if(type == ContentType.block){
|
||||
name = SaveVersion.modContentNameMap.get(name, name);
|
||||
}
|
||||
return (T)contentNameMap[type.ordinal()].get(name);
|
||||
|
||||
return (T)map.get(name);
|
||||
}
|
||||
|
||||
public <T extends Content> T getByID(ContentType type, int id){
|
||||
|
||||
@@ -504,6 +504,8 @@ public class Renderer implements ApplicationListener{
|
||||
|
||||
public void showLaunch(CoreBlock coreType){
|
||||
Vars.ui.hudfrag.showLaunch();
|
||||
Vars.control.input.frag.config.hideConfig();
|
||||
Vars.control.input.frag.inv.hide();
|
||||
launchCoreType = coreType;
|
||||
launching = true;
|
||||
landCore = player.team().core();
|
||||
|
||||
@@ -59,6 +59,13 @@ public abstract class SaveFileReader{
|
||||
"cryofluidmixer", "cryofluid-mixer"
|
||||
);
|
||||
|
||||
public static final ObjectMap<String, String> modContentNameMap = ObjectMap.of(
|
||||
"craters", "crater-stone",
|
||||
"deepwater", "deep-water",
|
||||
"water", "shallow-water",
|
||||
"slag", "molten-slag"
|
||||
);
|
||||
|
||||
protected final ReusableByteOutStream byteOutput = new ReusableByteOutStream();
|
||||
protected final DataOutputStream dataBytes = new DataOutputStream(byteOutput);
|
||||
protected final ReusableByteOutStream byteOutputSmall = new ReusableByteOutStream();
|
||||
|
||||
@@ -80,6 +80,8 @@ public class ContentParser{
|
||||
if(data.isString()){
|
||||
StatusEffect result = locate(ContentType.status, data.asString());
|
||||
if(result != null) return result;
|
||||
result = (StatusEffect)fieldOpt(StatusEffects.class, data);
|
||||
if(result != null) return result;
|
||||
throw new IllegalArgumentException("Unknown status effect: '" + data.asString() + "'");
|
||||
}
|
||||
StatusEffect effect = new StatusEffect(currentMod.name + "-" + data.getString("name"));
|
||||
|
||||
@@ -845,7 +845,8 @@ public class Block extends UnlockableContent{
|
||||
}
|
||||
|
||||
if(!outputsPower && consumes.hasPower() && consumes.getPower().buffered){
|
||||
throw new IllegalArgumentException("Consumer using buffered power: " + name);
|
||||
Log.warn("Consumer using buffered power: @. Disabling buffered power.", name);
|
||||
consumes.getPower().buffered = false;
|
||||
}
|
||||
|
||||
if(buildVisibility == BuildVisibility.sandboxOnly){
|
||||
|
||||
@@ -8,11 +8,11 @@ import mindustry.world.meta.*;
|
||||
/** Consumer class for blocks which consume power while being connected to a power graph. */
|
||||
public class ConsumePower extends Consume{
|
||||
/** The maximum amount of power which can be processed per tick. This might influence efficiency or load a buffer. */
|
||||
public final float usage;
|
||||
public float usage;
|
||||
/** The maximum power capacity in power units. */
|
||||
public final float capacity;
|
||||
public float capacity;
|
||||
/** True if the module can store power. */
|
||||
public final boolean buffered;
|
||||
public boolean buffered;
|
||||
|
||||
public ConsumePower(float usage, float capacity, boolean buffered){
|
||||
this.usage = usage;
|
||||
|
||||
Reference in New Issue
Block a user