Skip to content

Commit

Permalink
Remove edit instances before renaming a world; resolves #368
Browse files Browse the repository at this point in the history
  • Loading branch information
Sataniel98 committed May 31, 2018
1 parent b73b7d5 commit 7e65ff1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Building DungeonsXL from source requires [Apache Maven](https://maven.apache.org
Maven automatically fetches all dependencies and builds DungeonsXL; just run _build.bat_ or enter the command _mvn clean install_.

#### DRECommons
[DRECommons](https://github.com/DRE2N/DRECommons) is a util library for common tasks. DungeonsXL contains DRECommons 4.1.
[DRECommons](https://github.com/DRE2N/DRECommons) is a util library for common tasks. DungeonsXL contains DRECommons 4.1.1.

#### Caliburn API
[Caliburn](https://github.com/DRE2N/CaliburnAPI) is an API to read custom items and mobs from config files. DungeonsXL contains Caliburn Beta 0.4.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import de.erethon.dungeonsxl.global.GlobalProtection;
import de.erethon.dungeonsxl.global.GroupSign;
import de.erethon.dungeonsxl.player.DPermission;
import de.erethon.dungeonsxl.world.DEditWorld;
import de.erethon.dungeonsxl.world.DResourceWorld;
import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -62,6 +63,12 @@ public void onExecute(String[] args, CommandSender sender) {
resource.getFolder().renameTo(new File(DungeonsXL.MAPS, args[2]));
resource.getSignData().updateFile(resource);

for (DEditWorld editWorld : plugin.getDWorlds().getEditWorlds()) {
if (editWorld.getResource() == resource) {
editWorld.delete(true);
}
}

for (Dungeon dungeon : plugin.getDungeons().getDungeons()) {
DungeonConfig dConfig = dungeon.getConfig();
FileConfiguration config = dConfig.getConfig();
Expand Down

0 comments on commit 7e65ff1

Please sign in to comment.