mirror of
https://gitlab.bixilon.de/bixilon/pixlyzer.git
synced 2025-09-24 20:58:04 -04:00
fix abstract player entity data
This commit is contained in:
parent
6529c359ee
commit
dcf04103c6
@ -10,6 +10,7 @@ import net.minecraft.resources.ResourceLocation
|
||||
import net.minecraft.world.entity.Entity
|
||||
import net.minecraft.world.entity.LivingEntity
|
||||
import net.minecraft.world.entity.ai.attributes.Attributes
|
||||
import net.minecraft.world.entity.player.Player
|
||||
|
||||
object EntityGenerator : Generator(
|
||||
"entities"
|
||||
@ -128,6 +129,17 @@ object EntityGenerator : Generator(
|
||||
|
||||
generateMetaDataForParents(entityClass, entityData, data)
|
||||
}
|
||||
|
||||
// Fix player
|
||||
data[ResourceLocation("player").toString()]?.asJsonObject?.let {
|
||||
val playerClassName = Player::class.simpleName.toString()
|
||||
val player = data[playerClassName].asJsonObject
|
||||
for ((key, value) in player.entrySet()) {
|
||||
it.add(key, value)
|
||||
}
|
||||
it.addProperty("class", playerClassName)
|
||||
data.remove(playerClassName)
|
||||
}
|
||||
}
|
||||
|
||||
private fun generateMetaDataForParents(clazz: Class<out Entity>, entityData: JsonObject, data: JsonObject) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user