From 2be899094a328effce684e986008295d07e46622 Mon Sep 17 00:00:00 2001 From: modmuss Date: Wed, 21 Aug 2024 18:25:15 +0100 Subject: [PATCH] 24w34a (#4046) Co-authored-by: PepperCode1 <44146161+peppercode1@users.noreply.github.com> --- ...erMixin.java => SerializedChunkMixin.java} | 22 +++--- .../fabric-data-attachment-api-v1.mixins.json | 2 +- .../item/ArmorKnockbackResistanceTest.java | 16 ++-- .../client/ClientChunkManagerMixin.java | 2 +- .../loading/v1/DelegatingUnbakedModel.java | 4 +- .../loading/ModelLoadingEventDispatcher.java | 4 +- .../model/loading/BakedModelManagerMixin.java | 20 ++--- .../loading/ModelLoaderBakerImplMixin.java | 8 +- .../model/loading/ModelLoaderMixin.java | 12 +-- ...va => ReferencedModelsCollectorMixin.java} | 22 +++--- .../fabric-model-loading-api-v1.mixins.json | 2 +- .../model/loading/ModelTestModClient.java | 6 +- .../registry/sync/FabricRegistryInit.java | 4 + ...erMixin.java => SerializedChunkMixin.java} | 6 +- .../fabric-registry-sync-v0.mixins.json | 2 +- .../api/renderer/v1/mesh/MutableQuadView.java | 25 +------ .../api/renderer/v1/mesh/QuadEmitter.java | 10 +-- .../impl/renderer/VanillaModelEncoder.java | 2 +- .../renderer/client/FrameUnbakedModel.java | 2 +- .../client/OctagonalColumnUnbakedModel.java | 2 +- .../renderer/client/PillarUnbakedModel.java | 2 +- .../client/RiverstoneUnbakedModel.java | 6 +- .../indigo/renderer/aocalc/AoCalculator.java | 32 +------- .../renderer/aocalc/VanillaAoHelper.java | 2 +- .../renderer/mesh/MutableQuadViewImpl.java | 6 +- .../renderer/render/ItemRenderContext.java | 75 +++++-------------- .../client/rendering/FabricShaderProgram.java | 45 ----------- .../client/rendering/WorldRendererMixin.java | 6 +- .../rendering/shader/GameRendererMixin.java | 53 ------------- .../ShaderProgramImportProcessorMixin.java | 57 -------------- .../rendering/shader/ShaderProgramMixin.java | 68 ----------------- .../resources/fabric-rendering-v1.mixins.json | 5 +- .../rendering/TooltipComponentTestInit.java | 16 ++-- .../client/DimensionalRenderingTest.java | 4 +- .../rendering/client/HudAndShaderTest.java | 15 +--- .../client/WorldRenderEventsTests.java | 4 +- .../ingame/client/FluidVariantRenderTest.java | 4 +- ...ransitive-access-wideners-v1.accesswidener | 2 - gradle.properties | 40 +++++----- 39 files changed, 140 insertions(+), 475 deletions(-) rename fabric-data-attachment-api-v1/src/main/java/net/fabricmc/fabric/mixin/attachment/{ChunkSerializerMixin.java => SerializedChunkMixin.java} (84%) rename fabric-model-loading-api-v1/src/client/java/net/fabricmc/fabric/mixin/client/model/loading/{class_10097Mixin.java => ReferencedModelsCollectorMixin.java} (77%) rename fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/mixin/registry/sync/{ChunkSerializerMixin.java => SerializedChunkMixin.java} (91%) delete mode 100644 fabric-rendering-v1/src/client/java/net/fabricmc/fabric/impl/client/rendering/FabricShaderProgram.java delete mode 100644 fabric-rendering-v1/src/client/java/net/fabricmc/fabric/mixin/client/rendering/shader/GameRendererMixin.java delete mode 100644 fabric-rendering-v1/src/client/java/net/fabricmc/fabric/mixin/client/rendering/shader/ShaderProgramImportProcessorMixin.java delete mode 100644 fabric-rendering-v1/src/client/java/net/fabricmc/fabric/mixin/client/rendering/shader/ShaderProgramMixin.java diff --git a/fabric-data-attachment-api-v1/src/main/java/net/fabricmc/fabric/mixin/attachment/ChunkSerializerMixin.java b/fabric-data-attachment-api-v1/src/main/java/net/fabricmc/fabric/mixin/attachment/SerializedChunkMixin.java similarity index 84% rename from fabric-data-attachment-api-v1/src/main/java/net/fabricmc/fabric/mixin/attachment/ChunkSerializerMixin.java rename to fabric-data-attachment-api-v1/src/main/java/net/fabricmc/fabric/mixin/attachment/SerializedChunkMixin.java index de102d2ed..cc0e5f0f9 100644 --- a/fabric-data-attachment-api-v1/src/main/java/net/fabricmc/fabric/mixin/attachment/ChunkSerializerMixin.java +++ b/fabric-data-attachment-api-v1/src/main/java/net/fabricmc/fabric/mixin/attachment/SerializedChunkMixin.java @@ -30,37 +30,37 @@ import net.minecraft.nbt.NbtElement; import net.minecraft.registry.DynamicRegistryManager; import net.minecraft.server.world.ServerWorld; import net.minecraft.util.math.ChunkPos; -import net.minecraft.world.ChunkSerializer; import net.minecraft.world.HeightLimitView; import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.ProtoChunk; +import net.minecraft.world.chunk.SerializedChunk; import net.minecraft.world.poi.PointOfInterestStorage; import net.minecraft.world.storage.StorageKey; import net.fabricmc.fabric.api.attachment.v1.AttachmentTarget; import net.fabricmc.fabric.impl.attachment.AttachmentTargetImpl; -@Mixin(ChunkSerializer.class) -abstract class ChunkSerializerMixin { +@Mixin(SerializedChunk.class) +abstract class SerializedChunkMixin { // Adding a mutable record field like this is likely a bad idea, but I cannot see a better way. @Unique @Nullable private NbtCompound attachmentNbtData; - @Inject(method = "method_61794", at = @At("RETURN")) - private static void storeAttachmentNbtData(HeightLimitView heightLimitView, DynamicRegistryManager dynamicRegistryManager, NbtCompound nbt, CallbackInfoReturnable cir, @Share("attachmentDataNbt") LocalRef attachmentDataNbt) { - final ChunkSerializer serializer = cir.getReturnValue(); + @Inject(method = "fromNbt", at = @At("RETURN")) + private static void storeAttachmentNbtData(HeightLimitView heightLimitView, DynamicRegistryManager dynamicRegistryManager, NbtCompound nbt, CallbackInfoReturnable cir, @Share("attachmentDataNbt") LocalRef attachmentDataNbt) { + final SerializedChunk serializer = cir.getReturnValue(); if (serializer == null) { return; } if (nbt.contains(AttachmentTarget.NBT_ATTACHMENT_KEY, NbtElement.COMPOUND_TYPE)) { - ((ChunkSerializerMixin) (Object) serializer).attachmentNbtData = nbt.getCompound(AttachmentTarget.NBT_ATTACHMENT_KEY); + ((SerializedChunkMixin) (Object) serializer).attachmentNbtData = nbt.getCompound(AttachmentTarget.NBT_ATTACHMENT_KEY); } } - @Inject(method = "deserialize", at = @At("RETURN")) + @Inject(method = "convert", at = @At("RETURN")) private void setAttachmentDataInChunk(ServerWorld serverWorld, PointOfInterestStorage pointOfInterestStorage, StorageKey storageKey, ChunkPos chunkPos, CallbackInfoReturnable cir) { ProtoChunk chunk = cir.getReturnValue(); @@ -71,11 +71,11 @@ abstract class ChunkSerializerMixin { } } - @Inject(method = "method_61793", at = @At("RETURN")) - private static void storeAttachmentNbtData(ServerWorld world, Chunk chunk, CallbackInfoReturnable cir) { + @Inject(method = "fromChunk", at = @At("RETURN")) + private static void storeAttachmentNbtData(ServerWorld world, Chunk chunk, CallbackInfoReturnable cir) { var nbt = new NbtCompound(); ((AttachmentTargetImpl) chunk).fabric_writeAttachmentsToNbt(nbt, world.getRegistryManager()); - ((ChunkSerializerMixin) (Object) cir.getReturnValue()).attachmentNbtData = nbt.getCompound(AttachmentTarget.NBT_ATTACHMENT_KEY); + ((SerializedChunkMixin) (Object) cir.getReturnValue()).attachmentNbtData = nbt.getCompound(AttachmentTarget.NBT_ATTACHMENT_KEY); } @Inject(method = "serialize", at = @At("RETURN")) diff --git a/fabric-data-attachment-api-v1/src/main/resources/fabric-data-attachment-api-v1.mixins.json b/fabric-data-attachment-api-v1/src/main/resources/fabric-data-attachment-api-v1.mixins.json index 1ceeec076..788fef65f 100644 --- a/fabric-data-attachment-api-v1/src/main/resources/fabric-data-attachment-api-v1.mixins.json +++ b/fabric-data-attachment-api-v1/src/main/resources/fabric-data-attachment-api-v1.mixins.json @@ -6,7 +6,7 @@ "AttachmentTargetsMixin", "BannerBlockEntityMixin", "BlockEntityMixin", - "ChunkSerializerMixin", + "SerializedChunkMixin", "EntityMixin", "ServerWorldMixin", "WorldChunkMixin", diff --git a/fabric-item-api-v1/src/testmod/java/net/fabricmc/fabric/test/item/ArmorKnockbackResistanceTest.java b/fabric-item-api-v1/src/testmod/java/net/fabricmc/fabric/test/item/ArmorKnockbackResistanceTest.java index a59c314df..48dfcad3d 100644 --- a/fabric-item-api-v1/src/testmod/java/net/fabricmc/fabric/test/item/ArmorKnockbackResistanceTest.java +++ b/fabric-item-api-v1/src/testmod/java/net/fabricmc/fabric/test/item/ArmorKnockbackResistanceTest.java @@ -42,14 +42,14 @@ public class ArmorKnockbackResistanceTest implements ModInitializer { } private static ArmorMaterial createTestArmorMaterial() { - return new ArmorMaterial(Util.make(new EnumMap<>(ArmorItem.Type.class), (map) -> { - map.put(ArmorItem.Type.BOOTS, 1); - map.put(ArmorItem.Type.LEGGINGS, 2); - map.put(ArmorItem.Type.CHESTPLATE, 3); - map.put(ArmorItem.Type.HELMET, 1); - map.put(ArmorItem.Type.BODY, 3); - }), - 0, + return new ArmorMaterial( + Util.make(new EnumMap<>(ArmorItem.Type.class), (map) -> { + map.put(ArmorItem.Type.BOOTS, 1); + map.put(ArmorItem.Type.LEGGINGS, 2); + map.put(ArmorItem.Type.CHESTPLATE, 3); + map.put(ArmorItem.Type.HELMET, 1); + map.put(ArmorItem.Type.BODY, 3); + }), SoundEvents.ITEM_ARMOR_EQUIP_LEATHER, (stack) -> stack.getItem() == Items.LEATHER, List.of(new ArmorMaterial.Layer(Identifier.of("fabric-item-api-v1-testmod", "wood"))), diff --git a/fabric-lifecycle-events-v1/src/client/java/net/fabricmc/fabric/mixin/event/lifecycle/client/ClientChunkManagerMixin.java b/fabric-lifecycle-events-v1/src/client/java/net/fabricmc/fabric/mixin/event/lifecycle/client/ClientChunkManagerMixin.java index a477973d3..9b27fbb1e 100644 --- a/fabric-lifecycle-events-v1/src/client/java/net/fabricmc/fabric/mixin/event/lifecycle/client/ClientChunkManagerMixin.java +++ b/fabric-lifecycle-events-v1/src/client/java/net/fabricmc/fabric/mixin/event/lifecycle/client/ClientChunkManagerMixin.java @@ -55,7 +55,7 @@ public abstract class ClientChunkManagerMixin { } } - @Inject(method = "unload", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/world/ClientChunkManager$ClientChunkMap;compareAndSet(ILnet/minecraft/world/chunk/WorldChunk;Lnet/minecraft/world/chunk/WorldChunk;)Lnet/minecraft/world/chunk/WorldChunk;"), locals = LocalCapture.CAPTURE_FAILHARD) + @Inject(method = "unload", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/world/ClientChunkManager$ClientChunkMap;method_62893(ILnet/minecraft/world/chunk/WorldChunk;)V"), locals = LocalCapture.CAPTURE_FAILHARD) private void onChunkUnload(ChunkPos pos, CallbackInfo ci, int i, WorldChunk chunk) { ClientChunkEvents.CHUNK_UNLOAD.invoker().onChunkUnload(this.world, chunk); } diff --git a/fabric-model-loading-api-v1/src/client/java/net/fabricmc/fabric/api/client/model/loading/v1/DelegatingUnbakedModel.java b/fabric-model-loading-api-v1/src/client/java/net/fabricmc/fabric/api/client/model/loading/v1/DelegatingUnbakedModel.java index 4e2c80937..d361f16ee 100644 --- a/fabric-model-loading-api-v1/src/client/java/net/fabricmc/fabric/api/client/model/loading/v1/DelegatingUnbakedModel.java +++ b/fabric-model-loading-api-v1/src/client/java/net/fabricmc/fabric/api/client/model/loading/v1/DelegatingUnbakedModel.java @@ -46,8 +46,8 @@ public final class DelegatingUnbakedModel implements UnbakedModel { } @Override - public void method_62326(class_10103 arg, class_10102 arg2) { - arg.method_62642(delegate); + public void resolve(Resolver resolver, ModelType modelType) { + resolver.resolve(delegate); } @Override diff --git a/fabric-model-loading-api-v1/src/client/java/net/fabricmc/fabric/impl/client/model/loading/ModelLoadingEventDispatcher.java b/fabric-model-loading-api-v1/src/client/java/net/fabricmc/fabric/impl/client/model/loading/ModelLoadingEventDispatcher.java index 34daf56bf..b80ad7263 100644 --- a/fabric-model-loading-api-v1/src/client/java/net/fabricmc/fabric/impl/client/model/loading/ModelLoadingEventDispatcher.java +++ b/fabric-model-loading-api-v1/src/client/java/net/fabricmc/fabric/impl/client/model/loading/ModelLoadingEventDispatcher.java @@ -85,7 +85,7 @@ public class ModelLoadingEventDispatcher { } } - public BlockStatesLoader.class_10095 loadBlockStateModels() { + public BlockStatesLoader.BlockStateDefinition loadBlockStateModels() { Map map = new HashMap<>(); pluginContext.blockStateResolvers.forEach((block, resolver) -> { @@ -105,7 +105,7 @@ public class ModelLoadingEventDispatcher { resolveBlockStates(resolver, block, output); }); - return new BlockStatesLoader.class_10095(map); + return new BlockStatesLoader.BlockStateDefinition(map); } private void resolveBlockStates(BlockStateResolver resolver, Block block, BiConsumer output) { diff --git a/fabric-model-loading-api-v1/src/client/java/net/fabricmc/fabric/mixin/client/model/loading/BakedModelManagerMixin.java b/fabric-model-loading-api-v1/src/client/java/net/fabricmc/fabric/mixin/client/model/loading/BakedModelManagerMixin.java index 2d91f0782..9deb5efac 100644 --- a/fabric-model-loading-api-v1/src/client/java/net/fabricmc/fabric/mixin/client/model/loading/BakedModelManagerMixin.java +++ b/fabric-model-loading-api-v1/src/client/java/net/fabricmc/fabric/mixin/client/model/loading/BakedModelManagerMixin.java @@ -35,10 +35,10 @@ import org.spongepowered.asm.mixin.injection.ModifyArg; import org.spongepowered.asm.mixin.injection.Redirect; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import net.minecraft.class_10097; import net.minecraft.client.render.model.BakedModel; import net.minecraft.client.render.model.BakedModelManager; import net.minecraft.client.render.model.BlockStatesLoader; +import net.minecraft.client.render.model.ReferencedModelsCollector; import net.minecraft.client.render.model.UnbakedModel; import net.minecraft.client.util.ModelIdentifier; import net.minecraft.resource.ResourceManager; @@ -79,14 +79,14 @@ abstract class BakedModelManagerMixin implements FabricBakedModelManager { } @ModifyExpressionValue(method = "reload", at = @At(value = "INVOKE", target = "net/minecraft/client/render/model/BakedModelManager.reloadBlockStates(Lnet/minecraft/client/render/model/BlockStatesLoader;Lnet/minecraft/resource/ResourceManager;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;")) - private CompletableFuture hookBlockStateModelLoading(CompletableFuture modelsFuture) { - CompletableFuture resolvedModelsFuture = eventDispatcherFuture.thenApplyAsync(ModelLoadingEventDispatcher::loadBlockStateModels); + private CompletableFuture hookBlockStateModelLoading(CompletableFuture modelsFuture) { + CompletableFuture resolvedModelsFuture = eventDispatcherFuture.thenApplyAsync(ModelLoadingEventDispatcher::loadBlockStateModels); return modelsFuture.thenCombine(resolvedModelsFuture, (models, resolvedModels) -> { Map map = models.models(); if (!(map instanceof HashMap)) { map = new HashMap<>(map); - models = new BlockStatesLoader.class_10095(map); + models = new BlockStatesLoader.BlockStateDefinition(map); } map.putAll(resolvedModels.models()); @@ -102,17 +102,17 @@ abstract class BakedModelManagerMixin implements FabricBakedModelManager { ordinal = 0, remap = false )) - private CompletableFuture hookModelDiscovery( - CompletableFuture self, + private CompletableFuture hookModelDiscovery( + CompletableFuture self, CompletionStage> otherFuture, - BiFunction, class_10097> function, + BiFunction, ReferencedModelsCollector> function, Executor executor) { - CompletableFuture>> pairFuture = self.thenCombine(otherFuture, Pair::new); + CompletableFuture>> pairFuture = self.thenCombine(otherFuture, Pair::new); return pairFuture.thenCombineAsync(eventDispatcherFuture, (pair, eventDispatcher) -> { ModelLoadingEventDispatcher.CURRENT.set(eventDispatcher); - class_10097 class_10097 = function.apply(pair.getLeft(), pair.getRight()); + ReferencedModelsCollector referencedModelsCollector = function.apply(pair.getLeft(), pair.getRight()); ModelLoadingEventDispatcher.CURRENT.remove(); - return class_10097; + return referencedModelsCollector; }, executor); } diff --git a/fabric-model-loading-api-v1/src/client/java/net/fabricmc/fabric/mixin/client/model/loading/ModelLoaderBakerImplMixin.java b/fabric-model-loading-api-v1/src/client/java/net/fabricmc/fabric/mixin/client/model/loading/ModelLoaderBakerImplMixin.java index 9e207c323..2750e1d20 100644 --- a/fabric-model-loading-api-v1/src/client/java/net/fabricmc/fabric/mixin/client/model/loading/ModelLoaderBakerImplMixin.java +++ b/fabric-model-loading-api-v1/src/client/java/net/fabricmc/fabric/mixin/client/model/loading/ModelLoaderBakerImplMixin.java @@ -29,7 +29,7 @@ import org.spongepowered.asm.mixin.injection.Coerce; import net.minecraft.client.render.model.BakedModel; import net.minecraft.client.render.model.Baker; import net.minecraft.client.render.model.ModelBakeSettings; -import net.minecraft.client.render.model.ModelLoader; +import net.minecraft.client.render.model.ModelBaker; import net.minecraft.client.render.model.UnbakedModel; import net.minecraft.client.texture.Sprite; import net.minecraft.client.util.SpriteIdentifier; @@ -39,16 +39,16 @@ import net.fabricmc.fabric.impl.client.model.loading.BakerImplHooks; import net.fabricmc.fabric.impl.client.model.loading.ModelLoaderHooks; import net.fabricmc.fabric.impl.client.model.loading.ModelLoadingEventDispatcher; -@Mixin(targets = "net/minecraft/client/render/model/ModelLoader$BakerImpl") +@Mixin(targets = "net/minecraft/client/render/model/ModelBaker$BakerImpl") abstract class ModelLoaderBakerImplMixin implements BakerImplHooks { @Shadow @Final - private ModelLoader field_40571; + private ModelBaker field_40571; @Shadow @Final private Function textureGetter; - @WrapOperation(method = "bake(Lnet/minecraft/util/Identifier;Lnet/minecraft/client/render/model/ModelBakeSettings;)Lnet/minecraft/client/render/model/BakedModel;", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/model/ModelLoader$BakerImpl;bake(Lnet/minecraft/client/render/model/UnbakedModel;Lnet/minecraft/client/render/model/ModelBakeSettings;)Lnet/minecraft/client/render/model/BakedModel;")) + @WrapOperation(method = "bake(Lnet/minecraft/util/Identifier;Lnet/minecraft/client/render/model/ModelBakeSettings;)Lnet/minecraft/client/render/model/BakedModel;", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/model/ModelBaker$BakerImpl;bake(Lnet/minecraft/client/render/model/UnbakedModel;Lnet/minecraft/client/render/model/ModelBakeSettings;)Lnet/minecraft/client/render/model/BakedModel;")) private BakedModel wrapInnerBake(@Coerce Baker self, UnbakedModel unbakedModel, ModelBakeSettings settings, Operation operation, Identifier id) { ModelLoadingEventDispatcher dispatcher = ((ModelLoaderHooks) this.field_40571).fabric_getDispatcher(); unbakedModel = dispatcher.modifyModelBeforeBake(unbakedModel, id, null, textureGetter, settings, self); diff --git a/fabric-model-loading-api-v1/src/client/java/net/fabricmc/fabric/mixin/client/model/loading/ModelLoaderMixin.java b/fabric-model-loading-api-v1/src/client/java/net/fabricmc/fabric/mixin/client/model/loading/ModelLoaderMixin.java index 22d7f84f9..769125a2d 100644 --- a/fabric-model-loading-api-v1/src/client/java/net/fabricmc/fabric/mixin/client/model/loading/ModelLoaderMixin.java +++ b/fabric-model-loading-api-v1/src/client/java/net/fabricmc/fabric/mixin/client/model/loading/ModelLoaderMixin.java @@ -28,11 +28,11 @@ import org.spongepowered.asm.mixin.injection.Coerce; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import net.minecraft.class_10096; import net.minecraft.client.render.model.BakedModel; import net.minecraft.client.render.model.Baker; +import net.minecraft.client.render.model.MissingModel; import net.minecraft.client.render.model.ModelBakeSettings; -import net.minecraft.client.render.model.ModelLoader; +import net.minecraft.client.render.model.ModelBaker; import net.minecraft.client.render.model.UnbakedModel; import net.minecraft.client.texture.Sprite; import net.minecraft.client.util.ModelIdentifier; @@ -43,7 +43,7 @@ import net.fabricmc.fabric.impl.client.model.loading.ModelLoaderHooks; import net.fabricmc.fabric.impl.client.model.loading.ModelLoadingConstants; import net.fabricmc.fabric.impl.client.model.loading.ModelLoadingEventDispatcher; -@Mixin(ModelLoader.class) +@Mixin(ModelBaker.class) abstract class ModelLoaderMixin implements ModelLoaderHooks { @Unique @Nullable @@ -54,13 +54,13 @@ abstract class ModelLoaderMixin implements ModelLoaderHooks { fabric_eventDispatcher = ModelLoadingEventDispatcher.CURRENT.get(); } - @WrapOperation(method = "method_61072(Lnet/minecraft/client/render/model/ModelLoader$SpriteGetter;Lnet/minecraft/client/util/ModelIdentifier;Lnet/minecraft/client/render/model/UnbakedModel;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/model/ModelLoader$BakerImpl;bake(Lnet/minecraft/client/render/model/UnbakedModel;Lnet/minecraft/client/render/model/ModelBakeSettings;)Lnet/minecraft/client/render/model/BakedModel;")) - private BakedModel wrapSingleOuterBake(@Coerce Baker baker, UnbakedModel unbakedModel, ModelBakeSettings settings, Operation operation, ModelLoader.SpriteGetter spriteGetter, ModelIdentifier id) { + @WrapOperation(method = "method_61072", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/model/ModelBaker$BakerImpl;bake(Lnet/minecraft/client/render/model/UnbakedModel;Lnet/minecraft/client/render/model/ModelBakeSettings;)Lnet/minecraft/client/render/model/BakedModel;")) + private BakedModel wrapSingleOuterBake(@Coerce Baker baker, UnbakedModel unbakedModel, ModelBakeSettings settings, Operation operation, ModelBaker.SpriteGetter spriteGetter, ModelIdentifier id) { if (fabric_eventDispatcher == null) { return operation.call(baker, unbakedModel, settings); } - if (ModelLoadingConstants.isResourceModelId(id) || id.equals(class_10096.field_53661)) { + if (ModelLoadingConstants.isResourceModelId(id) || id.equals(MissingModel.MODEL_ID)) { // Call the baker instead of the operation to ensure the baked model is cached and doesn't end up going // through events twice. // This ignores the UnbakedModel in field_53662 (top-level model map) but it should be the same as the one in field_53663 (resource model map). diff --git a/fabric-model-loading-api-v1/src/client/java/net/fabricmc/fabric/mixin/client/model/loading/class_10097Mixin.java b/fabric-model-loading-api-v1/src/client/java/net/fabricmc/fabric/mixin/client/model/loading/ReferencedModelsCollectorMixin.java similarity index 77% rename from fabric-model-loading-api-v1/src/client/java/net/fabricmc/fabric/mixin/client/model/loading/class_10097Mixin.java rename to fabric-model-loading-api-v1/src/client/java/net/fabricmc/fabric/mixin/client/model/loading/ReferencedModelsCollectorMixin.java index 6bbf6e5d3..ac0ea35e8 100644 --- a/fabric-model-loading-api-v1/src/client/java/net/fabricmc/fabric/mixin/client/model/loading/class_10097Mixin.java +++ b/fabric-model-loading-api-v1/src/client/java/net/fabricmc/fabric/mixin/client/model/loading/ReferencedModelsCollectorMixin.java @@ -25,8 +25,8 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.ModifyVariable; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import net.minecraft.class_10097; import net.minecraft.client.render.model.BlockStatesLoader; +import net.minecraft.client.render.model.ReferencedModelsCollector; import net.minecraft.client.render.model.UnbakedModel; import net.minecraft.client.util.ModelIdentifier; import net.minecraft.util.Identifier; @@ -34,37 +34,37 @@ import net.minecraft.util.Identifier; import net.fabricmc.fabric.impl.client.model.loading.ModelLoadingConstants; import net.fabricmc.fabric.impl.client.model.loading.ModelLoadingEventDispatcher; -@Mixin(class_10097.class) -abstract class class_10097Mixin { +@Mixin(ReferencedModelsCollector.class) +abstract class ReferencedModelsCollectorMixin { @Unique @Nullable private ModelLoadingEventDispatcher fabric_eventDispatcher; @Shadow - abstract UnbakedModel method_62638(Identifier identifier); + abstract UnbakedModel computeResolvedModel(Identifier identifier); @Shadow - abstract void method_62635(ModelIdentifier modelIdentifier, UnbakedModel unbakedModel); + abstract void addTopLevelModel(ModelIdentifier modelIdentifier, UnbakedModel unbakedModel); @Inject(method = "", at = @At("RETURN")) private void onReturnInit(CallbackInfo ci) { fabric_eventDispatcher = ModelLoadingEventDispatcher.CURRENT.get(); } - @Inject(method = "method_62632", at = @At("RETURN")) - private void onAddStandardModels(BlockStatesLoader.class_10095 blockStateModels, CallbackInfo ci) { + @Inject(method = "addBlockStates", at = @At("RETURN")) + private void onAddStandardModels(BlockStatesLoader.BlockStateDefinition blockStateModels, CallbackInfo ci) { if (fabric_eventDispatcher == null) { return; } fabric_eventDispatcher.addExtraModels(id -> { ModelIdentifier modelId = ModelLoadingConstants.toResourceModelId(id); - UnbakedModel unbakedModel = method_62638(id); - method_62635(modelId, unbakedModel); + UnbakedModel unbakedModel = computeResolvedModel(id); + addTopLevelModel(modelId, unbakedModel); }); } - @ModifyVariable(method = "method_62640", at = @At(value = "STORE", ordinal = 0), ordinal = 0) + @ModifyVariable(method = "getModel", at = @At(value = "STORE", ordinal = 0), ordinal = 0) @Nullable private UnbakedModel onLoadResourceModel(@Nullable UnbakedModel model, Identifier id) { if (fabric_eventDispatcher == null) { @@ -80,7 +80,7 @@ abstract class class_10097Mixin { return fabric_eventDispatcher.modifyModelOnLoad(model, id, null); } - @ModifyVariable(method = "method_62635", at = @At("HEAD"), argsOnly = true) + @ModifyVariable(method = "addTopLevelModel", at = @At("HEAD"), argsOnly = true) private UnbakedModel onAddTopLevelModel(UnbakedModel model, ModelIdentifier modelId) { if (fabric_eventDispatcher == null) { return model; diff --git a/fabric-model-loading-api-v1/src/client/resources/fabric-model-loading-api-v1.mixins.json b/fabric-model-loading-api-v1/src/client/resources/fabric-model-loading-api-v1.mixins.json index 047df397b..7edc34faf 100644 --- a/fabric-model-loading-api-v1/src/client/resources/fabric-model-loading-api-v1.mixins.json +++ b/fabric-model-loading-api-v1/src/client/resources/fabric-model-loading-api-v1.mixins.json @@ -4,7 +4,7 @@ "compatibilityLevel": "JAVA_21", "client": [ "BakedModelManagerMixin", - "class_10097Mixin", + "ReferencedModelsCollectorMixin", "ModelLoaderBakerImplMixin", "ModelLoaderMixin" ], diff --git a/fabric-model-loading-api-v1/src/testmodClient/java/net/fabricmc/fabric/test/model/loading/ModelTestModClient.java b/fabric-model-loading-api-v1/src/testmodClient/java/net/fabricmc/fabric/test/model/loading/ModelTestModClient.java index d088f5d9c..de0cd39a8 100644 --- a/fabric-model-loading-api-v1/src/testmodClient/java/net/fabricmc/fabric/test/model/loading/ModelTestModClient.java +++ b/fabric-model-loading-api-v1/src/testmodClient/java/net/fabricmc/fabric/test/model/loading/ModelTestModClient.java @@ -22,10 +22,10 @@ import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.CropBlock; import net.minecraft.block.HorizontalConnectingBlock; -import net.minecraft.class_10096; import net.minecraft.client.render.block.BlockModels; import net.minecraft.client.render.entity.PlayerEntityRenderer; import net.minecraft.client.render.model.BakedModel; +import net.minecraft.client.render.model.MissingModel; import net.minecraft.client.render.model.UnbakedModel; import net.minecraft.client.util.ModelIdentifier; import net.minecraft.resource.ResourceType; @@ -86,7 +86,7 @@ public class ModelTestModClient implements ClientModInitializer { ModelIdentifier id = context.topLevelId(); if (id != null && id.equals(fenceId)) { - return new DelegatingUnbakedModel(class_10096.field_53660); + return new DelegatingUnbakedModel(MissingModel.ID); } return model; @@ -98,7 +98,7 @@ public class ModelTestModClient implements ClientModInitializer { Identifier id = context.resourceId(); if (id != null && id.equals(BROWN_GLAZED_TERRACOTTA_MODEL_ID)) { - return context.baker().getOrLoadModel(class_10096.field_53660); + return context.baker().getModel(MissingModel.ID); } return model; diff --git a/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/impl/registry/sync/FabricRegistryInit.java b/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/impl/registry/sync/FabricRegistryInit.java index ef20ab416..6d2fe03fa 100644 --- a/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/impl/registry/sync/FabricRegistryInit.java +++ b/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/impl/registry/sync/FabricRegistryInit.java @@ -207,5 +207,9 @@ public class FabricRegistryInit implements ModInitializer { // Synced via PacketCodecs.registry RegistryAttributeHolder.get(Registries.ARMOR_MATERIAL) .addAttribute(RegistryAttribute.SYNCED); + + // Synced via PacketCodecs.registry + RegistryAttributeHolder.get(Registries.field_53967) + .addAttribute(RegistryAttribute.SYNCED); } } diff --git a/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/mixin/registry/sync/ChunkSerializerMixin.java b/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/mixin/registry/sync/SerializedChunkMixin.java similarity index 91% rename from fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/mixin/registry/sync/ChunkSerializerMixin.java rename to fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/mixin/registry/sync/SerializedChunkMixin.java index 7c7a80f1a..b20125775 100644 --- a/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/mixin/registry/sync/ChunkSerializerMixin.java +++ b/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/mixin/registry/sync/SerializedChunkMixin.java @@ -21,10 +21,10 @@ import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Redirect; -import net.minecraft.world.ChunkSerializer; +import net.minecraft.world.chunk.SerializedChunk; -@Mixin(ChunkSerializer.class) -public class ChunkSerializerMixin { +@Mixin(SerializedChunk.class) +public class SerializedChunkMixin { @Redirect(method = "readStructureReferences", at = @At(value = "INVOKE", target = "Lorg/slf4j/Logger;warn(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V", remap = false)) private static void log(Logger logger, String msg, Object identifier, Object chunkPos) { // Drop to debug log level. diff --git a/fabric-registry-sync-v0/src/main/resources/fabric-registry-sync-v0.mixins.json b/fabric-registry-sync-v0/src/main/resources/fabric-registry-sync-v0.mixins.json index d4c130020..d8d12369e 100644 --- a/fabric-registry-sync-v0/src/main/resources/fabric-registry-sync-v0.mixins.json +++ b/fabric-registry-sync-v0/src/main/resources/fabric-registry-sync-v0.mixins.json @@ -5,7 +5,7 @@ "mixins": [ "BlocksMixin", "BootstrapMixin", - "ChunkSerializerMixin", + "SerializedChunkMixin", "DebugChunkGeneratorAccessor", "ExperimentalRegistriesValidatorMixin", "IdListMixin", diff --git a/fabric-renderer-api-v1/src/client/java/net/fabricmc/fabric/api/renderer/v1/mesh/MutableQuadView.java b/fabric-renderer-api-v1/src/client/java/net/fabricmc/fabric/api/renderer/v1/mesh/MutableQuadView.java index cf946622a..5cba83cdc 100644 --- a/fabric-renderer-api-v1/src/client/java/net/fabricmc/fabric/api/renderer/v1/mesh/MutableQuadView.java +++ b/fabric-renderer-api-v1/src/client/java/net/fabricmc/fabric/api/renderer/v1/mesh/MutableQuadView.java @@ -16,7 +16,6 @@ package net.fabricmc.fabric.api.renderer.v1.mesh; -import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.Nullable; import org.joml.Vector2f; import org.joml.Vector2fc; @@ -303,29 +302,7 @@ public interface MutableQuadView extends QuadView { * *

Calling this method does not emit the quad. */ - default MutableQuadView fromVanilla(BakedQuad quad, RenderMaterial material, @Nullable Direction cullFace) { - return fromVanilla(quad, material, cullFace, true); - } - - // TODO: If this is unmarked as experimental, update the javadoc of the other overloads. - /** - * Enables bulk vertex data transfer using the standard Minecraft quad format. - * - *

The material applied to this quad view might be slightly different from the {@code material} parameter regarding diffuse shading. - * If either the baked quad {@link BakedQuad#hasShade() does not have shade} or the material {@link MaterialFinder#disableDiffuse(boolean) does not have shade}, - * diffuse shading will be disabled for this quad view. - * This is reflected in the quad view's {@link #material()}, but the {@code material} parameter is unchanged (it is immutable anyway). - * - *

If {@code applyLightEmission} is {@code true}, the {@linkplain BakedQuad#getLightEmission() baked quad's light emission} will be applied - * to the lightmap values from the vertex data after copying. Otherwise, the light emission will be ignored. - * - *

Calling this method does not emit the quad. - * - * @apiNote This method is marked as experimental because future snapshots may change the item renderer to also respect quad light emission, - * in which case this method will be removed. See MC-275296. - */ - @ApiStatus.Experimental - MutableQuadView fromVanilla(BakedQuad quad, RenderMaterial material, @Nullable Direction cullFace, boolean applyLightEmission); + MutableQuadView fromVanilla(BakedQuad quad, RenderMaterial material, @Nullable Direction cullFace); /** * @deprecated Use {@link #color(int, int)} instead. diff --git a/fabric-renderer-api-v1/src/client/java/net/fabricmc/fabric/api/renderer/v1/mesh/QuadEmitter.java b/fabric-renderer-api-v1/src/client/java/net/fabricmc/fabric/api/renderer/v1/mesh/QuadEmitter.java index c3632e442..1616d8def 100644 --- a/fabric-renderer-api-v1/src/client/java/net/fabricmc/fabric/api/renderer/v1/mesh/QuadEmitter.java +++ b/fabric-renderer-api-v1/src/client/java/net/fabricmc/fabric/api/renderer/v1/mesh/QuadEmitter.java @@ -16,7 +16,6 @@ package net.fabricmc.fabric.api.renderer.v1.mesh; -import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.Nullable; import org.joml.Vector2f; import org.joml.Vector2fc; @@ -139,14 +138,7 @@ public interface QuadEmitter extends MutableQuadView { QuadEmitter fromVanilla(int[] quadData, int startIndex); @Override - default QuadEmitter fromVanilla(BakedQuad quad, RenderMaterial material, @Nullable Direction cullFace) { - MutableQuadView.super.fromVanilla(quad, material, cullFace); - return this; - } - - @ApiStatus.Experimental - @Override - QuadEmitter fromVanilla(BakedQuad quad, RenderMaterial material, @Nullable Direction cullFace, boolean applyLightEmission); + QuadEmitter fromVanilla(BakedQuad quad, RenderMaterial material, @Nullable Direction cullFace); /** * Tolerance for determining if the depth parameter to {@link #square(Direction, float, float, float, float, float)} diff --git a/fabric-renderer-api-v1/src/client/java/net/fabricmc/fabric/impl/renderer/VanillaModelEncoder.java b/fabric-renderer-api-v1/src/client/java/net/fabricmc/fabric/impl/renderer/VanillaModelEncoder.java index b76ebd5dc..73cf27200 100644 --- a/fabric-renderer-api-v1/src/client/java/net/fabricmc/fabric/impl/renderer/VanillaModelEncoder.java +++ b/fabric-renderer-api-v1/src/client/java/net/fabricmc/fabric/impl/renderer/VanillaModelEncoder.java @@ -78,7 +78,7 @@ public class VanillaModelEncoder { for (int j = 0; j < count; j++) { final BakedQuad q = quads.get(j); - emitter.fromVanilla(q, STANDARD_MATERIAL, cullFace, false); + emitter.fromVanilla(q, STANDARD_MATERIAL, cullFace); emitter.emit(); } } diff --git a/fabric-renderer-api-v1/src/testmodClient/java/net/fabricmc/fabric/test/renderer/client/FrameUnbakedModel.java b/fabric-renderer-api-v1/src/testmodClient/java/net/fabricmc/fabric/test/renderer/client/FrameUnbakedModel.java index 8f595f0db..b55791082 100644 --- a/fabric-renderer-api-v1/src/testmodClient/java/net/fabricmc/fabric/test/renderer/client/FrameUnbakedModel.java +++ b/fabric-renderer-api-v1/src/testmodClient/java/net/fabricmc/fabric/test/renderer/client/FrameUnbakedModel.java @@ -40,7 +40,7 @@ public class FrameUnbakedModel implements UnbakedModel { private static final SpriteIdentifier OBSIDIAN_SPRITE_ID = new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE, Identifier.ofVanilla("block/obsidian")); @Override - public void method_62326(class_10103 arg, class_10102 arg2) { + public void resolve(Resolver resolver, ModelType currentlyResolvingType) { } /* diff --git a/fabric-renderer-api-v1/src/testmodClient/java/net/fabricmc/fabric/test/renderer/client/OctagonalColumnUnbakedModel.java b/fabric-renderer-api-v1/src/testmodClient/java/net/fabricmc/fabric/test/renderer/client/OctagonalColumnUnbakedModel.java index 478dc6b29..796527034 100644 --- a/fabric-renderer-api-v1/src/testmodClient/java/net/fabricmc/fabric/test/renderer/client/OctagonalColumnUnbakedModel.java +++ b/fabric-renderer-api-v1/src/testmodClient/java/net/fabricmc/fabric/test/renderer/client/OctagonalColumnUnbakedModel.java @@ -55,7 +55,7 @@ public class OctagonalColumnUnbakedModel implements UnbakedModel { } @Override - public void method_62326(class_10103 arg, class_10102 arg2) { + public void resolve(Resolver resolver, ModelType currentlyResolvingType) { } @Override diff --git a/fabric-renderer-api-v1/src/testmodClient/java/net/fabricmc/fabric/test/renderer/client/PillarUnbakedModel.java b/fabric-renderer-api-v1/src/testmodClient/java/net/fabricmc/fabric/test/renderer/client/PillarUnbakedModel.java index a76a17c78..a70e6d0e0 100644 --- a/fabric-renderer-api-v1/src/testmodClient/java/net/fabricmc/fabric/test/renderer/client/PillarUnbakedModel.java +++ b/fabric-renderer-api-v1/src/testmodClient/java/net/fabricmc/fabric/test/renderer/client/PillarUnbakedModel.java @@ -38,7 +38,7 @@ public class PillarUnbakedModel implements UnbakedModel { .toList(); @Override - public void method_62326(class_10103 arg, class_10102 arg2) { + public void resolve(Resolver resolver, ModelType currentlyResolvingType) { } @Nullable diff --git a/fabric-renderer-api-v1/src/testmodClient/java/net/fabricmc/fabric/test/renderer/client/RiverstoneUnbakedModel.java b/fabric-renderer-api-v1/src/testmodClient/java/net/fabricmc/fabric/test/renderer/client/RiverstoneUnbakedModel.java index ba2290f35..7e63e0bb1 100644 --- a/fabric-renderer-api-v1/src/testmodClient/java/net/fabricmc/fabric/test/renderer/client/RiverstoneUnbakedModel.java +++ b/fabric-renderer-api-v1/src/testmodClient/java/net/fabricmc/fabric/test/renderer/client/RiverstoneUnbakedModel.java @@ -33,9 +33,9 @@ public class RiverstoneUnbakedModel implements UnbakedModel { private static final Identifier GOLD_BLOCK_MODEL_ID = Identifier.ofVanilla("block/gold_block"); @Override - public void method_62326(class_10103 arg, class_10102 arg2) { - arg.method_62642(STONE_MODEL_ID); - arg.method_62642(GOLD_BLOCK_MODEL_ID); + public void resolve(Resolver resolver, ModelType currentlyResolvingType) { + resolver.resolve(STONE_MODEL_ID); + resolver.resolve(GOLD_BLOCK_MODEL_ID); } @Nullable diff --git a/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/renderer/aocalc/AoCalculator.java b/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/renderer/aocalc/AoCalculator.java index a662227ee..48afd517d 100644 --- a/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/renderer/aocalc/AoCalculator.java +++ b/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/renderer/aocalc/AoCalculator.java @@ -36,7 +36,6 @@ import net.minecraft.block.BlockState; import net.minecraft.client.render.LightmapTextureManager; import net.minecraft.client.render.WorldRenderer; import net.minecraft.client.render.block.BlockModelRenderer; -import net.minecraft.client.render.model.BakedQuad; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.util.math.MathHelper; @@ -150,16 +149,14 @@ public abstract class AoCalculator { private final float[] vanillaAoData = new float[Direction.values().length * 2]; private final BitSet vanillaAoFlags = new BitSet(3); private final int[] vertexData = new int[EncodingFormat.QUAD_STRIDE]; - private final DummyBakedQuad dummyBakedQuad = new DummyBakedQuad(); private void calcVanilla(QuadViewImpl quad, float[] aoDest, int[] lightDest) { vanillaAoFlags.clear(); final Direction lightFace = quad.lightFace(); quad.toVanilla(vertexData, 0); - dummyBakedQuad.prepare(quad.lightFace(), quad.hasShade()); VanillaAoHelper.getQuadDimensions(blockInfo.blockView, blockInfo.blockState, blockInfo.blockPos, vertexData, lightFace, vanillaAoData, vanillaAoFlags); - vanillaCalc.apply(blockInfo.blockView, blockInfo.blockState, blockInfo.blockPos, vanillaAoData, vanillaAoFlags, dummyBakedQuad); + vanillaCalc.apply(blockInfo.blockView, blockInfo.blockState, blockInfo.blockPos, lightFace, vanillaAoData, vanillaAoFlags, quad.hasShade()); System.arraycopy(vanillaCalc.brightness, 0, aoDest, 0, 4); System.arraycopy(vanillaCalc.light, 0, lightDest, 0, 4); @@ -584,31 +581,4 @@ public abstract class AoCalculator { if (b == 0) return a; return Math.min(a, b); } - - // This quad is passed to the vanilla AO calc. It only calls getFace, isEmissive, getLightEmission, and hasShade. - // Since Indigo already applies vanilla's light emission value in MutableQuadView#fromVanilla, this quad should not - // provide its own light emission. - private static class DummyBakedQuad extends BakedQuad { - private Direction lightFace; - private boolean shade; - - DummyBakedQuad() { - super(new int[32], -1, Direction.UP, null, true, 0); - } - - public void prepare(Direction lightFace, boolean shade) { - this.lightFace = lightFace; - this.shade = shade; - } - - @Override - public Direction getFace() { - return lightFace; - } - - @Override - public boolean hasShade() { - return shade; - } - } } diff --git a/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/renderer/aocalc/VanillaAoHelper.java b/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/renderer/aocalc/VanillaAoHelper.java index 88d47d74a..c1258643a 100644 --- a/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/renderer/aocalc/VanillaAoHelper.java +++ b/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/renderer/aocalc/VanillaAoHelper.java @@ -28,7 +28,7 @@ import net.minecraft.world.BlockRenderView; public final class VanillaAoHelper { // Renderer method we call isn't declared as static, but uses no // instance data and is called from multiple threads in vanilla also. - private static BlockModelRenderer BLOCK_RENDERER = MinecraftClient.getInstance().getBlockRenderManager().getModelRenderer(); + private static final BlockModelRenderer BLOCK_RENDERER = MinecraftClient.getInstance().getBlockRenderManager().getModelRenderer(); public static void getQuadDimensions(BlockRenderView blockRenderView, BlockState blockState, BlockPos pos, int[] vertexData, Direction face, float[] aoData, BitSet controlBits) { BLOCK_RENDERER.getQuadDimensions(blockRenderView, blockState, pos, vertexData, face, aoData, controlBits); diff --git a/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/renderer/mesh/MutableQuadViewImpl.java b/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/renderer/mesh/MutableQuadViewImpl.java index 64a24e2d4..3f9a88bcf 100644 --- a/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/renderer/mesh/MutableQuadViewImpl.java +++ b/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/renderer/mesh/MutableQuadViewImpl.java @@ -195,7 +195,7 @@ public abstract class MutableQuadViewImpl extends QuadViewImpl implements QuadEm } @Override - public final MutableQuadViewImpl fromVanilla(BakedQuad quad, RenderMaterial material, @Nullable Direction cullFace, boolean applyLightEmission) { + public final MutableQuadViewImpl fromVanilla(BakedQuad quad, RenderMaterial material, @Nullable Direction cullFace) { fromVanilla(quad.getVertexData(), 0); data[baseIndex + HEADER_BITS] = EncodingFormat.cullFace(0, cullFace); nominalFace(quad.getFace()); @@ -205,9 +205,9 @@ public abstract class MutableQuadViewImpl extends QuadViewImpl implements QuadEm material = RenderMaterialImpl.setDisableDiffuse((RenderMaterialImpl) material, true); } - if (applyLightEmission && quad.isEmissive()) { - int lightEmission = quad.getLightEmission(); + int lightEmission = quad.getLightEmission(); + if (lightEmission > 0) { for (int i = 0; i < 4; i++) { lightmap(i, LightmapTextureManager.applyEmission(lightmap(i), lightEmission)); } diff --git a/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/renderer/render/ItemRenderContext.java b/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/renderer/render/ItemRenderContext.java index bc38e6d50..151937d7f 100644 --- a/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/renderer/render/ItemRenderContext.java +++ b/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/renderer/render/ItemRenderContext.java @@ -21,7 +21,6 @@ import java.util.function.Supplier; import org.jetbrains.annotations.Nullable; import net.minecraft.block.BlockState; -import net.minecraft.client.MinecraftClient; import net.minecraft.client.color.item.ItemColors; import net.minecraft.client.render.LightmapTextureManager; import net.minecraft.client.render.RenderLayer; @@ -33,8 +32,6 @@ import net.minecraft.client.render.item.ItemRenderer; import net.minecraft.client.render.model.BakedModel; import net.minecraft.client.render.model.json.ModelTransformationMode; import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.item.BlockItem; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.math.Direction; import net.minecraft.util.math.MatrixUtil; @@ -85,7 +82,6 @@ public class ItemRenderContext extends AbstractRenderContext { private int lightmap; private boolean isDefaultTranslucent; - private boolean isTranslucentDirect; private boolean isDefaultGlint; private boolean isGlintDynamicDisplay; @@ -146,24 +142,7 @@ public class ItemRenderContext extends AbstractRenderContext { } private void computeOutputInfo() { - isDefaultTranslucent = true; - isTranslucentDirect = true; - - Item item = itemStack.getItem(); - - if (item instanceof BlockItem blockItem) { - BlockState state = blockItem.getBlock().getDefaultState(); - RenderLayer renderLayer = RenderLayers.getBlockLayer(state); - - if (renderLayer != RenderLayer.getTranslucent()) { - isDefaultTranslucent = false; - } - - if (transformMode != ModelTransformationMode.GUI && !transformMode.isFirstPerson()) { - isTranslucentDirect = false; - } - } - + isDefaultTranslucent = RenderLayers.getItemLayer(itemStack) == TexturedRenderLayers.getItemEntityTranslucentCull(); isDefaultGlint = itemStack.hasGlint(); isGlintDynamicDisplay = ItemRendererAccessor.fabric_callUsesDynamicDisplay(itemStack); } @@ -209,7 +188,7 @@ public class ItemRenderContext extends AbstractRenderContext { /** * Caches custom blend mode / vertex consumers and mimics the logic - * in {@code RenderLayers.getEntityBlockLayer}. Layers other than + * in {@code RenderLayers.getItemLayer}. Layers other than * translucent are mapped to cutout. */ private VertexConsumer getVertexConsumer(BlendMode blendMode, TriState glintMode) { @@ -231,13 +210,13 @@ public class ItemRenderContext extends AbstractRenderContext { if (translucent) { if (glint) { if (translucentGlintVertexConsumer == null) { - translucentGlintVertexConsumer = createTranslucentVertexConsumer(true); + translucentGlintVertexConsumer = createVertexConsumer(TexturedRenderLayers.getItemEntityTranslucentCull(), true); } return translucentGlintVertexConsumer; } else { if (translucentVertexConsumer == null) { - translucentVertexConsumer = createTranslucentVertexConsumer(false); + translucentVertexConsumer = createVertexConsumer(TexturedRenderLayers.getItemEntityTranslucentCull(), false); } return translucentVertexConsumer; @@ -245,13 +224,13 @@ public class ItemRenderContext extends AbstractRenderContext { } else { if (glint) { if (cutoutGlintVertexConsumer == null) { - cutoutGlintVertexConsumer = createCutoutVertexConsumer(true); + cutoutGlintVertexConsumer = createVertexConsumer(TexturedRenderLayers.getEntityCutout(), true); } return cutoutGlintVertexConsumer; } else { if (cutoutVertexConsumer == null) { - cutoutVertexConsumer = createCutoutVertexConsumer(false); + cutoutVertexConsumer = createVertexConsumer(TexturedRenderLayers.getEntityCutout(), false); } return cutoutVertexConsumer; @@ -259,40 +238,22 @@ public class ItemRenderContext extends AbstractRenderContext { } } - private VertexConsumer createTranslucentVertexConsumer(boolean glint) { - if (glint && isGlintDynamicDisplay) { - return createDynamicDisplayGlintVertexConsumer(MinecraftClient.isFabulousGraphicsOrBetter() && !isTranslucentDirect ? TexturedRenderLayers.getItemEntityTranslucentCull() : TexturedRenderLayers.getEntityTranslucentCull()); - } + private VertexConsumer createVertexConsumer(RenderLayer layer, boolean glint) { + if (isGlintDynamicDisplay && glint) { + if (dynamicDisplayGlintEntry == null) { + dynamicDisplayGlintEntry = matrixStack.peek().copy(); - if (isTranslucentDirect) { - return ItemRenderer.getDirectItemGlintConsumer(vertexConsumerProvider, TexturedRenderLayers.getEntityTranslucentCull(), true, glint); - } else if (MinecraftClient.isFabulousGraphicsOrBetter()) { - return ItemRenderer.getItemGlintConsumer(vertexConsumerProvider, TexturedRenderLayers.getItemEntityTranslucentCull(), true, glint); - } else { - return ItemRenderer.getItemGlintConsumer(vertexConsumerProvider, TexturedRenderLayers.getEntityTranslucentCull(), true, glint); - } - } - - private VertexConsumer createCutoutVertexConsumer(boolean glint) { - if (glint && isGlintDynamicDisplay) { - return createDynamicDisplayGlintVertexConsumer(TexturedRenderLayers.getEntityCutout()); - } - - return ItemRenderer.getDirectItemGlintConsumer(vertexConsumerProvider, TexturedRenderLayers.getEntityCutout(), true, glint); - } - - private VertexConsumer createDynamicDisplayGlintVertexConsumer(RenderLayer layer) { - if (dynamicDisplayGlintEntry == null) { - dynamicDisplayGlintEntry = matrixStack.peek().copy(); - - if (transformMode == ModelTransformationMode.GUI) { - MatrixUtil.scale(dynamicDisplayGlintEntry.getPositionMatrix(), 0.5F); - } else if (transformMode.isFirstPerson()) { - MatrixUtil.scale(dynamicDisplayGlintEntry.getPositionMatrix(), 0.75F); + if (transformMode == ModelTransformationMode.GUI) { + MatrixUtil.scale(dynamicDisplayGlintEntry.getPositionMatrix(), 0.5F); + } else if (transformMode.isFirstPerson()) { + MatrixUtil.scale(dynamicDisplayGlintEntry.getPositionMatrix(), 0.75F); + } } + + return ItemRenderer.getDynamicDisplayGlintConsumer(vertexConsumerProvider, layer, dynamicDisplayGlintEntry); } - return ItemRenderer.getDynamicDisplayGlintConsumer(vertexConsumerProvider, layer, dynamicDisplayGlintEntry); + return ItemRenderer.getItemGlintConsumer(vertexConsumerProvider, layer, true, glint); } private class BakedModelConsumerImpl implements BakedModelConsumer { diff --git a/fabric-rendering-v1/src/client/java/net/fabricmc/fabric/impl/client/rendering/FabricShaderProgram.java b/fabric-rendering-v1/src/client/java/net/fabricmc/fabric/impl/client/rendering/FabricShaderProgram.java deleted file mode 100644 index 5ee289648..000000000 --- a/fabric-rendering-v1/src/client/java/net/fabricmc/fabric/impl/client/rendering/FabricShaderProgram.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2016, 2017, 2018, 2019 FabricMC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.fabricmc.fabric.impl.client.rendering; - -import java.io.IOException; - -import net.minecraft.client.gl.ShaderProgram; -import net.minecraft.client.render.VertexFormat; -import net.minecraft.resource.ResourceFactory; -import net.minecraft.util.Identifier; - -public final class FabricShaderProgram extends ShaderProgram { - public FabricShaderProgram(ResourceFactory factory, Identifier name, VertexFormat format) throws IOException { - super(factory, name.toString(), format); - } - - /** - * Rewrites the input string containing an identifier - * with the namespace of the id in the front instead of in the middle. - * - *

Example: {@code shaders/core/my_mod:xyz} -> {@code my_mod:shaders/core/xyz} - * - * @param input the raw input string - * @param containedId the ID contained within the input string - * @return the corrected full ID string - */ - public static Identifier rewriteAsId(String input, String containedId) { - Identifier contained = Identifier.of(containedId); - return contained.withPath(path -> input.replace(containedId, path)); - } -} diff --git a/fabric-rendering-v1/src/client/java/net/fabricmc/fabric/mixin/client/rendering/WorldRendererMixin.java b/fabric-rendering-v1/src/client/java/net/fabricmc/fabric/mixin/client/rendering/WorldRendererMixin.java index 46644d4ba..fa0dfb7d7 100644 --- a/fabric-rendering-v1/src/client/java/net/fabricmc/fabric/mixin/client/rendering/WorldRendererMixin.java +++ b/fabric-rendering-v1/src/client/java/net/fabricmc/fabric/mixin/client/rendering/WorldRendererMixin.java @@ -30,7 +30,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import net.minecraft.block.BlockState; import net.minecraft.client.MinecraftClient; -import net.minecraft.client.gl.PostEffectProcessor; import net.minecraft.client.option.CloudRenderMode; import net.minecraft.client.render.BufferBuilderStorage; import net.minecraft.client.render.Camera; @@ -61,7 +60,6 @@ public abstract class WorldRendererMixin { @Shadow private BufferBuilderStorage bufferBuilders; @Shadow private ClientWorld world; - @Shadow private PostEffectProcessor transparencyPostProcessor; @Final @Shadow private MinecraftClient client; @@ -69,7 +67,7 @@ public abstract class WorldRendererMixin { @Inject(method = "render", at = @At("HEAD")) private void beforeRender(ObjectAllocator objectAllocator, RenderTickCounter tickCounter, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightmapTextureManager lightmapTextureManager, Matrix4f positionMatrix, Matrix4f projectionMatrix, CallbackInfo ci) { - context.prepare((WorldRenderer) (Object) this, tickCounter, renderBlockOutline, camera, gameRenderer, lightmapTextureManager, projectionMatrix, positionMatrix, bufferBuilders.getEntityVertexConsumers(), world.getProfiler(), transparencyPostProcessor != null, world); + context.prepare((WorldRenderer) (Object) this, tickCounter, renderBlockOutline, camera, gameRenderer, lightmapTextureManager, projectionMatrix, positionMatrix, bufferBuilders.getEntityVertexConsumers(), world.getProfiler(), MinecraftClient.isFabulousGraphicsOrBetter(), world); WorldRenderEvents.START.invoker().onStart(context); } @@ -144,7 +142,7 @@ public abstract class WorldRendererMixin { method = "method_62214", at = @At( value = "INVOKE", - target = "Lnet/minecraft/client/render/debug/DebugRenderer;render(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider$Immediate;DDD)V", + target = "Lnet/minecraft/client/render/debug/DebugRenderer;render(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/Frustum;Lnet/minecraft/client/render/VertexConsumerProvider$Immediate;DDD)V", ordinal = 0 ) ) diff --git a/fabric-rendering-v1/src/client/java/net/fabricmc/fabric/mixin/client/rendering/shader/GameRendererMixin.java b/fabric-rendering-v1/src/client/java/net/fabricmc/fabric/mixin/client/rendering/shader/GameRendererMixin.java deleted file mode 100644 index 2b79cbf36..000000000 --- a/fabric-rendering-v1/src/client/java/net/fabricmc/fabric/mixin/client/rendering/shader/GameRendererMixin.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2016, 2017, 2018, 2019 FabricMC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.fabricmc.fabric.mixin.client.rendering.shader; - -import java.io.IOException; -import java.util.List; -import java.util.function.Consumer; - -import com.llamalad7.mixinextras.sugar.Local; -import com.mojang.datafixers.util.Pair; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import net.minecraft.client.gl.ShaderProgram; -import net.minecraft.client.render.GameRenderer; -import net.minecraft.resource.ResourceFactory; - -import net.fabricmc.fabric.api.client.rendering.v1.CoreShaderRegistrationCallback; -import net.fabricmc.fabric.impl.client.rendering.FabricShaderProgram; - -/** - * Implements custom core shader registration (CoreShaderRegistrationCallback). - */ -@Mixin(GameRenderer.class) -abstract class GameRendererMixin { - @Inject( - method = "loadPrograms", - at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/GameRenderer;loadBlurPostProcessor(Lnet/minecraft/resource/ResourceFactory;)V") - ) - private void registerShaders(ResourceFactory factory, CallbackInfo info, @Local(ordinal = 0) List shaderStages, @Local(ordinal = 1) List>> programs) throws IOException { - CoreShaderRegistrationCallback.RegistrationContext context = (id, vertexFormat, loadCallback) -> { - ShaderProgram program = new FabricShaderProgram(factory, id, vertexFormat); - programs.add(Pair.of(program, loadCallback)); - }; - CoreShaderRegistrationCallback.EVENT.invoker().registerShaders(context); - } -} diff --git a/fabric-rendering-v1/src/client/java/net/fabricmc/fabric/mixin/client/rendering/shader/ShaderProgramImportProcessorMixin.java b/fabric-rendering-v1/src/client/java/net/fabricmc/fabric/mixin/client/rendering/shader/ShaderProgramImportProcessorMixin.java deleted file mode 100644 index ded69a1b0..000000000 --- a/fabric-rendering-v1/src/client/java/net/fabricmc/fabric/mixin/client/rendering/shader/ShaderProgramImportProcessorMixin.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2016, 2017, 2018, 2019 FabricMC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.fabricmc.fabric.mixin.client.rendering.shader; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Unique; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.ModifyVariable; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -import net.minecraft.util.Identifier; - -import net.fabricmc.fabric.impl.client.rendering.FabricShaderProgram; - -/** - * Lets modded shaders {@code #moj_import} shaders from any namespace with the - * {@code <>} syntax. - */ -@Mixin(targets = "net.minecraft.client.gl.ShaderProgram$1") -abstract class ShaderProgramImportProcessorMixin { - @Unique - private String capturedImport; - - @Inject(method = "loadImport", at = @At("HEAD")) - private void captureImport(boolean inline, String name, CallbackInfoReturnable info) { - capturedImport = name; - } - - @ModifyVariable(method = "loadImport", at = @At("STORE"), ordinal = 0, argsOnly = true) - private String modifyImportId(String id, boolean inline) { - if (!inline && capturedImport.contains(String.valueOf(Identifier.NAMESPACE_SEPARATOR))) { - return FabricShaderProgram.rewriteAsId(id, capturedImport).toString(); - } - - return id; - } - - @Inject(method = "loadImport", at = @At("RETURN")) - private void uncaptureImport(boolean inline, String name, CallbackInfoReturnable info) { - capturedImport = null; - } -} diff --git a/fabric-rendering-v1/src/client/java/net/fabricmc/fabric/mixin/client/rendering/shader/ShaderProgramMixin.java b/fabric-rendering-v1/src/client/java/net/fabricmc/fabric/mixin/client/rendering/shader/ShaderProgramMixin.java deleted file mode 100644 index 5c9c457ef..000000000 --- a/fabric-rendering-v1/src/client/java/net/fabricmc/fabric/mixin/client/rendering/shader/ShaderProgramMixin.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2016, 2017, 2018, 2019 FabricMC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.fabricmc.fabric.mixin.client.rendering.shader; - -import com.llamalad7.mixinextras.injector.wrapoperation.Operation; -import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; -import org.spongepowered.asm.mixin.Final; -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.ModifyVariable; - -import net.minecraft.client.gl.ShaderProgram; -import net.minecraft.client.gl.ShaderStage; -import net.minecraft.resource.ResourceFactory; -import net.minecraft.util.Identifier; - -import net.fabricmc.fabric.impl.client.rendering.FabricShaderProgram; - -@Mixin(ShaderProgram.class) -abstract class ShaderProgramMixin { - @Shadow - @Final - private String name; - - // Allow loading FabricShaderPrograms from arbitrary namespaces. - @WrapOperation(method = "", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Identifier;ofVanilla(Ljava/lang/String;)Lnet/minecraft/util/Identifier;"), allow = 1) - private Identifier modifyId(String id, Operation original) { - if ((Object) this instanceof FabricShaderProgram) { - return FabricShaderProgram.rewriteAsId(id, name); - } - - return original.call(id); - } - - // Allow loading shader stages from arbitrary namespaces. - @ModifyVariable(method = "loadShader", at = @At("STORE"), ordinal = 1) - private static String modifyStageId(String id, ResourceFactory factory, ShaderStage.Type type, String name) { - if (name.contains(String.valueOf(Identifier.NAMESPACE_SEPARATOR))) { - return FabricShaderProgram.rewriteAsId(id, name).toString(); - } - - return id; - } - - @WrapOperation(method = "loadShader", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Identifier;ofVanilla(Ljava/lang/String;)Lnet/minecraft/util/Identifier;"), allow = 1) - private static Identifier allowNoneMinecraftId(String id, Operation original) { - if (id.contains(String.valueOf(Identifier.NAMESPACE_SEPARATOR))) { - return Identifier.of(id); - } - - return original.call(id); - } -} diff --git a/fabric-rendering-v1/src/client/resources/fabric-rendering-v1.mixins.json b/fabric-rendering-v1/src/client/resources/fabric-rendering-v1.mixins.json index 304e9be0b..b3ca07a79 100644 --- a/fabric-rendering-v1/src/client/resources/fabric-rendering-v1.mixins.json +++ b/fabric-rendering-v1/src/client/resources/fabric-rendering-v1.mixins.json @@ -18,10 +18,7 @@ "ItemColorsMixin", "LivingEntityRendererAccessor", "TooltipComponentMixin", - "WorldRendererMixin", - "shader.GameRendererMixin", - "shader.ShaderProgramImportProcessorMixin", - "shader.ShaderProgramMixin" + "WorldRendererMixin" ], "injectors": { "defaultRequire": 1 diff --git a/fabric-rendering-v1/src/testmod/java/net/fabricmc/fabric/test/rendering/TooltipComponentTestInit.java b/fabric-rendering-v1/src/testmod/java/net/fabricmc/fabric/test/rendering/TooltipComponentTestInit.java index ff86f9138..a783aad51 100644 --- a/fabric-rendering-v1/src/testmod/java/net/fabricmc/fabric/test/rendering/TooltipComponentTestInit.java +++ b/fabric-rendering-v1/src/testmod/java/net/fabricmc/fabric/test/rendering/TooltipComponentTestInit.java @@ -61,14 +61,14 @@ public class TooltipComponentTestInit implements ModInitializer { } private static ArmorMaterial createTestArmorMaterial() { - return new ArmorMaterial(Util.make(new EnumMap<>(ArmorItem.Type.class), (map) -> { - map.put(ArmorItem.Type.BOOTS, 1); - map.put(ArmorItem.Type.LEGGINGS, 2); - map.put(ArmorItem.Type.CHESTPLATE, 3); - map.put(ArmorItem.Type.HELMET, 1); - map.put(ArmorItem.Type.BODY, 3); - }), - 0, + return new ArmorMaterial( + Util.make(new EnumMap<>(ArmorItem.Type.class), (map) -> { + map.put(ArmorItem.Type.BOOTS, 1); + map.put(ArmorItem.Type.LEGGINGS, 2); + map.put(ArmorItem.Type.CHESTPLATE, 3); + map.put(ArmorItem.Type.HELMET, 1); + map.put(ArmorItem.Type.BODY, 3); + }), SoundEvents.ITEM_ARMOR_EQUIP_LEATHER, (stack) -> stack.getItem() == Items.LEATHER, List.of(new ArmorMaterial.Layer(Identifier.of("fabric-rendering-v1-testmod", "test_material"))), diff --git a/fabric-rendering-v1/src/testmodClient/java/net/fabricmc/fabric/test/rendering/client/DimensionalRenderingTest.java b/fabric-rendering-v1/src/testmodClient/java/net/fabricmc/fabric/test/rendering/client/DimensionalRenderingTest.java index 7d11b03d7..e3a0dc387 100644 --- a/fabric-rendering-v1/src/testmodClient/java/net/fabricmc/fabric/test/rendering/client/DimensionalRenderingTest.java +++ b/fabric-rendering-v1/src/testmodClient/java/net/fabricmc/fabric/test/rendering/client/DimensionalRenderingTest.java @@ -19,10 +19,10 @@ package net.fabricmc.fabric.test.rendering.client; import com.mojang.blaze3d.systems.RenderSystem; import org.joml.Matrix4f; +import net.minecraft.class_10142; import net.minecraft.client.render.BufferBuilder; import net.minecraft.client.render.BufferRenderer; import net.minecraft.client.render.DimensionEffects; -import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; import net.minecraft.client.render.VertexFormats; @@ -41,7 +41,7 @@ public class DimensionalRenderingTest implements ClientModInitializer { RenderSystem.enableBlend(); RenderSystem.defaultBlendFunc(); RenderSystem.depthMask(false); - RenderSystem.setShader(GameRenderer::getPositionTexColorProgram); + RenderSystem.setShader(class_10142.POSITION_TEX_COLOR); RenderSystem.setShaderTexture(0, END_SKY); Tessellator tessellator = Tessellator.getInstance(); BufferBuilder bufferBuilder = tessellator.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_TEXTURE_COLOR); diff --git a/fabric-rendering-v1/src/testmodClient/java/net/fabricmc/fabric/test/rendering/client/HudAndShaderTest.java b/fabric-rendering-v1/src/testmodClient/java/net/fabricmc/fabric/test/rendering/client/HudAndShaderTest.java index 8aa2b8d0d..8bb8825aa 100644 --- a/fabric-rendering-v1/src/testmodClient/java/net/fabricmc/fabric/test/rendering/client/HudAndShaderTest.java +++ b/fabric-rendering-v1/src/testmodClient/java/net/fabricmc/fabric/test/rendering/client/HudAndShaderTest.java @@ -16,17 +16,8 @@ package net.fabricmc.fabric.test.rendering.client; -import com.mojang.blaze3d.systems.RenderSystem; -import org.joml.Matrix4f; - -import net.minecraft.client.MinecraftClient; import net.minecraft.client.gl.ShaderProgram; -import net.minecraft.client.render.BufferBuilder; -import net.minecraft.client.render.BufferRenderer; -import net.minecraft.client.render.Tessellator; -import net.minecraft.client.render.VertexFormat; import net.minecraft.client.render.VertexFormats; -import net.minecraft.client.util.Window; import net.minecraft.util.Identifier; import net.fabricmc.api.ClientModInitializer; @@ -48,12 +39,12 @@ public class HudAndShaderTest implements ClientModInitializer { context.register(id, VertexFormats.POSITION, program -> testShader = program); }); - HudRenderCallback.EVENT.register((drawContext, tickDelta) -> { + /*HudRenderCallback.EVENT.register((drawContext, tickDelta) -> { MinecraftClient client = MinecraftClient.getInstance(); Window window = client.getWindow(); int x = window.getScaledWidth() - 15; int y = window.getScaledHeight() - 15; - RenderSystem.setShader(() -> testShader); + RenderSystem.setShader(testShader); RenderSystem.setShaderColor(0f, 1f, 0f, 1f); Matrix4f positionMatrix = drawContext.getMatrices().peek().getPositionMatrix(); BufferBuilder buffer = Tessellator.getInstance().begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); @@ -64,6 +55,6 @@ public class HudAndShaderTest implements ClientModInitializer { BufferRenderer.drawWithGlobalProgram(buffer.end()); // Reset shader color RenderSystem.setShaderColor(1f, 1f, 1f, 1f); - }); + });*/ } } diff --git a/fabric-rendering-v1/src/testmodClient/java/net/fabricmc/fabric/test/rendering/client/WorldRenderEventsTests.java b/fabric-rendering-v1/src/testmodClient/java/net/fabricmc/fabric/test/rendering/client/WorldRenderEventsTests.java index f93ed44ee..c5f90808a 100644 --- a/fabric-rendering-v1/src/testmodClient/java/net/fabricmc/fabric/test/rendering/client/WorldRenderEventsTests.java +++ b/fabric-rendering-v1/src/testmodClient/java/net/fabricmc/fabric/test/rendering/client/WorldRenderEventsTests.java @@ -19,11 +19,11 @@ package net.fabricmc.fabric.test.rendering.client; import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.block.Blocks; +import net.minecraft.class_10142; import net.minecraft.class_9974; import net.minecraft.client.MinecraftClient; import net.minecraft.client.render.BufferBuilder; import net.minecraft.client.render.BufferRenderer; -import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.OverlayTexture; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; @@ -70,7 +70,7 @@ public class WorldRenderEventsTests implements ClientModInitializer { matrices.push(); matrices.translate(-camera.x, -camera.y, -camera.z); - RenderSystem.setShader(GameRenderer::getPositionColorProgram); + RenderSystem.setShader(class_10142.POSITION_COLOR); RenderSystem.setShaderColor(1f, 1f, 1f, 1f); RenderSystem.enableBlend(); RenderSystem.defaultBlendFunc(); diff --git a/fabric-transfer-api-v1/src/testmodClient/java/net/fabricmc/fabric/test/transfer/ingame/client/FluidVariantRenderTest.java b/fabric-transfer-api-v1/src/testmodClient/java/net/fabricmc/fabric/test/transfer/ingame/client/FluidVariantRenderTest.java index f34eb115a..8358fa63c 100644 --- a/fabric-transfer-api-v1/src/testmodClient/java/net/fabricmc/fabric/test/transfer/ingame/client/FluidVariantRenderTest.java +++ b/fabric-transfer-api-v1/src/testmodClient/java/net/fabricmc/fabric/test/transfer/ingame/client/FluidVariantRenderTest.java @@ -21,12 +21,12 @@ import java.util.List; import com.mojang.blaze3d.systems.RenderSystem; import org.joml.Matrix4f; +import net.minecraft.class_10142; import net.minecraft.client.MinecraftClient; import net.minecraft.client.font.TextRenderer; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.render.BufferBuilder; import net.minecraft.client.render.BufferRenderer; -import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormat; import net.minecraft.client.render.VertexFormats; @@ -93,7 +93,7 @@ public class FluidVariantRenderTest implements ClientModInitializer { float b = (color & 255) / 255f; RenderSystem.disableDepthTest(); - RenderSystem.setShader(GameRenderer::getPositionTexColorProgram); + RenderSystem.setShader(class_10142.POSITION_TEX_COLOR); BufferBuilder bufferBuilder = Tessellator.getInstance().begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_TEXTURE_COLOR); float x0 = (float) i; float y0 = (float) j; diff --git a/fabric-transitive-access-wideners-v1/src/main/resources/fabric-transitive-access-wideners-v1.accesswidener b/fabric-transitive-access-wideners-v1/src/main/resources/fabric-transitive-access-wideners-v1.accesswidener index 372a17311..476e59dc0 100644 --- a/fabric-transitive-access-wideners-v1/src/main/resources/fabric-transitive-access-wideners-v1.accesswidener +++ b/fabric-transitive-access-wideners-v1/src/main/resources/fabric-transitive-access-wideners-v1.accesswidener @@ -269,7 +269,6 @@ transitive-accessible field net/minecraft/client/render/RenderPhase ENTITY_CUTOU transitive-accessible field net/minecraft/client/render/RenderPhase ENTITY_CUTOUT_NONULL_PROGRAM Lnet/minecraft/client/render/RenderPhase$ShaderProgram; transitive-accessible field net/minecraft/client/render/RenderPhase ENTITY_CUTOUT_NONULL_OFFSET_Z_PROGRAM Lnet/minecraft/client/render/RenderPhase$ShaderProgram; transitive-accessible field net/minecraft/client/render/RenderPhase ITEM_ENTITY_TRANSLUCENT_CULL_PROGRAM Lnet/minecraft/client/render/RenderPhase$ShaderProgram; -transitive-accessible field net/minecraft/client/render/RenderPhase ENTITY_TRANSLUCENT_CULL_PROGRAM Lnet/minecraft/client/render/RenderPhase$ShaderProgram; transitive-accessible field net/minecraft/client/render/RenderPhase ENTITY_TRANSLUCENT_PROGRAM Lnet/minecraft/client/render/RenderPhase$ShaderProgram; transitive-accessible field net/minecraft/client/render/RenderPhase ENTITY_TRANSLUCENT_EMISSIVE_PROGRAM Lnet/minecraft/client/render/RenderPhase$ShaderProgram; transitive-accessible field net/minecraft/client/render/RenderPhase ENTITY_SMOOTH_CUTOUT_PROGRAM Lnet/minecraft/client/render/RenderPhase$ShaderProgram; @@ -287,7 +286,6 @@ transitive-accessible field net/minecraft/client/render/RenderPhase ARMOR_ENTITY transitive-accessible field net/minecraft/client/render/RenderPhase TRANSLUCENT_GLINT_PROGRAM Lnet/minecraft/client/render/RenderPhase$ShaderProgram; transitive-accessible field net/minecraft/client/render/RenderPhase GLINT_PROGRAM Lnet/minecraft/client/render/RenderPhase$ShaderProgram; transitive-accessible field net/minecraft/client/render/RenderPhase ENTITY_GLINT_PROGRAM Lnet/minecraft/client/render/RenderPhase$ShaderProgram; -transitive-accessible field net/minecraft/client/render/RenderPhase DIRECT_ENTITY_GLINT_PROGRAM Lnet/minecraft/client/render/RenderPhase$ShaderProgram; transitive-accessible field net/minecraft/client/render/RenderPhase CRUMBLING_PROGRAM Lnet/minecraft/client/render/RenderPhase$ShaderProgram; transitive-accessible field net/minecraft/client/render/RenderPhase TEXT_PROGRAM Lnet/minecraft/client/render/RenderPhase$ShaderProgram; transitive-accessible field net/minecraft/client/render/RenderPhase TEXT_BACKGROUND_PROGRAM Lnet/minecraft/client/render/RenderPhase$ShaderProgram; diff --git a/gradle.properties b/gradle.properties index d64261f42..080d9298f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,9 +2,9 @@ org.gradle.jvmargs=-Xmx2560M org.gradle.parallel=true fabric.loom.multiProjectOptimisation=true -version=0.102.2 -minecraft_version=24w33a -yarn_version=+build.18 +version=0.102.3 +minecraft_version=24w34a +yarn_version=+build.1 loader_version=0.16.2 installer_version=1.0.1 @@ -13,7 +13,7 @@ curseforge_minecraft_version=1.21.2-Snapshot # Do not manually update, use the bumpversions task: fabric-api-base-version=0.4.43 -fabric-api-lookup-api-v1-version=1.6.69 +fabric-api-lookup-api-v1-version=1.6.70 fabric-biome-api-v1-version=14.0.0 fabric-block-api-v1-version=1.0.23 fabric-block-view-api-v2-version=1.0.11 @@ -21,42 +21,42 @@ fabric-blockrenderlayer-v1-version=1.1.53 fabric-command-api-v1-version=1.2.50 fabric-command-api-v2-version=2.2.29 fabric-commands-v0-version=0.2.67 -fabric-content-registries-v0-version=9.0.0 +fabric-content-registries-v0-version=9.0.1 fabric-crash-report-info-v1-version=0.2.30 -fabric-data-attachment-api-v1-version=1.1.28 -fabric-data-generation-api-v1-version=21.0.0 +fabric-data-attachment-api-v1-version=1.1.29 +fabric-data-generation-api-v1-version=21.0.1 fabric-dimensions-v1-version=4.0.1 fabric-entity-events-v1-version=1.6.13 fabric-events-interaction-v0-version=2.0.0 fabric-game-rule-api-v1-version=1.0.54 fabric-gametest-api-v1-version=2.0.5 -fabric-item-api-v1-version=11.0.1 +fabric-item-api-v1-version=11.0.2 fabric-item-group-api-v1-version=4.1.5 fabric-key-binding-api-v1-version=1.0.48 fabric-keybindings-v0-version=0.2.46 -fabric-lifecycle-events-v1-version=2.3.13 +fabric-lifecycle-events-v1-version=2.3.14 fabric-loot-api-v2-version=3.0.15 fabric-loot-api-v3-version=1.0.3 fabric-message-api-v1-version=6.0.14 -fabric-model-loading-api-v1-version=2.0.0 +fabric-model-loading-api-v1-version=3.0.0 fabric-networking-api-v1-version=4.2.3 fabric-object-builder-api-v1-version=16.0.0 fabric-particles-v1-version=4.0.3 fabric-recipe-api-v1-version=6.0.0 -fabric-registry-sync-v0-version=5.1.3 -fabric-renderer-api-v1-version=3.4.0 -fabric-renderer-indigo-version=1.7.0 +fabric-registry-sync-v0-version=5.1.4 +fabric-renderer-api-v1-version=3.5.0 +fabric-renderer-indigo-version=1.8.0 fabric-rendering-data-attachment-v1-version=0.3.49 fabric-rendering-fluids-v1-version=3.1.7 -fabric-rendering-v0-version=1.1.72 -fabric-rendering-v1-version=5.0.6 +fabric-rendering-v0-version=1.1.73 +fabric-rendering-v1-version=6.0.0 fabric-resource-conditions-api-v1-version=5.0.0 fabric-resource-loader-v0-version=2.0.0 fabric-screen-api-v1-version=2.0.26 -fabric-screen-handler-api-v1-version=1.3.87 +fabric-screen-handler-api-v1-version=1.3.88 fabric-sound-api-v1-version=1.0.24 -fabric-transfer-api-v1-version=5.1.18 -fabric-transitive-access-wideners-v1-version=6.1.1 -fabric-convention-tags-v1-version=2.0.21 -fabric-convention-tags-v2-version=2.6.1 +fabric-transfer-api-v1-version=5.1.19 +fabric-transitive-access-wideners-v1-version=6.1.2 +fabric-convention-tags-v1-version=2.0.22 +fabric-convention-tags-v2-version=2.6.2 fabric-client-tags-api-v1-version=1.1.16