mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-18 16:02:19 +01:00
Merge pull request #4036 from jacquerol/mc1.18/dev
Add 3rd person crossbow holding animation to potato cannon and zapper
This commit is contained in:
commit
8e64f387bc
3 changed files with 41 additions and 7 deletions
|
@ -0,0 +1,31 @@
|
||||||
|
package com.simibubi.create.foundation.mixin;
|
||||||
|
|
||||||
|
import com.simibubi.create.content.curiosities.zapper.ZapperItem;
|
||||||
|
|
||||||
|
import net.minecraft.world.item.Item;
|
||||||
|
|
||||||
|
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.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
import com.simibubi.create.content.curiosities.weapons.PotatoCannonItem;
|
||||||
|
import net.minecraft.client.model.HumanoidModel;
|
||||||
|
import net.minecraft.client.player.AbstractClientPlayer;
|
||||||
|
import net.minecraft.client.renderer.entity.player.PlayerRenderer;
|
||||||
|
import net.minecraft.world.InteractionHand;
|
||||||
|
|
||||||
|
@Mixin(PlayerRenderer.class)
|
||||||
|
public class PlayerEntityRendererMixin {
|
||||||
|
@Inject(
|
||||||
|
method = "getArmPose",
|
||||||
|
at = @At("HEAD"),
|
||||||
|
cancellable = true
|
||||||
|
)
|
||||||
|
private static void getArmPose(AbstractClientPlayer player, InteractionHand hand, CallbackInfoReturnable<HumanoidModel.ArmPose> ci) {
|
||||||
|
Item handItem = player.getItemInHand(hand).getItem();
|
||||||
|
if (!player.swinging && (handItem instanceof PotatoCannonItem || handItem instanceof ZapperItem))
|
||||||
|
ci.setReturnValue(HumanoidModel.ArmPose.CROSSBOW_HOLD);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -96,18 +96,20 @@
|
||||||
],
|
],
|
||||||
"display": {
|
"display": {
|
||||||
"thirdperson_righthand": {
|
"thirdperson_righthand": {
|
||||||
"translation": [0, 2, 0]
|
"rotation": [0, -15, 0],
|
||||||
|
"translation": [0, 0, -4]
|
||||||
},
|
},
|
||||||
"thirdperson_lefthand": {
|
"thirdperson_lefthand": {
|
||||||
"translation": [0, 2, 0]
|
"rotation": [0, -15, 0],
|
||||||
|
"translation": [0, 0, -4]
|
||||||
},
|
},
|
||||||
"firstperson_righthand": {
|
"firstperson_righthand": {
|
||||||
"rotation": [5, 4, 5],
|
"rotation": [5, 5, 5],
|
||||||
"translation": [0.25, 4, 0.75]
|
"translation": [0.25, 5, 0.75]
|
||||||
},
|
},
|
||||||
"firstperson_lefthand": {
|
"firstperson_lefthand": {
|
||||||
"rotation": [5, 4, 5],
|
"rotation": [5, 5, 5],
|
||||||
"translation": [0.25, 4, 0.75]
|
"translation": [0.25, 5, 0.75]
|
||||||
},
|
},
|
||||||
"ground": {
|
"ground": {
|
||||||
"rotation": [0, 0, 90],
|
"rotation": [0, 0, 90],
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
"HeavyBootsOnPlayerMixin",
|
"HeavyBootsOnPlayerMixin",
|
||||||
"LevelRendererMixin",
|
"LevelRendererMixin",
|
||||||
"MapRendererMapInstanceMixin",
|
"MapRendererMapInstanceMixin",
|
||||||
|
"PlayerEntityRendererMixin",
|
||||||
"ModelDataRefreshMixin",
|
"ModelDataRefreshMixin",
|
||||||
"WindowResizeMixin",
|
"WindowResizeMixin",
|
||||||
"accessor.AgeableListModelAccessor",
|
"accessor.AgeableListModelAccessor",
|
||||||
|
|
Loading…
Reference in a new issue