1.3.3 rc1
This commit is contained in:
parent
4ef8f170cc
commit
56e6cac28f
39 changed files with 71 additions and 69 deletions
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
@ -23,16 +23,10 @@ import static net.tylermurphy.hideAndSeek.configuration.Config.*;
|
||||||
|
|
||||||
import net.tylermurphy.hideAndSeek.game.Board;
|
import net.tylermurphy.hideAndSeek.game.Board;
|
||||||
import net.tylermurphy.hideAndSeek.game.Game;
|
import net.tylermurphy.hideAndSeek.game.Game;
|
||||||
import net.tylermurphy.hideAndSeek.util.Status;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.GameMode;
|
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.attribute.Attribute;
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
import static net.tylermurphy.hideAndSeek.configuration.Localization.*;
|
import static net.tylermurphy.hideAndSeek.configuration.Localization.*;
|
||||||
|
|
||||||
public class Join implements ICommand {
|
public class Join implements ICommand {
|
||||||
|
@ -52,29 +46,7 @@ public class Join implements ICommand {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
join(player);
|
Game.join(player);
|
||||||
}
|
|
||||||
|
|
||||||
public static void join(Player player){
|
|
||||||
if(Game.status == Status.STANDBY) {
|
|
||||||
player.getInventory().clear();
|
|
||||||
Board.addHider(player);
|
|
||||||
if(announceMessagesToNonPlayers) Bukkit.broadcastMessage(messagePrefix + message("GAME_JOIN").addPlayer(player));
|
|
||||||
else Game.broadcastMessage(messagePrefix + message("GAME_JOIN").addPlayer(player));
|
|
||||||
player.teleport(new Location(Bukkit.getWorld(lobbyWorld), lobbyPosition.getX(),lobbyPosition.getY(),lobbyPosition.getZ()));
|
|
||||||
player.setGameMode(GameMode.ADVENTURE);
|
|
||||||
Board.createLobbyBoard(player);
|
|
||||||
Board.reloadLobbyBoards();
|
|
||||||
} else {
|
|
||||||
Board.addSpectator(player);
|
|
||||||
player.sendMessage(messagePrefix + message("GAME_JOIN_SPECTATOR"));
|
|
||||||
player.setGameMode(GameMode.SPECTATOR);
|
|
||||||
Board.createGameBoard(player);
|
|
||||||
player.teleport(new Location(Bukkit.getWorld("hideandseek_"+spawnWorld), spawnPosition.getX(),spawnPosition.getY(),spawnPosition.getZ()));
|
|
||||||
}
|
|
||||||
|
|
||||||
player.setFoodLevel(20);
|
|
||||||
player.setHealth(Objects.requireNonNull(player.getAttribute(Attribute.GENERIC_MAX_HEALTH)).getBaseValue());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLabel() {
|
public String getLabel() {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
@ -54,7 +54,7 @@ public class EventListener implements Listener {
|
||||||
Game.removeItems(event.getPlayer());
|
Game.removeItems(event.getPlayer());
|
||||||
if(Game.isNotSetup()) return;
|
if(Game.isNotSetup()) return;
|
||||||
if(autoJoin){
|
if(autoJoin){
|
||||||
Join.join(event.getPlayer());
|
Game.join(event.getPlayer());
|
||||||
} else if(teleportToExit) {
|
} else if(teleportToExit) {
|
||||||
if (event.getPlayer().getWorld().getName().equals("hideandseek_" + spawnWorld) || event.getPlayer().getWorld().getName().equals(lobbyWorld)) {
|
if (event.getPlayer().getWorld().getName().equals("hideandseek_" + spawnWorld) || event.getPlayer().getWorld().getName().equals(lobbyWorld)) {
|
||||||
event.getPlayer().teleport(new Location(Bukkit.getWorld(exitWorld), exitPosition.getX(), exitPosition.getY(), exitPosition.getZ()));
|
event.getPlayer().teleport(new Location(Bukkit.getWorld(exitWorld), exitPosition.getX(), exitPosition.getY(), exitPosition.getZ()));
|
||||||
|
@ -62,11 +62,15 @@ public class EventListener implements Listener {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (event.getPlayer().getWorld().getName().equals("hideandseek_" + spawnWorld)) {
|
if (event.getPlayer().getWorld().getName().equals("hideandseek_" + spawnWorld)) {
|
||||||
|
if(Game.status != Status.STANDBY){
|
||||||
|
Game.join(event.getPlayer());
|
||||||
|
} else {
|
||||||
event.getPlayer().teleport(new Location(Bukkit.getWorld(exitWorld), exitPosition.getX(), exitPosition.getY(), exitPosition.getZ()));
|
event.getPlayer().teleport(new Location(Bukkit.getWorld(exitWorld), exitPosition.getX(), exitPosition.getY(), exitPosition.getZ()));
|
||||||
event.getPlayer().setGameMode(GameMode.ADVENTURE);
|
event.getPlayer().setGameMode(GameMode.ADVENTURE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onQuit(PlayerQuitEvent event) {
|
public void onQuit(PlayerQuitEvent event) {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
@ -28,6 +28,7 @@ import net.tylermurphy.hideAndSeek.util.Status;
|
||||||
import net.tylermurphy.hideAndSeek.util.WinType;
|
import net.tylermurphy.hideAndSeek.util.WinType;
|
||||||
import net.tylermurphy.hideAndSeek.world.WorldLoader;
|
import net.tylermurphy.hideAndSeek.world.WorldLoader;
|
||||||
import org.bukkit.*;
|
import org.bukkit.*;
|
||||||
|
import org.bukkit.attribute.Attribute;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.Firework;
|
import org.bukkit.entity.Firework;
|
||||||
|
@ -219,6 +220,29 @@ public class Game {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void join(Player player){
|
||||||
|
if(Game.status == Status.STANDBY) {
|
||||||
|
player.getInventory().clear();
|
||||||
|
Board.addHider(player);
|
||||||
|
if(announceMessagesToNonPlayers) Bukkit.broadcastMessage(messagePrefix + message("GAME_JOIN").addPlayer(player));
|
||||||
|
else Game.broadcastMessage(messagePrefix + message("GAME_JOIN").addPlayer(player));
|
||||||
|
player.teleport(new Location(Bukkit.getWorld(lobbyWorld), lobbyPosition.getX(),lobbyPosition.getY(),lobbyPosition.getZ()));
|
||||||
|
player.setGameMode(GameMode.ADVENTURE);
|
||||||
|
Board.createLobbyBoard(player);
|
||||||
|
Board.reloadLobbyBoards();
|
||||||
|
} else {
|
||||||
|
Board.addSpectator(player);
|
||||||
|
player.sendMessage(messagePrefix + message("GAME_JOIN_SPECTATOR"));
|
||||||
|
player.setGameMode(GameMode.SPECTATOR);
|
||||||
|
Board.createGameBoard(player);
|
||||||
|
player.teleport(new Location(Bukkit.getWorld("hideandseek_"+spawnWorld), spawnPosition.getX(),spawnPosition.getY(),spawnPosition.getZ()));
|
||||||
|
player.sendTitle(ChatColor.GRAY + "" + ChatColor.BOLD + "SPECTATING", ChatColor.WHITE + message("SPECTATOR_SUBTITLE").toString(), 10, 70, 20);
|
||||||
|
}
|
||||||
|
|
||||||
|
player.setFoodLevel(20);
|
||||||
|
player.setHealth(Objects.requireNonNull(player.getAttribute(Attribute.GENERIC_MAX_HEALTH)).getBaseValue());
|
||||||
|
}
|
||||||
|
|
||||||
public static void removeItems(Player player){
|
public static void removeItems(Player player){
|
||||||
for(ItemStack si : Items.SEEKER_ITEMS)
|
for(ItemStack si : Items.SEEKER_ITEMS)
|
||||||
for(ItemStack i : player.getInventory().getContents())
|
for(ItemStack i : player.getInventory().getContents())
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* he Free Software Foundation, either version 3 of the License.
|
* he Free Software Foundation version 3.
|
||||||
*
|
*
|
||||||
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|
|
@ -58,6 +58,7 @@ Localization:
|
||||||
STOP: "Das Spiel wurde gestoppt."
|
STOP: "Das Spiel wurde gestoppt."
|
||||||
HIDERS_SUBTITLE: "Verstecke dich gut vor den Seekern!"
|
HIDERS_SUBTITLE: "Verstecke dich gut vor den Seekern!"
|
||||||
SEEKERS_SUBTITLE: "Finde alle Hider!"
|
SEEKERS_SUBTITLE: "Finde alle Hider!"
|
||||||
|
SPECTATOR_SUBTITLE: "Du bist mitten im spiel beigetreten."
|
||||||
BOUNDS_WRONG_WORLD: "Führe diesen Befehl bitte in der Spielwelt aus."
|
BOUNDS_WRONG_WORLD: "Führe diesen Befehl bitte in der Spielwelt aus."
|
||||||
BOUNDS: "Grenzen erfolgreich an dieser Position gesetzt. ({AMOUNT}/2)"
|
BOUNDS: "Grenzen erfolgreich an dieser Position gesetzt. ({AMOUNT}/2)"
|
||||||
NOT_AT_ZERO: "Bitte nicht an einer Position setzen, die eine Koordinate bei 0 enthält."
|
NOT_AT_ZERO: "Bitte nicht an einer Position setzen, die eine Koordinate bei 0 enthält."
|
||||||
|
|
|
@ -58,6 +58,7 @@ Localization:
|
||||||
STOP: "Game has been force stopped."
|
STOP: "Game has been force stopped."
|
||||||
HIDERS_SUBTITLE: "Hide away from the seekers"
|
HIDERS_SUBTITLE: "Hide away from the seekers"
|
||||||
SEEKERS_SUBTITLE: "Eliminate all hiders"
|
SEEKERS_SUBTITLE: "Eliminate all hiders"
|
||||||
|
SPECTATOR_SUBTITLE: "You joined mid-game."
|
||||||
BOUNDS_WRONG_WORLD: "Please run this command in the game world."
|
BOUNDS_WRONG_WORLD: "Please run this command in the game world."
|
||||||
BOUNDS: "Successfully set bounds at this position ({AMOUNT}/2)."
|
BOUNDS: "Successfully set bounds at this position ({AMOUNT}/2)."
|
||||||
NOT_AT_ZERO: "Please do not set at a location containing a coordinate at 0."
|
NOT_AT_ZERO: "Please do not set at a location containing a coordinate at 0."
|
||||||
|
|
Loading…
Reference in a new issue