Files
CatServer/patches/net/minecraft/client/renderer/vertex/VertexFormat.java.patch
2019-02-24 22:29:41 +08:00

39 lines
1.0 KiB
Diff

--- ../src-base/minecraft/net/minecraft/client/renderer/vertex/VertexFormat.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/vertex/VertexFormat.java
@@ -17,6 +17,7 @@
private int colorElementOffset;
private final List<Integer> uvOffsetsById;
private int normalElementOffset;
+ private int hashCode;
public VertexFormat(VertexFormat vertexFormatIn)
{
@@ -47,6 +48,7 @@
this.uvOffsetsById.clear();
this.normalElementOffset = -1;
this.nextOffset = 0;
+ this.hashCode = 0;
}
@SuppressWarnings("incomplete-switch")
@@ -75,6 +77,7 @@
}
this.nextOffset += element.getSize();
+ this.hashCode = 0;
return this;
}
}
@@ -204,9 +207,11 @@
public int hashCode()
{
+ if (this.hashCode != 0) return this.hashCode;
int i = this.elements.hashCode();
i = 31 * i + this.offsets.hashCode();
i = 31 * i + this.nextOffset;
+ this.hashCode = i;
return i;
}
}