Fix potential NPE in ForgeHooks.onItemPlaceIntoWorld when passing in null player. (#7505)

This commit is contained in:
Alex O'Neill authored and GitHub committed 2020-12-28 12:18:52 -08:00
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();