Skip to content

Commit

Permalink
3.2.6 b576
Browse files Browse the repository at this point in the history
* fixed rule allowed-worldguard-regions breaking levelling on regions outside of the list
  • Loading branch information
stumper66 committed Nov 30, 2021
1 parent 61dd4d4 commit 7806d98
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 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.2.6 b575</version>
<version>3.2.6 b576</version>
<packaging>jar</packaging>

<name>LevelledMobs</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.jetbrains.annotations.Nullable;
import simplepets.brainsynder.api.plugin.SimplePets;

import java.util.Collections;
import java.util.List;
import java.util.Map;

Expand Down Expand Up @@ -337,9 +338,9 @@ public static boolean isMobOfShopkeepers(final @NotNull LivingEntityWrapper lmEn
return isExternalType;
}

@Nullable
@NotNull
public static List<String> getWGRegionsAtLocation(@NotNull final LivingEntityInterface lmInterface){
if (!ExternalCompatibilityManager.hasWorldGuardInstalled()) return null;
if (!ExternalCompatibilityManager.hasWorldGuardInstalled()) return Collections.emptyList();

return WorldGuardIntegration.getWorldGuardRegionsForLocation(lmInterface);
}
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/me/lokka30/levelledmobs/rules/RulesManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -644,12 +644,12 @@ private boolean isRuleApplicable_Entity(final LivingEntityWrapper lmEntity, @Not
if (ri.conditions_WGRegions != null){
boolean isInList = false;
final List<String> wgRegions = ExternalCompatibilityManager.getWGRegionsAtLocation(lmInterface);
if (wgRegions != null) {
for (final String regionName : wgRegions) {
if (ri.conditions_WGRegions.isEnabledInList(regionName, null)) {
isInList = true;
break;
}
if (wgRegions.isEmpty()) wgRegions.add("(none)");

for (final String regionName : wgRegions) {
if (ri.conditions_WGRegions.isEnabledInList(regionName, null)) {
isInList = true;
break;
}
}

Expand Down

0 comments on commit 7806d98

Please sign in to comment.