1
0
mirror of https://github.com/chylex/Minecraft-Phantom-Panel.git synced 2025-08-18 18:24:56 +02:00
Files
.config
.run
.workdir
Agent
Phantom.Agent
Phantom.Agent.Minecraft
Command
Instance
Java
Launcher
Properties
MinecraftServerProperties.cs
MinecraftServerProperty.cs
ServerProperties.cs
Server
Phantom.Agent.Minecraft.csproj
Phantom.Agent.Rpc
Phantom.Agent.Services
Common
Controller
Docker
Utils
Web
.dockerignore
.gitattributes
.gitignore
AddMigration.bat
AddMigration.sh
Directory.Build.props
Directory.Build.targets
Dockerfile
LICENSE
Packages.props
PhantomPanel.sln
README.md
global.json

23 lines
1.0 KiB
C#

namespace Phantom.Agent.Minecraft.Properties;
static class MinecraftServerProperties {
private sealed class Boolean : MinecraftServerProperty<bool> {
public Boolean(string key) : base(key) {}
protected override bool Read(string value) => value.Equals("true", StringComparison.OrdinalIgnoreCase);
protected override string Write(bool value) => value ? "true" : "false";
}
private sealed class UnsignedShort : MinecraftServerProperty<ushort> {
public UnsignedShort(string key) : base(key) {}
protected override ushort Read(string value) => ushort.Parse(value);
protected override string Write(ushort value) => value.ToString();
}
public static readonly MinecraftServerProperty<ushort> ServerPort = new UnsignedShort("server-port");
public static readonly MinecraftServerProperty<ushort> RconPort = new UnsignedShort("rcon.port");
public static readonly MinecraftServerProperty<bool> EnableRcon = new Boolean("enable-rcon");
public static readonly MinecraftServerProperty<bool> SyncChunkWrites = new Boolean("sync-chunk-writes");
}