-
Notifications
You must be signed in to change notification settings - Fork 3
/
JvmData.java
50 lines (46 loc) · 1.74 KB
/
JvmData.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
* D3Backend
* Copyright (C) 2015 - 2017 Dries007 & Double Door Development
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.doubledoordev.backend.server;
import com.google.gson.JsonObject;
import com.google.gson.annotations.Expose;
import net.doubledoordev.backend.util.IUpdateFromJson;
/**
* @author Dries007
*/
public class JvmData implements IUpdateFromJson
{
@Expose
public int ramMin = 512;
@Expose
public int ramMax = 2048;
@Expose
public String extraJavaParameters = "";
@Expose
public String extraMCParameters = "";
@Expose
public String jarName = "minecraft_server.jar";
@Override
public void updateFrom(JsonObject json)
{
if (json.has("ramMin")) ramMin = json.get("ramMin").getAsInt();
if (json.has("ramMax")) ramMax = json.get("ramMax").getAsInt();
if (json.has("extraJavaParameters")) extraJavaParameters = json.get("extraJavaParameters").getAsString();
if (json.has("extraMCParameters")) extraMCParameters = json.get("extraMCParameters").getAsString();
if (json.has("jarName")) jarName = json.get("jarName").getAsString();
}
}