3
0
Mirror von https://github.com/Moulberry/AxiomPaperPlugin.git synchronisiert 2024-09-29 16:00:04 +02:00

1.21: Apply components when placing block entities

Dieser Commit ist enthalten in:
Moulberry 2024-08-21 10:15:19 +08:00
Ursprung ba042757fd
Commit bacb8f1ecd

Datei anzeigen

@ -358,6 +358,11 @@ public class SetBlockPacketListener implements PluginMessageListener {
BlockItem.updateCustomBlockEntityTag(player.level(), player, clickedPos, inHand); 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)) { if (!(actualBlock instanceof BedBlock) && !(actualBlock instanceof DoublePlantBlock) && !(actualBlock instanceof DoorBlock)) {
actualBlock.setPlacedBy(player.level(), clickedPos, actualBlockState, player, inHand); actualBlock.setPlacedBy(player.level(), clickedPos, actualBlockState, player, inHand);
} }