Skip to content

Commit

Permalink
Fix patched onEquipItem.
Browse files Browse the repository at this point in the history
Signed-off-by: 秋雨落 <[email protected]>
  • Loading branch information
qyl27 committed Nov 8, 2024
1 parent fd678b5 commit 5ba275c
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ public abstract class LivingEntityMixin extends EntityMixin implements LivingEnt
@Shadow public abstract int getArmorValue();
@Shadow public abstract EquipmentSlot getEquipmentSlotForItem(ItemStack itemStack);
@Shadow protected abstract void dropAllDeathLoot(ServerLevel serverLevel, DamageSource damageSource);
@Shadow public abstract void onEquipItem(EquipmentSlot slot, ItemStack original, ItemStack newStack);
// @formatter:on

public int expToDrop;
Expand Down Expand Up @@ -989,13 +990,13 @@ public void setItemSlot(EquipmentSlot slot, ItemStack stack, boolean silent) {
this.setItemSlot(slot, stack);
}

public void onEquipItem(EquipmentSlot slotIn, ItemStack stack, boolean silent) {
this.setItemSlot(slotIn, stack);
public void onEquipItem(EquipmentSlot slot, ItemStack stack, ItemStack stack1, boolean silent) {
this.onEquipItem(slot, stack, stack1);
}

@Override
public void bridge$setSlot(EquipmentSlot slotIn, ItemStack stack, boolean silent) {
this.onEquipItem(slotIn, stack, silent);
public void bridge$setSlot(EquipmentSlot slot, ItemStack stack, boolean silent) {
this.setItemSlot(slot, stack, silent);
}

protected void equipEventAndSound(EquipmentSlot slot, ItemStack oldItem, ItemStack newItem, boolean silent) {
Expand Down

0 comments on commit 5ba275c

Please sign in to comment.