Updates registries on /dxl rename

This commit is contained in:
Daniel Saukel 2020-10-31 17:00:10 +01:00
parent 7cdb5f9329
commit ab514e4938

View File

@ -96,6 +96,11 @@ public class RenameCommand extends DCommand {
} catch (IOException ex) {
}
}
resource.getSingleFloorDungeon().setName(args[2]);
plugin.getDungeonRegistry().removeKey(args[1]);
plugin.getDungeonRegistry().add(args[2], resource.getSingleFloorDungeon());
plugin.getMapRegistry().removeKey(args[1]);
plugin.getMapRegistry().add(args[2], resource);
boolean changed = false;
for (GlobalProtection protection : plugin.getGlobalProtectionCache().getProtections().toArray(new GlobalProtection[]{})) {