Skip to content

Commit

Permalink
v3.4.0 b624
Browse files Browse the repository at this point in the history
* fix behavior when using /lm summon with blacklisted mobs then they get unexpected high level attributes applied
  • Loading branch information
stumper66 committed Mar 30, 2022
1 parent 2718592 commit 79bcc63
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<groupId>me.lokka30</groupId>
<artifactId>LevelledMobs</artifactId>
<version>3.4.0 b623</version>
<version>3.4.0 b624</version>
<packaging>jar</packaging>

<name>LevelledMobs</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,12 +281,19 @@ public int getRule_MobMinLevel(@NotNull final LivingEntityInterface lmInterface)

public int getRule_MobMaxLevel(@NotNull final LivingEntityInterface lmInterface){
int maxLevel = 0;
int firstMaxLevel = -1;

for (final RuleInfo ruleInfo : lmInterface.getApplicableRules()) {
if (ruleInfo.restrictions_MaxLevel != null) maxLevel = ruleInfo.restrictions_MaxLevel;
if (ruleInfo.restrictions_MaxLevel != null) {
maxLevel = ruleInfo.restrictions_MaxLevel;
if (firstMaxLevel < 0 && maxLevel > 0) firstMaxLevel = maxLevel;
}
}

if (maxLevel <= 0 && lmInterface.getSummonedLevel() != null){
if (maxLevel == 0 && firstMaxLevel > 0)
maxLevel = firstMaxLevel;

int summonedLevel = lmInterface.getSummonedLevel();
if (summonedLevel > maxLevel) maxLevel = summonedLevel;
}
Expand Down

0 comments on commit 79bcc63

Please sign in to comment.