mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-17 05:03:55 -07:00
Update for 1.4_00_01 -- if you bypassed Bukkit, you will most likely break.
This commit is contained in:
@@ -12,14 +12,14 @@ import joptsimple.OptionSet; // CraftBukkit
|
||||
public class PropertyManager {
|
||||
|
||||
public static Logger a = Logger.getLogger("Minecraft");
|
||||
private Properties b = new Properties();
|
||||
private Properties properties = new Properties();
|
||||
private File c;
|
||||
|
||||
public PropertyManager(File file1) {
|
||||
this.c = file1;
|
||||
if (file1.exists()) {
|
||||
try {
|
||||
this.b.load(new FileInputStream(file1));
|
||||
this.properties.load(new FileInputStream(file1));
|
||||
} catch (Exception exception) {
|
||||
a.log(Level.WARNING, "Failed to load " + file1, exception);
|
||||
this.a();
|
||||
@@ -55,45 +55,46 @@ public class PropertyManager {
|
||||
|
||||
public void b() {
|
||||
try {
|
||||
this.b.store(new FileOutputStream(this.c), "Minecraft server properties");
|
||||
this.properties.store(new FileOutputStream(this.c), "Minecraft server properties");
|
||||
} catch (Exception exception) {
|
||||
a.log(Level.WARNING, "Failed to save " + this.c, exception);
|
||||
this.a();
|
||||
}
|
||||
}
|
||||
|
||||
public String a(String s, String s1) {
|
||||
if (!this.b.containsKey(s)) {
|
||||
this.b.setProperty(s, getOverride(s, s1)); // CraftBukkit
|
||||
public String getString(String s, String s1) {
|
||||
if (!this.properties.containsKey(s)) {
|
||||
s1 = getOverride(s, s1); // CraftBukkit
|
||||
this.properties.setProperty(s, s1);
|
||||
this.b();
|
||||
}
|
||||
|
||||
return getOverride(s, this.b.getProperty(s, s1)); // CraftBukkit
|
||||
return getOverride(s, this.properties.getProperty(s, s1)); // CraftBukkit
|
||||
}
|
||||
|
||||
public int a(String s, int i) {
|
||||
public int getInt(String s, int i) {
|
||||
try {
|
||||
return getOverride(s, Integer.parseInt(this.a(s, "" + i))); // CraftBukkit
|
||||
return getOverride(s, Integer.parseInt(this.getString(s, "" + i))); // CraftBukkit
|
||||
} catch (Exception exception) {
|
||||
i = getOverride(s, i); // CraftBukkit
|
||||
this.b.setProperty(s, "" + i);
|
||||
this.properties.setProperty(s, "" + i);
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean a(String s, boolean flag) {
|
||||
public boolean getBoolean(String s, boolean flag) {
|
||||
try {
|
||||
return getOverride(s, Boolean.parseBoolean(this.a(s, "" + flag))); // CraftBukkit
|
||||
return getOverride(s, Boolean.parseBoolean(this.getString(s, "" + flag))); // CraftBukkit
|
||||
} catch (Exception exception) {
|
||||
flag = getOverride(s, flag); // CraftBukkit
|
||||
this.b.setProperty(s, "" + flag);
|
||||
this.properties.setProperty(s, "" + flag);
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
|
||||
public void b(String s, boolean flag) {
|
||||
flag = getOverride(s, flag); // CraftBukkit
|
||||
this.b.setProperty(s, "" + flag);
|
||||
this.properties.setProperty(s, "" + flag);
|
||||
this.b();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user