diff --git a/core/src/mindustry/core/NetServer.java b/core/src/mindustry/core/NetServer.java index b5b285d0bf..b5eedaf12c 100644 --- a/core/src/mindustry/core/NetServer.java +++ b/core/src/mindustry/core/NetServer.java @@ -869,7 +869,7 @@ public class NetServer implements ApplicationListener{ } if(state.isGame() && net.server()){ - if(state.rules.pvp){ + if(state.rules.pvp && state.rules.pvpAutoPause){ boolean waiting = isWaitingForPlayers(), paused = state.isPaused(); if(waiting != paused){ if(waiting){ @@ -1003,7 +1003,7 @@ public class NetServer implements ApplicationListener{ player.con.snapshotsSent++; } - String fixName(String name){ + public String fixName(String name){ name = name.trim().replace("\n", "").replace("\t", ""); if(name.equals("[") || name.equals("]")){ return ""; @@ -1027,7 +1027,7 @@ public class NetServer implements ApplicationListener{ return result.toString(); } - static String checkColor(String str){ + public String checkColor(String str){ for(int i = 1; i < str.length(); i++){ if(str.charAt(i) == ']'){ String color = str.substring(1, i); diff --git a/core/src/mindustry/game/Rules.java b/core/src/mindustry/game/Rules.java index d116726c75..d26613f021 100644 --- a/core/src/mindustry/game/Rules.java +++ b/core/src/mindustry/game/Rules.java @@ -31,6 +31,8 @@ public class Rules{ public boolean waves; /** Whether the game objective is PvP. Note that this enables automatic hosting. */ public boolean pvp; + /** Whether is waiting for players enabled in PvP. */ + public boolean pvpAutoPause = true; /** Whether to pause the wave timer until all enemies are destroyed. */ public boolean waitEnemies = false; /** Determines if gamemode is attack mode. */ diff --git a/core/src/mindustry/mod/ContentParser.java b/core/src/mindustry/mod/ContentParser.java index 506df53c1b..645b188042 100644 --- a/core/src/mindustry/mod/ContentParser.java +++ b/core/src/mindustry/mod/ContentParser.java @@ -461,12 +461,13 @@ public class ContentParser{ } var typeVal = value.get("type"); + if(unit.constructor == null || typeVal != null){ + if(typeVal != null && !typeVal.isString()){ + throw new RuntimeException("Unit '" + name + "' has an incorrect type. Types must be strings."); + } - if(typeVal != null && !typeVal.isString()){ - throw new RuntimeException("Unit '" + name + "' has an incorrect type. Types must be strings."); + unit.constructor = unitType(typeVal); } - - unit.constructor = unitType(typeVal); }else{ unit = locate(ContentType.unit, name); } diff --git a/core/src/mindustry/world/Block.java b/core/src/mindustry/world/Block.java index 5c49709220..e96c58bbb9 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -1324,6 +1324,7 @@ public class Block extends UnlockableContent implements Senseable{ editorBase = new PixmapRegion(base); }else{ + if(gen[0] != null) packer.add(PageType.main, "block-" + name + "-full", Core.atlas.getPixmap(gen[0])); editorBase = gen[0] == null ? Core.atlas.getPixmap(fullIcon) : Core.atlas.getPixmap(gen[0]); }