Fix onBlockAdded being called twice for ItemEntity placing non-TE blocks (#7607)

This commit is contained in:
Take Weiland authored and GitHub committed 2021-02-09 13:02:08 -08:00
1 parent f450d4025d
commit 8460227ddf
2 files changed
+7 -6

No files matched your search

@@ -678,10 +678,7 @@ public class ForgeHooks
int updateFlag = snap.getFlag();
BlockState oldBlock = snap.getReplacedBlock();
BlockState newBlock = world.getBlockState(snap.getPos());
if (!newBlock.hasTileEntity()) // Containers get placed automatically
{
newBlock.onBlockAdded(world, snap.getPos(), oldBlock, false);
}
newBlock.onBlockAdded(world, snap.getPos(), oldBlock, false);
world.markAndNotifyBlock(snap.getPos(), world.getChunkAt(snap.getPos()), oldBlock, newBlock, updateFlag, 512);
}