Skip to content

Commit ec0b09f

Browse files
committed
fixed lightning triggering on self & fixed crash when joining constantiam queue
1 parent 70e31ae commit ec0b09f

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ yarn_mappings=1.21.11+build.3
88
loader_version=0.18.2
99

1010
# Mod Properties
11-
mod_version=2.6.12
11+
mod_version=2.6.13
1212
maven_group=cqb13.NumbyHack
1313
archives_base_name=Numby-Hack

src/main/java/cqb13/NumbyHack/utils/PlayerParticle.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ private static void onPostTickEvent(TickEvent.Post post) {
7878
}
7979

8080
private static void displayParticleEffect(PlayerEntity player, ParticleEffect effect) {
81-
assert mc.player != null;
82-
assert mc.world != null;
81+
if (mc.world == null || mc.player == null) {
82+
return;
83+
}
8384

8485
if (effect == ParticleTypes.SOUL) {
8586
double x = player.getX() + (RANDOM.nextDouble() - 0.5D) * (double) player.getWidth();
@@ -114,7 +115,13 @@ private static void displayParticleEffect(PlayerEntity player, ParticleEffect ef
114115

115116
@EventHandler
116117
private static void onEntityAdded(@NotNull EntityAddedEvent event) {
117-
assert mc.world != null;
118+
if (mc.world == null || mc.player == null) {
119+
return;
120+
}
121+
122+
if (event.entity.getUuid().equals(mc.player.getUuid())) {
123+
return;
124+
}
118125

119126
if (!LIGHTNING_UUIDS.contains(event.entity.getUuid())) {
120127
return;

0 commit comments

Comments
 (0)