summaryrefslogtreewikicommitdiff
path: root/src/main/java/net/tylermurphy/hideAndSeek/command
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/SaveMap.java4
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/SetSpawnLocation.java2
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/Setup.java11
3 files changed, 12 insertions, 5 deletions
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/SaveMap.java b/src/main/java/net/tylermurphy/hideAndSeek/command/SaveMap.java
index c48e1c6..f5e63a5 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/SaveMap.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/SaveMap.java
@@ -36,6 +36,10 @@ public class SaveMap implements ICommand {
public static boolean runningBackup = false;
public void execute(CommandSender sender, String[] args) {
+ if(!mapSaveEnabled){
+ sender.sendMessage(errorPrefix + message("MAPSAVE_DISABLED"));
+ return;
+ }
if(Game.status != Status.STANDBY) {
sender.sendMessage(errorPrefix + message("GAME_INPROGRESS"));
return;
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/SetSpawnLocation.java b/src/main/java/net/tylermurphy/hideAndSeek/command/SetSpawnLocation.java
index 7afe861..d5e1cba 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/SetSpawnLocation.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/SetSpawnLocation.java
@@ -56,7 +56,7 @@ public class SetSpawnLocation implements ICommand {
if(world == null){
throw new RuntimeException("Unable to get world: " + spawnWorld);
}
- if(!world.getName().equals(spawnWorld)){
+ if(mapSaveEnabled && !world.getName().equals(spawnWorld)){
Game.worldLoader.unloadMap();
Game.worldLoader = new WorldLoader(world.getName());
}
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/Setup.java b/src/main/java/net/tylermurphy/hideAndSeek/command/Setup.java
index 74c29bf..14a5d6f 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/Setup.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/Setup.java
@@ -19,6 +19,7 @@
package net.tylermurphy.hideAndSeek.command;
+import net.tylermurphy.hideAndSeek.game.Game;
import org.bukkit.command.CommandSender;
import net.tylermurphy.hideAndSeek.Main;
@@ -51,10 +52,12 @@ public class Setup implements ICommand {
msg = msg + "\n" + message("SETUP_BOUNDS");
count++;
}
- File destenation = new File(Main.root+File.separator+"hideandseek_"+spawnWorld);
- if(!destenation.exists()) {
- msg = msg + "\n" + message("SETUP_SAVEMAP");
- count++;
+ if(mapSaveEnabled) {
+ File destenation = new File(Main.root + File.separator + Game.getGameWorld());
+ if (!destenation.exists()) {
+ msg = msg + "\n" + message("SETUP_SAVEMAP");
+ count++;
+ }
}
if(count < 1) {
sender.sendMessage(messagePrefix + message("SETUP_COMPLETE"));