mirror of
https://github.com/TeamMidnightDust/SwordBlocking.git
synced 2025-12-15 14:35:10 +01:00
Fix mixin apply crash
This commit is contained in:
@@ -40,7 +40,7 @@ public abstract class MixinHeldItemRenderer {
|
||||
}
|
||||
|
||||
@Redirect(method = "renderFirstPersonItem", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/AbstractClientPlayerEntity;getActiveHand()Lnet/minecraft/util/Hand;", ordinal = 1))
|
||||
private Hand swordBlocking$changeActiveHand(AbstractClientPlayerEntity player, @Local(name = "hand") Hand hand) {
|
||||
private Hand swordBlocking$changeActiveHand(AbstractClientPlayerEntity player) {
|
||||
Hand activeHand = player.getActiveHand();
|
||||
if (SwordBlockingClient.isEntityBlocking(player)) {
|
||||
return swordBlocking$getBlockingHand(activeHand);
|
||||
@@ -50,7 +50,7 @@ public abstract class MixinHeldItemRenderer {
|
||||
}
|
||||
|
||||
@Redirect(method = "renderFirstPersonItem", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;getUseAction()Lnet/minecraft/item/consume/UseAction;"))
|
||||
private UseAction swordBlocking$changeItemAction(ItemStack stack, @Local(argsOnly = true) AbstractClientPlayerEntity player, @Local(name = "hand") Hand hand) {
|
||||
private UseAction swordBlocking$changeItemAction(ItemStack stack, @Local(argsOnly = true) AbstractClientPlayerEntity player, @Local(argsOnly = true) Hand hand) {
|
||||
UseAction defaultUseAction = stack.getUseAction();
|
||||
if (SwordBlockingClient.isEntityBlocking(player)) {
|
||||
return swordBlocking$getBlockingHand(player.getActiveHand()) == hand ? UseAction.BLOCK : defaultUseAction;
|
||||
|
||||
@@ -17,7 +17,7 @@ neoforge_version=21.4.9-beta
|
||||
|
||||
# Information
|
||||
archives_base_name=swordblocking
|
||||
mod_version=2.2.0
|
||||
mod_version=2.2.1
|
||||
maven_group=eu.midnightdust
|
||||
release_type=release
|
||||
curseforge_id=427738
|
||||
|
||||
Reference in New Issue
Block a user