forked from BLOCKFANTASY/LOOHP-Limbo
Merge branch 'master' into feature/generate-sources
This commit is contained in:
commit
4cbfb37ab7
2
pom.xml
2
pom.xml
|
|
@ -5,7 +5,7 @@
|
||||||
<groupId>com.loohp</groupId>
|
<groupId>com.loohp</groupId>
|
||||||
<artifactId>Limbo</artifactId>
|
<artifactId>Limbo</artifactId>
|
||||||
<name>Limbo</name>
|
<name>Limbo</name>
|
||||||
<version>0.6.0-ALPHA</version>
|
<version>0.6.1-ALPHA</version>
|
||||||
|
|
||||||
<description>Standalone Limbo Minecraft Server.</description>
|
<description>Standalone Limbo Minecraft Server.</description>
|
||||||
<url>https://github.com/LOOHP/Limbo</url>
|
<url>https://github.com/LOOHP/Limbo</url>
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ public class ServerProperties {
|
||||||
private Location worldSpawn;
|
private Location worldSpawn;
|
||||||
private boolean reducedDebugInfo;
|
private boolean reducedDebugInfo;
|
||||||
private boolean allowFlight;
|
private boolean allowFlight;
|
||||||
|
private boolean allowChat;
|
||||||
private String motdJson;
|
private String motdJson;
|
||||||
private String versionString;
|
private String versionString;
|
||||||
private int protocol;
|
private int protocol;
|
||||||
|
|
@ -93,6 +94,7 @@ public class ServerProperties {
|
||||||
worldSpawn = new Location(world, x, y, z, yaw, pitch);
|
worldSpawn = new Location(world, x, y, z, yaw, pitch);
|
||||||
reducedDebugInfo = Boolean.parseBoolean(prop.getProperty("reduced-debug-info"));
|
reducedDebugInfo = Boolean.parseBoolean(prop.getProperty("reduced-debug-info"));
|
||||||
allowFlight = Boolean.parseBoolean(prop.getProperty("allow-flight"));
|
allowFlight = Boolean.parseBoolean(prop.getProperty("allow-flight"));
|
||||||
|
allowChat = Boolean.parseBoolean(prop.getProperty("allow-chat"));
|
||||||
motdJson = prop.getProperty("motd");
|
motdJson = prop.getProperty("motd");
|
||||||
versionString = prop.getProperty("version");
|
versionString = prop.getProperty("version");
|
||||||
bungeecord = Boolean.parseBoolean(prop.getProperty("bungeecord"));
|
bungeecord = Boolean.parseBoolean(prop.getProperty("bungeecord"));
|
||||||
|
|
@ -213,6 +215,10 @@ public class ServerProperties {
|
||||||
return allowFlight;
|
return allowFlight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isAllowChat() {
|
||||||
|
return this.allowChat;
|
||||||
|
}
|
||||||
|
|
||||||
public String getMotdJson() {
|
public String getMotdJson() {
|
||||||
return motdJson;
|
return motdJson;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -247,13 +247,15 @@ public class Player extends LivingEntity implements CommandSender {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void chat(String message) {
|
public void chat(String message) {
|
||||||
String format = "<%name%> %message%";
|
if (Limbo.getInstance().getServerProperties().isAllowChat()) {
|
||||||
PlayerChatEvent event = (PlayerChatEvent) Limbo.getInstance().getEventsManager().callEvent(new PlayerChatEvent(this, format, message, false));
|
String format = "<%name%> %message%";
|
||||||
if (!event.isCancelled()) {
|
PlayerChatEvent event = (PlayerChatEvent) Limbo.getInstance().getEventsManager().callEvent(new PlayerChatEvent(this, format, message, false));
|
||||||
String chat = event.getFormat().replace("%name%", username).replace("%message%", event.getMessage());
|
if (!event.isCancelled() && this.hasPermission("limboserver.chat")) {
|
||||||
Limbo.getInstance().getConsole().sendMessage(chat);
|
String chat = event.getFormat().replace("%name%", username).replace("%message%", event.getMessage());
|
||||||
for (Player each : Limbo.getInstance().getPlayers()) {
|
Limbo.getInstance().getConsole().sendMessage(chat);
|
||||||
each.sendMessage(chat, uuid);
|
for (Player each : Limbo.getInstance().getPlayers()) {
|
||||||
|
each.sendMessage(chat, uuid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ groups:
|
||||||
- limboserver.gamemode
|
- limboserver.gamemode
|
||||||
default:
|
default:
|
||||||
- limboserver.spawn
|
- limboserver.spawn
|
||||||
|
- limboserver.chat
|
||||||
|
|
||||||
players:
|
players:
|
||||||
LOOHP:
|
LOOHP:
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,10 @@ level-dimension=minecraft:overworld
|
||||||
#Whether Flying is allowed
|
#Whether Flying is allowed
|
||||||
allow-flight=false
|
allow-flight=false
|
||||||
|
|
||||||
|
#Whether chat messages are allowed
|
||||||
|
#Setting this property to false should give more performance but will render the "limboserver.chat" permission powerless
|
||||||
|
allow-chat=true
|
||||||
|
|
||||||
#GameMode, survival, creative, adventure, spectator
|
#GameMode, survival, creative, adventure, spectator
|
||||||
default-gamemode=creative
|
default-gamemode=creative
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue