aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/options
diff options
context:
space:
mode:
authorDavid Mills <85420839+Keebler408@users.noreply.github.com>2021-09-27 13:43:38 -0500
committerDavid Mills <85420839+Keebler408@users.noreply.github.com>2021-09-27 13:43:38 -0500
commit6a61e4e97006c8fe85581bea9d5f3fc0409ecfac (patch)
tree1aef72342490097dd9b024a21603eacc920b64b9 /src/main/java/io/github/moulberry/notenoughupdates/options
parent4ce3332d0cacdfa6b621d5b60f4f8e9251a9fd40 (diff)
downloadnotenoughupdates-6a61e4e97006c8fe85581bea9d5f3fc0409ecfac.tar.gz
notenoughupdates-6a61e4e97006c8fe85581bea9d5f3fc0409ecfac.tar.bz2
notenoughupdates-6a61e4e97006c8fe85581bea9d5f3fc0409ecfac.zip
Update per-location commissions to read commission type stack, not current player location
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/options')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java
index d4a078a9..06619ffd 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java
@@ -365,13 +365,19 @@ public class NEUConfig extends Config {
}
public HiddenLocationSpecific getLocationSpecific() {
- if(SBInfo.getInstance().location == null) {
- return null;
- }
- return hidden.locationSpecific.computeIfAbsent(SBInfo.getInstance().getLocation(), k-> new HiddenLocationSpecific());
+ String location = SBInfo.getInstance().getLocation();
+ if(location == null || location.isEmpty()) {
+ return null;
}
- public static class HiddenLocationSpecific {
+ return getLocationSpecific(location);
+ }
+
+ public HiddenLocationSpecific getLocationSpecific(String location) {
+ return hidden.locationSpecific.computeIfAbsent(location, k-> new HiddenLocationSpecific());
+ }
+
+ public static class HiddenLocationSpecific {
@Expose public Map<String, Integer> commissionMaxes = new HashMap<>();
}