mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-21 18:15:26 +01:00
Added option to disable saving of world when cloning.
This commit is contained in:
parent
17129f68d2
commit
0d41d0982c
@ -77,6 +77,8 @@ public class MultiverseCoreConfiguration extends SerializationConfig implements
|
||||
private volatile boolean autopurge;
|
||||
@Property
|
||||
private volatile boolean idonotwanttodonate;
|
||||
@Property
|
||||
private volatile boolean clone_saving;
|
||||
|
||||
public MultiverseCoreConfiguration() {
|
||||
super();
|
||||
@ -111,6 +113,7 @@ public class MultiverseCoreConfiguration extends SerializationConfig implements
|
||||
portalsearchradius = 128;
|
||||
autopurge = true;
|
||||
idonotwanttodonate = false;
|
||||
clone_saving=false;
|
||||
// END CHECKSTYLE-SUPPRESSION: MagicNumberCheck
|
||||
}
|
||||
|
||||
@ -378,6 +381,16 @@ public class MultiverseCoreConfiguration extends SerializationConfig implements
|
||||
return !idonotwanttodonate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doCloneSaving(){
|
||||
return clone_saving;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCloneSaving(boolean doSaving){
|
||||
this.clone_saving=doSaving;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setShowDonateMessage(boolean showDonateMessage) {
|
||||
this.idonotwanttodonate = !showDonateMessage;
|
||||
|
@ -25,7 +25,9 @@ import java.util.List;
|
||||
* This API contains all of the world managing
|
||||
* functions that your heart desires!
|
||||
*/
|
||||
public interface MVWorldManager {
|
||||
public interface
|
||||
|
||||
MVWorldManager {
|
||||
/**
|
||||
* Add a new World to the Multiverse Setup.
|
||||
*
|
||||
|
@ -233,6 +233,10 @@ public interface MultiverseCoreConfig extends ConfigurationSerializable {
|
||||
*/
|
||||
boolean isShowingDonateMessage();
|
||||
|
||||
boolean doCloneSaving();
|
||||
|
||||
void setCloneSaving(boolean doSaving);
|
||||
|
||||
/**
|
||||
* Sets whether or not the donation/patreon messages are shown.
|
||||
*
|
||||
|
@ -176,9 +176,11 @@ public class WorldManager implements MVWorldManager {
|
||||
boolean wasAutoSave = false;
|
||||
if (oldWorld != null && oldWorld.getCBWorld().isAutoSave()) {
|
||||
wasAutoSave = true;
|
||||
Logging.config("Saving world '%s'", oldName);
|
||||
oldWorld.getCBWorld().setAutoSave(false);
|
||||
oldWorld.getCBWorld().save();
|
||||
if(plugin.getMVConfig().doCloneSaving()){
|
||||
Logging.config("Saving world '%s'", oldName);
|
||||
oldWorld.getCBWorld().setAutoSave(false);
|
||||
oldWorld.getCBWorld().save();
|
||||
}
|
||||
}
|
||||
Logging.config("Copying files for world '%s'", oldName);
|
||||
if (!FileUtils.copyFolder(oldWorldFile, newWorldFile, ignoreFiles)) {
|
||||
|
Loading…
Reference in New Issue
Block a user