mirror of
https://gitlab.bixilon.de/bixilon/pixlyzer.git
synced 2025-09-27 14:10:01 -04:00
22w16b
This commit is contained in:
parent
ad2e017c85
commit
ef7fecdca9
2
pom.xml
2
pom.xml
@ -17,7 +17,7 @@
|
|||||||
<kotlin.compiler.jvmTarget>1.8</kotlin.compiler.jvmTarget>
|
<kotlin.compiler.jvmTarget>1.8</kotlin.compiler.jvmTarget>
|
||||||
<maven.compiler.source>1.8</maven.compiler.source>
|
<maven.compiler.source>1.8</maven.compiler.source>
|
||||||
<maven.compiler.target>1.8</maven.compiler.target>
|
<maven.compiler.target>1.8</maven.compiler.target>
|
||||||
<minecraft.version>22w15a</minecraft.version>
|
<minecraft.version>22w16b</minecraft.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
|
@ -64,6 +64,7 @@ object EntityDataDataTypeGenerator : Generator(
|
|||||||
"field_38826", "CAT_VARIANT" -> "CAT_VARIANT"
|
"field_38826", "CAT_VARIANT" -> "CAT_VARIANT"
|
||||||
"field_38827", "FROG_VARIANT" -> "FROG_VARIANT"
|
"field_38827", "FROG_VARIANT" -> "FROG_VARIANT"
|
||||||
"FIREWORK_DATA", "field_17910" -> "FIREWORK_DATA"
|
"FIREWORK_DATA", "field_17910" -> "FIREWORK_DATA"
|
||||||
|
"PAINTING_VARIANT" -> "MOTIVE"
|
||||||
else -> TODO("Unknown meta data type: $this")
|
else -> TODO("Unknown meta data type: $this")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -170,6 +170,7 @@ object EntityGenerator : Generator(
|
|||||||
"class_4985" -> "StriderEntity"
|
"class_4985" -> "StriderEntity"
|
||||||
"class_4836" -> "PiglinEntity"
|
"class_4836" -> "PiglinEntity"
|
||||||
"class_7102" -> "FrogEntity"
|
"class_7102" -> "FrogEntity"
|
||||||
|
"HorseBaseEntity" -> "AbstractHorseEntity"
|
||||||
else -> className
|
else -> className
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -186,7 +187,8 @@ object EntityGenerator : Generator(
|
|||||||
}
|
}
|
||||||
field.isAccessible = true
|
field.isAccessible = true
|
||||||
val dataAccessor: TrackedData<*> = field.get(null) as TrackedData<*>
|
val dataAccessor: TrackedData<*> = field.get(null) as TrackedData<*>
|
||||||
val entityClazzData = PixLyzer.ENTITY_META_DATA_MAPPING[correctClassName(clazz.simpleName)]?.mapCast() ?: error("Can not find entity: " + correctClassName(clazz.simpleName))
|
val className = correctClassName(clazz.simpleName)
|
||||||
|
val entityClazzData = PixLyzer.ENTITY_META_DATA_MAPPING[className]?.mapCast() ?: error("Can not find entity: $className, requires field ${field.name}")
|
||||||
val entityData = entityClazzData["data"]!!.mapCast()!!
|
val entityData = entityClazzData["data"]!!.mapCast()!!
|
||||||
val realFieldName = entityData[field.name]?.toString() ?: error("Can not find meta data field ${field.name} for ${clazz.simpleName}")
|
val realFieldName = entityData[field.name]?.toString() ?: error("Can not find meta data field ${field.name} for ${clazz.simpleName}")
|
||||||
json[realFieldName] = dataAccessor.id
|
json[realFieldName] = dataAccessor.id
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package de.bixilon.pixlyzer.generator.generators
|
package de.bixilon.pixlyzer.generator.generators
|
||||||
|
|
||||||
import de.bixilon.pixlyzer.generator.Generator
|
import de.bixilon.pixlyzer.generator.Generator
|
||||||
|
import de.bixilon.pixlyzer.util.ReflectionUtil.getClass
|
||||||
import de.bixilon.pixlyzer.util.ReflectionUtil.getField
|
import de.bixilon.pixlyzer.util.ReflectionUtil.getField
|
||||||
import de.bixilon.pixlyzer.util.Util.compound
|
import de.bixilon.pixlyzer.util.Util.compound
|
||||||
import net.minecraft.entity.decoration.painting.PaintingMotive
|
|
||||||
import net.minecraft.util.registry.Registry
|
import net.minecraft.util.registry.Registry
|
||||||
|
|
||||||
object MotiveGenerator : Generator(
|
object MotiveGenerator : Generator(
|
||||||
@ -15,12 +15,15 @@ object MotiveGenerator : Generator(
|
|||||||
val motiveData = compound()
|
val motiveData = compound()
|
||||||
motiveData["id"] = MOTIVE_REGISTRY.getRawId(motive)
|
motiveData["id"] = MOTIVE_REGISTRY.getRawId(motive)
|
||||||
|
|
||||||
motiveData["width"] = motive.width
|
motiveData["width"] = WIDTH_FIELD.get(motive) as Int
|
||||||
motiveData["height"] = motive.height
|
motiveData["height"] = HEIGHT_FIELD.get(motive) as Int
|
||||||
|
|
||||||
data[resourceLocation.toString()] = motiveData
|
data[resourceLocation.toString()] = motiveData
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val MOTIVE_REGISTRY = getField(Registry::class.java, "PAINTING_MOTIVE", "MOTIVE")!!.get(null) as Registry<PaintingMotive>
|
val MOTIVE_REGISTRY = getField(Registry::class.java, "PAINTING_VARIANT", "PAINTING_MOTIVE", "MOTIVE")!!.get(null) as Registry<Any>
|
||||||
|
val MOTIVE_CLASS = getClass("net.minecraft.entity.decoration.painting.PaintingVariant", "net.minecraft.entity.decoration.painting.PaintingMotive")
|
||||||
|
val WIDTH_FIELD = getField(MOTIVE_CLASS, "width")!!
|
||||||
|
val HEIGHT_FIELD = getField(MOTIVE_CLASS, "height")!!
|
||||||
}
|
}
|
||||||
|
@ -202,7 +202,7 @@
|
|||||||
"CHEST": "ABSTRACT_CHESTED_HORSE_HAS_CHEST"
|
"CHEST": "ABSTRACT_CHESTED_HORSE_HAS_CHEST"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"HorseBaseEntity": {
|
"AbstractHorseEntity": {
|
||||||
"data": {
|
"data": {
|
||||||
"HORSE_FLAGS": "ABSTRACT_HORSE_FLAGS",
|
"HORSE_FLAGS": "ABSTRACT_HORSE_FLAGS",
|
||||||
"OWNER_UUID": "ABSTRACT_HORSE_OWNER_UUID"
|
"OWNER_UUID": "ABSTRACT_HORSE_OWNER_UUID"
|
||||||
@ -586,5 +586,10 @@
|
|||||||
"data": {
|
"data": {
|
||||||
"ANGER": "WARDEN_ANGER"
|
"ANGER": "WARDEN_ANGER"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"PaintingEntity": {
|
||||||
|
"data": {
|
||||||
|
"VARIANT": "MOTIVE"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user