mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Working snippets (without autocomplete)
This commit is contained in:
parent
875adc8bdf
commit
2a22d25975
@ -405,7 +405,7 @@ public class IrisData implements ExclusionStrategy, TypeAdapterFactory {
|
||||
|
||||
if(r.startsWith("snippet/" + snippetType + "/"))
|
||||
{
|
||||
File f = new File(getDataFolder(), r);
|
||||
File f = new File(getDataFolder(), r + ".json");
|
||||
|
||||
if(f.exists())
|
||||
{
|
||||
|
@ -523,16 +523,26 @@ public class SchemaBuilder {
|
||||
d.add(fancyType);
|
||||
d.add(getDescription(k.getType()));
|
||||
|
||||
if(k.getType().isAnnotationPresent(Snippet.class))
|
||||
{
|
||||
String sm = k.getType().getDeclaredAnnotation(Snippet.class).value();
|
||||
d.add(" ");
|
||||
d.add("You can instead specify \"snippet/" + sm + "/some-name.json\" to use a snippet file instead of specifying it here.");
|
||||
}
|
||||
|
||||
try {
|
||||
k.setAccessible(true);
|
||||
Object value = k.get(cl.newInstance());
|
||||
|
||||
if (value != null) {
|
||||
if (value instanceof List) {
|
||||
d.add(" ");
|
||||
d.add("* Default Value is an empty list");
|
||||
} else if (!cl.isPrimitive() && !(value instanceof Number) && !(value instanceof String) && !(cl.isEnum())) {
|
||||
d.add(" ");
|
||||
d.add("* Default Value is a default object (create this object to see default properties)");
|
||||
} else {
|
||||
d.add(" ");
|
||||
d.add("* Default Value is " + value);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user