mirror of
https://github.com/EpicEricEE/ShopChest.git
synced 2024-11-08 20:01:25 +01: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);
|
Matcher matcher = PART_PATTERN.matcher(text);
|
||||||
|
|
||||||
if (!matcher.find()) {
|
if (!matcher.find()) {
|
||||||
rootPart = new Part(text);
|
return new Part(text);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
matcher.reset();
|
matcher.reset();
|
||||||
@ -199,7 +198,7 @@ public class JsonBuilder {
|
|||||||
lastEndIndex = endIndex;
|
lastEndIndex = endIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
rootPart = array;
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -328,9 +328,9 @@ public class Utils {
|
|||||||
clickEvent.put("action", new JsonBuilder.Part("open_url"));
|
clickEvent.put("action", new JsonBuilder.Part("open_url"));
|
||||||
clickEvent.put("value", new JsonBuilder.Part(plugin.getDownloadLink()));
|
clickEvent.put("value", new JsonBuilder.Part(plugin.getDownloadLink()));
|
||||||
|
|
||||||
jb.parse(LanguageUtils.getMessage(Message.UPDATE_AVAILABLE, new Replacement(Placeholder.VERSION, plugin.getLatestVersion())));
|
JsonBuilder.PartMap rootPart = JsonBuilder.parse(LanguageUtils.getMessage(Message.UPDATE_AVAILABLE,
|
||||||
|
new Replacement(Placeholder.VERSION, plugin.getLatestVersion()))).toMap();
|
||||||
|
|
||||||
JsonBuilder.PartMap rootPart = jb.getRootPart().toMap();
|
|
||||||
rootPart.setValue("hoverEvent", new JsonBuilder.PartMap(hoverEvent));
|
rootPart.setValue("hoverEvent", new JsonBuilder.PartMap(hoverEvent));
|
||||||
rootPart.setValue("clickEvent", new JsonBuilder.PartMap(clickEvent));
|
rootPart.setValue("clickEvent", new JsonBuilder.PartMap(clickEvent));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user