mirror of
https://github.com/FabricMC/fabric.git
synced 2025-03-23 21:40:02 -04:00
Send block entity update packet along with regular block update packet (#1689)
* Send block entity update packet along with regular block update packet * Fix style
This commit is contained in:
parent
49e84ad51a
commit
3fb13e467a
1 changed files with 10 additions and 0 deletions
|
@ -27,6 +27,7 @@ import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
|
|||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.network.packet.s2c.play.BlockEntityUpdateS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.BlockUpdateS2CPacket;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
|
@ -61,6 +62,15 @@ public class MixinServerPlayerInteractionManager {
|
|||
if (result != ActionResult.PASS) {
|
||||
// The client might have broken the block on its side, so make sure to let it know.
|
||||
this.player.networkHandler.sendPacket(new BlockUpdateS2CPacket(world, pos));
|
||||
|
||||
if (world.getBlockState(pos).hasBlockEntity()) {
|
||||
BlockEntityUpdateS2CPacket updatePacket = world.getBlockEntity(pos).toUpdatePacket();
|
||||
|
||||
if (updatePacket != null) {
|
||||
this.player.networkHandler.sendPacket(updatePacket);
|
||||
}
|
||||
}
|
||||
|
||||
info.cancel();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue