diff options
author | Tyler Murphy <tylermurphy534@gmail.com> | 2022-11-26 14:23:39 -0500 |
---|---|---|
committer | Tyler Murphy <tylermurphy534@gmail.com> | 2022-11-26 14:23:39 -0500 |
commit | 6b453dde9758bc6d4d399528209addc2b817ce1a (patch) | |
tree | 3172b2afa630621a22cc65426f6b932b1b0f912f /src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Spawn.java | |
parent | fix seeker/hider returning null (diff) | |
download | kenshinshideandseek-6b453dde9758bc6d4d399528209addc2b817ce1a.tar.gz kenshinshideandseek-6b453dde9758bc6d4d399528209addc2b817ce1a.tar.bz2 kenshinshideandseek-6b453dde9758bc6d4d399528209addc2b817ce1a.zip |
1.7.0RC1
Diffstat (limited to 'src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Spawn.java')
-rw-r--r-- | src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Spawn.java | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Spawn.java b/src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Spawn.java index b983404..0baf55e 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Spawn.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Spawn.java @@ -1,22 +1,3 @@ -/* - * This file is part of Kenshins Hide and Seek - * - * Copyright (c) 2021 Tyler Murphy. - * - * 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 - * he Free Software Foundation version 3. - * - * Kenshins Hide and Seek is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - */ - package net.tylermurphy.hideAndSeek.command.map.set; import net.tylermurphy.hideAndSeek.command.util.ICommand; @@ -47,8 +28,16 @@ public class Spawn implements ICommand { map.setSpawn(Location.from(sender)); + if(!map.isBoundsNotSetup()) { + Vector boundsMin = map.getBoundsMin(); + Vector boundsMax = map.getBoundsMax(); + if(map.getSpawn().isNotInBounds(boundsMin.getBlockX(), boundsMax.getBlockX(), boundsMin.getBlockZ(), boundsMax.getBlockZ())) { + sender.sendMessage(warningPrefix + message("WARN_MAP_BOUNDS")); + } + } + if(map.getSeekerLobby().getWorld() != null && !map.getSeekerLobby().getWorld().equals(sender.getLocation().getWorld().getName())) { - sender.sendMessage(message("SEEKER_LOBBY_SPAWN_RESET").toString()); + sender.sendMessage(warningPrefix + message("SEEKER_LOBBY_SPAWN_RESET")); map.setSeekerLobby(Location.getDefault()); } |