use of net.minecraft.network.PacketByteBuf in project bewitchment by MoriyaShiine.
the class SyncDemonTradesPacket method send.
public static void send(PlayerEntity player, DemonMerchant merchant, int syncId) {
PacketByteBuf buf = new PacketByteBuf(Unpooled.buffer());
buf.writeInt(syncId);
DemonEntity.DemonTradeOffer.toPacket(merchant.getOffers(), buf);
buf.writeInt(merchant.getDemonTrader().getId());
buf.writeBoolean(merchant.isDiscount());
ServerPlayNetworking.send((ServerPlayerEntity) player, ID, buf);
}
use of net.minecraft.network.PacketByteBuf in project WK by witches-kitchen.
the class ParticlePacketHandler method send.
public static void send(ServerPlayerEntity player, final BlockPos pos, final Identifier particle, @Nullable final Identifier sound, final byte range) {
final PacketByteBuf data = PacketByteBufs.create();
data.writeBlockPos(pos);
data.writeIdentifier(particle);
data.writeIdentifier(sound == null ? new Identifier("") : sound);
data.writeByte(range);
ServerPlayNetworking.send(player, CHANNEL, data);
}
use of net.minecraft.network.PacketByteBuf in project WK by witches-kitchen.
the class SplashParticlePacketHandler method send.
public static void send(ServerPlayerEntity player, BlockPos pos, double r, double g, double b, double offsetX, double offsetY, double offsetZ, byte amount) {
PacketByteBuf data = PacketByteBufs.create();
data.writeBlockPos(pos);
data.writeDouble(r);
data.writeDouble(g);
data.writeDouble(b);
data.writeDouble(offsetX);
data.writeDouble(offsetY);
data.writeDouble(offsetZ);
data.writeByte(amount);
ServerPlayNetworking.send(player, SPLASH_PARTICLE_CHANNEL, data);
}
use of net.minecraft.network.PacketByteBuf in project frame-fabric by moddingplayground.
the class SynchronizedBooleanGameRuleRegistryImpl method synchronize.
public void synchronize(ServerPlayerEntity player, String id, boolean value) {
PacketByteBuf buf = PacketByteBufs.create();
buf.writeString(id);
buf.writeBoolean(value);
ServerPlayNetworking.send(player, PACKET_ID, buf);
}
use of net.minecraft.network.PacketByteBuf in project VeinMining by TheIllusiveC4.
the class VeinMiningNetwork method sendState.
public static void sendState(boolean state) {
PacketByteBuf buf = PacketByteBufs.create();
buf.writeBoolean(state);
ClientPlayNetworking.send(SEND_STATE, buf);
}
Aggregations