Skip to content

Commit 1bd617b

Browse files
committed
Fixed nullability problem #2
1 parent e5e5a49 commit 1bd617b

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
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.02.13-1.18.1
1111

1212
# Mod Properties
13-
mod_version=1.0.2
13+
mod_version=1.0.2.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

src/main/java/limonblaze/originsclasses/util/ClericUtils.java

-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
package limonblaze.originsclasses.util;
22

3-
import limonblaze.originsclasses.compat.OriginsClassesCompat;
43
import net.minecraft.nbt.CompoundTag;
54
import net.minecraft.nbt.Tag;
65
import net.minecraft.world.effect.MobEffectInstance;
76
import net.minecraft.world.item.ItemStack;
8-
import shadows.apotheosis.Apotheosis;
97

108
public class ClericUtils {
119

0 commit comments

Comments
 (0)