mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-13 16:54:22 +00:00
Fix potential NPE in ForgeHooks.onItemPlaceIntoWorld when passing in null player. (#7505)
This commit is contained in:
1 parent
545723dc8c
commit
a1119cd77a
1 file changed
+2
-1
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user