diff --git a/pom.xml b/pom.xml index 66bfdcb..0218097 100644 --- a/pom.xml +++ b/pom.xml @@ -17,7 +17,7 @@ 1.8 1.8 1.8 - 21w14a + 1.15-pre3 diff --git a/src/main/kotlin/de/bixilon/pixlyzer/generator/generators/BiomeGenerator.kt b/src/main/kotlin/de/bixilon/pixlyzer/generator/generators/BiomeGenerator.kt index d0dd18a..b0fab97 100644 --- a/src/main/kotlin/de/bixilon/pixlyzer/generator/generators/BiomeGenerator.kt +++ b/src/main/kotlin/de/bixilon/pixlyzer/generator/generators/BiomeGenerator.kt @@ -4,6 +4,7 @@ import com.google.gson.JsonObject 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.getGetter import net.minecraft.sound.SoundEvent import net.minecraft.util.Identifier import net.minecraft.util.math.BlockPos @@ -90,6 +91,8 @@ object BiomeGenerator : Generator( if (!biomeData.has("sky_color")) { BIOME_SKY_COLOR_FIELD?.getInt(biome)?.let { biomeData.addProperty("sky_color", it) + } ?: let { + SKY_COLOR_GETTER?.invoke(biome) } ?: let { 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 { Biome::class.java.getMethod("getFoliageColor") } catch (exception: Exception) { - null + try { + Biome::class.java.getMethod("getFoliageColorAt") + } catch (exception: Exception) { + null + } } private val GRASS_COLOR_OVERRIDE_METHOD = try { Biome::class.java.getMethod("getGrassColorAt", BlockPos::class.java) } catch (exception: Exception) { null } + private val SKY_COLOR_GETTER = getGetter(Biome::class.java, "getSkyColor") private val SKY_COLOR_FUNCTION = try { 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 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") diff --git a/src/main/resources/entities_metadata_mappings.json b/src/main/resources/entities_metadata_mappings.json index 8f3927d..4d3349a 100644 --- a/src/main/resources/entities_metadata_mappings.json +++ b/src/main/resources/entities_metadata_mappings.json @@ -161,6 +161,7 @@ "ABSORPTION_AMOUNT": "PLAYER_ABSORPTION_HEARTS", "SCORE": "PLAYER_SCORE", "PLAYER_MODEL_PARTS": "PLAYER_SKIN_PARTS_FLAGS", + "PLAYER_MODEL_BIT_MASK": "PLAYER_SKIN_PARTS_FLAGS", "MAIN_ARM": "PLAYER_SKIN_MAIN_HAND", "LEFT_SHOULDER_ENTITY": "PLAYER_LEFT_SHOULDER_DATA", "RIGHT_SHOULDER_ENTITY": "PLAYER_RIGHT_SHOULDER_DATA"