diff --git a/common/src/main/java/foundry/veil/api/client/render/VeilShaderBufferLayout.java b/common/src/main/java/foundry/veil/api/client/render/VeilShaderBufferLayout.java index d38fcde9..50145773 100644 --- a/common/src/main/java/foundry/veil/api/client/render/VeilShaderBufferLayout.java +++ b/common/src/main/java/foundry/veil/api/client/render/VeilShaderBufferLayout.java @@ -10,10 +10,8 @@ import org.joml.*; import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; +import java.util.Random; +import java.util.*; import java.util.function.Function; /** @@ -99,6 +97,8 @@ public interface FieldSerializer { */ public static class Builder { + private static final Random RANDOM = new Random(); + private final String name; private final List structFields; private final Map> fields; @@ -106,7 +106,7 @@ public static class Builder { private ShaderBlock.MemoryLayout memoryLayout; public Builder() { - this.name = "VeilBuffer" + Long.hashCode(System.currentTimeMillis()); + this.name = "VeilBuffer" + RANDOM.nextLong(); this.structFields = new ArrayList<>(); this.fields = new Object2ObjectArrayMap<>(); this.binding = ShaderBlock.BufferBinding.UNIFORM;