Skip to content

Commit 91ec322

Browse files
committed
Fixed nullability problem #2
1 parent 732a7d1 commit 91ec322

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ org.gradle.daemon=false
1010
mappings_version=2022.03.13-1.18.2
1111

1212
# Mod Properties
13-
mod_version=1.1.1
13+
mod_version=1.1.1.1
1414
mod_id=origins_classes
1515
mod_author=LimonBlaze
1616
maven_group=limonblaze.originsclasses

src/main/java/limonblaze/originsclasses/mixin/PotionUtilMixin.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ public class PotionUtilMixin {
1818

1919
@Inject(method = "getAllEffects(Lnet/minecraft/nbt/CompoundTag;)Ljava/util/List;", at = @At("RETURN"), cancellable = true)
2020
private static void originsClasses$modifyPotion(@Nullable CompoundTag nbt, CallbackInfoReturnable<List<MobEffectInstance>> cir) {
21-
byte bonusLevel = ClericUtils.getPotionBonus(nbt);
22-
if(bonusLevel > 0) {
23-
cir.setReturnValue(cir.getReturnValue().stream().map(effect -> ClericUtils.applyPotionBonus(effect, bonusLevel)).collect(Collectors.toList()));
21+
if(nbt != null) {
22+
byte bonusLevel = ClericUtils.getPotionBonus(nbt);
23+
if(bonusLevel > 0) {
24+
cir.setReturnValue(cir.getReturnValue().stream().map(effect -> ClericUtils.applyPotionBonus(effect, bonusLevel)).collect(Collectors.toList()));
25+
}
2426
}
2527
}
2628

0 commit comments

Comments
 (0)