From 8eb4b3903fdbae2daebb55c2ab3874368db71873 Mon Sep 17 00:00:00 2001 From: Skye Date: Thu, 22 Aug 2024 03:52:42 +0000 Subject: [PATCH] Render altiora sheaf on fabric --- .../client/FabricPlayerRendererMixin.java | 24 +++++++++++++++++++ .../main/resources/fabricasting.mixins.json | 3 ++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 Fabric/src/main/java/at/petrak/hexcasting/fabric/mixin/client/FabricPlayerRendererMixin.java diff --git a/Fabric/src/main/java/at/petrak/hexcasting/fabric/mixin/client/FabricPlayerRendererMixin.java b/Fabric/src/main/java/at/petrak/hexcasting/fabric/mixin/client/FabricPlayerRendererMixin.java new file mode 100644 index 0000000000..ec5bd74371 --- /dev/null +++ b/Fabric/src/main/java/at/petrak/hexcasting/fabric/mixin/client/FabricPlayerRendererMixin.java @@ -0,0 +1,24 @@ +package at.petrak.hexcasting.fabric.mixin.client; + +import at.petrak.hexcasting.client.model.AltioraLayer; +import net.minecraft.client.model.PlayerModel; +import net.minecraft.client.player.AbstractClientPlayer; +import net.minecraft.client.renderer.entity.EntityRendererProvider; +import net.minecraft.client.renderer.entity.LivingEntityRenderer; +import net.minecraft.client.renderer.entity.player.PlayerRenderer; +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; + +@Mixin(PlayerRenderer.class) +public abstract class FabricPlayerRendererMixin extends LivingEntityRenderer> { + public FabricPlayerRendererMixin(EntityRendererProvider.Context context, PlayerModel entityModel, float f) { + super(context, entityModel, f); + } + + @Inject(method = "", at = @At("TAIL")) + private void addAltiora(EntityRendererProvider.Context ctx, boolean bl, CallbackInfo ci) { + this.addLayer(new AltioraLayer<>((PlayerRenderer)(Object)this, ctx.getModelSet())); + } +} diff --git a/Fabric/src/main/resources/fabricasting.mixins.json b/Fabric/src/main/resources/fabricasting.mixins.json index 5a816cf1ba..f23162f39f 100644 --- a/Fabric/src/main/resources/fabricasting.mixins.json +++ b/Fabric/src/main/resources/fabricasting.mixins.json @@ -22,6 +22,7 @@ "client.FabricMixinGameRenderer", "client.FabricModelManagerMixin", "client.FabricMouseHandlerMixin", - "client.FabricParticleEngineMixin" + "client.FabricParticleEngineMixin", + "client.FabricPlayerRendererMixin" ] }