mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-11 16:36:58 -04:00
allow mobs without id (used for object ids)
This commit is contained in:
parent
a43d4afbaa
commit
6759a149fc
@ -27,7 +27,11 @@ public class EntityInformation extends ModIdentifier {
|
||||
}
|
||||
|
||||
public static EntityInformation deserialize(String mod, String identifier, JsonObject data) {
|
||||
return new EntityInformation(mod, identifier, data.get("width").getAsFloat(), data.get("height").getAsFloat());
|
||||
if (data.has("width") && data.has("height")) {
|
||||
return new EntityInformation(mod, identifier, data.get("width").getAsFloat(), data.get("height").getAsFloat());
|
||||
}
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
public float getWidth() {
|
||||
|
@ -407,12 +407,15 @@ public class VersionMapping {
|
||||
|
||||
private void loadEntityMapping(String mod, String identifier, JsonObject fullModData) {
|
||||
JsonObject data = fullModData.getAsJsonObject(identifier);
|
||||
if (data.has("id")) {
|
||||
Class<? extends Entity> clazz = EntityClassMappings.getByIdentifier(mod, identifier);
|
||||
EntityInformation information = EntityInformation.deserialize(mod, identifier, data);
|
||||
if (information != null) {
|
||||
// not abstract, has id and attributes
|
||||
Class<? extends Entity> clazz = EntityClassMappings.getByIdentifier(mod, identifier);
|
||||
entityInformationMap.put(clazz, EntityInformation.deserialize(mod, identifier, data));
|
||||
entityInformationMap.put(clazz, information);
|
||||
|
||||
entityIdClassMap.put(data.get("id").getAsInt(), clazz);
|
||||
if (data.has("id")) {
|
||||
entityIdClassMap.put(data.get("id").getAsInt(), clazz);
|
||||
}
|
||||
}
|
||||
String parent = null;
|
||||
int metaDataIndexOffset = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user