mirror of
https://gitlab.bixilon.de/bixilon/pixlyzer.git
synced 2025-09-28 22:52:07 -04:00
entities: move entity attributes to sub json object
This commit is contained in:
parent
446a500fdb
commit
61fd25f300
@ -57,6 +57,7 @@ object EntityGenerator : Generator(
|
|||||||
// ToDo: entityData.addProperty("category", entityType.getEntityCategory(entity).ordinal)
|
// ToDo: entityData.addProperty("category", entityType.getEntityCategory(entity).ordinal)
|
||||||
|
|
||||||
if (entity is LivingEntity && entity2 is LivingEntity) {
|
if (entity is LivingEntity && entity2 is LivingEntity) {
|
||||||
|
val attributesData = JsonObject()
|
||||||
for ((resourceLocation, attribute) in ATTRIBUTE_MAP) {
|
for ((resourceLocation, attribute) in ATTRIBUTE_MAP) {
|
||||||
val attributes = LIVING_ENTITY_GET_ATTRIBUTES_METHOD.invoke(entity) ?: continue
|
val attributes = LIVING_ENTITY_GET_ATTRIBUTES_METHOD.invoke(entity) ?: continue
|
||||||
val instance = BASE_ATTRIBUTE_MAP_GET_INSTANCE_METHOD.invoke(attributes, attribute) as EntityAttributeInstance? ?: continue
|
val instance = BASE_ATTRIBUTE_MAP_GET_INSTANCE_METHOD.invoke(attributes, attribute) as EntityAttributeInstance? ?: continue
|
||||||
@ -68,7 +69,11 @@ object EntityGenerator : Generator(
|
|||||||
if (value != value2) {
|
if (value != value2) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
entityData.addProperty(resourceLocation, value)
|
|
||||||
|
attributesData.addProperty(resourceLocation, value)
|
||||||
|
}
|
||||||
|
if (attributesData.size() > 0) {
|
||||||
|
entityData.add("attributes", attributesData)
|
||||||
}
|
}
|
||||||
|
|
||||||
// entity.getEatingSound(ItemStack.EMPTY)?.let {
|
// entity.getEatingSound(ItemStack.EMPTY)?.let {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user