mirror of
https://github.com/amalthea-mc/ShopChest.git
synced 2024-11-26 04:12:22 +00:00
Make JsonBuilder.parse static
This commit is contained in:
parent
720fceaba1
commit
3c0790d670
@ -134,12 +134,11 @@ public class JsonBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
public void parse(String text) {
|
||||
public static Part parse(String text) {
|
||||
Matcher matcher = PART_PATTERN.matcher(text);
|
||||
|
||||
if (!matcher.find()) {
|
||||
rootPart = new Part(text);
|
||||
return;
|
||||
return new Part(text);
|
||||
}
|
||||
|
||||
matcher.reset();
|
||||
@ -199,7 +198,7 @@ public class JsonBuilder {
|
||||
lastEndIndex = endIndex;
|
||||
}
|
||||
|
||||
rootPart = array;
|
||||
return array;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -328,9 +328,9 @@ public class Utils {
|
||||
clickEvent.put("action", new JsonBuilder.Part("open_url"));
|
||||
clickEvent.put("value", new JsonBuilder.Part(plugin.getDownloadLink()));
|
||||
|
||||
jb.parse(LanguageUtils.getMessage(Message.UPDATE_AVAILABLE, new Replacement(Placeholder.VERSION, plugin.getLatestVersion())));
|
||||
|
||||
JsonBuilder.PartMap rootPart = jb.getRootPart().toMap();
|
||||
JsonBuilder.PartMap rootPart = JsonBuilder.parse(LanguageUtils.getMessage(Message.UPDATE_AVAILABLE,
|
||||
new Replacement(Placeholder.VERSION, plugin.getLatestVersion()))).toMap();
|
||||
|
||||
rootPart.setValue("hoverEvent", new JsonBuilder.PartMap(hoverEvent));
|
||||
rootPart.setValue("clickEvent", new JsonBuilder.PartMap(clickEvent));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user