Skip to content

Commit

Permalink
fix: remove "final" in config class
Browse files Browse the repository at this point in the history
  • Loading branch information
smartcmd committed May 11, 2024
1 parent c70abb2 commit 2ac1d02
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 37 deletions.
4 changes: 2 additions & 2 deletions Allay-API/src/main/java/org/allaymc/api/server/BanInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
public class BanInfo extends OkaeriConfig {
@CustomKey("banned-players")
@Comment("Banned player list. The value can be player's name or uuid")
private final Set<String> bannedPlayers = Sets.newConcurrentHashSet();
private Set<String> bannedPlayers = Sets.newConcurrentHashSet();

@CustomKey("banned-ips")
@Comment("Banned ip list")
private final Set<String> bannedIps = Sets.newConcurrentHashSet();
private Set<String> bannedIps = Sets.newConcurrentHashSet();
}
66 changes: 33 additions & 33 deletions Allay-API/src/main/java/org/allaymc/api/server/ServerSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
public class ServerSettings extends OkaeriConfig {

@CustomKey("generic-settings")
private final GenericSettings genericSettings = new GenericSettings();
private GenericSettings genericSettings = new GenericSettings();
@CustomKey("network-settings")
private final NetworkSettings networkSettings = new NetworkSettings();
private NetworkSettings networkSettings = new NetworkSettings();
@CustomKey("world-settings")
private final WorldConfig worldSettings = new WorldConfig();
private WorldConfig worldSettings = new WorldConfig();
@CustomKey("entity-settings")
private final EntitySettings entitySettings = new EntitySettings();
private EntitySettings entitySettings = new EntitySettings();
@CustomKey("storage-settings")
private final StorageSettings storageSettings = new StorageSettings();
private StorageSettings storageSettings = new StorageSettings();
@CustomKey("resource-pack-settings")
private final ResourcePackSettings resourcePackSettings = new ResourcePackSettings();
private ResourcePackSettings resourcePackSettings = new ResourcePackSettings();

@Getter
@Setter
Expand Down Expand Up @@ -68,58 +68,58 @@ public static class GenericSettings extends OkaeriConfig {
@Accessors(fluent = true)
public static class NetworkSettings extends OkaeriConfig {

private final String ip = "127.0.0.1";
private String ip = "127.0.0.1";

private final int port = 19132;
private int port = 19132;

@CustomKey("xbox-auth")
private final boolean xboxAuth = true;
private boolean xboxAuth = true;

@Comment("Turning this on is highly recommended for security reasons")
@CustomKey("enable-network-encryption")
private final boolean enableNetworkEncryption = true;
private boolean enableNetworkEncryption = true;

@Comment("Possible values: ZLIB, SNAPPY")
@CustomKey("compression-algorithm")
private final PacketCompressionAlgorithm compressionAlgorithm = PacketCompressionAlgorithm.ZLIB;
private PacketCompressionAlgorithm compressionAlgorithm = PacketCompressionAlgorithm.ZLIB;

@CustomKey("network-thread-number")
@Comment("0 == the server will automatically determine the number of netty threads")
private final int networkThreadNumber = 0;
private int networkThreadNumber = 0;

@CustomKey("max-synced-packets-handle-count-once")
@Comment("The maximum number of packets that can be processed at once")
private final int maxSyncedPacketsHandleCountAtOnce = 128;
private int maxSyncedPacketsHandleCountAtOnce = 128;
}

@Getter
@Accessors(fluent = true)
public static class WorldConfig extends OkaeriConfig {

@CustomKey("ticking-radius")
private final int tickingRadius = 8;
private int tickingRadius = 8;

@CustomKey("view-distance")
private final int viewDistance = 16;
private int viewDistance = 16;

@CustomKey("chunk-try-send-count-per-tick")
private final int chunkTrySendCountPerTick = 16;
private int chunkTrySendCountPerTick = 16;

@CustomKey("use-sub-chunk-sending-system")
private final boolean useSubChunkSendingSystem = false;
private boolean useSubChunkSendingSystem = false;

@Comment("Possible values: ASYNC, SYNC")
@Comment("This only works if sub-chunk sending system is not enabled")
@Comment("And will be forced to SYNC if sub-chunk sending system is enabled")
@CustomKey("chunk-sending-strategy")
private final ChunkSendingStrategy chunkSendingStrategy = ChunkSendingStrategy.ASYNC;
private ChunkSendingStrategy chunkSendingStrategy = ChunkSendingStrategy.ASYNC;

@CustomKey("do-first-spawn-chunk-threshold")
private final int doFirstSpawnChunkThreshold = 56;
private int doFirstSpawnChunkThreshold = 56;

@Comment("Determines how long a chunk without chunk loaders will remain loaded (gt)")
@CustomKey("remove-unneeded-chunk-cycle")
private final int removeUnneededChunkCycle = 1200;
private int removeUnneededChunkCycle = 1200;

public enum ChunkSendingStrategy {
ASYNC,
Expand All @@ -134,7 +134,7 @@ public static class EntitySettings extends OkaeriConfig {
@Comment("Entity physics engine settings")
@Comment("Do not change them if you don't know what you are doing!")
@CustomKey("physics-engine-settings")
private final PhysicsEngineSettings physicsEngineSettings = new PhysicsEngineSettings();
private PhysicsEngineSettings physicsEngineSettings = new PhysicsEngineSettings();

@Getter
@Accessors(fluent = true)
Expand All @@ -143,30 +143,30 @@ public static class PhysicsEngineSettings extends OkaeriConfig {
@Comment("This threshold acts on each axis individually")
@Comment("Increasing this threshold will reduce bandwidth pressure, but may result in untimely motion updates")
@CustomKey("diff-position-threshold")
private final float diffPositionThreshold = 0.0001f;
private float diffPositionThreshold = 0.0001f;

@Comment("Similar to \"diffPositionThreshold\"")
@CustomKey("diff-rotation-threshold")
private final float diffRotationThreshold = 0.1f;
private float diffRotationThreshold = 0.1f;

@Comment("When the motion falls below this value, its motion is zeroed")
@CustomKey("motion-threshold")
private final float motionThreshold = 0.003f;
private float motionThreshold = 0.003f;

@Comment("Walk assist offset")
@CustomKey("stepping-offset")
private final float steppingOffset = 0.05f;
private float steppingOffset = 0.05f;

@Comment("This usually determines how quickly an entity item is moved when getting stuck in a block")
@CustomKey("block-collision-motion")
private final float blockCollisionMotion = 0.2f;
private float blockCollisionMotion = 0.2f;

@CustomKey("fat-aabb-margin")
private final float fatAABBMargin = 0.0005f;
private float fatAABBMargin = 0.0005f;

@Comment("Delta move packet will reduce the network pressure if there are a lot of entities")
@CustomKey("use-delta-move-packet")
private final boolean useDeltaMovePacket = false;
private boolean useDeltaMovePacket = false;
}
}

Expand All @@ -175,11 +175,11 @@ public static class PhysicsEngineSettings extends OkaeriConfig {
public static class StorageSettings extends OkaeriConfig {
@CustomKey("save-player-data")
@Comment("If set to false, the player's data will not be saved")
private final boolean savePlayerData = true;
private boolean savePlayerData = true;

@CustomKey("save-player-data-cycle")
@Comment("Determines the cycle of player data auto saving")
private final int playerDataAutoSaveCycle = 20 * 60;
private int playerDataAutoSaveCycle = 20 * 60;
}

@Getter
Expand All @@ -188,18 +188,18 @@ public static class ResourcePackSettings extends OkaeriConfig {

@CustomKey("auto-encrypt")
@Comment("If set to true, packs will be automatically encrypted")
private final boolean autoEncrypt = true;
private boolean autoEncrypt = true;

@CustomKey("max-chunk-size")
@Comment("The maximum size of a resource pack chunk (unit: KB)")
@Comment("Decrease this value may reduce the pressure on the network when sending packs to multiple clients")
@Comment("However, it may also increase the time it takes to send the packs")
private final int maxChunkSize = 100; // 100KB, from BDS
private int maxChunkSize = 100; // 100KB, from BDS

@Comment("true - the player must accept resource packs, otherwise he will not log in to the server")
@Comment("false - the player can log in to the server without accepting resource packs")
@CustomKey("force-resource-packs")
private final boolean forceResourcePacks = false;
private boolean forceResourcePacks = false;

// TODO: URL packs configuration
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
@Accessors(fluent = true)
public class Whitelist extends OkaeriConfig {
@Comment("Whitelisted player list. The value can be player's name or uuid")
private final Set<String> whitelist = Sets.newConcurrentHashSet();
private Set<String> whitelist = Sets.newConcurrentHashSet();
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ public class WorldSettings extends OkaeriConfig {
.overworld(new WorldEntry.DimensionSettings("FLAT", ""))
.build();

private final Map<String, WorldEntry> worlds = Map.of(DEFAULT_WORLD_NAME, DEFAULT);
@CustomKey("worlds")
private Map<String, WorldEntry> worlds = Map.of(DEFAULT_WORLD_NAME, DEFAULT);

@CustomKey("default-world")
@Setter
Expand Down

0 comments on commit 2ac1d02

Please sign in to comment.