Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix end links not working after restart #201

Merged
merged 1 commit into from
Dec 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,26 @@ public void loadConfig() {
Set<String> worldKeys = this.MVNPconfiguration.getConfigurationSection("worlds").getKeys(false);
if (worldKeys != null) {
for (String worldString : worldKeys) {
String nether = this.MVNPconfiguration.getString("worlds." + worldString + ".portalgoesto.NETHER", null);
String ender = this.MVNPconfiguration.getString("worlds." + worldString + ".portalgoesto.END", null);
String nether = this.MVNPconfiguration.getString("worlds." + worldString + ".portalgoesto." + PortalType.NETHER, null);
String ender = this.MVNPconfiguration.getString("worlds." + worldString + ".portalgoesto." + PortalType.ENDER, null);
if (nether != null) {
this.linkMap.put(worldString, nether);
}
if (ender != null) {
this.endLinkMap.put(worldString, ender);
}

// Convert from old version enum which used END not ENDER
String oldEnder = this.MVNPconfiguration.getString("worlds." + worldString + ".portalgoesto.END", null);
if (oldEnder != null) {
if (this.addWorldLink(worldString, oldEnder, PortalType.ENDER)) {
this.MVNPconfiguration.set("worlds." + worldString + ".portalgoesto.END", null);
nicegamer7 marked this conversation as resolved.
Show resolved Hide resolved
}
else {
Logging.warning("Error converting old end link of '%s' to '%s'", worldString, oldEnder);
}
}

}
}
this.saveMVNPConfig();
Expand Down