diff options
| author | DoKM <54663875+DoKM@users.noreply.github.com> | 2021-09-27 21:06:35 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-27 21:06:35 +0200 |
| commit | 007020ae547a88b2855479f69886bf42e1c4da5a (patch) | |
| tree | fd4a98db21c23a14f9e95a0014dddf388a12f16d /src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java | |
| parent | 4ce3332d0cacdfa6b621d5b60f4f8e9251a9fd40 (diff) | |
| parent | 4da2b758d13b8ae443f1b2b84ec39e123c3b29f1 (diff) | |
| download | notenoughupdates-007020ae547a88b2855479f69886bf42e1c4da5a.tar.gz notenoughupdates-007020ae547a88b2855479f69886bf42e1c4da5a.tar.bz2 notenoughupdates-007020ae547a88b2855479f69886bf42e1c4da5a.zip | |
Merge pull request #37 from Keebler408/master
Update commission location to use commission type stack, not player location
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java | 16 |
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<>(); } |
