Added config for showing connect/disconnect messages

This commit is contained in:
Anuken
2019-12-30 11:36:50 -05:00
parent 905d7abadb
commit 73461e0364
3 changed files with 6 additions and 5 deletions

View File

@@ -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));

View File

@@ -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),

View File

@@ -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