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());
}
Aggregations