Skip to content

Commit

Permalink
1.21: Apply components when placing block entities
Browse files Browse the repository at this point in the history
  • Loading branch information
Moulberry committed Aug 21, 2024
1 parent ba04275 commit bacb8f1
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,11 @@ private void process(Player bukkitPlayer, byte[] message) {

BlockItem.updateCustomBlockEntityTag(player.level(), player, clickedPos, inHand);

BlockEntity blockEntity = player.level().getBlockEntity(clickedPos);
if (blockEntity != null) {
blockEntity.applyComponentsFromItemStack(inHand);
}

if (!(actualBlock instanceof BedBlock) && !(actualBlock instanceof DoublePlantBlock) && !(actualBlock instanceof DoorBlock)) {
actualBlock.setPlacedBy(player.level(), clickedPos, actualBlockState, player, inHand);
}
Expand Down

0 comments on commit bacb8f1

Please sign in to comment.