Fix potential NPE in ForgeHooks.onItemPlaceIntoWorld when passing in null player. (#7505)
This commit is contained in:
parent
545723dc8c
commit
a1119cd77a
1 changed files with 2 additions and 1 deletions
|
@ -674,7 +674,8 @@ public class ForgeHooks
|
|||
|
||||
world.markAndNotifyBlock(snap.getPos(), world.getChunkAt(snap.getPos()), oldBlock, newBlock, updateFlag, 512);
|
||||
}
|
||||
player.addStat(Stats.ITEM_USED.get(item));
|
||||
if (player != null)
|
||||
player.addStat(Stats.ITEM_USED.get(item));
|
||||
}
|
||||
}
|
||||
world.capturedBlockSnapshots.clear();
|
||||
|
|
Loading…
Reference in a new issue