Search in sources :

Example 1 with Packet

use of net.minecraft.network.protocol.Packet in project MinecraftForge by MinecraftForge.

the class MCRegisterPacketHandler method sendRegistry.

public void sendRegistry(Connection manager, final NetworkDirection dir) {
    FriendlyByteBuf pb = new FriendlyByteBuf(Unpooled.buffer());
    pb.writeBytes(getFrom(manager).toByteArray());
    final ICustomPacket<Packet<?>> iPacketICustomPacket = dir.buildPacket(Pair.of(pb, 0), NetworkConstants.MC_REGISTER_RESOURCE);
    manager.send(iPacketICustomPacket.getThis());
}
Also used : FriendlyByteBuf(net.minecraft.network.FriendlyByteBuf) Packet(net.minecraft.network.protocol.Packet)

Aggregations

FriendlyByteBuf (net.minecraft.network.FriendlyByteBuf)1 Packet (net.minecraft.network.protocol.Packet)1