mirror of
https://github.com/chylex/Minecraft-Phantom-Panel.git
synced 2024-11-24 22:42:53 +01:00
26 lines
733 B
C#
26 lines
733 B
C#
using System.Collections.ObjectModel;
|
|
|
|
namespace Phantom.Agent.Minecraft.Java;
|
|
|
|
sealed class JvmArgumentBuilder {
|
|
private readonly JvmProperties basicProperties;
|
|
private readonly List<string> customProperties = new ();
|
|
|
|
public JvmArgumentBuilder(JvmProperties basicProperties) {
|
|
this.basicProperties = basicProperties;
|
|
}
|
|
|
|
public void AddProperty(string key, string value) {
|
|
customProperties.Add("-D" + key + "=\"" + value + "\""); // TODO test quoting?
|
|
}
|
|
|
|
public void Build(Collection<string> target) {
|
|
target.Add("-Xms" + basicProperties.InitialHeapMegabytes + "M");
|
|
target.Add("-Xmx" + basicProperties.MaximumHeapMegabytes + "M");
|
|
|
|
foreach (var property in customProperties) {
|
|
target.Add(property);
|
|
}
|
|
}
|
|
}
|