diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f6b8708da..565e0448a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -9,7 +9,7 @@ # Remember to update corresponding versions in fabric.mod.json/neoforge.mods.toml fabric-api = "0.127.0+1.21.6" fabric-loader = "0.16.14" -neoForge = "21.6.0-beta" +neoForge = "21.6.12-beta" neoMergeTool = "2.0.0" mixin = "0.8.5" parchment = "2025.04.19" diff --git a/projects/common/src/client/java/dan200/computercraft/client/ClientRegistry.java b/projects/common/src/client/java/dan200/computercraft/client/ClientRegistry.java index 169e41c15..299e8651c 100644 --- a/projects/common/src/client/java/dan200/computercraft/client/ClientRegistry.java +++ b/projects/common/src/client/java/dan200/computercraft/client/ClientRegistry.java @@ -67,7 +67,7 @@ public final class ClientRegistry { private static final Map> models = new ConcurrentHashMap<>(); public static ModelKey getModel(ResourceLocation model) { - return models.computeIfAbsent(model, m -> ClientPlatformHelper.get().createModelKey(m, m::toString)); + return models.computeIfAbsent(model, m -> ClientPlatformHelper.get().createModelKey(m::toString)); } public static StandaloneModel getModel(ModelManager manager, ResourceLocation modelId) { diff --git a/projects/common/src/client/java/dan200/computercraft/client/CustomModelManager.java b/projects/common/src/client/java/dan200/computercraft/client/CustomModelManager.java index e380fe3e8..379af32e7 100644 --- a/projects/common/src/client/java/dan200/computercraft/client/CustomModelManager.java +++ b/projects/common/src/client/java/dan200/computercraft/client/CustomModelManager.java @@ -9,7 +9,6 @@ import com.mojang.serialization.JsonOps; import dan200.computercraft.client.platform.ClientPlatformHelper; import dan200.computercraft.client.platform.ModelKey; import dan200.computercraft.shared.util.ResourceUtils; -import net.minecraft.client.resources.model.MissingBlockModel; import net.minecraft.client.resources.model.ModelBaker; import net.minecraft.client.resources.model.ModelManager; import net.minecraft.client.resources.model.ResolvableModel; @@ -48,12 +47,12 @@ public class CustomModelManager { this.codec = codec; this.bake = bake; - this.missingModelKey = ClientPlatformHelper.get().createModelKey(MissingBlockModel.LOCATION, () -> "Missing " + kind); + this.missingModelKey = ClientPlatformHelper.get().createModelKey(() -> "Missing " + kind); this.missingModel = missingModel; } private ModelKey getModelKey(ResourceLocation id) { - return modelKeys.computeIfAbsent(id, o -> ClientPlatformHelper.get().createModelKey(o, () -> kind + " " + o)); + return modelKeys.computeIfAbsent(id, o -> ClientPlatformHelper.get().createModelKey(() -> kind + " " + o)); } /** diff --git a/projects/common/src/client/java/dan200/computercraft/client/platform/ClientPlatformHelper.java b/projects/common/src/client/java/dan200/computercraft/client/platform/ClientPlatformHelper.java index badf19207..adb7a1bfe 100644 --- a/projects/common/src/client/java/dan200/computercraft/client/platform/ClientPlatformHelper.java +++ b/projects/common/src/client/java/dan200/computercraft/client/platform/ClientPlatformHelper.java @@ -6,7 +6,6 @@ package dan200.computercraft.client.platform; import dan200.computercraft.impl.Services; import net.minecraft.client.resources.model.ModelDebugName; -import net.minecraft.resources.ResourceLocation; import org.jetbrains.annotations.Contract; import org.jspecify.annotations.Nullable; @@ -19,13 +18,12 @@ public interface ClientPlatformHelper { /** * Create a new unique {@link ModelKey}. * - * @param id An identifier for this model key. * @param name The debug name for this model key. * @param The type of baked model. * @return The newly created model key. */ - @Contract("_, _ -> new") - ModelKey createModelKey(ResourceLocation id, ModelDebugName name); + @Contract("_ -> new") + ModelKey createModelKey(ModelDebugName name); final class Instance { static final @Nullable ClientPlatformHelper INSTANCE; diff --git a/projects/fabric/src/client/java/dan200/computercraft/client/platform/ClientPlatformHelperImpl.java b/projects/fabric/src/client/java/dan200/computercraft/client/platform/ClientPlatformHelperImpl.java index 1ed5cd6eb..be7fa4102 100644 --- a/projects/fabric/src/client/java/dan200/computercraft/client/platform/ClientPlatformHelperImpl.java +++ b/projects/fabric/src/client/java/dan200/computercraft/client/platform/ClientPlatformHelperImpl.java @@ -7,12 +7,11 @@ package dan200.computercraft.client.platform; import com.google.auto.service.AutoService; import net.fabricmc.fabric.api.client.model.loading.v1.ExtraModelKey; import net.minecraft.client.resources.model.ModelDebugName; -import net.minecraft.resources.ResourceLocation; @AutoService(ClientPlatformHelper.class) public class ClientPlatformHelperImpl implements ClientPlatformHelper { @Override - public ModelKey createModelKey(ResourceLocation id, ModelDebugName name) { + public ModelKey createModelKey(ModelDebugName name) { return new FabricModelKey<>(ExtraModelKey.create(name::debugName)); } } diff --git a/projects/forge/src/client/java/dan200/computercraft/client/ForgeClientRegistry.java b/projects/forge/src/client/java/dan200/computercraft/client/ForgeClientRegistry.java index 43df90c8b..95f85b140 100644 --- a/projects/forge/src/client/java/dan200/computercraft/client/ForgeClientRegistry.java +++ b/projects/forge/src/client/java/dan200/computercraft/client/ForgeClientRegistry.java @@ -33,7 +33,7 @@ import java.util.function.BiFunction; /** * Registers textures and models for items. */ -@EventBusSubscriber(modid = ComputerCraftAPI.MOD_ID, value = Dist.CLIENT, bus = EventBusSubscriber.Bus.MOD) +@EventBusSubscriber(modid = ComputerCraftAPI.MOD_ID, value = Dist.CLIENT) public final class ForgeClientRegistry { static final ContextKey ITEM_FRAME_STATE = new ContextKey<>(ResourceLocation.fromNamespaceAndPath(ComputerCraftAPI.MOD_ID, "item_frame")); diff --git a/projects/forge/src/client/java/dan200/computercraft/client/platform/ClientPlatformHelperImpl.java b/projects/forge/src/client/java/dan200/computercraft/client/platform/ClientPlatformHelperImpl.java index 0e53b5307..5c627d8d3 100644 --- a/projects/forge/src/client/java/dan200/computercraft/client/platform/ClientPlatformHelperImpl.java +++ b/projects/forge/src/client/java/dan200/computercraft/client/platform/ClientPlatformHelperImpl.java @@ -6,13 +6,12 @@ package dan200.computercraft.client.platform; import com.google.auto.service.AutoService; import net.minecraft.client.resources.model.ModelDebugName; -import net.minecraft.resources.ResourceLocation; import net.neoforged.neoforge.client.model.standalone.StandaloneModelKey; @AutoService(ClientPlatformHelper.class) public class ClientPlatformHelperImpl implements ClientPlatformHelper { @Override - public ModelKey createModelKey(ResourceLocation id, ModelDebugName name) { - return new ForgeModelKey<>(new StandaloneModelKey(id)); + public ModelKey createModelKey(ModelDebugName name) { + return new ForgeModelKey<>(new StandaloneModelKey(name)); } } diff --git a/projects/forge/src/datagen/java/dan200/computercraft/data/ForgeDataProviders.java b/projects/forge/src/datagen/java/dan200/computercraft/data/ForgeDataProviders.java index 839e72807..817dbd8f7 100644 --- a/projects/forge/src/datagen/java/dan200/computercraft/data/ForgeDataProviders.java +++ b/projects/forge/src/datagen/java/dan200/computercraft/data/ForgeDataProviders.java @@ -31,7 +31,7 @@ import java.util.concurrent.CompletableFuture; import java.util.function.BiConsumer; import java.util.function.Consumer; -@EventBusSubscriber(bus = EventBusSubscriber.Bus.MOD) +@EventBusSubscriber public class ForgeDataProviders { @SubscribeEvent public static void gather(GatherDataEvent.Client event) { diff --git a/projects/forge/src/examples/java/com/example/examplemod/ForgeExampleModDataGenerator.java b/projects/forge/src/examples/java/com/example/examplemod/ForgeExampleModDataGenerator.java index a47bd612d..bbf54bcb9 100644 --- a/projects/forge/src/examples/java/com/example/examplemod/ForgeExampleModDataGenerator.java +++ b/projects/forge/src/examples/java/com/example/examplemod/ForgeExampleModDataGenerator.java @@ -17,7 +17,7 @@ import java.util.concurrent.CompletableFuture; /** * Data generators for the Forge version of our example mod. */ -@EventBusSubscriber(bus = EventBusSubscriber.Bus.MOD) +@EventBusSubscriber public class ForgeExampleModDataGenerator { @SubscribeEvent public static void gather(GatherDataEvent.Client event) { diff --git a/projects/forge/src/main/java/dan200/computercraft/ComputerCraft.java b/projects/forge/src/main/java/dan200/computercraft/ComputerCraft.java index 90231f037..5913a335c 100644 --- a/projects/forge/src/main/java/dan200/computercraft/ComputerCraft.java +++ b/projects/forge/src/main/java/dan200/computercraft/ComputerCraft.java @@ -66,7 +66,7 @@ import java.util.List; import java.util.function.BiFunction; @Mod(ComputerCraftAPI.MOD_ID) -@EventBusSubscriber(modid = ComputerCraftAPI.MOD_ID, bus = EventBusSubscriber.Bus.MOD) +@EventBusSubscriber(modid = ComputerCraftAPI.MOD_ID) public final class ComputerCraft { private static @Nullable IEventBus eventBus;