9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-30 04:29:05 +00:00

Mythic mobs support

This commit is contained in:
Daniel Mills
2020-10-13 05:53:50 -04:00
parent 38e62a9c98
commit 31320b4ab7
8 changed files with 174 additions and 4 deletions

View File

@@ -26,6 +26,7 @@ import com.volmit.iris.util.RegistryListFont;
import com.volmit.iris.util.RegistryListGenerator;
import com.volmit.iris.util.RegistryListItemType;
import com.volmit.iris.util.RegistryListLoot;
import com.volmit.iris.util.RegistryListMythical;
import com.volmit.iris.util.RegistryListObject;
import com.volmit.iris.util.RegistryListRegion;
import com.volmit.iris.util.RegistryListStructure;
@@ -207,6 +208,22 @@ public class SchemaBuilder
}
else if(k.isAnnotationPresent(RegistryListMythical.class))
{
String key = "enum-reg-mythical";
if(!definitions.containsKey(key))
{
JSONObject j = new JSONObject();
j.put("enum", new JSONArray(Iris.linkMythicMobs.getMythicMobTypes()));
definitions.put(key, j);
}
fancyType = "Mythic Mob Type";
prop.put("$ref", "#/definitions/" + key);
description.add(SYMBOL_TYPE__N + " Must be a valid Mythic Mob Type (use ctrl+space for auto complete!) Define mythic mobs with the mythic mobs plugin configuration files.");
}
else if(k.isAnnotationPresent(RegistryListBlockType.class))
{
String key = "enum-block-type";
@@ -553,6 +570,31 @@ public class SchemaBuilder
description.add(SYMBOL_TYPE__N + " Must be a valid Biome (use ctrl+space for auto complete!)");
}
else if(k.isAnnotationPresent(RegistryListMythical.class))
{
fancyType = "List of Mythic Mob Types";
String key = "enum-reg-mythical";
if(!definitions.containsKey(key))
{
JSONObject j = new JSONObject();
JSONArray ja = new JSONArray();
for(String i : Iris.linkMythicMobs.getMythicMobTypes())
{
ja.put(i);
}
j.put("enum", ja);
definitions.put(key, j);
}
JSONObject items = new JSONObject();
items.put("$ref", "#/definitions/" + key);
prop.put("items", items);
description.add(SYMBOL_TYPE__N + " Must be a valid Mythic Mob Type (use ctrl+space for auto complete!) Configure mob types in the mythic mobs plugin configuration files.");
}
else if(k.isAnnotationPresent(RegistryListBlockType.class))
{
fancyType = "List of Block Types";
@@ -839,6 +881,7 @@ public class SchemaBuilder
{
warnings.add("Unexpected Schema Type: " + type + " for field " + k.getName() + " (" + k.getType().getSimpleName() + ") in class " + cl.getSimpleName());
}
KList<String> d = new KList<>();
d.add(k.getName());
d.add(getFieldDescription(k));