yarn
yarn copied to clipboard
`VertexConsumer.vertex(double, double, double)` -> `pos`
The vertex(double, double, double)
and vertex(Matrix4f, float, float, float)
methods should be renamed to pos
. These methods only specify the position element of the vertex. pos
makes it in line with the color
and texture
methods.
My guess is that it was named vertex
to convey that it's a start of the vertex building. While it's true in vanilla, one can define a vertex format that doesn't have a position element at the beginning. In addition to that, the next
method already serves as a delimiter.
The other vertex
methods should not be renamed because they specify all elements of a vertex (and even call the next
method to end the current vertex building).
I'd say this is quite impactful too, since it affects any mod doing rendering with VertexConsumer
.
Given we've been doing some sort of rendering code refactor in snapshots it makes sense to fix there. Hmm, I can try make a PR from GitHub Mobile I guess? Or perhaps others with Enigma will do it first?
The name should be position
than pos
, as that's what we have in VertexFormatElement.Type
and VertexFormats
.
I'd prefer shorter names for builder methods especially when they have high traffic. I'm not sure if consistency is that important in this context.