Skip to content

Commit 690ea63

Browse files
committed
Prevent crash in case of race condition. Fix #139
1 parent 1cef6aa commit 690ea63

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

gradle-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ source: "https://github.com/tr7zw/ProcessedModTemplate/tree/master"
33
replacements:
44
name: "WaveyCapes"
55
id: "waveycapes"
6-
version: "1.10.0"
6+
version: "1.10.1"
77
description: "The cape shouldn't be a static slab!"
88
homepageUrl: "https://modrinth.com/mod/wavey-capes"
99
sourcesUrl: "https://github.com/tr7zw/WaveyCapes"

src/main/java/dev/tr7zw/waveycapes/render/CustomCapeRenderer.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,10 @@ private void modifyPoseStackSimulation(PoseStack poseStack, PlayerWrapper capeRe
265265
/*var entity = capeRenderInfo.getEntity();
266266
*///? }
267267
BasicSimulation simulation = ((CapeHolder) entity).getSimulation();
268+
if (simulation == null) {
269+
// race condition where the cape is being rendered before the simulation is initialized, just render it without movement instead of crashing
270+
return;
271+
}
268272
poseStack.pushPose();
269273
poseStack.translate(0.0D, 0.0D, 0.125D);
270274

0 commit comments

Comments
 (0)