Skip to content

Commit

Permalink
Check for players only (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
0hwx authored Jan 8, 2025
1 parent 743f707 commit b36dc61
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.util.Random;

import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;

import org.spongepowered.asm.mixin.Mixin;
Expand All @@ -19,7 +19,7 @@
public abstract class MixinItemStack {

@Unique
EntityPlayer bogo$entityPlayer = null;
EntityPlayerMP bogo$entityPlayer = null;

@Inject(
method = "attemptDamageItem",
Expand All @@ -35,7 +35,7 @@ public abstract class MixinItemStack {
target = "Lnet/minecraft/item/ItemStack;isItemStackDamageable()Z",
shift = At.Shift.AFTER))
private void bogo$damageItem(int p_77972_1_, EntityLivingBase p_77972_2_, CallbackInfo ci) {
if (p_77972_2_ instanceof EntityPlayer player) {
if (p_77972_2_ instanceof EntityPlayerMP player) {
bogo$entityPlayer = player;
} else bogo$entityPlayer = null;
}
Expand Down

0 comments on commit b36dc61

Please sign in to comment.