Merge branch 'master' of https://github.com/NorbiPeti/thebuttonautoflairmc
This commit is contained in:
commit
300eaa70b9
1 changed files with 15 additions and 0 deletions
|
@ -8,6 +8,7 @@ import java.util.Timer;
|
||||||
import java.util.TimerTask;
|
import java.util.TimerTask;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import com.palmergames.bukkit.towny.Towny;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
@ -48,6 +49,7 @@ import com.palmergames.bukkit.towny.object.Resident;
|
||||||
import com.palmergames.bukkit.towny.object.Town;
|
import com.palmergames.bukkit.towny.object.Town;
|
||||||
import com.palmergames.bukkit.towny.object.TownBlock;
|
import com.palmergames.bukkit.towny.object.TownBlock;
|
||||||
import com.palmergames.bukkit.towny.object.TownyUniverse;
|
import com.palmergames.bukkit.towny.object.TownyUniverse;
|
||||||
|
import com.palmergames.bukkit.towny.war.eventwar.War;
|
||||||
import com.palmergames.bukkit.towny.object.WorldCoord;
|
import com.palmergames.bukkit.towny.object.WorldCoord;
|
||||||
import com.vexsoftware.votifier.model.Vote;
|
import com.vexsoftware.votifier.model.Vote;
|
||||||
import com.vexsoftware.votifier.model.VotifierEvent;
|
import com.vexsoftware.votifier.model.VotifierEvent;
|
||||||
|
@ -400,11 +402,24 @@ public class PlayerListener implements Listener {
|
||||||
|| cmd.equalsIgnoreCase("tp")) {
|
|| cmd.equalsIgnoreCase("tp")) {
|
||||||
MinigamePlayer mgp = Minigames.plugin.pdata.getMinigamePlayer(event
|
MinigamePlayer mgp = Minigames.plugin.pdata.getMinigamePlayer(event
|
||||||
.getPlayer());
|
.getPlayer());
|
||||||
|
String currentWorld = event.getPlayer().getLocation().getWorld().getName();
|
||||||
|
Location currentLocation = event.getPlayer().getLocation();
|
||||||
|
TownyUniverse universe = Towny.plugin.getTownyUniverse();
|
||||||
if (mgp.isInMinigame()
|
if (mgp.isInMinigame()
|
||||||
&& mgp.getMinigame().getMechanic().getMechanic()
|
&& mgp.getMinigame().getMechanic().getMechanic()
|
||||||
.equals("creativeglobal")) {
|
.equals("creativeglobal")) {
|
||||||
mgp.setAllowTeleport(true);
|
mgp.setAllowTeleport(true);
|
||||||
}
|
}
|
||||||
|
else if (universe.isWarTime())
|
||||||
|
{
|
||||||
|
War war = universe.getWarEvent();
|
||||||
|
if (war.isWarZone(new WorldCoord(currentWorld, currentLocation.getBlockX(), currentLocation.getBlockZ())))
|
||||||
|
{
|
||||||
|
event.getPlayer().sendMessage(
|
||||||
|
"§cError: You can't teleport out of a war zone!");
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if (cmd.toLowerCase().startsWith("un")) {
|
} else if (cmd.toLowerCase().startsWith("un")) {
|
||||||
for (HelpTopic ht : PluginMain.Instance.getServer().getHelpMap()
|
for (HelpTopic ht : PluginMain.Instance.getServer().getHelpMap()
|
||||||
.getHelpTopics()) {
|
.getHelpTopics()) {
|
||||||
|
|
Loading…
Reference in a new issue