From 4e0de218e089658542201f28593b16683078a50c Mon Sep 17 00:00:00 2001 From: Matthew Periut Date: Wed, 4 Feb 2026 01:19:43 -0500 Subject: [PATCH 1/5] Update to last babric biny e0778a3 --- gradle.properties | 2 +- .../api/template/item/TemplateFlintAndSteelItem.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gradle.properties b/gradle.properties index 84d71c3c4..5a1ab6a95 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,7 @@ fabric.loom.multiProjectOptimisation=true # Fabric Properties # check these on https://fabricmc.net/use minecraft_version = b1.7.3 - yarn_mappings = b1.7.3+e1fe071 + yarn_mappings = b1.7.3+e0778a3 loader_version = 0.16.9 # Library Properties diff --git a/station-templates-v0/src/main/java/net/modificationstation/stationapi/api/template/item/TemplateFlintAndSteelItem.java b/station-templates-v0/src/main/java/net/modificationstation/stationapi/api/template/item/TemplateFlintAndSteelItem.java index 66c633fd0..4301d10c7 100644 --- a/station-templates-v0/src/main/java/net/modificationstation/stationapi/api/template/item/TemplateFlintAndSteelItem.java +++ b/station-templates-v0/src/main/java/net/modificationstation/stationapi/api/template/item/TemplateFlintAndSteelItem.java @@ -1,9 +1,9 @@ package net.modificationstation.stationapi.api.template.item; -import net.minecraft.item.FlintAndSteel; +import net.minecraft.item.FlintAndSteelItem; import net.modificationstation.stationapi.api.util.Identifier; -public class TemplateFlintAndSteelItem extends FlintAndSteel implements ItemTemplate { +public class TemplateFlintAndSteelItem extends FlintAndSteelItem implements ItemTemplate { public TemplateFlintAndSteelItem(Identifier identifier) { this(ItemTemplate.getNextId()); ItemTemplate.onConstructor(this, identifier); From 337044e3fbefde45cf0372f9e8a6ebd282fcb72d Mon Sep 17 00:00:00 2001 From: Matthew Periut Date: Wed, 4 Feb 2026 03:22:05 -0500 Subject: [PATCH 2/5] Runs on Ornithe (and fix java 25) --- build.gradle.kts | 63 ++++++++++++++----- .../net/fabricmc/loom/util/GroovyXmlUtil.java | 7 +-- gradle.properties | 10 ++- gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle.kts | 17 +++-- .../sltest/mixin/MixinLevel.java | 4 +- .../impl/recipe/CraftingRecipeComparator.java | 45 +++++++++++++ .../mixin/CraftingRecipeManagerMixin.java | 24 +++++++ .../src/main/resources/fabric.mod.json | 3 + .../resources/station-api-base.mixins.json | 12 ++++ .../src/main/resources/fabric.mod.json | 7 +-- .../src/main/resources/fabric.mod.json | 9 +-- .../src/main/resources/fabric.mod.json | 9 +-- .../entity/CustomSpawnDataProvider.java | 4 +- .../entity/EntitySpawnDataProvider.java | 3 +- .../server/entity/MobSpawnDataProvider.java | 7 ++- .../network/EntityClientNetworkHandler.java | 17 ++++- .../entity/server/TrackedEntityMixin.java | 11 +++- .../chunk/FlattenedWorldChunkLoader.java | 4 +- .../world/storage/FlattenedWorldStorage.java | 15 +++-- .../src/main/resources/fabric.mod.json | 31 ++++----- .../src/main/resources/fabric.mod.json | 15 ++--- .../src/main/resources/fabric.mod.json | 9 +-- .../stationapi/api/nbt/NbtOps.java | 13 +++- .../src/main/resources/fabric.mod.json | 31 ++++----- .../ClientServerRegistryRemapper.java | 7 ++- .../play/RemapClientRegistryS2CPacket.java | 12 +++- .../server/registry/ServerRegistrySender.java | 7 ++- .../api/client/world/ColorResolver.java | 8 +-- .../src/main/resources/fabric.mod.json | 15 ++--- .../render/ArsenicOverlayRenderer.java | 2 +- .../src/main/resources/fabric.mod.json | 15 ++--- .../gui/screen/EditWorldScreenImpl.java | 7 ++- .../mixin/world/ServerChunkCacheMixin.java | 2 +- .../mixin/world/client/ChunkCacheMixin.java | 2 +- .../mixin/world/server/class_79Mixin.java | 2 +- .../api/worldgen/biome/BiomeBuilder.java | 13 ++-- .../api/worldgen/biome/StationBiome.java | 7 ++- .../impl/worldgen/FogRendererImpl.java | 2 +- .../impl/worldgen/WorldDecoratorImpl.java | 2 +- .../impl/worldgen/WorldGeneratorImpl.java | 2 +- .../stationapi/mixin/worldgen/BiomeMixin.java | 7 ++- .../worldgen/NetherWorldSourceMixin.java | 2 +- .../worldgen/OverworldWorldSourceMixin.java | 2 +- .../worldgen/client/GrassBlockMixin.java | 2 +- .../worldgen/client/LeavesBlockMixin.java | 4 +- .../worldgen/client/TallPlantBlockMixin.java | 2 +- .../src/main/resources/fabric.mod.json | 7 +-- 48 files changed, 322 insertions(+), 181 deletions(-) create mode 100644 station-api-base/src/main/java/net/modificationstation/stationapi/impl/recipe/CraftingRecipeComparator.java create mode 100644 station-api-base/src/main/java/net/modificationstation/stationapi/mixin/CraftingRecipeManagerMixin.java create mode 100644 station-api-base/src/main/resources/station-api-base.mixins.json diff --git a/build.gradle.kts b/build.gradle.kts index 2fbae1742..f2d60002a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,8 +5,8 @@ import net.modificationstation.stationapi.gradle.SubprojectHelpers.addDependency plugins { id("maven-publish") - id("fabric-loom") version "1.9-SNAPSHOT" - id("babric-loom-extension") version "1.9.2" + id("net.fabricmc.fabric-loom-remap") version "1.15.+" + id("ploceus") version "1.15-SNAPSHOT" } // https://stackoverflow.com/a/40101046 - Even with kotlin, gradle can't get it's shit together. @@ -15,18 +15,39 @@ inline fun Project.configure(name: String, configuration: C.() -> Un } allprojects { - apply(plugin = "maven-publish") - apply(plugin = "fabric-loom") - apply(plugin = "babric-loom-extension") + if (project != rootProject) { + apply(plugin = "maven-publish") + apply(plugin = "net.fabricmc.fabric-loom-remap") + apply(plugin = "ploceus") + } + + pluginManager.withPlugin("ploceus") { + val ploceus = extensions.getByName("ploceus") + ploceus.setIntermediaryGeneration(2) + + dependencies { + "minecraft"("com.mojang:minecraft:${project.properties["minecraft_version"]}") + "mappings"(ploceus.mappings("net.glasslauncher:biny-ornithe:b1.7.3+build.${project.properties["biny_mappings"]}:mergedv2")) + "clientExceptions"(ploceus.raven(project.properties["client_raven_build"].toString(), "client")) + "serverExceptions"(ploceus.raven(project.properties["server_raven_build"].toString(), "server")) + "clientSignatures"(ploceus.sparrow(project.properties["client_sparrow_build"].toString(), "client")) + "serverSignatures"(ploceus.sparrow(project.properties["server_sparrow_build"].toString(), "server")) + "clientNests"("net.glasslauncher:biny-nests:b1.7.3-client+build.2") + "serverNests"("net.glasslauncher:biny-nests:b1.7.3-server+build.2") + "modImplementation"("net.fabricmc:fabric-loader:${project.properties["loader_version"]}") + } + } java.sourceCompatibility = JavaVersion.VERSION_17 java.targetCompatibility = JavaVersion.VERSION_17 repositories { + mavenLocal() maven(url = "https://maven.minecraftforge.net/") - maven(url = "https://maven.glass-launcher.net/babric") - maven(url = "https://maven.glass-launcher.net/snapshots") maven(url = "https://maven.glass-launcher.net/releases") + maven(url = "https://maven.glass-launcher.net/snapshots") + maven(url = "https://mvn.devos.one/releases") + maven(url = "https://maven.wispforest.io") maven(url = "https://jitpack.io/") mavenCentral() exclusiveContent { @@ -47,7 +68,10 @@ allprojects { all { exclude(group = "org.ow2.asm", module = "asm-debug-all") exclude(group = "org.ow2.asm", module = "asm-all") - exclude(group = "babric") + // Force correct Guava version to avoid conflicts + resolutionStrategy { + force("com.google.guava:guava:31.1-jre") + } } } @@ -55,16 +79,17 @@ allprojects { implementation("org.slf4j:slf4j-api:1.8.0-beta4") implementation("org.apache.logging.log4j:log4j-slf4j18-impl:2.17.2") - implementation("org.apache.logging.log4j:log4j-core:2.17.2") - implementation("com.google.guava:guava:33.2.1-jre") + implementation("org.apache.logging.log4j:log4j-core:2.17.2") { + exclude(group = "com.google.guava", module = "guava") + } + implementation("net.ornithemc:logger-config:1.0.0") { + exclude(group = "com.google.guava", module = "guava") + } + implementation("com.google.guava:guava:31.1-jre") implementation("com.google.code.gson:gson:2.9.0") //to change the versions see the gradle.properties file - minecraft("com.mojang:minecraft:${project.properties["minecraft_version"]}") - - mappings("net.glasslauncher:biny:${project.properties["yarn_mappings"]}:v2") - - modImplementation("net.fabricmc:fabric-loader:${project.properties["loader_version"]}") + //minecraft and mappings are added in the ploceus withPlugin block above "transitiveImplementation"(implementation("org.apache.commons:commons-lang3:3.12.0") as Dependency) "transitiveImplementation"(implementation("commons-io:commons-io:2.11.0") as Dependency) @@ -98,6 +123,7 @@ allprojects { // Optional bugfix mod for testing qol. Remove the // to enable. //modLocalRuntime "maven.modrinth:mojangfix:${project.properties["mojangfix_version"]}" + } sourceSets { @@ -255,6 +281,8 @@ dependencies { include("com.github.ben-manes.caffeine:caffeine:${project.properties["caffeine_version"]}") include("com.mojang:datafixerupper:${project.properties["dfu_version"]}") include("maven.modrinth:spasm:${project.properties["spasm_version"]}") + include("com.google.guava:guava:31.1-jre") + include("org.apache.commons:commons-lang3:3.12.0") } // Makes java shut up @@ -264,6 +292,11 @@ configure("compileTestJava") { options.forkOptions.executable = System.getProperty("java.home") + "/bin/javac" + (if (System.getProperty("os.name").startsWith("Windows")) ".exe" else "") } +// Don't fail test task when no tests are discovered (these are mod test classes, not unit tests) +tasks.withType { + failOnNoDiscoveredTests = false +} + publishing { publications { getByName("mavenJava", MavenPublication::class) { diff --git a/buildSrc/src/main/java/net/fabricmc/loom/util/GroovyXmlUtil.java b/buildSrc/src/main/java/net/fabricmc/loom/util/GroovyXmlUtil.java index 7547153ef..b4a3b2a19 100644 --- a/buildSrc/src/main/java/net/fabricmc/loom/util/GroovyXmlUtil.java +++ b/buildSrc/src/main/java/net/fabricmc/loom/util/GroovyXmlUtil.java @@ -25,7 +25,7 @@ package net.fabricmc.loom.util; import groovy.util.Node; -import groovy.xml.QName; +import groovy.namespace.QName; public final class GroovyXmlUtil { private GroovyXmlUtil() { } @@ -49,11 +49,6 @@ private static boolean isSameName(Object nodeName, String givenName) { return qName.matches(givenName); } - // New groovy 3 (gradle 7) class - if (nodeName instanceof groovy.namespace.QName qName) { - return qName.matches(givenName); - } - throw new UnsupportedOperationException("Cannot determine if " + nodeName.getClass() + " is the same as a String"); } } diff --git a/gradle.properties b/gradle.properties index 5a1ab6a95..b2dabda29 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,9 +10,15 @@ fabric.loom.multiProjectOptimisation=true # Fabric Properties # check these on https://fabricmc.net/use minecraft_version = b1.7.3 - yarn_mappings = b1.7.3+e0778a3 + biny_mappings = local loader_version = 0.16.9 +# Ploceus Properties + client_raven_build = 2 + server_raven_build = 2 + client_sparrow_build = 2 + server_sparrow_build = 2 + # Library Properties typetools_version = 0.8.3 unsafeevents_version = e31096e @@ -27,6 +33,6 @@ fabric.loom.multiProjectOptimisation=true archives_base_name = StationAPI # Test properties - gcapi_version = 3.2.5 + gcapi_version = 3.2.6 modmenu_version = 1.8.5-beta.11 rc_version = 0.5.4 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e18bc253b..19a6bdeb8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.0-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/settings.gradle.kts b/settings.gradle.kts index 9a8c39772..8e45b10cc 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,9 +1,18 @@ pluginManagement { repositories { - maven(url = "https://maven.glass-launcher.net/babric") - maven(url = "https://maven.fabricmc.net/") - maven(url = "https://jitpack.io/") - mavenCentral() + maven { + name = "Fabric" + url = uri("https://maven.fabricmc.net/") + } + maven { + name = "Ornithe Releases" + url = uri("https://maven.ornithemc.net/releases") + } + maven { + name = "Ornithe Snapshots" + url = uri("https://maven.ornithemc.net/snapshots") + } + mavenLocal() gradlePluginPortal() } } diff --git a/src/test/java/net/modificationstation/sltest/mixin/MixinLevel.java b/src/test/java/net/modificationstation/sltest/mixin/MixinLevel.java index 64200a553..14751e2ac 100644 --- a/src/test/java/net/modificationstation/sltest/mixin/MixinLevel.java +++ b/src/test/java/net/modificationstation/sltest/mixin/MixinLevel.java @@ -14,7 +14,7 @@ @Mixin(World.class) public abstract class MixinLevel { - @Shadow public abstract BiomeSource method_1781(); + @Shadow public abstract BiomeSource getBiomeSource(); /*@Inject( method = "(Lnet/minecraft/level/dimension/DimensionData;Ljava/lang/String;J)V", @@ -27,7 +27,7 @@ private void onInit(WorldStorage string, String l, long par3, CallbackInfo ci) { int[] pixels = ((DataBufferInt) buffer.getRaster().getDataBuffer()).getData(); int start = -(side >> 1); - BiomeSource biomeSource = method_1781(); + BiomeSource biomeSource = getBiomeSource(); Biome[] biomes = biomeSource.getBiomesInArea(new Biome[side * side], start, start, side, side); for (int i = 0; i < pixels.length; i++) { diff --git a/station-api-base/src/main/java/net/modificationstation/stationapi/impl/recipe/CraftingRecipeComparator.java b/station-api-base/src/main/java/net/modificationstation/stationapi/impl/recipe/CraftingRecipeComparator.java new file mode 100644 index 000000000..e30b567c6 --- /dev/null +++ b/station-api-base/src/main/java/net/modificationstation/stationapi/impl/recipe/CraftingRecipeComparator.java @@ -0,0 +1,45 @@ +package net.modificationstation.stationapi.impl.recipe; + +import java.util.Comparator; + +/** + * Fixed comparator that properly implements the comparison contract. + * Sorts recipes with shaped recipes first, then by size (smaller first). + * + * This fixes the buggy comparator in CraftingRecipeManager that violates + * the general contract and causes IllegalArgumentException in Java 17+. + */ +public class CraftingRecipeComparator implements Comparator { + @Override + public int compare(Object o1, Object o2) { + if (o1 == o2) return 0; + + try { + // Get class names to determine recipe type + String o1Class = o1.getClass().getSimpleName(); + String o2Class = o2.getClass().getSimpleName(); + + // Determine recipe types + boolean o1Shapeless = o1Class.contains("Shapeless"); + boolean o2Shapeless = o2Class.contains("Shapeless"); + + // Different types: Shaped comes before Shapeless + if (o1Shapeless != o2Shapeless) { + return o1Shapeless ? 1 : -1; + } + + // Same type: compare by size (smaller first) + try { + int o1Size = (Integer) o1.getClass().getMethod("getSize").invoke(o1); + int o2Size = (Integer) o2.getClass().getMethod("getSize").invoke(o2); + return Integer.compare(o1Size, o2Size); + } catch (Exception e) { + // If we can't get sizes, maintain order + return 0; + } + } catch (Exception e) { + // Fallback: maintain original order + return 0; + } + } +} diff --git a/station-api-base/src/main/java/net/modificationstation/stationapi/mixin/CraftingRecipeManagerMixin.java b/station-api-base/src/main/java/net/modificationstation/stationapi/mixin/CraftingRecipeManagerMixin.java new file mode 100644 index 000000000..13b410015 --- /dev/null +++ b/station-api-base/src/main/java/net/modificationstation/stationapi/mixin/CraftingRecipeManagerMixin.java @@ -0,0 +1,24 @@ +package net.modificationstation.stationapi.mixin; + +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +import net.minecraft.recipe.CraftingRecipe; +import net.modificationstation.stationapi.impl.recipe.CraftingRecipeComparator; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +@Mixin(targets = "net.minecraft.recipe.CraftingRecipeManager") +public class CraftingRecipeManagerMixin { + @Shadow + private List recipes; + + @Redirect(method = "", at = @At(value = "INVOKE", target = "Ljava/util/Collections;sort(Ljava/util/List;Ljava/util/Comparator;)V")) + void resort(List list, Comparator c) { + // Skip the buggy sort and use our fixed comparator instead + Collections.sort(this.recipes, new CraftingRecipeComparator()); + } +} diff --git a/station-api-base/src/main/resources/fabric.mod.json b/station-api-base/src/main/resources/fabric.mod.json index 4d14b2f32..120e0d4ec 100644 --- a/station-api-base/src/main/resources/fabric.mod.json +++ b/station-api-base/src/main/resources/fabric.mod.json @@ -18,6 +18,9 @@ "icon": "assets/station-api-base/icon.png", "environment": "*", + "mixins": [ + "station-api-base.mixins.json" + ], "entrypoints": { "preLaunch": [ "net.modificationstation.stationapi.api.StationAPI" diff --git a/station-api-base/src/main/resources/station-api-base.mixins.json b/station-api-base/src/main/resources/station-api-base.mixins.json new file mode 100644 index 000000000..5bde7a76c --- /dev/null +++ b/station-api-base/src/main/resources/station-api-base.mixins.json @@ -0,0 +1,12 @@ +{ + "required": true, + "minVersion": "0.8", + "package": "net.modificationstation.stationapi.mixin", + "compatibilityLevel": "JAVA_17", + "mixins": [ + "CraftingRecipeManagerMixin" + ], + "injectors": { + "defaultRequire": 1 + } +} diff --git a/station-blockitems-v0/src/main/resources/fabric.mod.json b/station-blockitems-v0/src/main/resources/fabric.mod.json index 3bfcac5b4..114c16f7c 100644 --- a/station-blockitems-v0/src/main/resources/fabric.mod.json +++ b/station-blockitems-v0/src/main/resources/fabric.mod.json @@ -2,7 +2,6 @@ "schemaVersion": 1, "id": "station-blockitems-v0", "version": "${version}", - "name": "Station BlockItems (v0)", "description": "API for custom block items.", "authors": [ @@ -13,10 +12,8 @@ "sources": "https://github.com/ModificationStation/StationAPI", "issues": "https://github.com/ModificationStation/StationAPI/issues" }, - "license": "MIT", "icon": "assets/station-blockitems-v0/icon.png", - "environment": "*", "entrypoints": { "stationapi:event_bus": [ @@ -29,16 +26,14 @@ "mixins": [ "station-blockitems-v0.mixins.json" ], - "depends": { "fabricloader": "*", "minecraft": "1.0.0-beta.7.3" }, - "custom": { "modmenu:api": true, "loom:injected_interfaces": { - "net/minecraft/class_17": [ + "net/minecraft/unmapped/C_81592558": [ "net/modificationstation/stationapi/api/block/StationBlockItemsBlock" ] } diff --git a/station-blocks-v0/src/main/resources/fabric.mod.json b/station-blocks-v0/src/main/resources/fabric.mod.json index 6247cd80d..11bf15874 100644 --- a/station-blocks-v0/src/main/resources/fabric.mod.json +++ b/station-blocks-v0/src/main/resources/fabric.mod.json @@ -2,7 +2,6 @@ "schemaVersion": 1, "id": "station-blocks-v0", "version": "${version}", - "name": "Station Blocks (v0)", "description": "Essential systems for modded blocks.", "authors": [ @@ -13,26 +12,22 @@ "sources": "https://github.com/ModificationStation/StationAPI", "issues": "https://github.com/ModificationStation/StationAPI/issues" }, - "license": "MIT", "icon": "assets/station-blocks-v0/icon.png", - "environment": "*", "mixins": [ "station-blocks-v0.mixins.json" ], - "depends": { "fabricloader": "*", "minecraft": "1.0.0-beta.7.3" }, - "custom": { "modmenu:api": true, "loom:injected_interfaces": { - "net/minecraft/class_17": [ + "net/minecraft/unmapped/C_81592558": [ "net/modificationstation/stationapi/api/block/StationBlock" ] } } -} \ No newline at end of file +} diff --git a/station-effects-api-v0/src/main/resources/fabric.mod.json b/station-effects-api-v0/src/main/resources/fabric.mod.json index 66c23707c..fd7bd0482 100644 --- a/station-effects-api-v0/src/main/resources/fabric.mod.json +++ b/station-effects-api-v0/src/main/resources/fabric.mod.json @@ -2,7 +2,6 @@ "schemaVersion": 1, "id": "station-effects-api-v0", "version": "${version}", - "name": "Station Entities (v0)", "description": "Provides essential systems for modded entities.", "authors": [ @@ -13,10 +12,8 @@ "sources": "https://github.com/ModificationStation/StationAPI", "issues": "https://github.com/ModificationStation/StationAPI/issues" }, - "license": "MIT", "icon": "assets/station-effects-api-v0/icon.png", - "environment": "*", "entrypoints": { "stationapi:event_bus": [ @@ -26,18 +23,16 @@ "mixins": [ "station-effects-api-v0.mixins.json" ], - "depends": { "fabricloader": "*", "minecraft": "1.0.0-beta.7.3" }, - "custom": { "modmenu:api": true, "loom:injected_interfaces": { - "net/minecraft/class_57": [ + "net/minecraft/unmapped/C_42232651": [ "net/modificationstation/stationapi/api/entity/StationEffectsEntity" ] } } -} \ No newline at end of file +} diff --git a/station-entities-v0/src/main/java/net/modificationstation/stationapi/api/server/entity/CustomSpawnDataProvider.java b/station-entities-v0/src/main/java/net/modificationstation/stationapi/api/server/entity/CustomSpawnDataProvider.java index 4eb801313..a73f3c5c4 100644 --- a/station-entities-v0/src/main/java/net/modificationstation/stationapi/api/server/entity/CustomSpawnDataProvider.java +++ b/station-entities-v0/src/main/java/net/modificationstation/stationapi/api/server/entity/CustomSpawnDataProvider.java @@ -2,7 +2,9 @@ import net.minecraft.network.packet.Packet; +import java.io.IOException; + public interface CustomSpawnDataProvider { - Packet getSpawnData(); + Packet getSpawnData() throws IOException; } diff --git a/station-entities-v0/src/main/java/net/modificationstation/stationapi/api/server/entity/EntitySpawnDataProvider.java b/station-entities-v0/src/main/java/net/modificationstation/stationapi/api/server/entity/EntitySpawnDataProvider.java index cb915c566..dc91a8d3d 100644 --- a/station-entities-v0/src/main/java/net/modificationstation/stationapi/api/server/entity/EntitySpawnDataProvider.java +++ b/station-entities-v0/src/main/java/net/modificationstation/stationapi/api/server/entity/EntitySpawnDataProvider.java @@ -11,11 +11,12 @@ import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; +import java.io.IOException; public interface EntitySpawnDataProvider extends StationSpawnDataProvider { @Override - default Packet getSpawnData() { + default Packet getSpawnData() throws IOException { Entity entity = (Entity) this; int ownerId = 0; if (entity instanceof HasOwner hasOwner) { diff --git a/station-entities-v0/src/main/java/net/modificationstation/stationapi/api/server/entity/MobSpawnDataProvider.java b/station-entities-v0/src/main/java/net/modificationstation/stationapi/api/server/entity/MobSpawnDataProvider.java index 9a993c181..b573d1121 100644 --- a/station-entities-v0/src/main/java/net/modificationstation/stationapi/api/server/entity/MobSpawnDataProvider.java +++ b/station-entities-v0/src/main/java/net/modificationstation/stationapi/api/server/entity/MobSpawnDataProvider.java @@ -8,6 +8,7 @@ import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; +import java.io.IOException; import static net.modificationstation.stationapi.api.StationAPI.NAMESPACE; import static net.modificationstation.stationapi.api.util.Identifier.of; @@ -30,7 +31,11 @@ default Packet getSpawnData() { (byte)((int)(mob.pitch * 256.0F / 360.0F)) }; ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - mob.getDataTracker().writeAllEntries(new DataOutputStream(outputStream)); + try { + mob.getDataTracker().writeAllEntries(new DataOutputStream(outputStream)); + } catch (IOException e) { + throw new RuntimeException(e); + } byte[] data = outputStream.toByteArray(); message.bytes = Bytes.concat(rotations, data); writeToMessage(message); diff --git a/station-entities-v0/src/main/java/net/modificationstation/stationapi/impl/client/network/EntityClientNetworkHandler.java b/station-entities-v0/src/main/java/net/modificationstation/stationapi/impl/client/network/EntityClientNetworkHandler.java index 98e7d6080..c3368f8db 100644 --- a/station-entities-v0/src/main/java/net/modificationstation/stationapi/impl/client/network/EntityClientNetworkHandler.java +++ b/station-entities-v0/src/main/java/net/modificationstation/stationapi/impl/client/network/EntityClientNetworkHandler.java @@ -27,6 +27,7 @@ import java.io.ByteArrayInputStream; import java.io.DataInputStream; +import java.io.IOException; import java.lang.invoke.MethodHandles; import java.util.Arrays; import java.util.List; @@ -74,8 +75,13 @@ private static void handleEntitySpawn(PlayerEntity player, MessagePacket message hasOwner.setOwner(networkHandler.invokeGetEntity(message.ints[4])); entity.setVelocityClient((double) message.shorts[0] / 8000.0D, (double) message.shorts[1] / 8000.0D, (double) message.shorts[2] / 8000.0D); } - if (message.bytes != null) - entity.getDataTracker().writeUpdatedEntries(DataTracker.readEntries(new DataInputStream(new ByteArrayInputStream(message.bytes)))); + if (message.bytes != null) { + try { + entity.getDataTracker().writeUpdatedEntries(DataTracker.readEntries(new DataInputStream(new ByteArrayInputStream(message.bytes)))); + } catch (IOException e) { + throw new RuntimeException(e); + } + } if (entity instanceof StationSpawnDataProvider provider) provider.readFromMessage(message); } @@ -104,7 +110,12 @@ private static void handleMobSpawn(PlayerEntity player, MessagePacket message) { mob.interpolateOnly = true; world.forceEntity(message.ints[0], mob); //noinspection unchecked - List data = DataTracker.readEntries(new DataInputStream(new ByteArrayInputStream(Arrays.copyOfRange(message.bytes, 2, message.bytes.length)))); + List data = null; + try { + data = DataTracker.readEntries(new DataInputStream(new ByteArrayInputStream(Arrays.copyOfRange(message.bytes, 2, message.bytes.length)))); + } catch (IOException e) { + throw new RuntimeException(e); + } if (data != null) mob.getDataTracker().writeUpdatedEntries(data); if (mob instanceof StationSpawnDataProvider provider) diff --git a/station-entities-v0/src/main/java/net/modificationstation/stationapi/mixin/entity/server/TrackedEntityMixin.java b/station-entities-v0/src/main/java/net/modificationstation/stationapi/mixin/entity/server/TrackedEntityMixin.java index e609e1245..16379b639 100644 --- a/station-entities-v0/src/main/java/net/modificationstation/stationapi/mixin/entity/server/TrackedEntityMixin.java +++ b/station-entities-v0/src/main/java/net/modificationstation/stationapi/mixin/entity/server/TrackedEntityMixin.java @@ -10,6 +10,8 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import java.io.IOException; + @Mixin(EntityTrackerEntry.class) class TrackedEntityMixin { @Shadow @@ -21,7 +23,12 @@ class TrackedEntityMixin { cancellable = true ) private void stationapi_getSpawnData(CallbackInfoReturnable cir) { - if (this.currentTrackedEntity instanceof CustomSpawnDataProvider provider) - cir.setReturnValue(provider.getSpawnData()); + if (this.currentTrackedEntity instanceof CustomSpawnDataProvider provider) { + try { + cir.setReturnValue(provider.getSpawnData()); + } catch (IOException e) { + throw new RuntimeException(e); + } + } } } diff --git a/station-flattening-v0/src/main/java/net/modificationstation/stationapi/impl/world/chunk/FlattenedWorldChunkLoader.java b/station-flattening-v0/src/main/java/net/modificationstation/stationapi/impl/world/chunk/FlattenedWorldChunkLoader.java index 2e6b637be..2a8383752 100644 --- a/station-flattening-v0/src/main/java/net/modificationstation/stationapi/impl/world/chunk/FlattenedWorldChunkLoader.java +++ b/station-flattening-v0/src/main/java/net/modificationstation/stationapi/impl/world/chunk/FlattenedWorldChunkLoader.java @@ -28,7 +28,7 @@ public FlattenedWorldChunkLoader(File dimFolder) { } @Override - public Chunk loadChunk(World arg, int i, int j) { + public Chunk loadChunk(World arg, int i, int j) throws IOException { DataInputStream dataInputStream = RegionIo.getChunkInputStream(dimFolder, i, j); if (dataInputStream == null) return null; @@ -54,7 +54,7 @@ public Chunk loadChunk(World arg, int i, int j) { } @Override - public void saveChunk(World world, Chunk oldChunk) { + public void saveChunk(World world, Chunk oldChunk) throws IOException { if (!(oldChunk instanceof FlattenedChunk chunk)) throw new IllegalStateException(getClass().getSimpleName() + " can't save chunk of type \"" + oldChunk.getClass().getName() + "\"!"); world.checkSessionLock(); DataOutputStream dataOutputStream = RegionIo.getChunkOutputStream(dimFolder, chunk.x, chunk.z); diff --git a/station-flattening-v0/src/main/java/net/modificationstation/stationapi/impl/world/storage/FlattenedWorldStorage.java b/station-flattening-v0/src/main/java/net/modificationstation/stationapi/impl/world/storage/FlattenedWorldStorage.java index 560050ce1..8db108843 100644 --- a/station-flattening-v0/src/main/java/net/modificationstation/stationapi/impl/world/storage/FlattenedWorldStorage.java +++ b/station-flattening-v0/src/main/java/net/modificationstation/stationapi/impl/world/storage/FlattenedWorldStorage.java @@ -6,7 +6,6 @@ import it.unimi.dsi.fastutil.ints.IntSet; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.*; import net.minecraft.client.gui.screen.LoadingDisplay; import net.minecraft.nbt.NbtCompound; import net.minecraft.nbt.NbtIo; @@ -53,7 +52,7 @@ public List getAll() { for (File worldPath : Objects.requireNonNull(this.dir.listFiles())) { String worldFolder; WorldProperties data; - if (!worldPath.isDirectory() || (data = this.method_1004(worldFolder = worldPath.getName())) == null) continue; + if (!worldPath.isDirectory() || (data = this.getProperties(worldFolder = worldPath.getName())) == null) continue; NbtCompound worldTag = getWorldTag(worldFolder); boolean requiresUpdating = data.getVersion() != 19132 || NbtHelper.requiresUpdating(worldTag); String worldName = data.getName(); @@ -81,7 +80,7 @@ public NbtCompound getWorldTag(String worldFolder) { } @Override - public WorldStorage method_1009(String string, boolean bl) { + public WorldStorage get(String string, boolean bl) { return new FlattenedDimensionFile(this.dir, string, bl); } @@ -95,10 +94,14 @@ public boolean needsConversion(String string) { @Override public boolean convert(String worldFolder, LoadingDisplay progress) { - return convertWorld(worldFolder, (type, compound) -> NbtHelper.addDataVersions(NbtHelper.update(type, compound)), progress); + try { + return convertWorld(worldFolder, (type, compound) -> NbtHelper.addDataVersions(NbtHelper.update(type, compound)), progress); + } catch (IOException e) { + throw new RuntimeException(e); + } } - public boolean convertWorld(String worldFolder, BiFunction convertFunction, LoadingDisplay progress) { + public boolean convertWorld(String worldFolder, BiFunction convertFunction, LoadingDisplay progress) throws IOException { RegionIo.flush(); LOGGER.info("Creating a backup of world \"" + worldFolder + "\"..."); File worldFile = new File(dir, worldFolder); @@ -153,7 +156,7 @@ private void scanDimensionDir(File dimensionFolder, List regions) { Arrays.stream(regionFiles).map(RegionFile::new).forEach(regions::add); } - private void convertChunks(List regions, BiFunction convertFunction, LoadingDisplay progress) { + private void convertChunks(List regions, BiFunction convertFunction, LoadingDisplay progress) throws IOException { List existingChunks = new ArrayList<>(); int totalChunks = 0; for (RegionFile region : regions) { diff --git a/station-flattening-v0/src/main/resources/fabric.mod.json b/station-flattening-v0/src/main/resources/fabric.mod.json index 73e6844e1..34ce197d7 100644 --- a/station-flattening-v0/src/main/resources/fabric.mod.json +++ b/station-flattening-v0/src/main/resources/fabric.mod.json @@ -2,7 +2,6 @@ "schemaVersion": 1, "id": "station-flattening-v0", "version": "${version}", - "name": "Station Flattening (v0)", "description": "MC1.13+ world save format for legacy Minecraft versions! Allows us to have infinite block and item IDs, as well as block states.", "authors": [ @@ -13,10 +12,8 @@ "sources": "https://github.com/ModificationStation/StationAPI", "issues": "https://github.com/ModificationStation/StationAPI/issues" }, - "license": "MIT", "icon": "assets/station-flattening-v0/icon.png", - "environment": "*", "entrypoints": { "stationapi:event_bus": [ @@ -35,49 +32,47 @@ "mixins": [ "station-flattening-v0.mixins.json" ], - "accessWidener" : "station-flattening-v0.accesswidener", - + "accessWidener": "station-flattening-v0.accesswidener", "depends": { "fabricloader": "*", "minecraft": "1.0.0-beta.7.3" }, - "custom": { "modmenu:api": true, "loom:injected_interfaces": { - "net/minecraft/class_18": [ + "net/minecraft/unmapped/C_64041439": [ "net/modificationstation/stationapi/api/world/StationFlatteningWorld" ], - "net/minecraft/class_43": [ + "net/minecraft/unmapped/C_14917579": [ "net/modificationstation/stationapi/api/world/chunk/StationFlatteningChunk" ], - "net/minecraft/class_17": [ + "net/minecraft/unmapped/C_81592558": [ "net/modificationstation/stationapi/api/block/StationFlatteningBlock" ], - "net/minecraft/class_54": [ + "net/minecraft/unmapped/C_40996800": [ "net/modificationstation/stationapi/api/entity/player/StationFlatteningPlayerEntity" ], - "net/minecraft/class_136": [ + "net/minecraft/unmapped/C_87542771": [ "net/modificationstation/stationapi/api/entity/player/StationFlatteningPlayerInventory" ], - "net/minecraft/class_31": [ + "net/minecraft/unmapped/C_88708284": [ "net/modificationstation/stationapi/api/item/StationFlatteningItemStack" ], - "net/minecraft/class_124": [ + "net/minecraft/unmapped/C_98888256": [ "net/modificationstation/stationapi/api/item/StationFlatteningItem" ], - "net/minecraft/class_42": [ + "net/minecraft/unmapped/C_97027864": [ "net/modificationstation/stationapi/api/world/StationFlatteningWorldPopulationRegion" ], - "net/minecraft/class_533": [ + "net/minecraft/unmapped/C_71827890": [ "net/modificationstation/stationapi/api/item/StationFlatteningBlockItem" ], - "net/minecraft/class_283": [ + "net/minecraft/unmapped/C_98403025": [ "net/modificationstation/stationapi/api/block/entity/StationFlatteningPistonBlockEntity" ], - "net/minecraft/class_50": [ + "net/minecraft/unmapped/C_90532916": [ "net/modificationstation/stationapi/api/world/dimension/StationDimension" ] } } -} \ No newline at end of file +} diff --git a/station-items-v0/src/main/resources/fabric.mod.json b/station-items-v0/src/main/resources/fabric.mod.json index b18a60b38..def4d3074 100644 --- a/station-items-v0/src/main/resources/fabric.mod.json +++ b/station-items-v0/src/main/resources/fabric.mod.json @@ -2,7 +2,6 @@ "schemaVersion": 1, "id": "station-items-v0", "version": "${version}", - "name": "Station Items (v0)", "description": "Essential systems for modded items.", "authors": [ @@ -13,10 +12,8 @@ "sources": "https://github.com/ModificationStation/StationAPI", "issues": "https://github.com/ModificationStation/StationAPI/issues" }, - "license": "MIT", "icon": "assets/station-items-v0/icon.png", - "environment": "*", "entrypoints": { "stationapi:event_bus": [ @@ -37,27 +34,25 @@ "mixins": [ "station-items-v0.mixins.json" ], - "depends": { "fabricloader": "*", "minecraft": "1.0.0-beta.7.3" }, - "custom": { "modmenu:api": true, "loom:injected_interfaces": { - "net/minecraft/class_124": [ + "net/minecraft/unmapped/C_98888256": [ "net/modificationstation/stationapi/api/item/StationItem" ], - "net/minecraft/class_31": [ + "net/minecraft/unmapped/C_88708284": [ "net/modificationstation/stationapi/api/item/StationItemStack" ], - "net/minecraft/class_17": [ + "net/minecraft/unmapped/C_81592558": [ "net/modificationstation/stationapi/api/block/StationItemsBlock" ], - "net/minecraft/class_57": [ + "net/minecraft/unmapped/C_42232651": [ "net/modificationstation/stationapi/api/entity/StationItemsEntity" ] } } -} \ No newline at end of file +} diff --git a/station-maths-v0/src/main/resources/fabric.mod.json b/station-maths-v0/src/main/resources/fabric.mod.json index edbefa8ee..5f0f605fe 100644 --- a/station-maths-v0/src/main/resources/fabric.mod.json +++ b/station-maths-v0/src/main/resources/fabric.mod.json @@ -2,7 +2,6 @@ "schemaVersion": 1, "id": "station-maths-v0", "version": "${version}", - "name": "Station Maths (v0)", "description": "Some math utilities.", "authors": [ @@ -13,26 +12,22 @@ "sources": "https://github.com/ModificationStation/StationAPI", "issues": "https://github.com/ModificationStation/StationAPI/issues" }, - "license": "MIT", "icon": "assets/station-maths-v0/icon.png", - "environment": "*", "mixins": [ "station-maths-v0.mixins.json" ], - "depends": { "fabricloader": "*", "minecraft": "1.0.0-beta.7.3" }, - "custom": { "modmenu:api": true, "loom:injected_interfaces": { - "net/minecraft/class_339": [ + "net/minecraft/unmapped/C_32594356": [ "net/modificationstation/stationapi/api/util/math/StationBlockPos" ] } } -} \ No newline at end of file +} diff --git a/station-nbt-v0/src/main/java/net/modificationstation/stationapi/api/nbt/NbtOps.java b/station-nbt-v0/src/main/java/net/modificationstation/stationapi/api/nbt/NbtOps.java index 50e34a869..dbc0b22e5 100644 --- a/station-nbt-v0/src/main/java/net/modificationstation/stationapi/api/nbt/NbtOps.java +++ b/station-nbt-v0/src/main/java/net/modificationstation/stationapi/api/nbt/NbtOps.java @@ -22,6 +22,7 @@ import java.io.DataInput; import java.io.DataOutput; +import java.io.IOException; import java.nio.ByteBuffer; import java.util.*; import java.util.function.*; @@ -195,12 +196,20 @@ public String toString() { @Override public void write(DataOutput out) { - array.write(out); + try { + array.write(out); + } catch (IOException e) { + throw new RuntimeException(e); + } } @Override public void read(DataInput in) { - array.read(in); + try { + array.read(in); + } catch (IOException e) { + throw new RuntimeException(e); + } } @Override diff --git a/station-nbt-v0/src/main/resources/fabric.mod.json b/station-nbt-v0/src/main/resources/fabric.mod.json index 6d4d2ef98..4fda49ffb 100644 --- a/station-nbt-v0/src/main/resources/fabric.mod.json +++ b/station-nbt-v0/src/main/resources/fabric.mod.json @@ -2,7 +2,6 @@ "schemaVersion": 1, "id": "station-nbt-v0", "version": "${version}", - "name": "Station NBT (v0)", "description": "Expands and makes it easier to use in-game NBT.", "authors": [ @@ -13,59 +12,55 @@ "sources": "https://github.com/ModificationStation/StationAPI", "issues": "https://github.com/ModificationStation/StationAPI/issues" }, - "license": "MIT", "icon": "assets/station-nbt-v0/icon.png", - "environment": "*", "mixins": [ "station-nbt-v0.mixins.json" ], - "depends": { "fabricloader": "*", "minecraft": "1.0.0-beta.7.3" }, - "custom": { "modmenu:api": true, "loom:injected_interfaces": { - "net/minecraft/class_360": [ + "net/minecraft/unmapped/C_64685490": [ "net/modificationstation/stationapi/api/nbt/StationNbtByte" ], - "net/minecraft/class_165": [ + "net/minecraft/unmapped/C_03009146": [ "net/modificationstation/stationapi/api/nbt/StationNbtByteArray" ], - "net/minecraft/class_8": [ + "net/minecraft/unmapped/C_74087615": [ "net/modificationstation/stationapi/api/nbt/StationNbtCompound" ], - "net/minecraft/class_419": [ + "net/minecraft/unmapped/C_06229858": [ "net/modificationstation/stationapi/api/nbt/StationNbtDouble" ], - "net/minecraft/class_187": [ + "net/minecraft/unmapped/C_97075175": [ "net/modificationstation/stationapi/api/nbt/StationNbtElement" ], - "net/minecraft/class_253": [ + "net/minecraft/unmapped/C_50870163": [ "net/modificationstation/stationapi/api/nbt/StationNbtEnd" ], - "net/minecraft/class_358": [ + "net/minecraft/unmapped/C_02949887": [ "net/modificationstation/stationapi/api/nbt/StationNbtFloat" ], - "net/minecraft/class_347": [ + "net/minecraft/unmapped/C_57925352": [ "net/modificationstation/stationapi/api/nbt/StationNbtInt" ], - "net/minecraft/class_202": [ + "net/minecraft/unmapped/C_79370641": [ "net/modificationstation/stationapi/api/nbt/StationNbtList" ], - "net/minecraft/class_273": [ + "net/minecraft/unmapped/C_90490889": [ "net/modificationstation/stationapi/api/nbt/StationNbtLong" ], - "net/minecraft/class_462": [ + "net/minecraft/unmapped/C_80104453": [ "net/modificationstation/stationapi/api/nbt/StationNbtShort" ], - "net/minecraft/class_522": [ + "net/minecraft/unmapped/C_74891195": [ "net/modificationstation/stationapi/api/nbt/StationNbtString" ] } } -} \ No newline at end of file +} diff --git a/station-registry-sync-v0/src/main/java/net/modificationstation/stationapi/impl/client/registry/ClientServerRegistryRemapper.java b/station-registry-sync-v0/src/main/java/net/modificationstation/stationapi/impl/client/registry/ClientServerRegistryRemapper.java index 0bfab1a18..f1738906a 100644 --- a/station-registry-sync-v0/src/main/java/net/modificationstation/stationapi/impl/client/registry/ClientServerRegistryRemapper.java +++ b/station-registry-sync-v0/src/main/java/net/modificationstation/stationapi/impl/client/registry/ClientServerRegistryRemapper.java @@ -12,6 +12,7 @@ import net.modificationstation.stationapi.api.registry.legacy.WorldLegacyRegistry; import java.io.ByteArrayInputStream; +import java.io.IOException; import java.lang.invoke.MethodHandles; import static net.modificationstation.stationapi.api.StationAPI.LOGGER; @@ -31,7 +32,11 @@ private static void registerListeners(MessageListenerRegistryEvent event) { private static void remapRegistries(PlayerEntity player, MessagePacket message) { LOGGER.info("Received level registries from server. Remapping..."); - WorldLegacyRegistry.loadAll(NbtIo.readCompressed(new ByteArrayInputStream(message.bytes))); + try { + WorldLegacyRegistry.loadAll(NbtIo.readCompressed(new ByteArrayInputStream(message.bytes))); + } catch (IOException e) { + throw new RuntimeException(e); + } LOGGER.info("Successfully synchronized registries with the server."); } } diff --git a/station-registry-sync-v0/src/main/java/net/modificationstation/stationapi/impl/network/packet/s2c/play/RemapClientRegistryS2CPacket.java b/station-registry-sync-v0/src/main/java/net/modificationstation/stationapi/impl/network/packet/s2c/play/RemapClientRegistryS2CPacket.java index 07fbbbbb0..49b34eb39 100644 --- a/station-registry-sync-v0/src/main/java/net/modificationstation/stationapi/impl/network/packet/s2c/play/RemapClientRegistryS2CPacket.java +++ b/station-registry-sync-v0/src/main/java/net/modificationstation/stationapi/impl/network/packet/s2c/play/RemapClientRegistryS2CPacket.java @@ -59,11 +59,19 @@ public void write(DataOutputStream stream) { try { stream.writeInt(map.size()); map.forEach((registryId, registryMapping) -> { - writeString(registryId.toString(), stream); + try { + writeString(registryId.toString(), stream); + } catch (IOException e) { + throw new RuntimeException(e); + } try { stream.writeInt(registryMapping.size()); registryMapping.forEach((identifier, rawId) -> { - writeString(identifier.toString(), stream); + try { + writeString(identifier.toString(), stream); + } catch (IOException e) { + throw new RuntimeException(e); + } try { stream.writeInt(rawId); } catch (IOException e) { diff --git a/station-registry-sync-v0/src/main/java/net/modificationstation/stationapi/impl/server/registry/ServerRegistrySender.java b/station-registry-sync-v0/src/main/java/net/modificationstation/stationapi/impl/server/registry/ServerRegistrySender.java index d6405057d..6daee7318 100644 --- a/station-registry-sync-v0/src/main/java/net/modificationstation/stationapi/impl/server/registry/ServerRegistrySender.java +++ b/station-registry-sync-v0/src/main/java/net/modificationstation/stationapi/impl/server/registry/ServerRegistrySender.java @@ -14,6 +14,7 @@ import net.modificationstation.stationapi.api.server.event.network.PlayerPacketHandlerSetEvent; import java.io.ByteArrayOutputStream; +import java.io.IOException; import java.lang.invoke.MethodHandles; import static net.modificationstation.stationapi.api.StationAPI.LOGGER; @@ -34,7 +35,11 @@ private static void sendWorldRegistry(PlayerPacketHandlerSetEvent event) { NbtCompound registries = new NbtCompound(); WorldLegacyRegistry.saveAll(registries); ByteArrayOutputStream byteOutputStream = new ByteArrayOutputStream(); - NbtIo.writeCompressed(registries, byteOutputStream); + try { + NbtIo.writeCompressed(registries, byteOutputStream); + } catch (IOException e) { + throw new RuntimeException(e); + } MessagePacket message = new MessagePacket(of(NAMESPACE, "server_registry_sync")); message.bytes = byteOutputStream.toByteArray(); PacketHelper.sendTo(event.player, message); diff --git a/station-renderer-api-v0/src/main/java/net/modificationstation/stationapi/api/client/world/ColorResolver.java b/station-renderer-api-v0/src/main/java/net/modificationstation/stationapi/api/client/world/ColorResolver.java index f8555f959..399a291ee 100644 --- a/station-renderer-api-v0/src/main/java/net/modificationstation/stationapi/api/client/world/ColorResolver.java +++ b/station-renderer-api-v0/src/main/java/net/modificationstation/stationapi/api/client/world/ColorResolver.java @@ -14,9 +14,9 @@ interface ByTemperatureAndRainfall extends ColorResolver { @Override default int getColor(BlockView world, double x, double y, double z) { - world.method_1781().getBiomesInArea(MathHelper.floor(x), MathHelper.floor(z), 1, 1); - double temperature = world.method_1781().temperatureMap[0]; - double rainfall = world.method_1781().downfallMap[0]; + world.getBiomeSource().getBiomesInArea(MathHelper.floor(x), MathHelper.floor(z), 1, 1); + double temperature = world.getBiomeSource().temperatureMap[0]; + double rainfall = world.getBiomeSource().downfallMap[0]; return getColour(temperature, rainfall); } @@ -28,7 +28,7 @@ interface ByBiomeAndPosition extends ColorResolver { @Override default int getColor(BlockView blockView, double x, double y, double z) { - return getColour(blockView.method_1781().getBiome(MathHelper.floor(x), MathHelper.floor(z)), x, z); + return getColour(blockView.getBiomeSource().getBiome(MathHelper.floor(x), MathHelper.floor(z)), x, z); } int getColour(Biome biome, double x, double z); diff --git a/station-renderer-api-v0/src/main/resources/fabric.mod.json b/station-renderer-api-v0/src/main/resources/fabric.mod.json index 0da340298..756de1903 100644 --- a/station-renderer-api-v0/src/main/resources/fabric.mod.json +++ b/station-renderer-api-v0/src/main/resources/fabric.mod.json @@ -2,7 +2,6 @@ "schemaVersion": 1, "id": "station-renderer-api-v0", "version": "${version}", - "name": "Station Renderer API (v0)", "description": "Textures, models, text color, etc.", "authors": [ @@ -13,10 +12,8 @@ "sources": "https://github.com/ModificationStation/StationAPI", "issues": "https://github.com/ModificationStation/StationAPI/issues" }, - "license": "MIT", "icon": "assets/station-renderer-api-v0/icon.png", - "environment": "client", "entrypoints": { "stationapi:event_bus_client": [ @@ -26,27 +23,25 @@ "mixins": [ "station-renderer-api-v0.mixins.json" ], - "depends": { "fabricloader": "*", "minecraft": "1.0.0-beta.7.3" }, - "custom": { "modmenu:api": true, "loom:injected_interfaces": { - "net/minecraft/class_17": [ + "net/minecraft/unmapped/C_81592558": [ "net/modificationstation/stationapi/api/client/block/StationRendererBlock" ], - "net/minecraft/class_67": [ + "net/minecraft/unmapped/C_96603444": [ "net/modificationstation/stationapi/api/client/render/StationTessellator" ], - "net/minecraft/class_124": [ + "net/minecraft/unmapped/C_98888256": [ "net/modificationstation/stationapi/api/client/item/StationRendererItem" ], - "net/minecraft/class_13": [ + "net/minecraft/unmapped/C_03670941": [ "net/modificationstation/stationapi/api/client/render/block/StationRendererBlockRenderManager" ] } } -} \ No newline at end of file +} diff --git a/station-renderer-arsenic/src/main/java/net/modificationstation/stationapi/impl/client/arsenic/renderer/render/ArsenicOverlayRenderer.java b/station-renderer-arsenic/src/main/java/net/modificationstation/stationapi/impl/client/arsenic/renderer/render/ArsenicOverlayRenderer.java index 8e08779ea..02902c13f 100644 --- a/station-renderer-arsenic/src/main/java/net/modificationstation/stationapi/impl/client/arsenic/renderer/render/ArsenicOverlayRenderer.java +++ b/station-renderer-arsenic/src/main/java/net/modificationstation/stationapi/impl/client/arsenic/renderer/render/ArsenicOverlayRenderer.java @@ -179,7 +179,7 @@ public void renderItem(float f) { Lighting.turnOn(); glPopMatrix(); ItemStack var5 = access.stationapi$getStack(); - float var6 = access.stationapi$getMinecraft().world.method_1782(MathHelper.floor(var3.x), MathHelper.floor(var3.y), MathHelper.floor(var3.z)); + float var6 = access.stationapi$getMinecraft().world.getLuminance(MathHelper.floor(var3.x), MathHelper.floor(var3.y), MathHelper.floor(var3.z)); if (var5 != null) { int var7 = Item.ITEMS[var5.itemId].getColorMultiplier(var5.getDamage()); float var8 = (float)(var7 >> 16 & 255) / 255.0F; diff --git a/station-tools-api-v1/src/main/resources/fabric.mod.json b/station-tools-api-v1/src/main/resources/fabric.mod.json index 486cd263e..ec09d1ed5 100644 --- a/station-tools-api-v1/src/main/resources/fabric.mod.json +++ b/station-tools-api-v1/src/main/resources/fabric.mod.json @@ -2,7 +2,6 @@ "schemaVersion": 1, "id": "station-tools-api-v1", "version": "${version}", - "name": "Station Tools API (v1)", "description": "Makes tools actually work properly. Also, custom shears!", "authors": [ @@ -13,10 +12,8 @@ "sources": "https://github.com/ModificationStation/StationAPI", "issues": "https://github.com/ModificationStation/StationAPI/issues" }, - "license": "MIT", "icon": "assets/station-tools-api-v1/icon.png", - "environment": "*", "entrypoints": { "stationapi:event_bus": [ @@ -26,28 +23,26 @@ "mixins": [ "station-tools-api-v1.mixins.json" ], - "depends": { "fabricloader": "*", "minecraft": "1.0.0-beta.7.3" }, - "custom": { "modmenu:api": true, "loom:injected_interfaces": { - "net/minecraft/class_126": [ + "net/minecraft/unmapped/C_17309128": [ "net/modificationstation/stationapi/api/item/tool/StationShearsItem" ], - "net/minecraft/class_249": [ + "net/minecraft/unmapped/C_50960081": [ "net/modificationstation/stationapi/api/item/tool/StationHoeItem" ], - "net/minecraft/class_352": [ + "net/minecraft/unmapped/C_64104387": [ "net/modificationstation/stationapi/api/item/tool/StationSwordItem" ], - "net/minecraft/class_428": [ + "net/minecraft/unmapped/C_74597326": [ "net/modificationstation/stationapi/api/item/tool/StationToolMaterial" ], - "net/minecraft/class_632": [ + "net/minecraft/unmapped/C_53672520": [ "net/modificationstation/stationapi/api/item/tool/StationToolItem" ] } diff --git a/station-vanilla-fix-v0/src/main/java/net/modificationstation/stationapi/impl/vanillafix/client/gui/screen/EditWorldScreenImpl.java b/station-vanilla-fix-v0/src/main/java/net/modificationstation/stationapi/impl/vanillafix/client/gui/screen/EditWorldScreenImpl.java index cac07514d..6f8fcfd12 100644 --- a/station-vanilla-fix-v0/src/main/java/net/modificationstation/stationapi/impl/vanillafix/client/gui/screen/EditWorldScreenImpl.java +++ b/station-vanilla-fix-v0/src/main/java/net/modificationstation/stationapi/impl/vanillafix/client/gui/screen/EditWorldScreenImpl.java @@ -21,6 +21,7 @@ import net.modificationstation.stationapi.impl.world.storage.FlattenedWorldStorage; import net.modificationstation.stationapi.mixin.vanillafix.client.ScreenAccessor; +import java.io.IOException; import java.lang.invoke.MethodHandles; import static net.mine_diver.unsafeevents.listener.ListenerPriority.LOW; @@ -52,7 +53,11 @@ private static void registerConversionButton(EditWorldScreenEvent.ScrollableButt FlattenedWorldStorage worldStorage = (FlattenedWorldStorage) mc.getWorldStorageSource(); mc.progressRenderer.progressStart("Converting World to " + worldStorage.getPreviousWorldFormat()); mc.progressRenderer.progressStage("This may take a while :)"); - worldStorage.convertWorld(screen.worldData.getSaveName(), (type, compound) -> (NbtCompound) VanillaDataFixerImpl.DATA_DAMAGER.get().update(type, new Dynamic<>(NbtOps.INSTANCE, compound).remove(DataFixers.DATA_VERSIONS), VanillaDataFixerImpl.HIGHEST_VERSION - NbtHelper.getDataVersions(compound).getInt(NAMESPACE.toString()), VanillaDataFixerImpl.VANILLA_VERSION).getValue(), mc.progressRenderer); + try { + worldStorage.convertWorld(screen.worldData.getSaveName(), (type, compound) -> (NbtCompound) VanillaDataFixerImpl.DATA_DAMAGER.get().update(type, new Dynamic<>(NbtOps.INSTANCE, compound).remove(DataFixers.DATA_VERSIONS), VanillaDataFixerImpl.HIGHEST_VERSION - NbtHelper.getDataVersions(compound).getInt(NAMESPACE.toString()), VanillaDataFixerImpl.VANILLA_VERSION).getValue(), mc.progressRenderer); + } catch (IOException e) { + throw new RuntimeException(e); + } mc.setScreen(screen); }, WorldConversionWarning.TO_MCREGION_EXPLANATION_KEY, WorldConversionWarning.CONVERT_KEY)) )); diff --git a/station-world-events-v0/src/main/java/net/modificationstation/stationapi/mixin/world/ServerChunkCacheMixin.java b/station-world-events-v0/src/main/java/net/modificationstation/stationapi/mixin/world/ServerChunkCacheMixin.java index 9f68033bd..30e89daf4 100644 --- a/station-world-events-v0/src/main/java/net/modificationstation/stationapi/mixin/world/ServerChunkCacheMixin.java +++ b/station-world-events-v0/src/main/java/net/modificationstation/stationapi/mixin/world/ServerChunkCacheMixin.java @@ -45,7 +45,7 @@ private void stationapi_onPopulate(ChunkSource worldSource, int chunkX, int chun WorldGenEvent.ChunkDecoration.builder() .world(world) .worldSource(this.generator) - .biome(world.method_1781().getBiome(blockX + 16, blockZ + 16)) + .biome(world.getBiomeSource().getBiome(blockX + 16, blockZ + 16)) .x(blockX).z(blockZ) .random(modRandom) .build() diff --git a/station-world-events-v0/src/main/java/net/modificationstation/stationapi/mixin/world/client/ChunkCacheMixin.java b/station-world-events-v0/src/main/java/net/modificationstation/stationapi/mixin/world/client/ChunkCacheMixin.java index aaf814003..643cc2ade 100644 --- a/station-world-events-v0/src/main/java/net/modificationstation/stationapi/mixin/world/client/ChunkCacheMixin.java +++ b/station-world-events-v0/src/main/java/net/modificationstation/stationapi/mixin/world/client/ChunkCacheMixin.java @@ -45,7 +45,7 @@ private void stationapi_onPopulate(ChunkSource worldSource, int chunkX, int chun WorldGenEvent.ChunkDecoration.builder() .world(world) .worldSource(this.generator) - .biome(world.method_1781().getBiome(blockX + 16, blockZ + 16)) + .biome(world.getBiomeSource().getBiome(blockX + 16, blockZ + 16)) .x(blockX).z(blockZ) .random(modRandom) .build() diff --git a/station-world-events-v0/src/main/java/net/modificationstation/stationapi/mixin/world/server/class_79Mixin.java b/station-world-events-v0/src/main/java/net/modificationstation/stationapi/mixin/world/server/class_79Mixin.java index f2a9fffbb..63b3131e8 100644 --- a/station-world-events-v0/src/main/java/net/modificationstation/stationapi/mixin/world/server/class_79Mixin.java +++ b/station-world-events-v0/src/main/java/net/modificationstation/stationapi/mixin/world/server/class_79Mixin.java @@ -42,7 +42,7 @@ private void stationapi_onPopulate(ChunkSource worldSource, int chunkX, int chun WorldGenEvent.ChunkDecoration.builder() .world(world) .worldSource(generator) - .biome(world.method_1781().getBiome(blockX + 16, blockZ + 16)) + .biome(world.getBiomeSource().getBiome(blockX + 16, blockZ + 16)) .x(blockX).z(blockZ) .random(modRandom) .build() diff --git a/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/api/worldgen/biome/BiomeBuilder.java b/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/api/worldgen/biome/BiomeBuilder.java index 4a8005f27..d07512480 100644 --- a/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/api/worldgen/biome/BiomeBuilder.java +++ b/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/api/worldgen/biome/BiomeBuilder.java @@ -3,6 +3,7 @@ import it.unimi.dsi.fastutil.objects.Reference2IntMap; import it.unimi.dsi.fastutil.objects.Reference2IntOpenHashMap; import net.minecraft.entity.Entity; +import net.minecraft.entity.LivingEntity; import net.minecraft.world.biome.Biome; import net.minecraft.world.gen.feature.Feature; import net.modificationstation.stationapi.api.worldgen.feature.DefaultFeatures; @@ -14,9 +15,9 @@ public class BiomeBuilder { private static final ThreadLocal INSTANCES = ThreadLocal.withInitial(BiomeBuilder::new); - private final Reference2IntMap> hostileEntities = new Reference2IntOpenHashMap<>(32); - private final Reference2IntMap> passiveEntities = new Reference2IntOpenHashMap<>(32); - private final Reference2IntMap> waterEntities = new Reference2IntOpenHashMap<>(32); + private final Reference2IntMap> hostileEntities = new Reference2IntOpenHashMap<>(32); + private final Reference2IntMap> passiveEntities = new Reference2IntOpenHashMap<>(32); + private final Reference2IntMap> waterEntities = new Reference2IntOpenHashMap<>(32); private final List features = new ArrayList<>(); private final List rules = new ArrayList<>(); private BiomeColorProvider grassColor; @@ -127,7 +128,7 @@ public BiomeBuilder snow(boolean snow) { * Add hostile entity (mobs/monsters) to spawn list. * Larger rarity value = more frequent entity spawn compared to other entities */ - public BiomeBuilder hostileEntity(Class entity, int rarity) { + public BiomeBuilder hostileEntity(Class entity, int rarity) { hostileEntities.put(entity, rarity); return this; } @@ -136,7 +137,7 @@ public BiomeBuilder hostileEntity(Class entity, int rarity) { * Add passive entity (animals) to spawn list. * Larger rarity value = more frequent entity spawn compared to other entities */ - public BiomeBuilder passiveEntity(Class entity, int rarity) { + public BiomeBuilder passiveEntity(Class entity, int rarity) { passiveEntities.put(entity, rarity); return this; } @@ -145,7 +146,7 @@ public BiomeBuilder passiveEntity(Class entity, int rarity) { * Add water entity (water animals) to spawn list. * Larger rarity value = more frequent entity spawn compared to other entities */ - public BiomeBuilder waterEntity(Class entity, int rarity) { + public BiomeBuilder waterEntity(Class entity, int rarity) { waterEntities.put(entity, rarity); return this; } diff --git a/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/api/worldgen/biome/StationBiome.java b/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/api/worldgen/biome/StationBiome.java index b4e8ee580..491fe5323 100644 --- a/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/api/worldgen/biome/StationBiome.java +++ b/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/api/worldgen/biome/StationBiome.java @@ -1,6 +1,7 @@ package net.modificationstation.stationapi.api.worldgen.biome; import net.minecraft.entity.Entity; +import net.minecraft.entity.LivingEntity; import net.minecraft.world.World; import net.minecraft.world.gen.feature.Feature; import net.modificationstation.stationapi.api.block.BlockState; @@ -69,15 +70,15 @@ default void setSnow(boolean snow) { Util.assertImpl(); } - default void addPassiveEntity(Class entityClass, int rarity) { + default void addPassiveEntity(Class entityClass, int rarity) { Util.assertImpl(); } - default void addHostileEntity(Class entityClass, int rarity) { + default void addHostileEntity(Class entityClass, int rarity) { Util.assertImpl(); } - default void addWaterEntity(Class entityClass, int rarity) { + default void addWaterEntity(Class entityClass, int rarity) { Util.assertImpl(); } diff --git a/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/impl/worldgen/FogRendererImpl.java b/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/impl/worldgen/FogRendererImpl.java index ea862e5fc..82fdeb369 100644 --- a/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/impl/worldgen/FogRendererImpl.java +++ b/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/impl/worldgen/FogRendererImpl.java @@ -8,7 +8,7 @@ public class FogRendererImpl { private static final float[] FOG_COLOR = new float[3]; public static void setupFog(Minecraft minecraft, float delta) { - BiomeSource biomeSource = minecraft.world.method_1781(); + BiomeSource biomeSource = minecraft.world.getBiomeSource(); double x = minecraft.camera.x; double z = minecraft.camera.z; int color = BiomeColorsImpl.FOG_INTERPOLATOR.getColor(biomeSource, x, z); diff --git a/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/impl/worldgen/WorldDecoratorImpl.java b/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/impl/worldgen/WorldDecoratorImpl.java index dfa135850..b03029583 100644 --- a/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/impl/worldgen/WorldDecoratorImpl.java +++ b/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/impl/worldgen/WorldDecoratorImpl.java @@ -19,7 +19,7 @@ public static void decorate(World world, int cx, int cz) { int x2 = x1 + 16; int z2 = z1 + 16; - world.method_1781().getBiomesInArea(BIOMES, x1, z1, 16, 16); + world.getBiomeSource().getBiomesInArea(BIOMES, x1, z1, 16, 16); int index = 0; for (int x = x1; x < x2; x++) { diff --git a/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/impl/worldgen/WorldGeneratorImpl.java b/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/impl/worldgen/WorldGeneratorImpl.java index c47a78ef0..aef60cea1 100644 --- a/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/impl/worldgen/WorldGeneratorImpl.java +++ b/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/impl/worldgen/WorldGeneratorImpl.java @@ -16,7 +16,7 @@ public static void updateNoise(World world, int cx, int cz, double[] data) { cx <<= 4; cz <<= 4; - BiomeSource biomeSource = world.method_1781(); + BiomeSource biomeSource = world.getBiomeSource(); int sideY = (1 << (MathHelper.ceilLog2(world.getHeight()) - 3)) + 1; int bottom = world.getBottomY() >> 3; int dx = sideY * 5; diff --git a/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/mixin/worldgen/BiomeMixin.java b/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/mixin/worldgen/BiomeMixin.java index 0f5a1b56a..7f15cfd91 100644 --- a/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/mixin/worldgen/BiomeMixin.java +++ b/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/mixin/worldgen/BiomeMixin.java @@ -1,6 +1,7 @@ package net.modificationstation.stationapi.mixin.worldgen; import net.minecraft.entity.Entity; +import net.minecraft.entity.LivingEntity; import net.minecraft.world.World; import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.EntitySpawnGroup; @@ -95,17 +96,17 @@ public void setSnow(boolean snow) { } @Override - public void addPassiveEntity(Class entityClass, int rarity) { + public void addPassiveEntity(Class entityClass, int rarity) { this.spawnablePassive.add(new EntitySpawnGroup(entityClass, rarity)); } @Override - public void addHostileEntity(Class entityClass, int rarity) { + public void addHostileEntity(Class entityClass, int rarity) { this.spawnableMonsters.add(new EntitySpawnGroup(entityClass, rarity)); } @Override - public void addWaterEntity(Class entityClass, int rarity) { + public void addWaterEntity(Class entityClass, int rarity) { this.spawnableWaterCreatures.add(new EntitySpawnGroup(entityClass, rarity)); } diff --git a/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/mixin/worldgen/NetherWorldSourceMixin.java b/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/mixin/worldgen/NetherWorldSourceMixin.java index dedb3c50d..2e6ee4320 100644 --- a/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/mixin/worldgen/NetherWorldSourceMixin.java +++ b/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/mixin/worldgen/NetherWorldSourceMixin.java @@ -31,7 +31,7 @@ private void stationapi_makeSurface(ChunkSource source, int cx, int cz, Callback cancellable = true ) private void stationapi_cancelFeatureGeneration(ChunkSource source, int cx, int cz, CallbackInfo info) { - Biome biome = this.world.method_1781().getBiome(cx + 16, cz + 16); + Biome biome = this.world.getBiomeSource().getBiome(cx + 16, cz + 16); if (biome.isNoDimensionFeatures()) { SandBlock.fallInstantly = false; info.cancel(); diff --git a/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/mixin/worldgen/OverworldWorldSourceMixin.java b/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/mixin/worldgen/OverworldWorldSourceMixin.java index 6f613d38f..31a59a322 100644 --- a/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/mixin/worldgen/OverworldWorldSourceMixin.java +++ b/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/mixin/worldgen/OverworldWorldSourceMixin.java @@ -64,7 +64,7 @@ private int stationapi_cancelSurfaceMaking(int constant, @Local Biome biome) { ) ) private void stationapi_changeHeight(int cx, int cz, byte[] args, Biome[] biomes, double[] par5, CallbackInfo info) { - BiomeSource biomeSource = world.method_1781(); + BiomeSource biomeSource = world.getBiomeSource(); biomeSource.temperatureMap = biomeSource.downfallMap = biomeSource.weirdnessMap = null; biomeSource.biomes = null; WorldGeneratorImpl.updateNoise(world, cx, cz, this.heightMap); diff --git a/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/mixin/worldgen/client/GrassBlockMixin.java b/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/mixin/worldgen/client/GrassBlockMixin.java index 799ce77ba..d8493bd02 100644 --- a/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/mixin/worldgen/client/GrassBlockMixin.java +++ b/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/mixin/worldgen/client/GrassBlockMixin.java @@ -16,7 +16,7 @@ class GrassBlockMixin { cancellable = true ) private void stationapi_getBiomeColor(BlockView view, int x, int y, int z, CallbackInfoReturnable info) { - int color = BiomeColorsImpl.GRASS_INTERPOLATOR.getColor(view.method_1781(), x, z); + int color = BiomeColorsImpl.GRASS_INTERPOLATOR.getColor(view.getBiomeSource(), x, z); info.setReturnValue(color); } } diff --git a/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/mixin/worldgen/client/LeavesBlockMixin.java b/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/mixin/worldgen/client/LeavesBlockMixin.java index c37e895ee..d6d666ce4 100644 --- a/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/mixin/worldgen/client/LeavesBlockMixin.java +++ b/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/mixin/worldgen/client/LeavesBlockMixin.java @@ -15,14 +15,14 @@ class LeavesBlockMixin { method = "getColorMultiplier", at = @At( value = "INVOKE", - target = "Lnet/minecraft/world/BlockView;method_1781()Lnet/minecraft/world/biome/source/BiomeSource;", + target = "Lnet/minecraft/world/BlockView;getBiomeSource()Lnet/minecraft/world/biome/source/BiomeSource;", ordinal = 0, shift = Shift.BEFORE ), cancellable = true ) private void stationapi_getBiomeColor(BlockView view, int x, int y, int z, CallbackInfoReturnable info) { - int color = BiomeColorsImpl.LEAVES_INTERPOLATOR.getColor(view.method_1781(), x, z); + int color = BiomeColorsImpl.LEAVES_INTERPOLATOR.getColor(view.getBiomeSource(), x, z); info.setReturnValue(color); } } diff --git a/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/mixin/worldgen/client/TallPlantBlockMixin.java b/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/mixin/worldgen/client/TallPlantBlockMixin.java index 2cc84d98a..78d2cc574 100644 --- a/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/mixin/worldgen/client/TallPlantBlockMixin.java +++ b/station-worldgen-api-v0/src/main/java/net/modificationstation/stationapi/mixin/worldgen/client/TallPlantBlockMixin.java @@ -22,7 +22,7 @@ private void stationapi_getBiomeColor(BlockView view, int x, int y, int z, Callb x += (int) (l >> 14) & 7; z += (int) (l >> 24) & 7; - int color = BiomeColorsImpl.GRASS_INTERPOLATOR.getColor(view.method_1781(), x, z); + int color = BiomeColorsImpl.GRASS_INTERPOLATOR.getColor(view.getBiomeSource(), x, z); info.setReturnValue(color); } } diff --git a/station-worldgen-api-v0/src/main/resources/fabric.mod.json b/station-worldgen-api-v0/src/main/resources/fabric.mod.json index 73689ec0a..b74765c95 100644 --- a/station-worldgen-api-v0/src/main/resources/fabric.mod.json +++ b/station-worldgen-api-v0/src/main/resources/fabric.mod.json @@ -2,7 +2,6 @@ "schemaVersion": 1, "id": "station-worldgen-api-v0", "version": "${version}", - "name": "Station Worldgen API (v0)", "description": "Provides a system for world and biome generation", "authors": [ @@ -13,10 +12,8 @@ "sources": "https://github.com/ModificationStation/StationAPI", "issues": "https://github.com/ModificationStation/StationAPI/issues" }, - "license": "MIT", "icon": "assets/station-worldgen-api-v0/icon.png", - "environment": "*", "entrypoints": { "stationapi:event_bus": [ @@ -26,16 +23,14 @@ "mixins": [ "station-worldgen-api-v0.mixins.json" ], - "depends": { "fabricloader": "*", "minecraft": "1.0.0-beta.7.3" }, - "custom": { "modmenu:api": true, "loom:injected_interfaces": { - "net/minecraft/class_153": [ + "net/minecraft/unmapped/C_28105876": [ "net/modificationstation/stationapi/api/worldgen/biome/StationBiome" ] } From fde540fac56e34497a2956aff88e7fafc6f68e34 Mon Sep 17 00:00:00 2001 From: Matthew Periut Date: Wed, 4 Feb 2026 04:30:25 -0500 Subject: [PATCH 3/5] Dynamic code path for multithreaded load when starac improved rendering hooks available. --- .../api/client/resource/LWJGLHelper.java | 126 +++++++++++++++ .../api/client/resource/ReloadScreen.java | 54 ++++++- .../client/resource/ReloadScreenManager.java | 147 +++++++++++++++--- .../resourceloader/client/MinecraftMixin.java | 10 +- 4 files changed, 314 insertions(+), 23 deletions(-) create mode 100644 station-resource-loader-v0/src/main/java/net/modificationstation/stationapi/api/client/resource/LWJGLHelper.java diff --git a/station-resource-loader-v0/src/main/java/net/modificationstation/stationapi/api/client/resource/LWJGLHelper.java b/station-resource-loader-v0/src/main/java/net/modificationstation/stationapi/api/client/resource/LWJGLHelper.java new file mode 100644 index 000000000..5ed8eb0a9 --- /dev/null +++ b/station-resource-loader-v0/src/main/java/net/modificationstation/stationapi/api/client/resource/LWJGLHelper.java @@ -0,0 +1,126 @@ +package net.modificationstation.stationapi.api.client.resource; + +import java.lang.reflect.Method; +import java.util.function.BooleanSupplier; + +/** + * Utility class to handle LWJGL2 vs LWJGL3/starac differences. + * + * For LWJGL2: Uses SharedDrawable for threaded context sharing. + * For LWJGL3/starac: Uses EarlyRenderLoop for single-threaded rendering with proper event handling. + */ +final class LWJGLHelper { + private static final boolean HAS_EARLY_RENDER_LOOP; + private static final boolean IS_LWJGL2; + + static { + boolean hasEarlyRenderLoop = false; + boolean isLwjgl2 = false; + + // First check if starac's EarlyRenderLoop exists (preferred for LWJGL3) + try { + Class.forName("org.lwjgl.opengl.EarlyRenderLoop"); + hasEarlyRenderLoop = true; + } catch (ClassNotFoundException e) { + // Not available + } + + // Check if this is LWJGL2 (has Drawable/SharedDrawable) + if (!hasEarlyRenderLoop) { + try { + Class.forName("org.lwjgl.opengl.Drawable"); + Class.forName("org.lwjgl.opengl.SharedDrawable"); + Class displayClass = Class.forName("org.lwjgl.opengl.Display"); + displayClass.getMethod("getDrawable"); + isLwjgl2 = true; + } catch (ClassNotFoundException | NoSuchMethodException e) { + // Not LWJGL2 + } + } + + HAS_EARLY_RENDER_LOOP = hasEarlyRenderLoop; + IS_LWJGL2 = isLwjgl2; + } + + private LWJGLHelper() {} + + /** + * @return true if starac's EarlyRenderLoop is available + */ + public static boolean hasEarlyRenderLoop() { + return HAS_EARLY_RENDER_LOOP; + } + + /** + * @return true if LWJGL2's SharedDrawable is available + */ + public static boolean isLWJGL2() { + return IS_LWJGL2; + } + + /** + * Runs an early render loop using starac's EarlyRenderLoop. + * This runs on the main thread with proper event handling. + * + * @param shouldContinue Returns true while the loop should keep running + * @param render Called each frame to perform rendering + */ + public static void runEarlyRenderLoop(BooleanSupplier shouldContinue, Runnable render) throws Exception { + if (!HAS_EARLY_RENDER_LOOP) { + throw new IllegalStateException("EarlyRenderLoop not available"); + } + + Class earlyRenderLoopClass = Class.forName("org.lwjgl.opengl.EarlyRenderLoop"); + Method runLoop = earlyRenderLoopClass.getMethod("runLoop", BooleanSupplier.class, Runnable.class); + runLoop.invoke(null, shouldContinue, render); + } + + /** + * Creates a SharedDrawable for LWJGL2 threaded context sharing. + */ + public static Object createSharedDrawable() throws Exception { + if (!IS_LWJGL2) { + throw new IllegalStateException("SharedDrawable not available (not LWJGL2)"); + } + + Class displayClass = Class.forName("org.lwjgl.opengl.Display"); + Class sharedDrawableClass = Class.forName("org.lwjgl.opengl.SharedDrawable"); + Class drawableClass = Class.forName("org.lwjgl.opengl.Drawable"); + + Method getDrawable = displayClass.getMethod("getDrawable"); + Object drawable = getDrawable.invoke(null); + + return sharedDrawableClass.getConstructor(drawableClass).newInstance(drawable); + } + + /** + * Makes the drawable current in the current thread (LWJGL2 only). + */ + public static void makeCurrent(Object drawable) throws Exception { + if (drawable == null) return; + + Class drawableClass = Class.forName("org.lwjgl.opengl.Drawable"); + Method makeCurrent = drawableClass.getMethod("makeCurrent"); + makeCurrent.invoke(drawable); + } + + /** + * Releases the context from the current thread (LWJGL2 only). + */ + public static void releaseContext(Object drawable) throws Exception { + if (drawable == null) return; + + Class drawableClass = Class.forName("org.lwjgl.opengl.Drawable"); + Method releaseContext = drawableClass.getMethod("releaseContext"); + releaseContext.invoke(drawable); + } + + /** + * Calls Display.update() for LWJGL2. + */ + public static void displayUpdate() throws Exception { + Class displayClass = Class.forName("org.lwjgl.opengl.Display"); + Method update = displayClass.getMethod("update"); + update.invoke(null); + } +} diff --git a/station-resource-loader-v0/src/main/java/net/modificationstation/stationapi/api/client/resource/ReloadScreen.java b/station-resource-loader-v0/src/main/java/net/modificationstation/stationapi/api/client/resource/ReloadScreen.java index 079b9ba26..6b90c1ad7 100644 --- a/station-resource-loader-v0/src/main/java/net/modificationstation/stationapi/api/client/resource/ReloadScreen.java +++ b/station-resource-loader-v0/src/main/java/net/modificationstation/stationapi/api/client/resource/ReloadScreen.java @@ -55,6 +55,9 @@ class ReloadScreen extends Screen { private long GLOBAL_FADE_OUT = 1000; private long RELOAD_START = STAGE_0_START + STAGE_0_FADE_IN; private long EXCEPTION_TRANSFORM = 500; + private static final long WRAP_UP_DURATION = 100; // 100ms wrap-up period after loading + private boolean inWrapUp = false; + private long wrapUpStart = 0; private final Screen parent; private final Runnable done; @@ -106,6 +109,15 @@ class ReloadScreen extends Screen { RELOAD_START = EXCEPTION_TRANSFORM = 1; } + else if (ReloadScreenManager.isUsingEarlyRenderLoop()) { + // Faster animations for single-threaded LWJGL3 mode + BACKGROUND_FADE_IN = 250; + STAGE_0_START = BACKGROUND_START + BACKGROUND_FADE_IN; + STAGE_0_FADE_IN = 500; + GLOBAL_FADE_OUT = 300; + RELOAD_START = STAGE_0_START + STAGE_0_FADE_IN; + EXCEPTION_TRANSFORM = 200; + } else { BACKGROUND_FADE_IN = 1000; STAGE_0_START = BACKGROUND_START + BACKGROUND_FADE_IN; @@ -368,7 +380,42 @@ public void render(int mouseX, int mouseY, float delta) { if (partial) currentTime = lastRender; else lastRender = currentTime; val locationsSize = ReloadScreenManager.LOCATIONS.size(); - if (!exceptionThrown && !finished && !(scrollProgress + .1 < locationsSize) && !(progress + .1 < 1) && ReloadScreenManager.isReloadComplete()) { + + // Check if we should enter wrap-up mode (loading done, EarlyRenderLoop mode) + if (!exceptionThrown && !finished && !inWrapUp && ReloadScreenManager.isReloadComplete()) { + if (ReloadScreenManager.isUsingEarlyRenderLoop()) { + // Enter wrap-up mode - must complete before finishing + inWrapUp = true; + wrapUpStart = currentTime; + } + } + + // During wrap-up, accelerate animations to catch up + float progressLerp = 0.05F; + float scrollLerp = 0.05F; + if (inWrapUp) { + // Speed up lerping during wrap-up + progressLerp = 0.4F; + scrollLerp = 0.4F; + + // Wrap-up MUST complete its full duration before finishing + val wrapUpElapsed = currentTime - wrapUpStart; + if (wrapUpElapsed >= WRAP_UP_DURATION) { + try { + ReloadScreenManager.getCurrentReload().ifPresent(ResourceReload::throwException); + finished = true; + fadeOutStart = currentTime; + inWrapUp = false; + } catch (CompletionException e) { + exceptionThrown = true; + exceptionStart = currentTime; + exception = e; + inWrapUp = false; + LOGGER.error("An exception occurred during resource loading", e); + } + } + } else if (!exceptionThrown && !finished && !(scrollProgress + .1 < locationsSize) && !(progress + .1 < 1) && ReloadScreenManager.isReloadComplete()) { + // Original logic for non-EarlyRenderLoop mode try { ReloadScreenManager.getCurrentReload().ifPresent(ResourceReload::throwException); finished = true; @@ -380,10 +427,11 @@ public void render(int mouseX, int mouseY, float delta) { LOGGER.error("An exception occurred during resource loading", e); } } + if (!partial) { Optional reload; - progress = Floats.constrainToRange(progress * .95F + (isReloadStarted() && (reload = ReloadScreenManager.getCurrentReload()).isPresent() ? reload.get().getProgress() : 0) * .05F, 0, 1); - scrollProgress = Floats.constrainToRange(scrollProgress * .95F + locationsSize * .05F, 0, locationsSize); + progress = Floats.constrainToRange(progress * (1 - progressLerp) + (isReloadStarted() && (reload = ReloadScreenManager.getCurrentReload()).isPresent() ? reload.get().getProgress() : 0) * progressLerp, 0, 1); + scrollProgress = Floats.constrainToRange(scrollProgress * (1 - scrollLerp) + locationsSize * scrollLerp, 0, locationsSize); } if ((finished ? currentTime <= fadeOutStart + GLOBAL_FADE_OUT : currentTime < BACKGROUND_START + BACKGROUND_FADE_IN) && parent != null) parent.render(mouseX, mouseY, delta); diff --git a/station-resource-loader-v0/src/main/java/net/modificationstation/stationapi/api/client/resource/ReloadScreenManager.java b/station-resource-loader-v0/src/main/java/net/modificationstation/stationapi/api/client/resource/ReloadScreenManager.java index 9902cacb6..7c83aa7a5 100644 --- a/station-resource-loader-v0/src/main/java/net/modificationstation/stationapi/api/client/resource/ReloadScreenManager.java +++ b/station-resource-loader-v0/src/main/java/net/modificationstation/stationapi/api/client/resource/ReloadScreenManager.java @@ -18,12 +18,8 @@ import net.modificationstation.stationapi.mixin.resourceloader.client.MinecraftAccessor; import net.modificationstation.stationapi.mixin.resourceloader.client.TessellatorAccessor; import org.jetbrains.annotations.NotNull; -import org.lwjgl.LWJGLException; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.Display; -import org.lwjgl.opengl.Drawable; -import org.lwjgl.opengl.SharedDrawable; import java.util.List; import java.util.Optional; @@ -31,6 +27,7 @@ import java.util.concurrent.Executor; import java.util.concurrent.atomic.AtomicBoolean; +import static net.modificationstation.stationapi.api.StationAPI.LOGGER; import static org.lwjgl.opengl.GL11.*; public class ReloadScreenManager { @@ -53,15 +50,30 @@ public static void pushLocation(ResourceReloader resourceReloader, String format pushLocation(ProfileResult.getHumanReadableName(formatString.formatted(location.replaceAll("^root", resourceReloader.getName())))); } - public static void openEarly() throws LWJGLException { + public static void openEarly() throws Exception { ReloadScreenManagerImpl.isMinecraftDone = false; applicationExecutor = ReloadScreenApplicationExecutor.INSTANCE; currentReload = Optional.of(new CompositeResourceReload()); //noinspection deprecation final Minecraft minecraft = (Minecraft) FabricLoader.getInstance().getGameInstance(); - final Drawable drawable = new SharedDrawable(Display.getDrawable()); - thread = Optional.of(new Thread(() -> ReloadScreenManager.onStartup(minecraft, drawable))); - thread.ifPresent(Thread::start); + + // Use starac's EarlyRenderLoop if available (LWJGL3 with proper event handling) + if (LWJGLHelper.hasEarlyRenderLoop()) { + LOGGER.info("Using starac EarlyRenderLoop for loading screen"); + onStartupWithEarlyRenderLoop(minecraft); + return; + } + + // Fall back to LWJGL2 threaded approach + if (LWJGLHelper.isLWJGL2()) { + final Object drawable = LWJGLHelper.createSharedDrawable(); + thread = Optional.of(new Thread(() -> onStartupThreaded(minecraft, drawable))); + thread.ifPresent(Thread::start); + return; + } + + // No compatible approach available - skip early loading screen + LOGGER.warn("No compatible early loading screen implementation available"); } public static void open() { @@ -101,17 +113,110 @@ static void onFinish() { currentReload = Optional.empty(); } - private static void onStartup( + // For single-threaded mode (starac): flag and stored state + private static boolean usingEarlyRenderLoop = false; + private static ReloadScreen earlyRenderLoopScreen = null; + private static AtomicBoolean earlyRenderLoopDone = null; + + /** + * Sets up state for single-threaded early render loop. + * Returns immediately - actual render loop runs in runEarlyRenderLoop(). + */ + private static void onStartupWithEarlyRenderLoop(final Minecraft minecraft) { + usingEarlyRenderLoop = true; + earlyRenderLoopDone = new AtomicBoolean(false); + earlyRenderLoopScreen = new ReloadScreen( + minecraft.currentScreen, + () -> earlyRenderLoopDone.set(true), + ReloadScreenTessellatorHolder.reloadScreenTessellator = TessellatorAccessor.stationapi_create(48) + ); + val screenScaler = new ScreenScaler(minecraft.options, minecraft.displayWidth, minecraft.displayHeight); + earlyRenderLoopScreen.init(minecraft, screenScaler.getScaledWidth(), screenScaler.getScaledHeight()); + earlyRenderLoopScreen.setTextRenderer(new TextRenderer(minecraft.options, "/font/default.png", minecraft.textureManager)); + } + + /** + * @return true if using single-threaded EarlyRenderLoop mode + */ + public static boolean isUsingEarlyRenderLoop() { + return usingEarlyRenderLoop; + } + + /** + * Runs the early render loop (single-threaded mode). + * Processes executor tasks while rendering until reload is complete. + */ + public static void runEarlyRenderLoop() { + if (!usingEarlyRenderLoop || earlyRenderLoopScreen == null) return; + + //noinspection deprecation + val minecraft = (Minecraft) FabricLoader.getInstance().getGameInstance(); + val screenScaler = new ScreenScaler(minecraft.options, minecraft.displayWidth, minecraft.displayHeight); + val width = screenScaler.getScaledWidth(); + val height = screenScaler.getScaledHeight(); + val timer = ((MinecraftAccessor) minecraft).getTimer(); + val screen = earlyRenderLoopScreen; + + // Set up GL state + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(0.0, screenScaler.rawScaledWidth, screenScaler.rawScaledHeight, 0.0, 1000.0, 3000.0); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glTranslatef(0.0f, 0.0f, -2000.0f); + glViewport(0, 0, minecraft.displayWidth, minecraft.displayHeight); + glClearColor(0.0f, 0.0f, 0.0f, 0.0f); + glDisable(GL_LIGHTING); + glEnable(GL_TEXTURE_2D); + glDisable(GL_FOG); + + try { + LWJGLHelper.runEarlyRenderLoop( + () -> !earlyRenderLoopDone.get(), + () -> { + // Process ALL pending executor tasks each frame + Runnable task; + while ((task = ReloadScreenApplicationExecutor.INSTANCE.poll()) != null) { + task.run(); + } + + val f = timer.partialTick; + timer.advance(); + timer.partialTick = f; + val mouseX = Mouse.getX() * width / minecraft.displayWidth; + val mouseY = height - Mouse.getY() * height / minecraft.displayHeight - 1; + screen.render(mouseX, mouseY, timer.partialTick); + } + ); + } catch (Exception e) { + throw new RuntimeException(e); + } + + // Clean up + glDisable(GL_LIGHTING); + glDisable(GL_FOG); + glEnable(GL_ALPHA_TEST); + glAlphaFunc(GL_GREATER, 0.1f); + usingEarlyRenderLoop = false; + earlyRenderLoopScreen = null; + earlyRenderLoopDone = null; + } + + /** + * Threaded approach for LWJGL2 using SharedDrawable. + */ + private static void onStartupThreaded( final Minecraft minecraft, - final Drawable drawable + final Object drawable ) { try { - drawable.makeCurrent(); - } catch (LWJGLException e) { + LWJGLHelper.makeCurrent(drawable); + } catch (Exception e) { throw new RuntimeException(e); } val done = new AtomicBoolean(); - val reloadScreen = new ReloadScreen( + val localReloadScreen = new ReloadScreen( minecraft.currentScreen, () -> done.set(true), ReloadScreenTessellatorHolder.reloadScreenTessellator = TessellatorAccessor.stationapi_create(48) @@ -119,8 +224,8 @@ private static void onStartup( val screenScaler = new ScreenScaler(minecraft.options, minecraft.displayWidth, minecraft.displayHeight); val width = screenScaler.getScaledWidth(); val height = screenScaler.getScaledHeight(); - reloadScreen.init(minecraft, width, height); - reloadScreen.setTextRenderer(new TextRenderer(minecraft.options, "/font/default.png", minecraft.textureManager)); + localReloadScreen.init(minecraft, width, height); + localReloadScreen.setTextRenderer(new TextRenderer(minecraft.options, "/font/default.png", minecraft.textureManager)); val timer = ((MinecraftAccessor) minecraft).getTimer(); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_PROJECTION); @@ -142,16 +247,20 @@ private static void onStartup( timer.partialTick = f; val mouseX = Mouse.getX() * width / minecraft.displayWidth; val mouseY = height - Mouse.getY() * height / minecraft.displayHeight - 1; - reloadScreen.render(mouseX, mouseY, timer.partialTick); - Display.update(); + localReloadScreen.render(mouseX, mouseY, timer.partialTick); + try { + LWJGLHelper.displayUpdate(); + } catch (Exception e) { + throw new RuntimeException(e); + } } glDisable(GL_LIGHTING); glDisable(GL_FOG); glEnable(GL_ALPHA_TEST); glAlphaFunc(GL_GREATER, 0.1f); try { - drawable.releaseContext(); - } catch (LWJGLException e) { + LWJGLHelper.releaseContext(drawable); + } catch (Exception e) { throw new RuntimeException(e); } thread = Optional.empty(); diff --git a/station-resource-loader-v0/src/main/java/net/modificationstation/stationapi/mixin/resourceloader/client/MinecraftMixin.java b/station-resource-loader-v0/src/main/java/net/modificationstation/stationapi/mixin/resourceloader/client/MinecraftMixin.java index f2f4dde16..a739282cf 100644 --- a/station-resource-loader-v0/src/main/java/net/modificationstation/stationapi/mixin/resourceloader/client/MinecraftMixin.java +++ b/station-resource-loader-v0/src/main/java/net/modificationstation/stationapi/mixin/resourceloader/client/MinecraftMixin.java @@ -52,7 +52,7 @@ private void stationapi_location_textureManager(CallbackInfo ci) { shift = At.Shift.AFTER ) ) - private void stationapi_textureManagerInit(CallbackInfo ci) throws LWJGLException { + private void stationapi_textureManagerInit(CallbackInfo ci) throws Exception { ReloadScreenManager.openEarly(); StationAPI.EVENT_BUS.post( AssetsResourceReloaderRegisterEvent.builder() @@ -111,6 +111,14 @@ private void stationapi_location_stats(CallbackInfo ci) { ) private void stationapi_applyReloadsAndWait(CallbackInfo ci) { ReloadScreenManagerImpl.isMinecraftDone = true; + + // Single-threaded mode (starac/LWJGL3): run render loop that processes tasks + if (ReloadScreenManager.isUsingEarlyRenderLoop()) { + ReloadScreenManager.runEarlyRenderLoop(); + return; + } + + // Threaded mode (LWJGL2): process tasks and wait for render thread while (!ReloadScreenManager.isReloadComplete()) { val command = ReloadScreenApplicationExecutor.INSTANCE.poll(); if (command != null) command.run(); From 94615f54e0e089acc2a09d1c0ad5be5a34121ad2 Mon Sep 17 00:00:00 2001 From: Matthew Periut Date: Wed, 4 Feb 2026 04:35:36 -0500 Subject: [PATCH 4/5] Use public ornithe biny version --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index b2dabda29..7cd720367 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,7 @@ fabric.loom.multiProjectOptimisation=true # Fabric Properties # check these on https://fabricmc.net/use minecraft_version = b1.7.3 - biny_mappings = local + biny_mappings = 9859f76 loader_version = 0.16.9 # Ploceus Properties From 38d30d3ca445bdb306446244408c3742c08de201 Mon Sep 17 00:00:00 2001 From: matthewperiut Date: Wed, 4 Feb 2026 15:23:58 -0500 Subject: [PATCH 5/5] Update GCAPI to publicly available lib --- build.gradle.kts | 3 +-- gradle.properties | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index f2d60002a..4f594637f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -42,7 +42,6 @@ allprojects { java.targetCompatibility = JavaVersion.VERSION_17 repositories { - mavenLocal() maven(url = "https://maven.minecraftforge.net/") maven(url = "https://maven.glass-launcher.net/releases") maven(url = "https://maven.glass-launcher.net/snapshots") @@ -102,7 +101,7 @@ allprojects { "transitiveImplementation"(implementation("me.carleslc:Simple-Yaml:1.8.4") as Dependency) // not a runtime dependency unless we use something outside its events. - modImplementation("net.glasslauncher.mods:GlassConfigAPI:${project.properties["gcapi_version"]}") + modImplementation("net.glasslauncher.mods:GlassConfigAPI:${project.properties["gcapi_version"]}+gen2") // convenience stuff // adds some useful annotations for data classes. does not add any dependencies diff --git a/gradle.properties b/gradle.properties index 7cd720367..20debad74 100644 --- a/gradle.properties +++ b/gradle.properties @@ -33,6 +33,6 @@ fabric.loom.multiProjectOptimisation=true archives_base_name = StationAPI # Test properties - gcapi_version = 3.2.6 + gcapi_version = 3.3.0 modmenu_version = 1.8.5-beta.11 rc_version = 0.5.4 \ No newline at end of file