generated from TropheusJ/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix cape with balloon cart holding anim
- Loading branch information
1 parent
f6a957f
commit f1e0eed
Showing
4 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
src/main/java/one/devos/nautical/up_and_away/framework/ext/HumanoidModelExt.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package one.devos.nautical.up_and_away.framework.ext; | ||
|
||
public interface HumanoidModelExt { | ||
boolean up_and_away$holdingBalloonCart(); | ||
} |
33 changes: 33 additions & 0 deletions
33
src/main/java/one/devos/nautical/up_and_away/mixin/client/CapeLayerMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package one.devos.nautical.up_and_away.mixin.client; | ||
|
||
import com.llamalad7.mixinextras.injector.ModifyExpressionValue; | ||
|
||
import net.minecraft.client.model.PlayerModel; | ||
import net.minecraft.client.player.AbstractClientPlayer; | ||
import net.minecraft.client.renderer.entity.RenderLayerParent; | ||
import net.minecraft.client.renderer.entity.layers.CapeLayer; | ||
|
||
import net.minecraft.client.renderer.entity.layers.RenderLayer; | ||
|
||
import one.devos.nautical.up_and_away.framework.ext.HumanoidModelExt; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
|
||
@Mixin(CapeLayer.class) | ||
public abstract class CapeLayerMixin extends RenderLayer<AbstractClientPlayer, PlayerModel<AbstractClientPlayer>> { | ||
private CapeLayerMixin(RenderLayerParent<AbstractClientPlayer, PlayerModel<AbstractClientPlayer>> context) { | ||
super(context); | ||
} | ||
|
||
@ModifyExpressionValue( | ||
method = "render(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;ILnet/minecraft/client/player/AbstractClientPlayer;FFFFFF)V", | ||
at = @At( | ||
value = "INVOKE", | ||
target = "Lnet/minecraft/client/player/AbstractClientPlayer;isCrouching()Z" | ||
) | ||
) | ||
private boolean balloonCartExtraCrouch(boolean original) { | ||
return original || ((HumanoidModelExt) this.getParentModel()).up_and_away$holdingBalloonCart(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters