Added config for showing connect/disconnect messages
This commit is contained in:
@@ -443,7 +443,7 @@ public class NetServer implements ApplicationListener{
|
|||||||
if(!player.con.hasDisconnected){
|
if(!player.con.hasDisconnected){
|
||||||
if(player.con.hasConnected){
|
if(player.con.hasConnected){
|
||||||
Events.fire(new PlayerLeave(player));
|
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);
|
Call.onPlayerDisconnect(player.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -581,7 +581,7 @@ public class NetServer implements ApplicationListener{
|
|||||||
|
|
||||||
player.add();
|
player.add();
|
||||||
player.con.hasConnected = true;
|
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);
|
Log.info("&lm[{1}] &y{0} has connected. ", player.name, player.uuid);
|
||||||
|
|
||||||
Events.fire(new PlayerJoin(player));
|
Events.fire(new PlayerJoin(player));
|
||||||
|
|||||||
@@ -320,6 +320,7 @@ public class Administration{
|
|||||||
name("The server name as displayed on clients.", "Server", "servername"),
|
name("The server name as displayed on clients.", "Server", "servername"),
|
||||||
port("The port to host on.", Vars.port),
|
port("The port to host on.", Vars.port),
|
||||||
autoUpdate("Whether to auto-update and exit when a new bleeding-edge update arrives.", false),
|
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.", ""),
|
startCommands("Commands run at startup. This should be a comma-separated list.", ""),
|
||||||
crashReport("Whether to send crash reports.", false, "crashreport"),
|
crashReport("Whether to send crash reports.", false, "crashreport"),
|
||||||
logging("Whether to log everything to files.", true),
|
logging("Whether to log everything to files.", true),
|
||||||
|
|||||||
@@ -257,7 +257,7 @@ public class BuildBlock extends Block{
|
|||||||
if(cblock != null){
|
if(cblock != null){
|
||||||
ItemStack[] requirements = cblock.requirements;
|
ItemStack[] requirements = cblock.requirements;
|
||||||
if(requirements.length != accumulator.length || totalAccumulator.length != requirements.length){
|
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
|
//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;
|
this.progress = 1f;
|
||||||
if(previous.buildCost >= 0.01f){
|
if(previous.buildCost >= 0.01f){
|
||||||
this.cblock = previous;
|
this.cblock = previous;
|
||||||
this.accumulator = new float[previous.requirements.length];
|
|
||||||
this.totalAccumulator = new float[previous.requirements.length];
|
|
||||||
this.buildCost = previous.buildCost * state.rules.buildCostMultiplier;
|
this.buildCost = previous.buildCost * state.rules.buildCostMultiplier;
|
||||||
}else{
|
}else{
|
||||||
this.buildCost = 20f; //default no-requirement build cost is 20
|
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
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user