config: fake online
This commit is contained in:
@@ -63,7 +63,9 @@ public class PacketHandler {
|
|||||||
serverInfo.version().name(ProtocolConstant.PROTOCOL_NAME);
|
serverInfo.version().name(ProtocolConstant.PROTOCOL_NAME);
|
||||||
serverInfo.version().protocol(ProtocolConstant.PROTOCOL_NUMBER);
|
serverInfo.version().protocol(ProtocolConstant.PROTOCOL_NUMBER);
|
||||||
serverInfo.players().max(config.players().maxOnlile());
|
serverInfo.players().max(config.players().maxOnlile());
|
||||||
serverInfo.players().online(config.players().onlile());
|
if (config.players().fakeOnline().enable()) {
|
||||||
|
serverInfo.players().online(config.players().fakeOnline().value());
|
||||||
|
}
|
||||||
serverInfo.players().sample(Collections.emptyList());
|
serverInfo.players().sample(Collections.emptyList());
|
||||||
serverInfo.description(TextSerializer.fromPlain(config.motd()));
|
serverInfo.description(TextSerializer.fromPlain(config.motd()));
|
||||||
|
|
||||||
|
|||||||
@@ -33,8 +33,17 @@ public class Config {
|
|||||||
@Setter
|
@Setter
|
||||||
@ToString
|
@ToString
|
||||||
public static class Players {
|
public static class Players {
|
||||||
|
private final FakeOnline fakeOnline = new FakeOnline();
|
||||||
|
|
||||||
private int maxOnlile;
|
private int maxOnlile;
|
||||||
private int onlile;
|
}
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
public static class FakeOnline {
|
||||||
|
private boolean enable;
|
||||||
|
private int value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
|
|||||||
@@ -27,10 +27,14 @@ public class ConfigModule {
|
|||||||
|
|
||||||
config.server().host(fromYamlPath("server/host", map, "127.0.0.1"));
|
config.server().host(fromYamlPath("server/host", map, "127.0.0.1"));
|
||||||
config.server().port(fromYamlPath("server/port", map, 25565));
|
config.server().port(fromYamlPath("server/port", map, 25565));
|
||||||
|
|
||||||
config.motd(fromYamlPath("motd", map, ""));
|
config.motd(fromYamlPath("motd", map, ""));
|
||||||
config.disconnectReason(fromYamlPath("disconnect-reason", map, ""));
|
config.disconnectReason(fromYamlPath("disconnect-reason", map, ""));
|
||||||
|
|
||||||
config.players().maxOnlile(fromYamlPath("players/max-online", map, 0));
|
config.players().maxOnlile(fromYamlPath("players/max-online", map, 0));
|
||||||
config.players().onlile(fromYamlPath("players/online", map, 0));
|
config.players().fakeOnline().enable(fromYamlPath("players/fake-online/enable", map, false));
|
||||||
|
config.players().fakeOnline().value(fromYamlPath("players/fake-online/value", map, 0));
|
||||||
|
|
||||||
config.world().viewDistance(fromYamlPath("world/view-distance", map, 0));
|
config.world().viewDistance(fromYamlPath("world/view-distance", map, 0));
|
||||||
|
|
||||||
if (Boolean.TRUE.equals(fromYamlPath("icon/enable", map, false))) {
|
if (Boolean.TRUE.equals(fromYamlPath("icon/enable", map, false))) {
|
||||||
|
|||||||
@@ -10,7 +10,9 @@ disconnect-reason: '&4Server is not available.'
|
|||||||
|
|
||||||
players:
|
players:
|
||||||
max-online: 0
|
max-online: 0
|
||||||
online: 0
|
fake-online:
|
||||||
|
enable: true
|
||||||
|
value: 0
|
||||||
|
|
||||||
# Размер значка: 64x64 px
|
# Размер значка: 64x64 px
|
||||||
icon:
|
icon:
|
||||||
|
|||||||
Reference in New Issue
Block a user