respawn bug fix

This commit is contained in:
Tyler Murphy 2021-08-13 22:30:17 -04:00
parent 94afcb9c88
commit 398b8d673a
4 changed files with 9 additions and 3 deletions

View file

@ -41,12 +41,9 @@ public class Store {
public static int getPlayerData(String playerName, String key) { public static int getPlayerData(String playerName, String key) {
HashMap<String,Integer> data = playerData.get(playerName); HashMap<String,Integer> data = playerData.get(playerName);
if(data == null) { if(data == null) {
data = new HashMap<String,Integer>();
playerData.put(playerName, data);
return 0; return 0;
} }
if(data.get(key) == null) { if(data.get(key) == null) {
data.put(key, 0);
return 0; return 0;
} }
return data.get(key); return data.get(key);

View file

@ -10,6 +10,10 @@ import static net.tylermurphy.hideAndSeek.Store.*;
public class EnableBorder implements ICommand { public class EnableBorder implements ICommand {
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
if(!status.equals("Standby") && !status.equals("Setup")) {
sender.sendMessage(errorPrefix + "Game is currently in session");
return;
}
if(worldborderPosition == null) { if(worldborderPosition == null) {
sender.sendMessage(errorPrefix + "Please setup worldborder info before enabling"); sender.sendMessage(errorPrefix + "Please setup worldborder info before enabling");
return; return;

View file

@ -12,6 +12,10 @@ import static net.tylermurphy.hideAndSeek.Store.*;
public class SetBorder implements ICommand { public class SetBorder implements ICommand {
public void execute(CommandSender sender, String[] args) { public void execute(CommandSender sender, String[] args) {
if(!status.equals("Standby") && !status.equals("Setup")) {
sender.sendMessage(errorPrefix + "Game is currently in session");
return;
}
if(spawnPosition == null) { if(spawnPosition == null) {
sender.sendMessage(errorPrefix + "Please set spawn position first"); sender.sendMessage(errorPrefix + "Please set spawn position first");
return; return;

View file

@ -47,6 +47,7 @@ public class Start implements ICommand {
player.removePotionEffect(effect.getType()); player.removePotionEffect(effect.getType());
} }
} }
Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), String.format("spawnpoint @a %s %s %s", spawnPosition.getBlockX(), spawnPosition.getBlockY(), spawnPosition.getBlockZ()));
for(String playerName : Seeker.getEntries()) { for(String playerName : Seeker.getEntries()) {
Player player = playerList.get(playerName); Player player = playerList.get(playerName);
if(player != null) { if(player != null) {