Update 2.7.13
This commit is contained in:
@@ -31,6 +31,7 @@ import uk.org.whoami.authme.security.RandomString;
|
||||
import uk.org.whoami.authme.settings.Messages;
|
||||
import uk.org.whoami.authme.settings.PlayersLogs;
|
||||
import uk.org.whoami.authme.settings.Settings;
|
||||
import uk.org.whoami.authme.settings.Spawn;
|
||||
|
||||
public class Management {
|
||||
|
||||
@@ -78,6 +79,8 @@ public class Management {
|
||||
} catch (NoClassDefFoundError ncdfe) {
|
||||
}
|
||||
}
|
||||
if (Spawn.getInstance().getLocation() != null)
|
||||
spawnLoc = Spawn.getInstance().getLocation();
|
||||
|
||||
if (PlayerCache.getInstance().isAuthenticated(name)) {
|
||||
return m._("logged_in");
|
||||
@@ -140,9 +143,9 @@ public class Management {
|
||||
this.utils.addNormal(player, limbo.getGroup());
|
||||
|
||||
|
||||
if ((Settings.isTeleportToSpawnEnabled.booleanValue()) && (!Settings.isForceSpawnLocOnJoinEnabled.booleanValue() && Settings.getForcedWorlds.contains(player.getWorld().getName())))
|
||||
if ((Settings.isTeleportToSpawnEnabled) && (!Settings.isForceSpawnLocOnJoinEnabled && Settings.getForcedWorlds.contains(player.getWorld().getName())))
|
||||
{
|
||||
if ((Settings.isSaveQuitLocationEnabled.booleanValue()) && (this.database.getAuth(name).getQuitLocY() != 0))
|
||||
if ((Settings.isSaveQuitLocationEnabled) && (this.database.getAuth(name).getQuitLocY() != 0))
|
||||
{
|
||||
this.utils.packCoords(this.database.getAuth(name).getQuitLocX(), this.database.getAuth(name).getQuitLocY(), this.database.getAuth(name).getQuitLocZ(), player);
|
||||
}
|
||||
@@ -160,7 +163,7 @@ public class Management {
|
||||
}
|
||||
|
||||
}
|
||||
else if (Settings.isForceSpawnLocOnJoinEnabled.booleanValue() && Settings.getForcedWorlds.contains(player.getWorld().getName())) {
|
||||
else if (Settings.isForceSpawnLocOnJoinEnabled && Settings.getForcedWorlds.contains(player.getWorld().getName())) {
|
||||
SpawnTeleportEvent tpEvent = new SpawnTeleportEvent(player, player.getLocation(), spawnLoc, true);
|
||||
pm.callEvent(tpEvent);
|
||||
if(!tpEvent.isCancelled()) {
|
||||
@@ -170,7 +173,7 @@ public class Management {
|
||||
player.teleport(tpEvent.getTo());
|
||||
}
|
||||
}
|
||||
else if ((Settings.isSaveQuitLocationEnabled.booleanValue()) && (this.database.getAuth(name).getQuitLocY() != 0))
|
||||
else if ((Settings.isSaveQuitLocationEnabled) && (this.database.getAuth(name).getQuitLocY() != 0))
|
||||
{
|
||||
this.utils.packCoords(this.database.getAuth(name).getQuitLocX(), this.database.getAuth(name).getQuitLocY(), this.database.getAuth(name).getQuitLocZ(), player);
|
||||
}
|
||||
@@ -188,7 +191,7 @@ public class Management {
|
||||
|
||||
player.setGameMode(GameMode.getByValue(limbo.getGameMode()));
|
||||
|
||||
if (Settings.protectInventoryBeforeLogInEnabled.booleanValue() && player.hasPlayedBefore()) {
|
||||
if (Settings.protectInventoryBeforeLogInEnabled && player.hasPlayedBefore()) {
|
||||
RestoreInventoryEvent event = new RestoreInventoryEvent(player, limbo.getInventory(), limbo.getArmour());
|
||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
@@ -235,7 +238,7 @@ public class Management {
|
||||
player.sendMessage(m._("login"));
|
||||
displayOtherAccounts(auth);
|
||||
if(!Settings.noConsoleSpam)
|
||||
ConsoleLogger.info(player.getDisplayName() + " logged in!");
|
||||
ConsoleLogger.info(player.getName() + " logged in!");
|
||||
if(plugin.notifications != null) {
|
||||
plugin.notifications.showNotification(new Notification("[AuthMe] " + player.getName() + " logged in!"));
|
||||
}
|
||||
@@ -243,10 +246,12 @@ public class Management {
|
||||
|
||||
} else {
|
||||
if (!Settings.noConsoleSpam)
|
||||
ConsoleLogger.info(player.getDisplayName() + " used the wrong password");
|
||||
ConsoleLogger.info(player.getName() + " used the wrong password");
|
||||
if (Settings.isKickOnWrongPasswordEnabled) {
|
||||
int gm = AuthMePlayerListener.gameMode.get(name);
|
||||
player.setGameMode(GameMode.getByValue(gm));
|
||||
try {
|
||||
int gm = AuthMePlayerListener.gameMode.get(name);
|
||||
player.setGameMode(GameMode.getByValue(gm));
|
||||
} catch (NullPointerException npe) {}
|
||||
player.kickPlayer(m._("wrong_pwd"));
|
||||
} else {
|
||||
return (m._("wrong_pwd"));
|
||||
@@ -266,9 +271,9 @@ public class Management {
|
||||
this.utils.addNormal(player, limbo.getGroup());
|
||||
|
||||
|
||||
if ((Settings.isTeleportToSpawnEnabled.booleanValue()) && (!Settings.isForceSpawnLocOnJoinEnabled.booleanValue() && Settings.getForcedWorlds.contains(player.getWorld().getName())))
|
||||
if ((Settings.isTeleportToSpawnEnabled) && (!Settings.isForceSpawnLocOnJoinEnabled && Settings.getForcedWorlds.contains(player.getWorld().getName())))
|
||||
{
|
||||
if ((Settings.isSaveQuitLocationEnabled.booleanValue()) && (this.database.getAuth(name).getQuitLocY() != 0)) {
|
||||
if ((Settings.isSaveQuitLocationEnabled) && (this.database.getAuth(name).getQuitLocY() != 0)) {
|
||||
Location quitLoc = new Location(player.getWorld(), this.database.getAuth(name).getQuitLocX() + 0.5D, this.database.getAuth(name).getQuitLocY() + 0.5D, this.database.getAuth(name).getQuitLocZ() + 0.5D);
|
||||
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(player, quitLoc);
|
||||
pm.callEvent(tpEvent);
|
||||
@@ -292,7 +297,7 @@ public class Management {
|
||||
}
|
||||
|
||||
}
|
||||
else if (Settings.isForceSpawnLocOnJoinEnabled.booleanValue() && Settings.getForcedWorlds.contains(player.getWorld().getName())) {
|
||||
else if (Settings.isForceSpawnLocOnJoinEnabled && Settings.getForcedWorlds.contains(player.getWorld().getName())) {
|
||||
|
||||
SpawnTeleportEvent tpEvent = new SpawnTeleportEvent(player, player.getLocation(), spawnLoc, true);
|
||||
pm.callEvent(tpEvent);
|
||||
@@ -303,7 +308,7 @@ public class Management {
|
||||
player.teleport(tpEvent.getTo());
|
||||
}
|
||||
}
|
||||
else if ((Settings.isSaveQuitLocationEnabled.booleanValue()) && (this.database.getAuth(name).getQuitLocY() != 0)) {
|
||||
else if ((Settings.isSaveQuitLocationEnabled) && (this.database.getAuth(name).getQuitLocY() != 0)) {
|
||||
Location quitLoc = new Location(player.getWorld(), this.database.getAuth(name).getQuitLocX() + 0.5D, this.database.getAuth(name).getQuitLocY() + 0.5D, this.database.getAuth(name).getQuitLocZ() + 0.5D);
|
||||
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(player, quitLoc);
|
||||
pm.callEvent(tpEvent);
|
||||
@@ -329,7 +334,7 @@ public class Management {
|
||||
|
||||
player.setGameMode(GameMode.getByValue(limbo.getGameMode()));
|
||||
|
||||
if (Settings.protectInventoryBeforeLogInEnabled.booleanValue() && player.hasPlayedBefore()) {
|
||||
if (Settings.protectInventoryBeforeLogInEnabled && player.hasPlayedBefore()) {
|
||||
RestoreInventoryEvent event = new RestoreInventoryEvent(player, limbo.getInventory(), limbo.getArmour());
|
||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
@@ -373,7 +378,7 @@ public class Management {
|
||||
player.sendMessage(m._("login"));
|
||||
displayOtherAccounts(auth);
|
||||
if(!Settings.noConsoleSpam)
|
||||
ConsoleLogger.info(player.getDisplayName() + " logged in!");
|
||||
ConsoleLogger.info(player.getName() + " logged in!");
|
||||
if(plugin.notifications != null) {
|
||||
plugin.notifications.showNotification(new Notification("[AuthMe] " + player.getName() + " logged in!"));
|
||||
}
|
||||
|
||||
@@ -150,13 +150,12 @@ public class Utils {
|
||||
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(pl, loc);
|
||||
AuthMe.getInstance().getServer().getPluginManager().callEvent(tpEvent);
|
||||
if(!tpEvent.isCancelled()) {
|
||||
if (!tpEvent.getTo().getWorld().getChunkAt(tpEvent.getTo()).isLoaded()) {
|
||||
tpEvent.getTo().getWorld().getChunkAt(tpEvent.getTo()).load();
|
||||
}
|
||||
if (!tpEvent.getTo().getWorld().getChunkAt(tpEvent.getTo()).isLoaded())
|
||||
tpEvent.getTo().getWorld().getChunkAt(tpEvent.getTo()).load();
|
||||
pl.teleport(tpEvent.getTo());
|
||||
}
|
||||
|
||||
id = Bukkit.getScheduler().runTaskTimerAsynchronously(AuthMe.authme, new Runnable()
|
||||
id = Bukkit.getScheduler().runTaskTimer(AuthMe.authme, new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
@@ -48,6 +48,7 @@ import uk.org.whoami.authme.datasource.DataSource;
|
||||
import uk.org.whoami.authme.security.PasswordSecurity;
|
||||
import uk.org.whoami.authme.settings.Messages;
|
||||
import uk.org.whoami.authme.settings.Settings;
|
||||
import uk.org.whoami.authme.settings.Spawn;
|
||||
import uk.org.whoami.authme.settings.SpoutCfg;
|
||||
|
||||
public class AdminCommand implements CommandExecutor {
|
||||
@@ -345,7 +346,33 @@ public class AdminCommand implements CommandExecutor {
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} catch (NullPointerException ex) {
|
||||
System.out.println(ex.getMessage());
|
||||
ConsoleLogger.showError(ex.getMessage());
|
||||
}
|
||||
|
||||
} else if (args[0].equalsIgnoreCase("setspawn")) {
|
||||
try {
|
||||
if (sender instanceof Player) {
|
||||
if (Spawn.getInstance().setSpawn(((Player) sender).getLocation()))
|
||||
sender.sendMessage("[AuthMe] Correctly define new spawn");
|
||||
else sender.sendMessage("[AuthMe] SetSpawn fail , please retry");
|
||||
} else {
|
||||
sender.sendMessage("[AuthMe] Please use that command in game");
|
||||
}
|
||||
} catch (NullPointerException ex) {
|
||||
ConsoleLogger.showError(ex.getMessage());
|
||||
}
|
||||
|
||||
} else if (args[0].equalsIgnoreCase("spawn")) {
|
||||
try {
|
||||
if (sender instanceof Player) {
|
||||
if (Spawn.getInstance().getLocation() != null)
|
||||
((Player) sender).teleport(Spawn.getInstance().getLocation());
|
||||
else sender.sendMessage("[AuthMe] Spawn fail , please try to define the spawn");
|
||||
} else {
|
||||
sender.sendMessage("[AuthMe] Please use that command in game");
|
||||
}
|
||||
} catch (NullPointerException ex) {
|
||||
ConsoleLogger.showError(ex.getMessage());
|
||||
}
|
||||
|
||||
} else if (args[0].equalsIgnoreCase("changepassword") || args[0].equalsIgnoreCase("cp")) {
|
||||
|
||||
@@ -64,14 +64,6 @@ public class ChangePasswordCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// Check to prevent Changing Password if is active VBullettin system
|
||||
//
|
||||
if(!Settings.getMySQLColumnSalt.isEmpty()) {
|
||||
player.sendMessage(m._("You can Change Your Password on Forum panel!"));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args.length != 2) {
|
||||
player.sendMessage(m._("usage_changepassword"));
|
||||
return true;
|
||||
|
||||
@@ -18,6 +18,7 @@ package uk.org.whoami.authme.commands;
|
||||
|
||||
import me.muizers.Notifications.Notification;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -39,6 +40,7 @@ import uk.org.whoami.authme.events.AuthMeTeleportEvent;
|
||||
import uk.org.whoami.authme.settings.Messages;
|
||||
import uk.org.whoami.authme.settings.PlayersLogs;
|
||||
import uk.org.whoami.authme.settings.Settings;
|
||||
import uk.org.whoami.authme.settings.Spawn;
|
||||
import uk.org.whoami.authme.task.MessageTask;
|
||||
import uk.org.whoami.authme.task.TimeoutTask;
|
||||
|
||||
@@ -93,7 +95,10 @@ public class LogoutCommand implements CommandExecutor {
|
||||
playerBackup.createCache(name, playerData, LimboCache.getInstance().getLimboPlayer(name).getGroup(),LimboCache.getInstance().getLimboPlayer(name).getOperator());
|
||||
}
|
||||
if (Settings.isTeleportToSpawnEnabled) {
|
||||
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(player, player.getWorld().getSpawnLocation());
|
||||
Location spawnLoc = player.getWorld().getSpawnLocation();
|
||||
if (Spawn.getInstance().getLocation() != null)
|
||||
spawnLoc = Spawn.getInstance().getLocation();
|
||||
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(player, spawnLoc);
|
||||
plugin.getServer().getPluginManager().callEvent(tpEvent);
|
||||
if(!tpEvent.isCancelled()) {
|
||||
if (!tpEvent.getTo().getWorld().getChunkAt(tpEvent.getTo()).isLoaded()) {
|
||||
|
||||
@@ -46,6 +46,7 @@ import uk.org.whoami.authme.security.RandomString;
|
||||
import uk.org.whoami.authme.settings.Messages;
|
||||
import uk.org.whoami.authme.settings.PlayersLogs;
|
||||
import uk.org.whoami.authme.settings.Settings;
|
||||
import uk.org.whoami.authme.settings.Spawn;
|
||||
import uk.org.whoami.authme.task.MessageTask;
|
||||
import uk.org.whoami.authme.task.TimeoutTask;
|
||||
|
||||
@@ -208,6 +209,9 @@ public class RegisterCommand implements CommandExecutor {
|
||||
|
||||
}
|
||||
}
|
||||
if (Spawn.getInstance().getLocation() != null)
|
||||
loca = Spawn.getInstance().getLocation();
|
||||
|
||||
RegisterTeleportEvent tpEvent = new RegisterTeleportEvent(player, loca);
|
||||
plugin.getServer().getPluginManager().callEvent(tpEvent);
|
||||
if(!tpEvent.isCancelled()) {
|
||||
@@ -282,6 +286,8 @@ public class RegisterCommand implements CommandExecutor {
|
||||
|
||||
}
|
||||
}
|
||||
if (Spawn.getInstance().getLocation() != null)
|
||||
loca = Spawn.getInstance().getLocation();
|
||||
RegisterTeleportEvent tpEvent = new RegisterTeleportEvent(player, loca);
|
||||
plugin.getServer().getPluginManager().callEvent(tpEvent);
|
||||
if(!tpEvent.isCancelled()) {
|
||||
|
||||
@@ -20,6 +20,7 @@ import java.security.NoSuchAlgorithmException;
|
||||
|
||||
import me.muizers.Notifications.Notification;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -35,10 +36,12 @@ import uk.org.whoami.authme.cache.auth.PlayerCache;
|
||||
import uk.org.whoami.authme.cache.backup.FileCache;
|
||||
import uk.org.whoami.authme.cache.limbo.LimboCache;
|
||||
import uk.org.whoami.authme.datasource.DataSource;
|
||||
import uk.org.whoami.authme.events.SpawnTeleportEvent;
|
||||
import uk.org.whoami.authme.security.PasswordSecurity;
|
||||
import uk.org.whoami.authme.settings.Messages;
|
||||
import uk.org.whoami.authme.settings.PlayersLogs;
|
||||
import uk.org.whoami.authme.settings.Settings;
|
||||
import uk.org.whoami.authme.settings.Spawn;
|
||||
import uk.org.whoami.authme.task.MessageTask;
|
||||
import uk.org.whoami.authme.task.TimeoutTask;
|
||||
|
||||
@@ -129,6 +132,27 @@ public class UnregisterCommand implements CommandExecutor {
|
||||
if(plugin.notifications != null) {
|
||||
plugin.notifications.showNotification(new Notification("[AuthMe] " + player.getName() + " unregistered himself!"));
|
||||
}
|
||||
if (Settings.isTeleportToSpawnEnabled) {
|
||||
Location spawn = player.getWorld().getSpawnLocation();
|
||||
if (plugin.mv != null) {
|
||||
try {
|
||||
spawn = plugin.mv.getMVWorldManager().getMVWorld(player.getWorld()).getSpawnLocation();
|
||||
} catch (NullPointerException npe) {
|
||||
} catch (ClassCastException cce) {
|
||||
} catch (NoClassDefFoundError ncdfe) {
|
||||
}
|
||||
}
|
||||
if (Spawn.getInstance().getLocation() != null)
|
||||
spawn = Spawn.getInstance().getLocation();
|
||||
SpawnTeleportEvent tpEvent = new SpawnTeleportEvent(player, player.getLocation(), spawn, false);
|
||||
plugin.getServer().getPluginManager().callEvent(tpEvent);
|
||||
if(!tpEvent.isCancelled()) {
|
||||
if (!tpEvent.getTo().getWorld().getChunkAt(tpEvent.getTo()).isLoaded()) {
|
||||
tpEvent.getTo().getWorld().getChunkAt(tpEvent.getTo()).load();
|
||||
}
|
||||
player.teleport(tpEvent.getTo());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
player.sendMessage(m._("wrong_pwd"));
|
||||
|
||||
@@ -11,8 +11,8 @@ public class ConsoleFilter implements Filter {
|
||||
public boolean isLoggable(LogRecord record) {
|
||||
String logM = record.getMessage().toLowerCase();
|
||||
if (!logM.contains("issued server command:")) return true;
|
||||
if (!logM.contains("/login") && !logM.contains("/l") && !logM.contains("/reg") && !logM.contains("/changepassword") && !logM.contains("/unregister")
|
||||
&& !logM.contains("/authme register") && !logM.contains("/authme changepassword")&& !logM.contains("/authme reg")&& !logM.contains("/authme cp")) return true;
|
||||
if (!logM.contains("/login ") && !logM.contains("/l ") && !logM.contains("/reg ") && !logM.contains("/changepassword ") && !logM.contains("/unregister ")
|
||||
&& !logM.contains("/authme register ") && !logM.contains("/authme changepassword ")&& !logM.contains("/authme reg ")&& !logM.contains("/authme cp ")) return true;
|
||||
String playername = record.getMessage().split(" ")[0];
|
||||
record.setMessage(playername + " issued an AuthMe command!");
|
||||
return true;
|
||||
|
||||
@@ -67,6 +67,7 @@ import uk.org.whoami.authme.plugin.manager.CombatTagComunicator;
|
||||
import uk.org.whoami.authme.settings.Messages;
|
||||
import uk.org.whoami.authme.settings.PlayersLogs;
|
||||
import uk.org.whoami.authme.settings.Settings;
|
||||
import uk.org.whoami.authme.settings.Spawn;
|
||||
import uk.org.whoami.authme.task.MessageTask;
|
||||
import uk.org.whoami.authme.task.TimeoutTask;
|
||||
|
||||
@@ -556,6 +557,8 @@ public class AuthMePlayerListener implements Listener {
|
||||
} catch (NoClassDefFoundError ncdfe) {
|
||||
}
|
||||
}
|
||||
if (Spawn.getInstance().getLocation() != null)
|
||||
spawn = Spawn.getInstance().getLocation();
|
||||
|
||||
if ((spawn.distance(player.getLocation()) > radius) ) {
|
||||
event.getPlayer().teleport(spawn);
|
||||
@@ -661,6 +664,8 @@ public class AuthMePlayerListener implements Listener {
|
||||
Player player = event.getPlayer();
|
||||
World world = player.getWorld();
|
||||
Location spawnLoc = world.getSpawnLocation();
|
||||
if (Spawn.getInstance().getLocation() != null)
|
||||
spawnLoc = Spawn.getInstance().getLocation();
|
||||
gm = player.getGameMode().getValue();
|
||||
final String name = player.getName().toLowerCase();
|
||||
gameMode.put(name, gm);
|
||||
|
||||
@@ -45,7 +45,12 @@ public class PhpBB {
|
||||
// private boolean dss_seeded = false;
|
||||
|
||||
private String unique_id() {
|
||||
return new RandomString(16).nextString();
|
||||
return unique_id("c");
|
||||
}
|
||||
|
||||
private String unique_id(String extra) {
|
||||
//TODO: Maybe check the salt?
|
||||
return "1234567890abcdef";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -643,6 +643,6 @@ public void mergeConfig() {
|
||||
}
|
||||
|
||||
public enum messagesLang {
|
||||
en, de, br, cz, pl, fr, ru, hu, sk, es, zhtw
|
||||
en, de, br, cz, pl, fr, ru, hu, sk, es, zhtw, fi
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
package uk.org.whoami.authme.settings;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
|
||||
public class Spawn extends CustomConfiguration {
|
||||
|
||||
private static Spawn spawn;
|
||||
private static List<String> emptyList = new ArrayList<String>();
|
||||
|
||||
public Spawn() {
|
||||
super(new File("./plugins/AuthMe/spawn.yml"));
|
||||
spawn = this;
|
||||
load();
|
||||
save();
|
||||
saveDefault();
|
||||
}
|
||||
|
||||
private void saveDefault() {
|
||||
if (!contains("spawn")) {
|
||||
set("spawn", emptyList);
|
||||
set("spawn.world", "");
|
||||
set("spawn.x", "");
|
||||
set("spawn.y", "");
|
||||
set("spawn.z", "");
|
||||
set("spawn.yaw", "");
|
||||
set("spawn.pitch", "");
|
||||
save();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static Spawn getInstance() {
|
||||
if (spawn == null) {
|
||||
spawn = new Spawn();
|
||||
}
|
||||
return spawn;
|
||||
}
|
||||
|
||||
public boolean setSpawn(Location location) {
|
||||
try {
|
||||
set("spawn.world", location.getWorld().getName());
|
||||
set("spawn.x", location.getX());
|
||||
set("spawn.y", location.getY());
|
||||
set("spawn.z", location.getZ());
|
||||
set("spawn.yaw", location.getYaw());
|
||||
set("spawn.pitch", location.getPitch());
|
||||
save();
|
||||
return true;
|
||||
} catch (NullPointerException npe) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public Location getLocation() {
|
||||
try {
|
||||
if (this.getString("spawn.world").isEmpty() || this.getString("spawn.world") == "") return null;
|
||||
Location location = new Location(Bukkit.getWorld(this.getString("spawn.world")), this.getDouble("spawn.x"), this.getDouble("spawn.y"), this.getDouble("spawn.z"), Float.parseFloat(this.getString("spawn.yaw")), Float.parseFloat(this.getString("spawn.pitch")));
|
||||
return location;
|
||||
} catch (NullPointerException npe) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user