Skip to content

Commit

Permalink
Fixed nullability problem #2
Browse files Browse the repository at this point in the history
  • Loading branch information
RaymondBlaze committed Apr 17, 2022
1 parent 732a7d1 commit 91ec322
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ org.gradle.daemon=false
mappings_version=2022.03.13-1.18.2

# Mod Properties
mod_version=1.1.1
mod_version=1.1.1.1
mod_id=origins_classes
mod_author=LimonBlaze
maven_group=limonblaze.originsclasses
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ public class PotionUtilMixin {

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

Expand Down

0 comments on commit 91ec322

Please sign in to comment.