diff --git a/gradle.properties b/gradle.properties index f7783ba..379272b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,17 +3,17 @@ org.gradle.jvmargs = -Xmx1G org.gradle.parallel = true # Fabric Properties -loom_version = 1.6.11 -minecraft_version = 1.21 -yarn_mappings = 1.21+build.1 -loader_version = 0.15.11 +loom_version = 1.8.12 +minecraft_version = 1.21.3 +yarn_mappings = 1.21.3+build.2 +loader_version = 0.16.9 # Mod Properties mod_version = 3.0.0-beta.6 -mod_minecraft_version = 1.21 +mod_minecraft_version = 1.21.3 maven_group = me.pepperbell archives_base_name = continuity # Dependencies -fabric_version = 0.100.1+1.21 -modmenu_version = 11.0.0-beta.1 +fabric_version = 0.107.3+1.21.3 +modmenu_version = 12.0.0-beta.1 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e644113..a4b76b9 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b82aa23..df97d72 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.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 1aa94a4..f5feea6 100755 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -84,7 +86,8 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum diff --git a/gradlew.bat b/gradlew.bat index 25da30d..9d21a21 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## diff --git a/src/main/java/me/pepperbell/continuity/client/mixin/BakedModelManagerMixin.java b/src/main/java/me/pepperbell/continuity/client/mixin/BakedModelManagerMixin.java index de7740f..33d22bc 100644 --- a/src/main/java/me/pepperbell/continuity/client/mixin/BakedModelManagerMixin.java +++ b/src/main/java/me/pepperbell/continuity/client/mixin/BakedModelManagerMixin.java @@ -14,9 +14,11 @@ import com.llamalad7.mixinextras.injector.ModifyReturnValue; +import it.unimi.dsi.fastutil.objects.Object2IntMap; import me.pepperbell.continuity.client.resource.BakedModelManagerReloadExtension; +import net.minecraft.block.BlockState; import net.minecraft.client.render.model.BakedModelManager; -import net.minecraft.client.render.model.ModelLoader; +import net.minecraft.client.render.model.ModelBaker; import net.minecraft.client.render.model.SpriteAtlasManager; import net.minecraft.resource.ResourceManager; import net.minecraft.resource.ResourceReloader; @@ -29,8 +31,8 @@ abstract class BakedModelManagerMixin { @Nullable private volatile BakedModelManagerReloadExtension continuity$reloadExtension; - @Inject(method = "reload(Lnet/minecraft/resource/ResourceReloader$Synchronizer;Lnet/minecraft/resource/ResourceManager;Lnet/minecraft/util/profiler/Profiler;Lnet/minecraft/util/profiler/Profiler;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;", at = @At("HEAD")) - private void continuity$onHeadReload(ResourceReloader.Synchronizer synchronizer, ResourceManager resourceManager, Profiler prepareProfiler, Profiler applyProfiler, Executor prepareExecutor, Executor applyExecutor, CallbackInfoReturnable> cir) { + @Inject(method = "reload(Lnet/minecraft/resource/ResourceReloader$Synchronizer;Lnet/minecraft/resource/ResourceManager;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;", at = @At("HEAD")) + private void continuity$onHeadReload(ResourceReloader.Synchronizer synchronizer, ResourceManager resourceManager, Executor prepareExecutor, Executor applyExecutor, CallbackInfoReturnable> cir) { continuity$reloadExtension = new BakedModelManagerReloadExtension(resourceManager, prepareExecutor); BakedModelManagerReloadExtension reloadExtension = continuity$reloadExtension; @@ -39,7 +41,7 @@ abstract class BakedModelManagerMixin { } } - @Inject(method = "reload(Lnet/minecraft/resource/ResourceReloader$Synchronizer;Lnet/minecraft/resource/ResourceManager;Lnet/minecraft/util/profiler/Profiler;Lnet/minecraft/util/profiler/Profiler;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;", at = @At("RETURN")) + @Inject(method = "reload(Lnet/minecraft/resource/ResourceReloader$Synchronizer;Lnet/minecraft/resource/ResourceManager;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;", at = @At("RETURN")) private void continuity$onReturnReload(CallbackInfoReturnable> cir) { BakedModelManagerReloadExtension reloadExtension = continuity$reloadExtension; if (reloadExtension != null) { @@ -47,16 +49,16 @@ abstract class BakedModelManagerMixin { } } - @ModifyReturnValue(method = "reload(Lnet/minecraft/resource/ResourceReloader$Synchronizer;Lnet/minecraft/resource/ResourceManager;Lnet/minecraft/util/profiler/Profiler;Lnet/minecraft/util/profiler/Profiler;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;", at = @At("RETURN")) + @ModifyReturnValue(method = "reload(Lnet/minecraft/resource/ResourceReloader$Synchronizer;Lnet/minecraft/resource/ResourceManager;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;", at = @At("RETURN")) private CompletableFuture continuity$modifyReturnReload(CompletableFuture original) { return original.thenRun(() -> continuity$reloadExtension = null); } - @Inject(method = "bake(Lnet/minecraft/util/profiler/Profiler;Ljava/util/Map;Lnet/minecraft/client/render/model/ModelLoader;)Lnet/minecraft/client/render/model/BakedModelManager$BakingResult;", at = @At("HEAD")) - private void continuity$onHeadBake(Profiler profiler, Map preparations, ModelLoader modelLoader, CallbackInfoReturnable cir) { + @Inject(method = "bake(Lnet/minecraft/util/profiler/Profiler;Ljava/util/Map;Lnet/minecraft/client/render/model/ModelBaker;Lit/unimi/dsi/fastutil/objects/Object2IntMap;)Lnet/minecraft/client/render/model/BakedModelManager$BakingResult;", at = @At("HEAD")) + private void continuity$onHeadBake(Profiler profiler, Map preparations, ModelBaker bakery, Object2IntMap modelGroups, CallbackInfoReturnable cir) { BakedModelManagerReloadExtension reloadExtension = continuity$reloadExtension; if (reloadExtension != null) { - reloadExtension.beforeBaking(preparations, modelLoader); + reloadExtension.beforeBaking(preparations); } } diff --git a/src/main/java/me/pepperbell/continuity/client/mixin/FallingBlockEntityRendererMixin.java b/src/main/java/me/pepperbell/continuity/client/mixin/FallingBlockEntityRendererMixin.java index 8c4b31d..f5299b7 100644 --- a/src/main/java/me/pepperbell/continuity/client/mixin/FallingBlockEntityRendererMixin.java +++ b/src/main/java/me/pepperbell/continuity/client/mixin/FallingBlockEntityRendererMixin.java @@ -10,14 +10,14 @@ @Mixin(FallingBlockEntityRenderer.class) abstract class FallingBlockEntityRendererMixin { - @Inject(method = "render(Lnet/minecraft/entity/FallingBlockEntity;FFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/block/BlockModelRenderer;render(Lnet/minecraft/world/BlockRenderView;Lnet/minecraft/client/render/model/BakedModel;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;ZLnet/minecraft/util/math/random/Random;JI)V")) + @Inject(method = "render(Lnet/minecraft/client/render/entity/state/FallingBlockEntityRenderState;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/block/BlockModelRenderer;render(Lnet/minecraft/world/BlockRenderView;Lnet/minecraft/client/render/model/BakedModel;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;ZLnet/minecraft/util/math/random/Random;JI)V")) private void continuity$beforeRenderModel(CallbackInfo ci) { ContinuityFeatureStates states = ContinuityFeatureStates.get(); states.getConnectedTexturesState().disable(); states.getEmissiveTexturesState().disable(); } - @Inject(method = "render(Lnet/minecraft/entity/FallingBlockEntity;FFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/block/BlockModelRenderer;render(Lnet/minecraft/world/BlockRenderView;Lnet/minecraft/client/render/model/BakedModel;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;ZLnet/minecraft/util/math/random/Random;JI)V", shift = At.Shift.AFTER)) + @Inject(method = "render(Lnet/minecraft/client/render/entity/state/FallingBlockEntityRenderState;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/block/BlockModelRenderer;render(Lnet/minecraft/world/BlockRenderView;Lnet/minecraft/client/render/model/BakedModel;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;ZLnet/minecraft/util/math/random/Random;JI)V", shift = At.Shift.AFTER)) private void continuity$afterRenderModel(CallbackInfo ci) { ContinuityFeatureStates states = ContinuityFeatureStates.get(); states.getConnectedTexturesState().enable(); diff --git a/src/main/java/me/pepperbell/continuity/client/mixin/ModelLoaderMixin.java b/src/main/java/me/pepperbell/continuity/client/mixin/ModelLoaderMixin.java deleted file mode 100644 index 22e2fa2..0000000 --- a/src/main/java/me/pepperbell/continuity/client/mixin/ModelLoaderMixin.java +++ /dev/null @@ -1,27 +0,0 @@ -package me.pepperbell.continuity.client.mixin; - -import org.jetbrains.annotations.Nullable; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Unique; - -import me.pepperbell.continuity.client.mixinterface.ModelLoaderExtension; -import me.pepperbell.continuity.client.resource.ModelWrappingHandler; -import net.minecraft.client.render.model.ModelLoader; - -@Mixin(ModelLoader.class) -abstract class ModelLoaderMixin implements ModelLoaderExtension { - @Unique - @Nullable - private ModelWrappingHandler continuity$modelWrappingHandler; - - @Override - @Nullable - public ModelWrappingHandler continuity$getModelWrappingHandler() { - return continuity$modelWrappingHandler; - } - - @Override - public void continuity$setModelWrappingHandler(@Nullable ModelWrappingHandler handler) { - this.continuity$modelWrappingHandler = handler; - } -} diff --git a/src/main/java/me/pepperbell/continuity/client/mixinterface/ModelLoaderExtension.java b/src/main/java/me/pepperbell/continuity/client/mixinterface/ModelLoaderExtension.java deleted file mode 100644 index 0a96e03..0000000 --- a/src/main/java/me/pepperbell/continuity/client/mixinterface/ModelLoaderExtension.java +++ /dev/null @@ -1,12 +0,0 @@ -package me.pepperbell.continuity.client.mixinterface; - -import org.jetbrains.annotations.Nullable; - -import me.pepperbell.continuity.client.resource.ModelWrappingHandler; - -public interface ModelLoaderExtension { - @Nullable - ModelWrappingHandler continuity$getModelWrappingHandler(); - - void continuity$setModelWrappingHandler(@Nullable ModelWrappingHandler handler); -} diff --git a/src/main/java/me/pepperbell/continuity/client/processor/overlay/StandardOverlayQuadProcessor.java b/src/main/java/me/pepperbell/continuity/client/processor/overlay/StandardOverlayQuadProcessor.java index dd3c6cf..90eb586 100644 --- a/src/main/java/me/pepperbell/continuity/client/processor/overlay/StandardOverlayQuadProcessor.java +++ b/src/main/java/me/pepperbell/continuity/client/processor/overlay/StandardOverlayQuadProcessor.java @@ -126,7 +126,7 @@ protected boolean appliesOverlayCorner(Direction dir0, Direction dir1, BlockPos. BlockState otherAppearanceState = otherState.getAppearance(blockView, mutablePos, lightFace, state, pos); if (appliesOverlay(otherAppearanceState, otherState, mutablePos, blockView, appearanceState, state, pos, lightFace, quadSprite)) { mutablePos.move(lightFace); - return !blockView.getBlockState(mutablePos).isOpaqueFullCube(blockView, mutablePos); + return !blockView.getBlockState(mutablePos).isOpaqueFullCube(); } return false; } @@ -219,7 +219,7 @@ protected OverlayEmitter getEmitter(BlockRenderView blockView, BlockState appear mutablePos.set(pos, directions[0]).move(lightFace); BlockState appearanceState0; - if (!blockView.getBlockState(mutablePos).isOpaqueFullCube(blockView, mutablePos)) { + if (!blockView.getBlockState(mutablePos).isOpaqueFullCube()) { mutablePos.set(pos, directions[0]); BlockState state0 = blockView.getBlockState(mutablePos); appearanceState0 = state0.getAppearance(blockView, mutablePos, lightFace, state, pos); @@ -232,7 +232,7 @@ protected OverlayEmitter getEmitter(BlockRenderView blockView, BlockState appear mutablePos.set(pos, directions[1]).move(lightFace); BlockState appearanceState1; - if (!blockView.getBlockState(mutablePos).isOpaqueFullCube(blockView, mutablePos)) { + if (!blockView.getBlockState(mutablePos).isOpaqueFullCube()) { mutablePos.set(pos, directions[1]); BlockState state1 = blockView.getBlockState(mutablePos); appearanceState1 = state1.getAppearance(blockView, mutablePos, lightFace, state, pos); @@ -245,7 +245,7 @@ protected OverlayEmitter getEmitter(BlockRenderView blockView, BlockState appear mutablePos.set(pos, directions[2]).move(lightFace); BlockState appearanceState2; - if (!blockView.getBlockState(mutablePos).isOpaqueFullCube(blockView, mutablePos)) { + if (!blockView.getBlockState(mutablePos).isOpaqueFullCube()) { mutablePos.set(pos, directions[2]); BlockState state2 = blockView.getBlockState(mutablePos); appearanceState2 = state2.getAppearance(blockView, mutablePos, lightFace, state, pos); @@ -258,7 +258,7 @@ protected OverlayEmitter getEmitter(BlockRenderView blockView, BlockState appear mutablePos.set(pos, directions[3]).move(lightFace); BlockState appearanceState3; - if (!blockView.getBlockState(mutablePos).isOpaqueFullCube(blockView, mutablePos)) { + if (!blockView.getBlockState(mutablePos).isOpaqueFullCube()) { mutablePos.set(pos, directions[3]); BlockState state3 = blockView.getBlockState(mutablePos); appearanceState3 = state3.getAppearance(blockView, mutablePos, lightFace, state, pos); diff --git a/src/main/java/me/pepperbell/continuity/client/resource/BakedModelManagerReloadExtension.java b/src/main/java/me/pepperbell/continuity/client/resource/BakedModelManagerReloadExtension.java index 2419ffe..1c165b2 100644 --- a/src/main/java/me/pepperbell/continuity/client/resource/BakedModelManagerReloadExtension.java +++ b/src/main/java/me/pepperbell/continuity/client/resource/BakedModelManagerReloadExtension.java @@ -10,9 +10,7 @@ import org.jetbrains.annotations.Nullable; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; -import me.pepperbell.continuity.client.mixinterface.ModelLoaderExtension; import me.pepperbell.continuity.client.model.QuadProcessors; -import net.minecraft.client.render.model.ModelLoader; import net.minecraft.client.render.model.SpriteAtlasManager; import net.minecraft.client.texture.Sprite; import net.minecraft.client.texture.SpriteAtlasTexture; @@ -29,6 +27,7 @@ public BakedModelManagerReloadExtension(ResourceManager resourceManager, Executo ctmLoadingResultFuture = CompletableFuture.supplyAsync(() -> CtmPropertiesLoader.loadAllWithState(resourceManager), prepareExecutor); spriteLoaderLoadContext = new SpriteLoaderLoadContextImpl(ctmLoadingResultFuture.thenApply(CtmPropertiesLoader.LoadingResult::getTextureDependencies), wrapEmissiveModels); EmissiveSuffixLoader.load(resourceManager); + ModelWrappingHandler.resetInstance(); } public void setContext() { @@ -39,7 +38,7 @@ public void clearContext() { SpriteLoaderLoadContext.THREAD_LOCAL.set(null); } - public void beforeBaking(Map preparations, ModelLoader modelLoader) { + public void beforeBaking(Map preparations) { CtmPropertiesLoader.LoadingResult result = ctmLoadingResultFuture.join(); List processorHolders = result.createProcessorHolders(spriteId -> { @@ -53,8 +52,7 @@ public void beforeBaking(Map pr this.processorHolders = processorHolders; - ModelWrappingHandler wrappingHandler = ModelWrappingHandler.create(!processorHolders.isEmpty(), wrapEmissiveModels.get()); - ((ModelLoaderExtension) modelLoader).continuity$setModelWrappingHandler(wrappingHandler); + ModelWrappingHandler.setInstance(!processorHolders.isEmpty(), wrapEmissiveModels.get()); } public void apply() { diff --git a/src/main/java/me/pepperbell/continuity/client/resource/CustomBlockLayers.java b/src/main/java/me/pepperbell/continuity/client/resource/CustomBlockLayers.java index 9f33cc3..717a574 100644 --- a/src/main/java/me/pepperbell/continuity/client/resource/CustomBlockLayers.java +++ b/src/main/java/me/pepperbell/continuity/client/resource/CustomBlockLayers.java @@ -19,8 +19,6 @@ import net.minecraft.resource.ResourceManager; import net.minecraft.resource.ResourceType; import net.minecraft.util.Identifier; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.EmptyBlockView; public final class CustomBlockLayers { public static final Identifier LOCATION = Identifier.ofVanilla("optifine/block.properties"); @@ -42,7 +40,7 @@ public static boolean isEmpty() { @Nullable public static RenderLayer getLayer(BlockState state) { if (!disableSolidCheck) { - if (state.isOpaqueFullCube(EmptyBlockView.INSTANCE, BlockPos.ORIGIN)) { + if (state.isOpaqueFullCube()) { return null; } } diff --git a/src/main/java/me/pepperbell/continuity/client/resource/ModelWrappingHandler.java b/src/main/java/me/pepperbell/continuity/client/resource/ModelWrappingHandler.java index d610558..817dd86 100644 --- a/src/main/java/me/pepperbell/continuity/client/resource/ModelWrappingHandler.java +++ b/src/main/java/me/pepperbell/continuity/client/resource/ModelWrappingHandler.java @@ -6,7 +6,6 @@ import com.google.common.collect.ImmutableMap; -import me.pepperbell.continuity.client.mixinterface.ModelLoaderExtension; import me.pepperbell.continuity.client.model.CtmBakedModel; import me.pepperbell.continuity.client.model.EmissiveBakedModel; import net.fabricmc.fabric.api.client.model.loading.v1.ModelLoadingPlugin; @@ -15,12 +14,15 @@ import net.minecraft.block.BlockState; import net.minecraft.client.render.block.BlockModels; import net.minecraft.client.render.model.BakedModel; -import net.minecraft.client.render.model.ModelLoader; +import net.minecraft.client.render.model.MissingModel; import net.minecraft.client.util.ModelIdentifier; import net.minecraft.registry.Registries; import net.minecraft.util.Identifier; public class ModelWrappingHandler { + @Nullable + private static volatile ModelWrappingHandler instance; + private final boolean wrapCtm; private final boolean wrapEmissive; private final ImmutableMap blockStateModelIds; @@ -32,11 +34,19 @@ private ModelWrappingHandler(boolean wrapCtm, boolean wrapEmissive) { } @Nullable - public static ModelWrappingHandler create(boolean wrapCtm, boolean wrapEmissive) { + public static ModelWrappingHandler getInstance() { + return instance; + } + + public static void setInstance(boolean wrapCtm, boolean wrapEmissive) { if (!wrapCtm && !wrapEmissive) { - return null; + return; } - return new ModelWrappingHandler(wrapCtm, wrapEmissive); + instance = new ModelWrappingHandler(wrapCtm, wrapEmissive); + } + + public static void resetInstance() { + instance = null; } private static ImmutableMap createBlockStateModelIdMap() { @@ -53,7 +63,7 @@ private static ImmutableMap createBlockStateModelId } public BakedModel wrap(@Nullable BakedModel model, @UnknownNullability Identifier resourceId, @UnknownNullability ModelIdentifier topLevelId) { - if (model != null && !model.isBuiltin() && (resourceId == null || !resourceId.equals(ModelLoader.MISSING_ID))) { + if (model != null && !model.isBuiltin() && (resourceId == null || !resourceId.equals(MissingModel.ID))) { if (wrapCtm) { if (topLevelId != null) { BlockState state = blockStateModelIds.get(topLevelId); @@ -73,8 +83,7 @@ public BakedModel wrap(@Nullable BakedModel model, @UnknownNullability Identifie public static void init() { ModelLoadingPlugin.register(pluginCtx -> { pluginCtx.modifyModelAfterBake().register(ModelModifier.WRAP_LAST_PHASE, (model, ctx) -> { - ModelLoader modelLoader = ctx.loader(); - ModelWrappingHandler wrappingHandler = ((ModelLoaderExtension) modelLoader).continuity$getModelWrappingHandler(); + ModelWrappingHandler wrappingHandler = getInstance(); if (wrappingHandler != null) { return wrappingHandler.wrap(model, ctx.resourceId(), ctx.topLevelId()); } diff --git a/src/main/java/me/pepperbell/continuity/client/util/biome/BiomeHolderManager.java b/src/main/java/me/pepperbell/continuity/client/util/biome/BiomeHolderManager.java index d4fd669..7873c93 100644 --- a/src/main/java/me/pepperbell/continuity/client/util/biome/BiomeHolderManager.java +++ b/src/main/java/me/pepperbell/continuity/client/util/biome/BiomeHolderManager.java @@ -39,7 +39,7 @@ public static void refreshHolders() { } Map compactIdMap = new Object2ObjectOpenHashMap<>(); - Registry biomeRegistry = registryManager.get(RegistryKeys.BIOME); + Registry biomeRegistry = registryManager.getOrThrow(RegistryKeys.BIOME); for (Identifier id : biomeRegistry.getIds()) { String path = id.getPath(); String compactPath = path.replace("_", ""); diff --git a/src/main/resources/continuity.mixins.json b/src/main/resources/continuity.mixins.json index 5c217b7..1d2c153 100644 --- a/src/main/resources/continuity.mixins.json +++ b/src/main/resources/continuity.mixins.json @@ -10,7 +10,6 @@ "FallingBlockEntityRendererMixin", "IdentifierMixin", "LifecycledResourceManagerImplMixin", - "ModelLoaderMixin", "NamespaceResourceManagerMixin", "PistonBlockEntityRendererMixin", "ReloadableResourceManagerImplAccessor", diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index d38d133..8c9da71 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -31,7 +31,7 @@ ], "depends": { - "minecraft": ">=1.21 <=1.21.1", + "minecraft": ">=1.21.3", "fabricloader": ">=0.15.0", "fabric-api": ">=0.100.1" }, diff --git a/src/main/resources/resourcepacks/default/pack.mcmeta b/src/main/resources/resourcepacks/default/pack.mcmeta index dd18aac..4953e5f 100644 --- a/src/main/resources/resourcepacks/default/pack.mcmeta +++ b/src/main/resources/resourcepacks/default/pack.mcmeta @@ -1,6 +1,7 @@ { "pack": { - "pack_format": 34, + "pack_format": 42, + "supported_formats": [42, 999], "description": { "translate": "resourcePack.continuity.default.description" } diff --git a/src/main/resources/resourcepacks/glass_pane_culling_fix/pack.mcmeta b/src/main/resources/resourcepacks/glass_pane_culling_fix/pack.mcmeta index 4ab5b50..c09e24f 100644 --- a/src/main/resources/resourcepacks/glass_pane_culling_fix/pack.mcmeta +++ b/src/main/resources/resourcepacks/glass_pane_culling_fix/pack.mcmeta @@ -1,6 +1,7 @@ { "pack": { - "pack_format": 34, + "pack_format": 42, + "supported_formats": [42, 999], "description": { "translate": "resourcePack.continuity.glass_pane_culling_fix.description" }