Skip to content

Commit

Permalink
Fix mixin conflict with BetterCombat (#1115 #1126)
Browse files Browse the repository at this point in the history
  • Loading branch information
IzzelAliz committed Dec 10, 2023
1 parent 5e70607 commit 610953f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,9 @@ public void handlePlayerAction(ServerboundPlayerActionPacket packetplayinblockdi
switch (packetplayinblockdig_enumplayerdigtype) {
case SWAP_ITEM_WITH_OFFHAND: {
if (!this.player.isSpectator()) {
// ItemStack itemstack = this.player.getItemInHand(InteractionHand.OFF_HAND);
// BetterCombat mixin compatibility
// https://github.com/ZsoltMolnarrr/BetterCombat/blob/9090f08faf4a3e51256c8a7a13af94a80b6128c0/common/src/main/java/net/bettercombat/mixin/ServerPlayNetworkHandlerMixin.java
ItemStack offhandStack = this.player.getItemInHand(InteractionHand.OFF_HAND);
var event = net.minecraftforge.common.ForgeHooks.onLivingSwapHandItems(this.player);
if (event.isCanceled()) return;
ItemStack itemstack = event.getItemSwappedToMainHand();
Expand Down

0 comments on commit 610953f

Please sign in to comment.