mirror of
https://gitlab.bixilon.de/bixilon/pixlyzer.git
synced 2025-09-28 14:41:57 -04:00
port until 19w46a
This commit is contained in:
parent
02e842a370
commit
6a0b10100a
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>21w14a</minecraft.version>
|
<minecraft.version>1.15-pre3</minecraft.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
|
@ -4,6 +4,7 @@ import com.google.gson.JsonObject
|
|||||||
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.getClass
|
||||||
import de.bixilon.pixlyzer.util.ReflectionUtil.getField
|
import de.bixilon.pixlyzer.util.ReflectionUtil.getField
|
||||||
|
import de.bixilon.pixlyzer.util.ReflectionUtil.getGetter
|
||||||
import net.minecraft.sound.SoundEvent
|
import net.minecraft.sound.SoundEvent
|
||||||
import net.minecraft.util.Identifier
|
import net.minecraft.util.Identifier
|
||||||
import net.minecraft.util.math.BlockPos
|
import net.minecraft.util.math.BlockPos
|
||||||
@ -90,6 +91,8 @@ object BiomeGenerator : Generator(
|
|||||||
if (!biomeData.has("sky_color")) {
|
if (!biomeData.has("sky_color")) {
|
||||||
BIOME_SKY_COLOR_FIELD?.getInt(biome)?.let {
|
BIOME_SKY_COLOR_FIELD?.getInt(biome)?.let {
|
||||||
biomeData.addProperty("sky_color", it)
|
biomeData.addProperty("sky_color", it)
|
||||||
|
} ?: let {
|
||||||
|
SKY_COLOR_GETTER?.invoke(biome)
|
||||||
} ?: let {
|
} ?: let {
|
||||||
biomeData.addProperty("sky_color", SKY_COLOR_FUNCTION!!.invoke(biome, 0.0f) as Int)
|
biomeData.addProperty("sky_color", SKY_COLOR_FUNCTION!!.invoke(biome, 0.0f) as Int)
|
||||||
}
|
}
|
||||||
@ -108,13 +111,18 @@ object BiomeGenerator : Generator(
|
|||||||
private val FOLIAGE_COLOR_METHOD = try {
|
private val FOLIAGE_COLOR_METHOD = try {
|
||||||
Biome::class.java.getMethod("getFoliageColor")
|
Biome::class.java.getMethod("getFoliageColor")
|
||||||
} catch (exception: Exception) {
|
} catch (exception: Exception) {
|
||||||
null
|
try {
|
||||||
|
Biome::class.java.getMethod("getFoliageColorAt")
|
||||||
|
} catch (exception: Exception) {
|
||||||
|
null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
private val GRASS_COLOR_OVERRIDE_METHOD = try {
|
private val GRASS_COLOR_OVERRIDE_METHOD = try {
|
||||||
Biome::class.java.getMethod("getGrassColorAt", BlockPos::class.java)
|
Biome::class.java.getMethod("getGrassColorAt", BlockPos::class.java)
|
||||||
} catch (exception: Exception) {
|
} catch (exception: Exception) {
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
private val SKY_COLOR_GETTER = getGetter(Biome::class.java, "getSkyColor")
|
||||||
|
|
||||||
private val SKY_COLOR_FUNCTION = try {
|
private val SKY_COLOR_FUNCTION = try {
|
||||||
Biome::class.java.getDeclaredMethod("getSkyColor", Float::class.java)
|
Biome::class.java.getDeclaredMethod("getSkyColor", Float::class.java)
|
||||||
@ -143,7 +151,7 @@ object BiomeGenerator : Generator(
|
|||||||
private val DOWNFALL_FIELD = getField(CLIMATE_SETTINGS_CLASS, "downfall")!!
|
private val DOWNFALL_FIELD = getField(CLIMATE_SETTINGS_CLASS, "downfall")!!
|
||||||
|
|
||||||
|
|
||||||
private val BIOME_SKY_COLOR_FIELD = getField(Biome::class.java, "skyColor")
|
private val BIOME_SKY_COLOR_FIELD = getField(Biome::class.java, "field_21806", "skyColor")
|
||||||
|
|
||||||
|
|
||||||
private val MUSIC_CLASS_EVENT_FIELD = getField(getClass("net.minecraft.sound.MusicSound"), "sound", "event")
|
private val MUSIC_CLASS_EVENT_FIELD = getField(getClass("net.minecraft.sound.MusicSound"), "sound", "event")
|
||||||
|
@ -161,6 +161,7 @@
|
|||||||
"ABSORPTION_AMOUNT": "PLAYER_ABSORPTION_HEARTS",
|
"ABSORPTION_AMOUNT": "PLAYER_ABSORPTION_HEARTS",
|
||||||
"SCORE": "PLAYER_SCORE",
|
"SCORE": "PLAYER_SCORE",
|
||||||
"PLAYER_MODEL_PARTS": "PLAYER_SKIN_PARTS_FLAGS",
|
"PLAYER_MODEL_PARTS": "PLAYER_SKIN_PARTS_FLAGS",
|
||||||
|
"PLAYER_MODEL_BIT_MASK": "PLAYER_SKIN_PARTS_FLAGS",
|
||||||
"MAIN_ARM": "PLAYER_SKIN_MAIN_HAND",
|
"MAIN_ARM": "PLAYER_SKIN_MAIN_HAND",
|
||||||
"LEFT_SHOULDER_ENTITY": "PLAYER_LEFT_SHOULDER_DATA",
|
"LEFT_SHOULDER_ENTITY": "PLAYER_LEFT_SHOULDER_DATA",
|
||||||
"RIGHT_SHOULDER_ENTITY": "PLAYER_RIGHT_SHOULDER_DATA"
|
"RIGHT_SHOULDER_ENTITY": "PLAYER_RIGHT_SHOULDER_DATA"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user