diff --git a/gradle.properties b/gradle.properties index 984f352..320b43c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,13 +5,13 @@ org.gradle.parallel=true org.gradle.configuration-cache=false # Fabric Properties # check these on https://fabricmc.net/develop -minecraft_version=26.2 +minecraft_version=26.3-pre-1 loader_version=0.19.3 -loom_version=1.16-SNAPSHOT +loom_version=1.17-SNAPSHOT fabric_kotlin_version=1.13.12+kotlin.2.4.0 # Mod Properties mod_version=1.0.0 maven_group=com.steelextractor archives_base_name=steel-extractor # Dependencies -fabric_version=0.152.0+26.2 +fabric_version=0.159.1+26.3 diff --git a/src/main/java/com/steelextractor/mixin/AxeItemAccessor.java b/src/main/java/com/steelextractor/mixin/AxeItemAccessor.java deleted file mode 100644 index ef4b023..0000000 --- a/src/main/java/com/steelextractor/mixin/AxeItemAccessor.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.steelextractor.mixin; - -import net.minecraft.world.item.AxeItem; -import net.minecraft.world.level.block.Block; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.gen.Accessor; - -import java.util.Map; - -@Mixin(AxeItem.class) -public interface AxeItemAccessor { - @Accessor("STRIPPABLES") - static Map getStrippables() { - throw new AssertionError(); - } -} diff --git a/src/main/java/com/steelextractor/mixin/ChunkAccessBiomeCacheMixin.java b/src/main/java/com/steelextractor/mixin/ChunkAccessBiomeCacheMixin.java index 67741ed..7417fb6 100644 --- a/src/main/java/com/steelextractor/mixin/ChunkAccessBiomeCacheMixin.java +++ b/src/main/java/com/steelextractor/mixin/ChunkAccessBiomeCacheMixin.java @@ -2,7 +2,6 @@ import com.steelextractor.BiomeCacheReset; import net.minecraft.world.level.biome.BiomeResolver; -import net.minecraft.world.level.biome.Climate; import net.minecraft.world.level.biome.MultiNoiseBiomeSource; import net.minecraft.world.level.chunk.ChunkAccess; import org.spongepowered.asm.mixin.Mixin; @@ -18,7 +17,7 @@ public abstract class ChunkAccessBiomeCacheMixin { * its R-tree warm-start within the chunk, but not across chunk boundaries. */ @Inject(method = "fillBiomesFromNoise", at = @At("HEAD")) - private void resetBiomeCacheForChunk(BiomeResolver biomeResolver, Climate.Sampler sampler, CallbackInfo ci) { + private void resetBiomeCacheForChunk(BiomeResolver biomeResolver, CallbackInfo ci) { if (biomeResolver instanceof MultiNoiseBiomeSource) { BiomeCacheReset.markNeeded(); } diff --git a/src/main/java/com/steelextractor/mixin/ChunkStepMixin.java b/src/main/java/com/steelextractor/mixin/ChunkStepMixin.java index 14ae014..cf98261 100644 --- a/src/main/java/com/steelextractor/mixin/ChunkStepMixin.java +++ b/src/main/java/com/steelextractor/mixin/ChunkStepMixin.java @@ -20,9 +20,7 @@ public class ChunkStepMixin { private static final Set IMMEDIATE_HASH_STAGES = Set.of( - ChunkStatus.NOISE, - ChunkStatus.SURFACE, - ChunkStatus.CARVERS + ChunkStatus.TERRAIN ); @Shadow diff --git a/src/main/kotlin/com/steelextractor/SteelExtractor.kt b/src/main/kotlin/com/steelextractor/SteelExtractor.kt index 77fe94e..9103aea 100644 --- a/src/main/kotlin/com/steelextractor/SteelExtractor.kt +++ b/src/main/kotlin/com/steelextractor/SteelExtractor.kt @@ -32,7 +32,6 @@ import com.steelextractor.extractors.CustomStatRegistryExtractor import com.steelextractor.extractors.Commands import com.steelextractor.extractors.GameEvents import com.steelextractor.extractors.Weathering -import com.steelextractor.extractors.Strippables import net.minecraft.resources.ResourceKey import net.minecraft.server.level.ServerLevel import net.minecraft.world.level.ChunkPos @@ -243,7 +242,6 @@ object SteelExtractor : ModInitializer { addUnlessDisabled("LEVEL_EVENTS") { LevelEvents() } addUnlessDisabled("TAGS") { Tags() } addUnlessDisabled("STRUCTURE_STARTS") { StructureStarts() } - addUnlessDisabled("STRIPPABLES") { Strippables() } addUnlessDisabled("WEATHERING") { Weathering() } addUnlessDisabled("CANDLE_CAKES") { CandleCakes() } addUnlessDisabled("WAXABLES") { Waxables() } @@ -432,7 +430,7 @@ object SteelExtractor : ModInitializer { val runningLightFeatureQueue = cluster.featureQueue.isEmpty() && cluster.lightFeatureQueue.isNotEmpty() val (queue, status, batchSize) = when { cluster.carverQueue.isNotEmpty() -> { - Triple(cluster.carverQueue, ChunkStatus.CARVERS, CARVER_CHUNKS_PER_TICK) + Triple(cluster.carverQueue, ChunkStatus.TERRAIN, CARVER_CHUNKS_PER_TICK) } cluster.featureQueue.isNotEmpty() -> { Triple(cluster.featureQueue, ChunkStatus.FEATURES, FEATURE_CHUNKS_PER_TICK) diff --git a/src/main/kotlin/com/steelextractor/extractors/BiomeHashes.kt b/src/main/kotlin/com/steelextractor/extractors/BiomeHashes.kt index d3aeb17..268d1ba 100644 --- a/src/main/kotlin/com/steelextractor/extractors/BiomeHashes.kt +++ b/src/main/kotlin/com/steelextractor/extractors/BiomeHashes.kt @@ -69,19 +69,19 @@ class BiomeHashes : SteelExtractor.Extractor { val noiseRegistry = server.registryAccess().lookupOrThrow(Registries.NOISE) val randomState = if (chunkGenerator is NoiseBasedChunkGenerator) { - RandomState.create(chunkGenerator.generatorSettings().value(), noiseRegistry, SEED) + RandomState.create(noiseRegistry, SEED, chunkGenerator.generatorSettings().value()) } else { logger.warn("Chunk generator for $name is not NoiseBasedChunkGenerator, using level's RandomState") level.chunkSource.randomState() } - val climateSampler = randomState.sampler() + val biomeResolver = biomeSource.createUncachedResolver(randomState) val hashesArray = JsonArray() val sampledPositions = SteelExtractor.sampledChunkPositions() for (pos in sampledPositions) { - val hash = chunkBiomeHash(climateSampler, biomeSource, pos.x, pos.z, minSectionY, maxSectionY) + val hash = chunkBiomeHash(biomeResolver, pos.x, pos.z, minSectionY, maxSectionY) val entry = JsonArray() entry.add(pos.x) @@ -103,8 +103,7 @@ class BiomeHashes : SteelExtractor.Extractor { * tie-breaking, then hashes in deterministic Y,Z,X order with section_y markers. */ private fun chunkBiomeHash( - climateSampler: net.minecraft.world.level.biome.Climate.Sampler, - biomeSource: net.minecraft.world.level.biome.BiomeSource, + biomeResolver: net.minecraft.world.level.biome.BiomeResolver, chunkX: Int, chunkZ: Int, minSectionY: Int, @@ -122,7 +121,7 @@ class BiomeHashes : SteelExtractor.Extractor { val quartY = sectionY * 4 + y val quartZ = chunkZ * 4 + z - val biome = biomeSource.getNoiseBiome(quartX, quartY, quartZ, climateSampler) + val biome = biomeResolver.getNoiseBiome(quartX, quartY, quartZ) val biomeName = biome.unwrapKey() .map { it.identifier().toString() } .orElse("unknown") diff --git a/src/main/kotlin/com/steelextractor/extractors/Blocks.kt b/src/main/kotlin/com/steelextractor/extractors/Blocks.kt index 17db734..9c5f2e4 100644 --- a/src/main/kotlin/com/steelextractor/extractors/Blocks.kt +++ b/src/main/kotlin/com/steelextractor/extractors/Blocks.kt @@ -600,6 +600,7 @@ class Blocks : SteelExtractor.Extractor { behaviourJson.addProperty("friction", getPrivateFieldValue(behaviourProps, "friction")) behaviourJson.addProperty("speedFactor", getPrivateFieldValue(behaviourProps, "speedFactor")) behaviourJson.addProperty("jumpFactor", getPrivateFieldValue(behaviourProps, "jumpFactor")) + behaviourJson.addProperty("bounceRestitution", getPrivateFieldValue(behaviourProps, "bounceRestitution")) behaviourJson.addProperty("dynamicShape", getPrivateFieldValue(behaviourProps, "dynamicShape")) behaviourJson.addProperty("offsetType", getOffsetType(block).name) behaviourJson.addProperty("maxHorizontalOffset", getProtectedFloatMethodValue(block, "getMaxHorizontalOffset")) diff --git a/src/main/kotlin/com/steelextractor/extractors/BuiltInRegistryKeys.kt b/src/main/kotlin/com/steelextractor/extractors/BuiltInRegistryKeys.kt index 5269841..baffec0 100644 --- a/src/main/kotlin/com/steelextractor/extractors/BuiltInRegistryKeys.kt +++ b/src/main/kotlin/com/steelextractor/extractors/BuiltInRegistryKeys.kt @@ -112,8 +112,6 @@ class MapDecorationTypeRegistryExtractor : SteelExtractor.Extractor { return extractBuiltInRegistry(BuiltInRegistries.MAP_DECORATION_TYPE) { type: MapDecorationType, json -> json.addProperty("asset_id", type.assetId().toString()) json.addProperty("show_on_item_frame", type.showOnItemFrame()) - json.addProperty("map_color", type.mapColor()) - json.addProperty("exploration_map_element", type.explorationMapElement()) json.addProperty("track_count", type.trackCount()) } } diff --git a/src/main/kotlin/com/steelextractor/extractors/Items.kt b/src/main/kotlin/com/steelextractor/extractors/Items.kt index b39937f..32568bd 100644 --- a/src/main/kotlin/com/steelextractor/extractors/Items.kt +++ b/src/main/kotlin/com/steelextractor/extractors/Items.kt @@ -11,10 +11,8 @@ import net.minecraft.resources.RegistryOps import net.minecraft.server.MinecraftServer import net.minecraft.world.item.BlockItem import net.minecraft.world.item.Item -import net.minecraft.world.item.SignItem import net.minecraft.world.item.StandingAndWallBlockItem import net.minecraft.world.level.block.Block -import net.minecraft.world.level.block.SignBlock import org.slf4j.LoggerFactory import java.lang.reflect.Field diff --git a/src/main/kotlin/com/steelextractor/extractors/Strippables.kt b/src/main/kotlin/com/steelextractor/extractors/Strippables.kt deleted file mode 100644 index fa7135a..0000000 --- a/src/main/kotlin/com/steelextractor/extractors/Strippables.kt +++ /dev/null @@ -1,32 +0,0 @@ -package com.steelextractor.extractors - -import com.google.gson.JsonArray -import com.google.gson.JsonElement -import com.google.gson.JsonObject -import com.steelextractor.SteelExtractor -import com.steelextractor.mixin.AxeItemAccessor -import net.minecraft.core.registries.BuiltInRegistries -import net.minecraft.server.MinecraftServer -import org.slf4j.LoggerFactory - - -class Strippables : SteelExtractor.Extractor { - private val logger = LoggerFactory.getLogger("steel-extractor-strippables") - - override fun fileName(): String { - return "steel-core/build/strippables.json" - } - - override fun extract(server: MinecraftServer): JsonElement { - val topLevelJson = JsonObject() - - for ((normal, stripped) in AxeItemAccessor.getStrippables()) { - topLevelJson.addProperty( - BuiltInRegistries.BLOCK.getKey(normal).path, - BuiltInRegistries.BLOCK.getKey(stripped).path - ) - } - - return topLevelJson - } -} diff --git a/src/main/resources/steel-extractor.mixins.json b/src/main/resources/steel-extractor.mixins.json index c0eba98..7d50bbf 100644 --- a/src/main/resources/steel-extractor.mixins.json +++ b/src/main/resources/steel-extractor.mixins.json @@ -8,7 +8,6 @@ "ChunkAccessBiomeCacheMixin", "ClimateRTreeMixin", "BiomeSourcePossibleBiomesMixin", - "AxeItemAccessor", "VegetationPatchFeatureMixin", "WaterloggedVegetationPatchFeatureMixin", "TreeFeatureMixin",