diff --git a/core/src/mindustry/core/NetServer.java b/core/src/mindustry/core/NetServer.java index b37ab7a57a..4880ad242d 100644 --- a/core/src/mindustry/core/NetServer.java +++ b/core/src/mindustry/core/NetServer.java @@ -443,7 +443,7 @@ public class NetServer implements ApplicationListener{ if(!player.con.hasDisconnected){ if(player.con.hasConnected){ Events.fire(new PlayerLeave(player)); - Call.sendMessage("[accent]" + player.name + "[accent] has disconnected."); + if(Config.showConnectMessages.bool()) Call.sendMessage("[accent]" + player.name + "[accent] has disconnected."); Call.onPlayerDisconnect(player.id); } @@ -581,7 +581,7 @@ public class NetServer implements ApplicationListener{ player.add(); player.con.hasConnected = true; - Call.sendMessage("[accent]" + player.name + "[accent] has connected."); + if(Config.showConnectMessages.bool()) Call.sendMessage("[accent]" + player.name + "[accent] has connected."); Log.info("&lm[{1}] &y{0} has connected. ", player.name, player.uuid); Events.fire(new PlayerJoin(player)); diff --git a/core/src/mindustry/net/Administration.java b/core/src/mindustry/net/Administration.java index 57a728a020..cdec5b81fd 100644 --- a/core/src/mindustry/net/Administration.java +++ b/core/src/mindustry/net/Administration.java @@ -320,6 +320,7 @@ public class Administration{ name("The server name as displayed on clients.", "Server", "servername"), port("The port to host on.", Vars.port), autoUpdate("Whether to auto-update and exit when a new bleeding-edge update arrives.", false), + showConnectMessages("Whether to display connect/disconnect messages.", true), startCommands("Commands run at startup. This should be a comma-separated list.", ""), crashReport("Whether to send crash reports.", false, "crashreport"), logging("Whether to log everything to files.", true), diff --git a/core/src/mindustry/world/blocks/BuildBlock.java b/core/src/mindustry/world/blocks/BuildBlock.java index 79061db553..bb1ea11468 100644 --- a/core/src/mindustry/world/blocks/BuildBlock.java +++ b/core/src/mindustry/world/blocks/BuildBlock.java @@ -257,7 +257,7 @@ public class BuildBlock extends Block{ if(cblock != null){ ItemStack[] requirements = cblock.requirements; if(requirements.length != accumulator.length || totalAccumulator.length != requirements.length){ - setDeconstruct(previous); + setDeconstruct(cblock); } //make sure you take into account that you can't deconstruct more than there is deconstructed @@ -342,12 +342,12 @@ public class BuildBlock extends Block{ this.progress = 1f; if(previous.buildCost >= 0.01f){ this.cblock = previous; - this.accumulator = new float[previous.requirements.length]; - this.totalAccumulator = new float[previous.requirements.length]; this.buildCost = previous.buildCost * state.rules.buildCostMultiplier; }else{ this.buildCost = 20f; //default no-requirement build cost is 20 } + this.accumulator = new float[previous.requirements.length]; + this.totalAccumulator = new float[previous.requirements.length]; } @Override