Skip to content

Commit

Permalink
fixed client crash
Browse files Browse the repository at this point in the history
  • Loading branch information
JustS-js committed Sep 1, 2024
1 parent a5abf8f commit 2257db7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/net/just_s/sframes/mixin/ItemFrameMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class ItemFrameMixin {
@Inject(at = @At("HEAD"), method = "damage", cancellable = true)
private void sframes$onItemFrameDamageWithTool(DamageSource source, float amount, CallbackInfoReturnable<Boolean> cir) {
Entity attacker = source.getAttacker();
if (attacker == null || !attacker.isPlayer()) return;
if (attacker == null || !attacker.isPlayer() || attacker.getWorld().isClient()) return;

ServerPlayerEntity player = (ServerPlayerEntity) attacker;
ItemStack itemStackInHand = player.getInventory().getStack(player.getInventory().selectedSlot);
Expand Down

0 comments on commit 2257db7

Please sign in to comment.