use of net.minecraft.network.protocol.game.ClientboundBlockUpdatePacket in project SpongeCommon by SpongePowered.
the class LevelMixin_API method sendBlockChange.
@Override
public void sendBlockChange(final int x, final int y, final int z, final org.spongepowered.api.block.BlockState state) {
Objects.requireNonNull(state, "state");
final ClientboundBlockUpdatePacket packet = new ClientboundBlockUpdatePacket(new BlockPos(x, y, z), (BlockState) state);
((net.minecraft.world.level.Level) (Object) this).players().stream().filter(ServerPlayer.class::isInstance).map(ServerPlayer.class::cast).forEach(p -> p.connection.send(packet));
}
use of net.minecraft.network.protocol.game.ClientboundBlockUpdatePacket in project SpongeCommon by SpongePowered.
the class LevelMixin_API method resetBlockChange.
@Override
public void resetBlockChange(final int x, final int y, final int z) {
final ClientboundBlockUpdatePacket packet = new ClientboundBlockUpdatePacket((LevelReader) this, new BlockPos(x, y, z));
((net.minecraft.world.level.Level) (Object) this).players().stream().filter(ServerPlayer.class::isInstance).map(ServerPlayer.class::cast).forEach(p -> p.connection.send(packet));
}
Aggregations