summaryrefslogtreewikicommitdiff
path: root/src/main/java/net/tylermurphy/hideAndSeek/command/SaveMap.java
diff options
context:
space:
mode:
authorTyler Murphy <tylermurphy534@gmail.com>2021-12-26 16:58:18 -0600
committerTyler Murphy <tylermurphy534@gmail.com>2021-12-26 16:58:18 -0600
commit1617bfe44ab2fc2112ee5cc6fa082b7981222c64 (patch)
tree8e3114039cdb034d5021bd4d32aecb81ce36cc05 /src/main/java/net/tylermurphy/hideAndSeek/command/SaveMap.java
parent1.3.3 beta 2 (diff)
downloadkenshinshideandseek-1617bfe44ab2fc2112ee5cc6fa082b7981222c64.tar.gz
kenshinshideandseek-1617bfe44ab2fc2112ee5cc6fa082b7981222c64.tar.bz2
kenshinshideandseek-1617bfe44ab2fc2112ee5cc6fa082b7981222c64.zip
1.3.3 beta 3
Diffstat (limited to 'src/main/java/net/tylermurphy/hideAndSeek/command/SaveMap.java')
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/SaveMap.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/SaveMap.java b/src/main/java/net/tylermurphy/hideAndSeek/command/SaveMap.java
index 2e8b4f8..1ce2aa4 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/SaveMap.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/SaveMap.java
@@ -2,8 +2,10 @@ package net.tylermurphy.hideAndSeek.command;
import static net.tylermurphy.hideAndSeek.configuration.Config.*;
-import net.tylermurphy.hideAndSeek.game.Status;
+import net.tylermurphy.hideAndSeek.game.Game;
+import net.tylermurphy.hideAndSeek.util.Status;
import org.bukkit.Bukkit;
+import org.bukkit.World;
import org.bukkit.command.CommandSender;
import org.bukkit.scheduler.BukkitRunnable;
@@ -15,7 +17,7 @@ public class SaveMap implements ICommand {
public static boolean runningBackup = false;
public void execute(CommandSender sender, String[] args) {
- if(Main.plugin.status != Status.STANDBY) {
+ if(Game.status != Status.STANDBY) {
sender.sendMessage(errorPrefix + message("GAME_INPROGRESS"));
return;
}
@@ -25,11 +27,15 @@ public class SaveMap implements ICommand {
}
sender.sendMessage(messagePrefix + message("MAPSAVE_START"));
sender.sendMessage(warningPrefix + message("MAPSAVE_WARNING"));
- Bukkit.getServer().getWorld(spawnWorld).save();
+ World world = Bukkit.getServer().getWorld(spawnWorld);
+ if(world == null){
+ throw new RuntimeException("Unable to get world: " + spawnWorld);
+ }
+ world.save();
BukkitRunnable runnable = new BukkitRunnable() {
public void run() {
sender.sendMessage(
- Main.plugin.worldLoader.save()
+ Game.worldLoader.save()
);
runningBackup = false;
}