refactor(*): 格式化代码 清理文件...

master
502647092 2016-03-29 14:41:30 +08:00
parent a4d502d11c
commit 4d2abf4e0b
12 changed files with 1105 additions and 1118 deletions

View File

@ -233,11 +233,6 @@ public abstract class FancyMessage implements JsonRepresentedObject, Cloneable,
protected List<MessagePart> messageParts;
public FancyMessage(final TextualComponent firstPartText) {
messageParts = new ArrayList<MessagePart>();
messageParts.add(new MessagePart(firstPartText));
}
/**
* Deserializes a JSON-represented message from a mapping of key-value
* pairs.
@ -353,6 +348,11 @@ public abstract class FancyMessage implements JsonRepresentedObject, Cloneable,
return newFM().text(firstPartText);
}
public FancyMessage(final TextualComponent firstPartText) {
messageParts = new ArrayList<MessagePart>();
messageParts.add(new MessagePart(firstPartText));
}
/**
* .
* </p>

View File

@ -46,7 +46,7 @@ public class PluginHelperConfig {
private static void initFile(final YamlConfiguration config) throws IOException {
if (config.getString("guid") == null) {
config.options().header("数据中心 http://yum.citycraft.cn 收集的数据仅用于统计插件使用情况").copyDefaults(true);
config.options().header("数据中心 http://www.yumc.pw 收集的数据仅用于统计插件使用情况").copyDefaults(true);
config.set("guid", UUID.randomUUID().toString());
config.set("debug", false);
config.save(configfile);

View File

@ -22,17 +22,6 @@ public final class ArrayWrapper<E> {
private E[] _array;
/**
* Creates an array wrapper with some elements.
*
* @param elements
* The elements of the array.
*/
@SafeVarargs
public ArrayWrapper(final E... elements) {
setArray(elements);
}
/**
* Converts an iterable element collection to an array of elements.
* The iteration order of the specified object will be used as the array
@ -70,6 +59,17 @@ public final class ArrayWrapper<E> {
return result;
}
/**
* Creates an array wrapper with some elements.
*
* @param elements
* The elements of the array.
*/
@SafeVarargs
public ArrayWrapper(final E... elements) {
setArray(elements);
}
/**
* Determines if this object has a value equivalent to another object.
*

View File

@ -18,14 +18,14 @@ public final class JsonString implements JsonRepresentedObject, ConfigurationSer
private final String _value;
public JsonString(final CharSequence value) {
_value = value == null ? null : value.toString();
}
public static JsonString deserialize(final Map<String, Object> map) {
return new JsonString(map.get("stringValue").toString());
}
public JsonString(final CharSequence value) {
_value = value == null ? null : value.toString();
}
public String getValue() {
return _value;
}

View File

@ -67,14 +67,6 @@ public final class MessagePart implements JsonRepresentedObject, ConfigurationSe
public ArrayList<JsonRepresentedObject> translationReplacements = new ArrayList<JsonRepresentedObject>();
public MessagePart() {
this.text = null;
}
public MessagePart(final TextualComponent text) {
this.text = text;
}
@SuppressWarnings("unchecked")
public static MessagePart deserialize(final Map<String, Object> serialized) {
final MessagePart part = new MessagePart((TextualComponent) serialized.get("text"));
@ -89,6 +81,14 @@ public final class MessagePart implements JsonRepresentedObject, ConfigurationSe
return part;
}
public MessagePart() {
this.text = null;
}
public MessagePart(final TextualComponent text) {
this.text = text;
}
@Override
@SuppressWarnings("unchecked")
public MessagePart clone() throws CloneNotSupportedException {

View File

@ -36,10 +36,6 @@ public final class Reflection {
private static final Map<String, Class<?>> _loadedOBCClasses = new HashMap<String, Class<?>>();
private static String _versionString;
private Reflection() {
}
@SuppressWarnings("rawtypes")
public static List<Field> getDeclaredFieldByType(final Class source, final Class type) {
final List<Field> list = new ArrayList<>();
@ -297,4 +293,8 @@ public final class Reflection {
return list;
}
private Reflection() {
}
}

View File

@ -206,15 +206,15 @@ public abstract class TextualComponent implements Cloneable {
private String _value;
public static ArbitraryTextTypeComponent deserialize(final Map<String, Object> map) {
return new ArbitraryTextTypeComponent(map.get("key").toString(), map.get("value").toString());
}
public ArbitraryTextTypeComponent(final String key, final String value) {
setKey(key);
setValue(value);
}
public static ArbitraryTextTypeComponent deserialize(final Map<String, Object> map) {
return new ArbitraryTextTypeComponent(map.get("key").toString(), map.get("value").toString());
}
@Override
public TextualComponent clone() throws CloneNotSupportedException {
// Since this is a private and final class, we can just
@ -274,11 +274,6 @@ public abstract class TextualComponent implements Cloneable {
private Map<String, String> _value;
public ComplexTextTypeComponent(final String key, final Map<String, String> values) {
setKey(key);
setValue(values);
}
public static ComplexTextTypeComponent deserialize(final Map<String, Object> map) {
String key = null;
final Map<String, String> value = new HashMap<String, String>();
@ -295,6 +290,11 @@ public abstract class TextualComponent implements Cloneable {
return new ComplexTextTypeComponent(key, value);
}
public ComplexTextTypeComponent(final String key, final Map<String, String> values) {
setKey(key);
setValue(values);
}
@Override
public TextualComponent clone() throws CloneNotSupportedException {
// Since this is a private and final class, we can just

View File

@ -1,13 +0,0 @@
Data:
#数据保存方式 [sqlite|MySQL]
FileSystem: sqlite
#MySQL数据库配置 只有当FileSystem配置为MySQL时有效
MySQL:
#数据库需要自行建立
database: minecraft
#数据表需要自行建立
tablename: prefixs
username: root
password:
ip: localhost
port: 3306