diff --git a/core/src/mindustry/core/ContentLoader.java b/core/src/mindustry/core/ContentLoader.java index f74ae47f07..6a836dceb5 100644 --- a/core/src/mindustry/core/ContentLoader.java +++ b/core/src/mindustry/core/ContentLoader.java @@ -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 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 getByID(ContentType type, int id){ diff --git a/core/src/mindustry/core/Renderer.java b/core/src/mindustry/core/Renderer.java index c348bc2fda..6605519266 100644 --- a/core/src/mindustry/core/Renderer.java +++ b/core/src/mindustry/core/Renderer.java @@ -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(); diff --git a/core/src/mindustry/io/SaveFileReader.java b/core/src/mindustry/io/SaveFileReader.java index 1a059c976b..0ea4f3af9d 100644 --- a/core/src/mindustry/io/SaveFileReader.java +++ b/core/src/mindustry/io/SaveFileReader.java @@ -59,6 +59,13 @@ public abstract class SaveFileReader{ "cryofluidmixer", "cryofluid-mixer" ); + public static final ObjectMap 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(); diff --git a/core/src/mindustry/mod/ContentParser.java b/core/src/mindustry/mod/ContentParser.java index 3644b3ad5b..a5e2cdf39b 100644 --- a/core/src/mindustry/mod/ContentParser.java +++ b/core/src/mindustry/mod/ContentParser.java @@ -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")); diff --git a/core/src/mindustry/world/Block.java b/core/src/mindustry/world/Block.java index be8837463a..4f8b078ef9 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -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){ diff --git a/core/src/mindustry/world/consumers/ConsumePower.java b/core/src/mindustry/world/consumers/ConsumePower.java index 67b23d6c4c..991ad968e7 100644 --- a/core/src/mindustry/world/consumers/ConsumePower.java +++ b/core/src/mindustry/world/consumers/ConsumePower.java @@ -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; diff --git a/gradle.properties b/gradle.properties index b38510c7c9..e56e8db5ca 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,4 +11,4 @@ android.useAndroidX=true #used for slow jitpack builds; TODO see if this actually works http.socketTimeout=80000 http.connectionTimeout=80000 -archash=98c420de77661889ab0330a956d50721f27f33d9 +archash=d78dce000f67845a757dca905de9209ad57106a9