Skip to content

Commit 0c496ef

Browse files
committed
Crash fix
1 parent c307dd4 commit 0c496ef

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/main/java/nekiplay/meteorplus/mixin/meteorclient/modules/CriticalsMixin.java

+7-5
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,15 @@ private void onSendPacket(PacketEvent.Send event, CallbackInfo ci) {
4545
if (skipCrit()) { ci.cancel(); return; }
4646

4747
Entity entity = packet.meteor$getEntity();
48-
if (entity.getType() == EntityType.SHULKER_BULLET || entity.getType() == EntityType.FIREBALL) {
49-
ci.cancel();
50-
}
51-
else if (entity instanceof LivingEntity livingEntity) {
52-
if (!needCrit(livingEntity) && noWorkIfItsNotNeed.get()) {
48+
if (entity != null) {
49+
if (entity.getType() == EntityType.SHULKER_BULLET || entity.getType() == EntityType.FIREBALL) {
5350
ci.cancel();
5451
}
52+
else if (entity instanceof LivingEntity livingEntity) {
53+
if (!needCrit(livingEntity) && noWorkIfItsNotNeed.get()) {
54+
ci.cancel();
55+
}
56+
}
5557
}
5658
}
5759
}

0 commit comments

Comments
 (0)