mirror of
https://e.coding.net/circlecloud/TellRaw.git
synced 2025-11-24 20:36:02 +00:00
refactor(*): 格式化代码 清理文件...
This commit is contained in:
@@ -233,11 +233,6 @@ public abstract class FancyMessage implements JsonRepresentedObject, Cloneable,
|
|||||||
|
|
||||||
protected List<MessagePart> messageParts;
|
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
|
* Deserializes a JSON-represented message from a mapping of key-value
|
||||||
* pairs.
|
* pairs.
|
||||||
@@ -353,6 +348,11 @@ public abstract class FancyMessage implements JsonRepresentedObject, Cloneable,
|
|||||||
return newFM().text(firstPartText);
|
return newFM().text(firstPartText);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public FancyMessage(final TextualComponent firstPartText) {
|
||||||
|
messageParts = new ArrayList<MessagePart>();
|
||||||
|
messageParts.add(new MessagePart(firstPartText));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 在客户端显示一个成就.
|
* 在客户端显示一个成就.
|
||||||
* </p>
|
* </p>
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public class PluginHelperConfig {
|
|||||||
|
|
||||||
private static void initFile(final YamlConfiguration config) throws IOException {
|
private static void initFile(final YamlConfiguration config) throws IOException {
|
||||||
if (config.getString("guid") == null) {
|
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("guid", UUID.randomUUID().toString());
|
||||||
config.set("debug", false);
|
config.set("debug", false);
|
||||||
config.save(configfile);
|
config.save(configfile);
|
||||||
|
|||||||
@@ -22,17 +22,6 @@ public final class ArrayWrapper<E> {
|
|||||||
|
|
||||||
private E[] _array;
|
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.
|
* Converts an iterable element collection to an array of elements.
|
||||||
* The iteration order of the specified object will be used as the array
|
* The iteration order of the specified object will be used as the array
|
||||||
@@ -70,6 +59,17 @@ public final class ArrayWrapper<E> {
|
|||||||
return result;
|
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.
|
* Determines if this object has a value equivalent to another object.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -18,14 +18,14 @@ public final class JsonString implements JsonRepresentedObject, ConfigurationSer
|
|||||||
|
|
||||||
private final String _value;
|
private final String _value;
|
||||||
|
|
||||||
public JsonString(final CharSequence value) {
|
|
||||||
_value = value == null ? null : value.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static JsonString deserialize(final Map<String, Object> map) {
|
public static JsonString deserialize(final Map<String, Object> map) {
|
||||||
return new JsonString(map.get("stringValue").toString());
|
return new JsonString(map.get("stringValue").toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public JsonString(final CharSequence value) {
|
||||||
|
_value = value == null ? null : value.toString();
|
||||||
|
}
|
||||||
|
|
||||||
public String getValue() {
|
public String getValue() {
|
||||||
return _value;
|
return _value;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,14 +67,6 @@ public final class MessagePart implements JsonRepresentedObject, ConfigurationSe
|
|||||||
|
|
||||||
public ArrayList<JsonRepresentedObject> translationReplacements = new ArrayList<JsonRepresentedObject>();
|
public ArrayList<JsonRepresentedObject> translationReplacements = new ArrayList<JsonRepresentedObject>();
|
||||||
|
|
||||||
public MessagePart() {
|
|
||||||
this.text = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MessagePart(final TextualComponent text) {
|
|
||||||
this.text = text;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public static MessagePart deserialize(final Map<String, Object> serialized) {
|
public static MessagePart deserialize(final Map<String, Object> serialized) {
|
||||||
final MessagePart part = new MessagePart((TextualComponent) serialized.get("text"));
|
final MessagePart part = new MessagePart((TextualComponent) serialized.get("text"));
|
||||||
@@ -89,6 +81,14 @@ public final class MessagePart implements JsonRepresentedObject, ConfigurationSe
|
|||||||
return part;
|
return part;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MessagePart() {
|
||||||
|
this.text = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MessagePart(final TextualComponent text) {
|
||||||
|
this.text = text;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public MessagePart clone() throws CloneNotSupportedException {
|
public MessagePart clone() throws CloneNotSupportedException {
|
||||||
|
|||||||
@@ -36,10 +36,6 @@ public final class Reflection {
|
|||||||
private static final Map<String, Class<?>> _loadedOBCClasses = new HashMap<String, Class<?>>();
|
private static final Map<String, Class<?>> _loadedOBCClasses = new HashMap<String, Class<?>>();
|
||||||
private static String _versionString;
|
private static String _versionString;
|
||||||
|
|
||||||
private Reflection() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
public static List<Field> getDeclaredFieldByType(final Class source, final Class type) {
|
public static List<Field> getDeclaredFieldByType(final Class source, final Class type) {
|
||||||
final List<Field> list = new ArrayList<>();
|
final List<Field> list = new ArrayList<>();
|
||||||
@@ -297,4 +293,8 @@ public final class Reflection {
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Reflection() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -206,15 +206,15 @@ public abstract class TextualComponent implements Cloneable {
|
|||||||
|
|
||||||
private String _value;
|
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) {
|
public ArbitraryTextTypeComponent(final String key, final String value) {
|
||||||
setKey(key);
|
setKey(key);
|
||||||
setValue(value);
|
setValue(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ArbitraryTextTypeComponent deserialize(final Map<String, Object> map) {
|
|
||||||
return new ArbitraryTextTypeComponent(map.get("key").toString(), map.get("value").toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TextualComponent clone() throws CloneNotSupportedException {
|
public TextualComponent clone() throws CloneNotSupportedException {
|
||||||
// Since this is a private and final class, we can just
|
// 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;
|
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) {
|
public static ComplexTextTypeComponent deserialize(final Map<String, Object> map) {
|
||||||
String key = null;
|
String key = null;
|
||||||
final Map<String, String> value = new HashMap<String, String>();
|
final Map<String, String> value = new HashMap<String, String>();
|
||||||
@@ -295,6 +290,11 @@ public abstract class TextualComponent implements Cloneable {
|
|||||||
return new ComplexTextTypeComponent(key, value);
|
return new ComplexTextTypeComponent(key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ComplexTextTypeComponent(final String key, final Map<String, String> values) {
|
||||||
|
setKey(key);
|
||||||
|
setValue(values);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TextualComponent clone() throws CloneNotSupportedException {
|
public TextualComponent clone() throws CloneNotSupportedException {
|
||||||
// Since this is a private and final class, we can just
|
// Since this is a private and final class, we can just
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
Data:
|
|
||||||
#数据保存方式 [sqlite|MySQL]
|
|
||||||
FileSystem: sqlite
|
|
||||||
#MySQL数据库配置 只有当FileSystem配置为MySQL时有效
|
|
||||||
MySQL:
|
|
||||||
#数据库需要自行建立
|
|
||||||
database: minecraft
|
|
||||||
#数据表需要自行建立
|
|
||||||
tablename: prefixs
|
|
||||||
username: root
|
|
||||||
password:
|
|
||||||
ip: localhost
|
|
||||||
port: 3306
|
|
||||||
Reference in New Issue
Block a user