Java Code Examples for com.mojang.datafixers.util.Pair#getSecond()

The following examples show how to use com.mojang.datafixers.util.Pair#getSecond() . 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 File: VBORenderType.java    From CodeChickenLib with GNU Lesser General Public License v2.1 6 votes vote down vote up
/**
 * Can be called runtime to have the Buffer rebuilt,
 * doing so has very limited applications and is not recommended.
 */
public void rebuild() {
    if (bufferId == -1) {
        bufferId = GL15.glGenBuffers();
    }

    BufferBuilder builder = new BufferBuilder(getBufferSize());
    builder.begin(getDrawMode(), getVertexFormat());
    factory.accept(getVertexFormat(), builder);
    builder.finishDrawing();
    Pair<BufferBuilder.DrawState, ByteBuffer> pair = builder.getNextBuffer();
    ByteBuffer buffer = pair.getSecond();
    count = buffer.remaining() / getVertexFormat().getSize();

    GL15.glBindBuffer(GL_ARRAY_BUFFER, bufferId);
    GL15.glBufferData(GL_ARRAY_BUFFER, buffer, GL_STATIC_DRAW);
    GL15.glBindBuffer(GL_ARRAY_BUFFER, 0);
}
 
Example 2
Source File: Proj2.java    From DataFixerUpper with MIT License 4 votes vote down vote up
@Override
public G view(final Pair<F, G> pair) {
    return pair.getSecond();
}