船新两个 Sendable Json 和 ActionBar
This commit is contained in:
parent
19b4bd9a6b
commit
919ded650b
@ -1,6 +1,16 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="AliControlFlowStatementWithoutBraces" enabled="false" level="BLOCKER" enabled_by_default="false" />
|
||||
<inspection_tool class="AliDeprecation" enabled="false" level="CRITICAL" enabled_by_default="false" />
|
||||
<inspection_tool class="AlibabaAbstractClassShouldStartWithAbstractNaming" enabled="false" level="CRITICAL" enabled_by_default="false" />
|
||||
<inspection_tool class="AlibabaAbstractMethodOrInterfaceMethodMustUseJavadoc" enabled="false" level="MAJOR" enabled_by_default="false" />
|
||||
<inspection_tool class="AlibabaAvoidComplexCondition" enabled="false" level="MAJOR" enabled_by_default="false" />
|
||||
<inspection_tool class="AlibabaClassMustHaveAuthor" enabled="false" level="MAJOR" enabled_by_default="false" />
|
||||
<inspection_tool class="AlibabaClassNamingShouldBeCamel" enabled="false" level="MAJOR" enabled_by_default="false" />
|
||||
<inspection_tool class="AlibabaConstantFieldShouldBeUpperCase" enabled="false" level="CRITICAL" enabled_by_default="false" />
|
||||
<inspection_tool class="AlibabaEnumConstantsMustHaveComment" enabled="false" level="CRITICAL" enabled_by_default="false" />
|
||||
<inspection_tool class="AlibabaUndefineMagicConstant" enabled="false" level="MAJOR" enabled_by_default="false" />
|
||||
<inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="TOP_LEVEL_CLASS_OPTIONS">
|
||||
<value>
|
||||
@ -30,7 +40,7 @@
|
||||
<option name="IGNORE_JAVADOC_PERIOD" value="true" />
|
||||
<option name="IGNORE_DUPLICATED_THROWS" value="false" />
|
||||
<option name="IGNORE_POINT_TO_ITSELF" value="false" />
|
||||
<option name="myAdditionalJavadocTags" value="author,author" />
|
||||
<option name="myAdditionalJavadocTags" value="author,author,date" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="SpellCheckingInspection" enabled="true" level="233" enabled_by_default="true">
|
||||
<option name="processCode" value="true" />
|
||||
|
@ -22,7 +22,7 @@ public class TLocaleActionBar implements TLocaleSendable, ConfigurationSerializa
|
||||
|
||||
private final boolean papi;
|
||||
|
||||
public TLocaleActionBar(String text, boolean papi) {
|
||||
private TLocaleActionBar(String text, boolean papi) {
|
||||
this.text = text;
|
||||
this.papi = papi;
|
||||
}
|
||||
|
@ -63,6 +63,7 @@ public class TLocaleJson implements TLocaleSendable, ConfigurationSerializable {
|
||||
String text = split.length > 1 ? split[0] : "";
|
||||
String node = split.length > 1 ? split[1] : split[0];
|
||||
if (section.containsKey(node)) {
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, Object> arg = (Map<String, Object>) section.get(node);
|
||||
text = (String) arg.getOrDefault("text", text);
|
||||
BaseComponent[] component = TextComponent.fromLegacyText(text);
|
||||
@ -83,6 +84,7 @@ public class TLocaleJson implements TLocaleSendable, ConfigurationSerializable {
|
||||
baseComponent.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(String.valueOf(value)).create()));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
});
|
||||
builder.addAll(Arrays.asList(component));
|
||||
|
@ -44,7 +44,7 @@ public class TLocaleText implements TLocaleSendable, ConfigurationSerializable {
|
||||
if (map.containsKey("text")) {
|
||||
Object object = map.get("text");
|
||||
Object objPapi = map.getOrDefault("papi", Main.getInst().getConfig().getBoolean("LOCALE.USE_PAPI", false));
|
||||
boolean papi = objPapi instanceof Boolean ? (boolean) objPapi : objPapi instanceof String && objPapi.equals("true");
|
||||
boolean papi = objPapi instanceof Boolean ? (boolean) objPapi : objPapi instanceof String && "true".equals(objPapi);
|
||||
if (object instanceof List) {
|
||||
return new TLocaleText(((List<String>) object).stream()
|
||||
.map(s -> ChatColor.translateAlternateColorCodes('&', s))
|
||||
|
Loading…
Reference in New Issue
Block a user