Skip to content

Commit

Permalink
How did I manage this
Browse files Browse the repository at this point in the history
  • Loading branch information
IMS212 committed Sep 5, 2023
1 parent a66a152 commit aef0141
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@

@Mixin(CapeLayer.class)
public class MixinCapeLayer {
private static final NamespacedId CAPE_LOCATION = new NamespacedId("minecraft", "player_cape");

@Inject(method = "render(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;ILnet/minecraft/client/player/AbstractClientPlayer;FFFFFF)V", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/vertex/PoseStack;pushPose()V"), locals = LocalCapture.CAPTURE_FAILHARD)
private void changeId(PoseStack pCapeLayer0, MultiBufferSource pMultiBufferSource1, int pInt2, AbstractClientPlayer pAbstractClientPlayer3, float pFloat4, float pFloat5, float pFloat6, float pFloat7, float pFloat8, float pFloat9, CallbackInfo ci, ItemStack lvItemStack11) {
if (BlockRenderingSettings.INSTANCE.getItemIds() == null) return;

ResourceLocation location = Registry.ITEM.getKey(Items.ELYTRA);

CapturedRenderingState.INSTANCE.setCurrentRenderedItem(BlockRenderingSettings.INSTANCE.getItemIds().applyAsInt(new NamespacedId(location.getNamespace(), location.getPath())));
CapturedRenderingState.INSTANCE.setCurrentRenderedItem(BlockRenderingSettings.INSTANCE.getItemIds().applyAsInt(CAPE_LOCATION));
}

@Inject(method = "render(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;ILnet/minecraft/client/player/AbstractClientPlayer;FFFFFF)V", at = @At(value = "RETURN"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@

@Mixin(ElytraLayer.class)
public abstract class MixinElytraLayer<T extends LivingEntity, M extends EntityModel<T>> extends RenderLayer<T, M> {
private static final NamespacedId CAPE_LOCATION = new NamespacedId("minecraft", "player_cape");

public MixinElytraLayer(RenderLayerParent<T, M> pRenderLayer0) {
super(pRenderLayer0);
}
Expand All @@ -36,7 +34,9 @@ public MixinElytraLayer(RenderLayerParent<T, M> pRenderLayer0) {
private void changeId(PoseStack pElytraLayer0, MultiBufferSource pMultiBufferSource1, int pInt2, T pLivingEntity3, float pFloat4, float pFloat5, float pFloat6, float pFloat7, float pFloat8, float pFloat9, CallbackInfo ci, ItemStack lvItemStack11, ResourceLocation lvResourceLocation12) {
if (BlockRenderingSettings.INSTANCE.getItemIds() == null) return;

CapturedRenderingState.INSTANCE.setCurrentRenderedItem(BlockRenderingSettings.INSTANCE.getItemIds().applyAsInt(CAPE_LOCATION));
ResourceLocation location = Registry.ITEM.getKey(Items.ELYTRA);

CapturedRenderingState.INSTANCE.setCurrentRenderedItem(BlockRenderingSettings.INSTANCE.getItemIds().applyAsInt(new NamespacedId(location.getNamespace(), location.getPath())));
}

@Inject(method = "render(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;ILnet/minecraft/world/entity/LivingEntity;FFFFFF)V", at = @At(value = "RETURN"))
Expand Down

0 comments on commit aef0141

Please sign in to comment.