Java Code Examples for us.myles.ViaVersion.api.remapper.ValueCreator

The following examples show how to use us.myles.ViaVersion.api.remapper.ValueCreator. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source Project: ViaVersion   Author: ViaVersion   File: PacketWrapper.java    License: MIT License 2 votes vote down vote up
/**
 * Create a new packet with values.
 *
 * @param packetID The ID of the new packet
 * @param init     A ValueCreator to write to the packet.
 * @return The newly created packet wrapper
 * @throws Exception If it failed to write the values from the ValueCreator.
 */
public PacketWrapper create(int packetID, ValueCreator init) throws Exception {
    PacketWrapper wrapper = create(packetID);
    init.write(wrapper);
    return wrapper;
}