Skip to content

Commit 3048b9a

Browse files
committed
minor fix
1 parent fe29d9e commit 3048b9a

3 files changed

Lines changed: 11 additions & 1 deletion

File tree

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ mod_name=MadParticle
3535
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
3636
mod_license=GNU GPL 3.0
3737
# The mod version. See https://semver.org/
38-
mod_version=26.1.2-9
38+
mod_version=26.1.2-10
3939
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
4040
# This should match the base package used for the mod sources.
4141
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html

src/main/java/cn/ussshenzhou/madparticle/particle/render/NeoInstancedRenderManager.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,12 @@ public void postUpdate(MultiThreadedEqualObjectLinkedOpenHashSetQueue<Particle>
191191
void updateTickVBOInternal(ObjectLinkedOpenHashSet<SingleQuadParticle> particles, int index, long tickVBOAddress, @Deprecated float partialTicks) {
192192
long start = tickVBOAddress + (long) index * TICK_VBO_SIZE;
193193
for (SingleQuadParticle particle : particles) {
194+
if (particle.removed) {
195+
MemoryUtil.zero(start, TICK_VBO_SIZE);
196+
index++;
197+
start += TICK_VBO_SIZE;
198+
continue;
199+
}
194200
//xyz roll
195201
MemoryUtil.memPutFloat(start, (float) particle.x);
196202
MemoryUtil.memPutFloat(start + 4, (float) particle.y);

src/main/java/cn/ussshenzhou/madparticle/util/MemoryUtil.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,8 @@ public static void memPutFloat(long ptr, float value) {
9393
public static void memPutDouble(long ptr, double value) {
9494
UNSAFE.putDouble(null, ptr, value);
9595
}
96+
97+
public static void zero(long ptr, int bytes) {
98+
UNSAFE.setMemory(ptr, bytes, (byte) 0);
99+
}
96100
}

0 commit comments

Comments
 (0)