Made some more public fields either private or final.

This commit is contained in:
RainWarrior committed 2016-03-24 22:22:21 +03:00
1 parent 756c58d5cb
commit 75032ebf9c
32 files changed
+355 -331

No files matched your search

@@ -286,7 +286,7 @@ public class ConfigCategory implements Map<String, Property>
{
Property prop = props[x];
if (prop.comment != null && !prop.comment.isEmpty())
if (prop.getComment() != null && !prop.getComment().isEmpty())
{
if (x != 0)
{
@@ -294,7 +294,7 @@ public class ConfigCategory implements Map<String, Property>
}
Splitter splitter = Splitter.onPattern("\r?\n");
for (String commentLine : splitter.split(prop.comment))
for (String commentLine : splitter.split(prop.getComment()))
{
write(out, pad1, "# ", commentLine);
}
@@ -148,7 +148,7 @@ public class ConfigElement implements IConfigElement
@Override
public String getComment()
{
return isProperty ? prop.comment : category.getComment();
return isProperty ? prop.getComment() : category.getComment();
}
@Override
@@ -706,7 +706,7 @@ public class Configuration
}
prop.setDefaultValue(defaultValue);
prop.comment = comment;
prop.setComment(comment);
return prop;
}
else if (defaultValue != null)
@@ -715,7 +715,7 @@ public class Configuration
prop.setValue(defaultValue); //Set and mark as dirty to signify it should save
cat.put(key, prop);
prop.setDefaultValue(defaultValue);
prop.comment = comment;
prop.setComment(comment);
return prop;
}
else
@@ -754,7 +754,7 @@ public class Configuration
}
prop.setDefaultValues(defaultValues);
prop.comment = comment;
prop.setComment(comment);
return prop;
}
@@ -762,7 +762,7 @@ public class Configuration
{
Property prop = new Property(key, defaultValues, type);
prop.setDefaultValues(defaultValues);
prop.comment = comment;
prop.setComment(comment);
cat.put(key, prop);
return prop;
}
@@ -1517,7 +1517,7 @@ public class Configuration
Property prop = this.get(category, name, defaultValue);
prop.setLanguageKey(langKey);
prop.setValidationPattern(pattern);
prop.comment = comment + " [default: " + defaultValue + "]";
prop.setComment(comment + " [default: " + defaultValue + "]");
return prop.getString();
}
@@ -1552,7 +1552,7 @@ public class Configuration
Property prop = this.get(category, name, defaultValue);
prop.setValidValues(validValues);
prop.setLanguageKey(langKey);
prop.comment = comment + " [default: " + defaultValue + "]";
prop.setComment(comment + " [default: " + defaultValue + "]");
return prop.getString();
}
@@ -1598,7 +1598,7 @@ public class Configuration
Property prop = this.get(category, name, defaultValue);
prop.setLanguageKey(langKey);
prop.setValidValues(validValues);
prop.comment = comment + " [default: " + prop.getDefault() + "]";
prop.setComment(comment + " [default: " + prop.getDefault() + "]");
return prop.getStringList();
}
@@ -1630,7 +1630,7 @@ public class Configuration
{
Property prop = this.get(category, name, defaultValue);
prop.setLanguageKey(langKey);
prop.comment = comment + " [default: " + defaultValue + "]";
prop.setComment(comment + " [default: " + defaultValue + "]");
return prop.getBoolean(defaultValue);
}
@@ -1666,7 +1666,7 @@ public class Configuration
{
Property prop = this.get(category, name, defaultValue);
prop.setLanguageKey(langKey);
prop.comment = comment + " [range: " + minValue + " ~ " + maxValue + ", default: " + defaultValue + "]";
prop.setComment(comment + " [range: " + minValue + " ~ " + maxValue + ", default: " + defaultValue + "]");
prop.setMinValue(minValue);
prop.setMaxValue(maxValue);
return prop.getInt(defaultValue) < minValue ? minValue : (prop.getInt(defaultValue) > maxValue ? maxValue : prop.getInt(defaultValue));
@@ -1704,7 +1704,7 @@ public class Configuration
{
Property prop = this.get(category, name, Float.toString(defaultValue), name);
prop.setLanguageKey(langKey);
prop.comment = comment + " [range: " + minValue + " ~ " + maxValue + ", default: " + defaultValue + "]";
prop.setComment(comment + " [range: " + minValue + " ~ " + maxValue + ", default: " + defaultValue + "]");
prop.setMinValue(minValue);
prop.setMaxValue(maxValue);
try
@@ -14,6 +14,16 @@ import net.minecraftforge.fml.client.config.GuiEditArrayEntries.IArrayEntry;
public class Property
{
public String getComment()
{
return comment;
}
public void setComment(String comment)
{
this.comment = comment;
}
public enum Type
{
STRING,
@@ -45,7 +55,7 @@ public class Property
private String name;
private String value;
private String defaultValue;
public String comment;
private String comment;
private String[] values;
private String[] defaultValues;
private String[] validValues;
@@ -113,7 +123,7 @@ public class Property
this.minValue = String.valueOf(Integer.MIN_VALUE);
this.maxValue = String.valueOf(Integer.MAX_VALUE);
this.langKey = langKey;
this.comment = "";
this.setComment("");
}
public Property(String name, String[] values, Type type)
@@ -155,7 +165,7 @@ public class Property
this.minValue = String.valueOf(Integer.MIN_VALUE);
this.maxValue = String.valueOf(Integer.MAX_VALUE);
this.langKey = langKey;
this.comment = "";
this.setComment("");
}
/**