Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 13 additions & 27 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id 'fabric-loom' version "${loom_version}"
id 'net.fabricmc.fabric-loom' version "${loom_version}"
id 'maven-publish'
id "org.jetbrains.kotlin.jvm" version "2.2.20"
id "org.jetbrains.kotlin.jvm" version "2.3.20"
}

version = project.mod_version
Expand All @@ -11,12 +11,6 @@ base {
archivesName = project.archives_base_name
}

repositories {
maven {
name = 'ParchmentMC'
url = 'https://maven.parchmentmc.org'
}
}

loom {
splitEnvironmentSourceSets()
Expand Down Expand Up @@ -48,15 +42,11 @@ fabricApi {
dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings loom.layered() {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-1.21.10:2025.10.12@zip")
}
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
implementation "net.fabricmc:fabric-loader:${project.loader_version}"

// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modImplementation "net.fabricmc:fabric-language-kotlin:${project.fabric_kotlin_version}"
implementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
implementation "net.fabricmc:fabric-language-kotlin:${project.fabric_kotlin_version}"
}

processResources {
Expand All @@ -67,24 +57,20 @@ processResources {
}
}

tasks.withType(JavaCompile).configureEach {
it.options.release = 21
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = 21
}
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(25)
}
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()
}

sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
tasks.withType(JavaExec).configureEach {
executable = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(25)
}.get().executablePath.asFile.absolutePath
}

jar {
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ org.gradle.configuration-cache=false

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.21.11
loader_version=0.18.2
loom_version=1.14-SNAPSHOT
fabric_kotlin_version=1.13.7+kotlin.2.2.21
minecraft_version=26.1
loader_version=0.18.4
loom_version=1.15-SNAPSHOT
fabric_kotlin_version=1.13.9+kotlin.2.3.10

# Mod Properties
mod_version=1.0.0
maven_group=com.steelextractor
archives_base_name=steel-extractor

# Dependencies
fabric_version=0.139.4+1.21.11
fabric_version=0.144.0+26.1
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion src/client/resources/steel-extractor.client.mixins.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"required": true,
"package": "com.steelextractor.mixin.client",
"compatibilityLevel": "JAVA_21",
"compatibilityLevel": "JAVA_25",
"client": [
"ExampleClientMixin"
],
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/com/steelextractor/mixin/AxeItemAccessor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
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<Block, Block> getStrippables() {
throw new AssertionError();
}
}
2 changes: 1 addition & 1 deletion src/main/kotlin/com/steelextractor/SteelExtractor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ object SteelExtractor : ModInitializer {
private val logger = LoggerFactory.getLogger("steel-extractor")

/** Set to false to skip chunk generation and chunk stage hash extraction. */
private const val ENABLE_CHUNK_EXTRACTION = false
private const val ENABLE_CHUNK_EXTRACTION = true

/** Set to false to skip storing per-chunk block data in memory and writing binary dump files. */
private const val ENABLE_BINARY_DUMP = false
Expand Down
6 changes: 2 additions & 4 deletions src/main/kotlin/com/steelextractor/extractors/Fluids.kt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ class Fluids : SteelExtractor.Extractor {
}

override fun extract(server: MinecraftServer): JsonElement {
val topLevelJson = JsonObject()
val fluidsJson = JsonArray()
val world = server.overworld()

Expand Down Expand Up @@ -96,6 +95,7 @@ class Fluids : SteelExtractor.Extractor {
val behaviorJson = JsonObject()

behaviorJson.addProperty("is_empty", fluidState.isEmpty)
behaviorJson.addProperty("is_source", fluidState.isSource)

// Explosion resistance (protected method)
val explosionResistanceMethod = getProtectedMethod(fluid, "getExplosionResistance")
Expand Down Expand Up @@ -182,8 +182,6 @@ class Fluids : SteelExtractor.Extractor {
fluidsJson.add(fluidJson)
}

topLevelJson.add("fluids", fluidsJson)

return topLevelJson
return fluidsJson
}
}
6 changes: 4 additions & 2 deletions src/main/kotlin/com/steelextractor/extractors/Items.kt
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ class Items : SteelExtractor.Extractor {
itemJson.addProperty("blockItem", BuiltInRegistries.BLOCK.getKey(item.block).path)
}
if (item is StandingAndWallBlockItem) {
val wallBlockField = StandingAndWallBlockItem::class.java.getDeclaredField("wallBlock")
wallBlockField.isAccessible = true
itemJson.addProperty(
"standingAndWallBlockItem",
BuiltInRegistries.BLOCK.getKey(item.javaClass.getField("wallBlock").get(item) as Block).path
"wallBlock",
BuiltInRegistries.BLOCK.getKey(wallBlockField.get(item) as Block).path
)
}

Expand Down
6 changes: 3 additions & 3 deletions src/main/kotlin/com/steelextractor/extractors/PoiTypes.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ class PoiTypesExtractor : SteelExtractor.Extractor {
stateJson.addProperty("block", blockKey?.path ?: "unknown")
stateJson.addProperty("state_id", blockStateId)

if (blockState.values.isNotEmpty()) {
if (blockState.properties.isNotEmpty()) {
val propsJson = JsonObject()
for ((prop, value) in blockState.values) {
for (prop in blockState.properties) {
@Suppress("UNCHECKED_CAST")
val propTyped = prop as net.minecraft.world.level.block.state.properties.Property<Comparable<Any>>
propsJson.addProperty(prop.name, propTyped.getName(value as Comparable<Any>))
propsJson.addProperty(prop.name, propTyped.getName(blockState.getValue(prop) as Comparable<Any>))
}
stateJson.add("properties", propsJson)
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/com/steelextractor/extractors/Strippables.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.google.gson.JsonArray
import com.google.gson.JsonElement
import com.google.gson.JsonObject
import com.steelextractor.SteelExtractor
import net.fabricmc.fabric.mixin.content.registry.AxeItemAccessor
import com.steelextractor.mixin.AxeItemAccessor
import net.minecraft.core.registries.BuiltInRegistries
import net.minecraft.server.MinecraftServer
import org.slf4j.LoggerFactory
Expand All @@ -20,7 +20,7 @@ class Strippables : SteelExtractor.Extractor {
override fun extract(server: MinecraftServer): JsonElement {
val topLevelJson = JsonObject()

for ((normal, stripped) in AxeItemAccessor.getStrippedBlocks()) {
for ((normal, stripped) in AxeItemAccessor.getStrippables()) {
topLevelJson.addProperty(
BuiltInRegistries.BLOCK.getKey(normal).path,
BuiltInRegistries.BLOCK.getKey(stripped).path
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
],
"depends": {
"fabricloader": ">=0.17.3",
"minecraft": "~1.21.10",
"java": ">=21",
"minecraft": ">=26.1-alpha.9",
"java": ">=25",
"fabric-api": "*",
"fabric-language-kotlin": "*"
},
Expand Down
5 changes: 3 additions & 2 deletions src/main/resources/steel-extractor.mixins.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"required": true,
"package": "com.steelextractor.mixin",
"compatibilityLevel": "JAVA_21",
"compatibilityLevel": "JAVA_25",
"mixins": [
"ExampleMixin",
"ChunkStepMixin"
"ChunkStepMixin",
"AxeItemAccessor"
],
"injectors": {
"defaultRequire": 1
Expand Down
Loading