mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-03 15:08:18 +01:00
Catch TeleportClause.COMMAND in the teleport listener.
Changed Teleport methods to pass a TeleportClause param
This commit is contained in:
parent
854fc05c5b
commit
10597cec2f
@ -235,7 +235,7 @@ public class EssentialsPlayerListener extends PlayerListener
|
||||
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
//There is TeleportCause.COMMMAND but plugins have to actively pass the cause in on their teleports.
|
||||
if(event.getCause() == TeleportCause.PLUGIN && ess.getSettings().registerBackInListener())
|
||||
if((event.getCause() == TeleportCause.PLUGIN || event.getCause() == TeleportCause.COMMAND)&& ess.getSettings().registerBackInListener())
|
||||
{
|
||||
user.setLastLocation();
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ import org.bukkit.event.Event.Priority;
|
||||
import org.bukkit.event.Event.Type;
|
||||
import org.bukkit.event.block.*;
|
||||
import org.bukkit.event.player.*;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
|
||||
|
||||
@ -109,7 +110,7 @@ public class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.sett
|
||||
{
|
||||
if (!(user.getBase() instanceof OfflinePlayer))
|
||||
{
|
||||
user.getTeleport().now(getJail(jail), false);
|
||||
user.getTeleport().now(getJail(jail), false, TeleportCause.COMMAND);
|
||||
}
|
||||
user.setJail(jail);
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ import org.bukkit.Location;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerRespawnEvent;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
|
||||
public class Teleport implements Runnable, ITeleport
|
||||
@ -58,8 +59,9 @@ public class Teleport implements Runnable, ITeleport
|
||||
private Trade chargeFor;
|
||||
private final IEssentials ess;
|
||||
private static final Logger logger = Logger.getLogger("Minecraft");
|
||||
private TeleportCause cause;
|
||||
|
||||
private void initTimer(long delay, Target target, Trade chargeFor)
|
||||
private void initTimer(long delay, Target target, Trade chargeFor, TeleportCause cause)
|
||||
{
|
||||
this.started = System.currentTimeMillis();
|
||||
this.delay = delay;
|
||||
@ -69,6 +71,7 @@ public class Teleport implements Runnable, ITeleport
|
||||
this.initZ = Math.round(user.getLocation().getZ() * MOVE_CONSTANT);
|
||||
this.teleportTarget = target;
|
||||
this.chargeFor = chargeFor;
|
||||
this.cause = cause;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -101,7 +104,7 @@ public class Teleport implements Runnable, ITeleport
|
||||
try
|
||||
{
|
||||
|
||||
now(teleportTarget);
|
||||
now(teleportTarget, cause);
|
||||
if (chargeFor != null)
|
||||
{
|
||||
chargeFor.charge(user);
|
||||
@ -125,19 +128,19 @@ public class Teleport implements Runnable, ITeleport
|
||||
this.ess = ess;
|
||||
}
|
||||
|
||||
public void respawn(final Trade chargeFor) throws Exception
|
||||
public void respawn(final Trade chargeFor, TeleportCause cause) throws Exception
|
||||
{
|
||||
final Player player = user.getBase();
|
||||
final Location bed = player.getBedSpawnLocation();
|
||||
final PlayerRespawnEvent pre = new PlayerRespawnEvent(player, bed == null ? player.getWorld().getSpawnLocation() : bed, bed != null);
|
||||
ess.getServer().getPluginManager().callEvent(pre);
|
||||
teleport(new Target(pre.getRespawnLocation()), chargeFor);
|
||||
teleport(new Target(pre.getRespawnLocation()), chargeFor, cause);
|
||||
}
|
||||
|
||||
public void warp(String warp, Trade chargeFor) throws Exception
|
||||
public void warp(String warp, Trade chargeFor, TeleportCause cause) throws Exception
|
||||
{
|
||||
Location loc = ess.getWarps().getWarp(warp);
|
||||
teleport(new Target(loc), chargeFor);
|
||||
teleport(new Target(loc), chargeFor, cause);
|
||||
user.sendMessage(_("warpingTo", warp));
|
||||
}
|
||||
|
||||
@ -188,17 +191,17 @@ public class Teleport implements Runnable, ITeleport
|
||||
cancel(false);
|
||||
}
|
||||
|
||||
public void teleport(Location loc, Trade chargeFor) throws Exception
|
||||
public void teleport(Location loc, Trade chargeFor, TeleportCause cause) throws Exception
|
||||
{
|
||||
teleport(new Target(loc), chargeFor);
|
||||
teleport(new Target(loc), chargeFor, cause);
|
||||
}
|
||||
|
||||
public void teleport(Entity entity, Trade chargeFor) throws Exception
|
||||
public void teleport(Entity entity, Trade chargeFor, TeleportCause cause) throws Exception
|
||||
{
|
||||
teleport(new Target(entity), chargeFor);
|
||||
teleport(new Target(entity), chargeFor, cause);
|
||||
}
|
||||
|
||||
private void teleport(Target target, Trade chargeFor) throws Exception
|
||||
private void teleport(Target target, Trade chargeFor, TeleportCause cause) throws Exception
|
||||
{
|
||||
double delay = ess.getSettings().getTeleportDelay();
|
||||
|
||||
@ -210,7 +213,7 @@ public class Teleport implements Runnable, ITeleport
|
||||
if (delay <= 0 || user.isAuthorized("essentials.teleport.timer.bypass"))
|
||||
{
|
||||
cooldown(false);
|
||||
now(target);
|
||||
now(target, cause);
|
||||
if (chargeFor != null)
|
||||
{
|
||||
chargeFor.charge(user);
|
||||
@ -223,51 +226,51 @@ public class Teleport implements Runnable, ITeleport
|
||||
c.add(Calendar.SECOND, (int)delay);
|
||||
c.add(Calendar.MILLISECOND, (int)((delay * 1000.0) % 1000.0));
|
||||
user.sendMessage(_("dontMoveMessage", Util.formatDateDiff(c.getTimeInMillis())));
|
||||
initTimer((long)(delay * 1000.0), target, chargeFor);
|
||||
initTimer((long)(delay * 1000.0), target, chargeFor, cause);
|
||||
|
||||
teleTimer = ess.scheduleSyncRepeatingTask(this, 10, 10);
|
||||
}
|
||||
|
||||
private void now(Target target) throws Exception
|
||||
private void now(Target target, TeleportCause cause) throws Exception
|
||||
{
|
||||
cancel();
|
||||
user.setLastLocation();
|
||||
user.getBase().teleport(Util.getSafeDestination(target.getLocation()));
|
||||
user.getBase().teleport(Util.getSafeDestination(target.getLocation()), cause);
|
||||
}
|
||||
|
||||
public void now(Location loc, boolean cooldown) throws Exception
|
||||
public void now(Location loc, boolean cooldown, TeleportCause cause) throws Exception
|
||||
{
|
||||
if (cooldown)
|
||||
{
|
||||
cooldown(false);
|
||||
}
|
||||
now(new Target(loc));
|
||||
now(new Target(loc), cause);
|
||||
}
|
||||
|
||||
public void now(Location loc, Trade chargeFor) throws Exception
|
||||
public void now(Location loc, Trade chargeFor, TeleportCause cause) throws Exception
|
||||
{
|
||||
cooldown(false);
|
||||
chargeFor.charge(user);
|
||||
now(new Target(loc));
|
||||
now(new Target(loc), cause);
|
||||
}
|
||||
|
||||
public void now(Entity entity, boolean cooldown) throws Exception
|
||||
public void now(Entity entity, boolean cooldown, TeleportCause cause) throws Exception
|
||||
{
|
||||
if (cooldown)
|
||||
{
|
||||
cooldown(false);
|
||||
}
|
||||
now(new Target(entity));
|
||||
now(new Target(entity), cause);
|
||||
}
|
||||
|
||||
public void back(Trade chargeFor) throws Exception
|
||||
{
|
||||
teleport(new Target(user.getLastLocation()), chargeFor);
|
||||
teleport(new Target(user.getLastLocation()), chargeFor, TeleportCause.COMMAND);
|
||||
}
|
||||
|
||||
public void back() throws Exception
|
||||
{
|
||||
now(new Target(user.getLastLocation()));
|
||||
now(new Target(user.getLastLocation()), TeleportCause.COMMAND);
|
||||
}
|
||||
|
||||
public void home(IUser user, String home, Trade chargeFor) throws Exception
|
||||
@ -277,6 +280,6 @@ public class Teleport implements Runnable, ITeleport
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
teleport(new Target(loc), chargeFor);
|
||||
teleport(new Target(loc), chargeFor, TeleportCause.COMMAND);
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,10 @@
|
||||
package com.earth2me.essentials.api;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
|
||||
public interface ITeleport
|
||||
{
|
||||
void now(Location loc, boolean cooldown) throws Exception;
|
||||
void now(Location loc, boolean cooldown, TeleportCause cause) throws Exception;
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
|
||||
public class Commandhome extends EssentialsCommand
|
||||
@ -48,7 +49,7 @@ public class Commandhome extends EssentialsCommand
|
||||
final Location bed = player.getBedSpawnLocation();
|
||||
if (bed != null)
|
||||
{
|
||||
user.getTeleport().teleport(bed, charge);
|
||||
user.getTeleport().teleport(bed, charge, TeleportCause.COMMAND);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -59,7 +60,7 @@ public class Commandhome extends EssentialsCommand
|
||||
final List<String> homes = player.getHomes();
|
||||
if (homes.isEmpty() && player.equals(user))
|
||||
{
|
||||
user.getTeleport().respawn(charge);
|
||||
user.getTeleport().respawn(charge, TeleportCause.COMMAND);
|
||||
}
|
||||
else if (homes.isEmpty())
|
||||
{
|
||||
|
@ -6,6 +6,7 @@ import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.Util;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
|
||||
public class Commandjump extends EssentialsCommand
|
||||
@ -35,6 +36,6 @@ public class Commandjump extends EssentialsCommand
|
||||
|
||||
final Trade charge = new Trade(this.getName(), ess);
|
||||
charge.isAffordableFor(user);
|
||||
user.getTeleport().teleport(loc, charge);
|
||||
user.getTeleport().teleport(loc, charge, TeleportCause.COMMAND);
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import com.earth2me.essentials.Trade;
|
||||
import com.earth2me.essentials.User;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
|
||||
public class Commandtop extends EssentialsCommand
|
||||
@ -20,7 +21,7 @@ public class Commandtop extends EssentialsCommand
|
||||
final int topX = user.getLocation().getBlockX();
|
||||
final int topZ = user.getLocation().getBlockZ();
|
||||
final int topY = user.getWorld().getHighestBlockYAt(topX, topZ);
|
||||
user.getTeleport().teleport(new Location(user.getWorld(), user.getLocation().getX(), topY + 1, user.getLocation().getZ()), new Trade(this.getName(), ess));
|
||||
user.getTeleport().teleport(new Location(user.getWorld(), user.getLocation().getX(), topY + 1, user.getLocation().getZ()), new Trade(this.getName(), ess), TeleportCause.COMMAND);
|
||||
user.sendMessage(_("teleportTop"));
|
||||
}
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import com.earth2me.essentials.Trade;
|
||||
import com.earth2me.essentials.User;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
|
||||
public class Commandtp extends EssentialsCommand
|
||||
@ -32,7 +33,7 @@ public class Commandtp extends EssentialsCommand
|
||||
user.sendMessage(_("teleporting"));
|
||||
final Trade charge = new Trade(this.getName(), ess);
|
||||
charge.isAffordableFor(user);
|
||||
user.getTeleport().teleport(player, charge);
|
||||
user.getTeleport().teleport(player, charge, TeleportCause.COMMAND);
|
||||
throw new NoChargeException();
|
||||
|
||||
default:
|
||||
@ -44,7 +45,7 @@ public class Commandtp extends EssentialsCommand
|
||||
user.sendMessage(_("teleporting"));
|
||||
final User target = getPlayer(server, args, 0);
|
||||
final User toPlayer = getPlayer(server, args, 1);
|
||||
target.getTeleport().now(toPlayer, false);
|
||||
target.getTeleport().now(toPlayer, false, TeleportCause.COMMAND);
|
||||
target.sendMessage(_("teleportAtoB", user.getDisplayName(), toPlayer.getDisplayName()));
|
||||
break;
|
||||
}
|
||||
@ -61,7 +62,7 @@ public class Commandtp extends EssentialsCommand
|
||||
sender.sendMessage(_("teleporting"));
|
||||
final User target = getPlayer(server, args, 0);
|
||||
final User toPlayer = getPlayer(server, args, 1);
|
||||
target.getTeleport().now(toPlayer, false);
|
||||
target.getTeleport().now(toPlayer, false, TeleportCause.COMMAND);
|
||||
target.sendMessage(_("teleportAtoB", Console.NAME, toPlayer.getDisplayName()));
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import com.earth2me.essentials.OfflinePlayer;
|
||||
import com.earth2me.essentials.Trade;
|
||||
import com.earth2me.essentials.User;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
|
||||
public class Commandtpaccept extends EssentialsCommand
|
||||
@ -40,11 +41,11 @@ public class Commandtpaccept extends EssentialsCommand
|
||||
|
||||
if (user.isTeleportRequestHere())
|
||||
{
|
||||
user.getTeleport().teleport(target, charge);
|
||||
user.getTeleport().teleport(target, charge, TeleportCause.COMMAND);
|
||||
}
|
||||
else
|
||||
{
|
||||
target.getTeleport().teleport(user, charge);
|
||||
target.getTeleport().teleport(user, charge, TeleportCause.COMMAND);
|
||||
}
|
||||
user.requestTeleport(null, false);
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import com.earth2me.essentials.User;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
|
||||
public class Commandtpall extends EssentialsCommand
|
||||
@ -43,7 +44,7 @@ public class Commandtpall extends EssentialsCommand
|
||||
}
|
||||
try
|
||||
{
|
||||
player.getTeleport().now(user, false);
|
||||
player.getTeleport().now(user, false, TeleportCause.COMMAND);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -4,6 +4,7 @@ import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.Trade;
|
||||
import com.earth2me.essentials.User;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
|
||||
public class Commandtphere extends EssentialsCommand
|
||||
@ -21,7 +22,7 @@ public class Commandtphere extends EssentialsCommand
|
||||
{
|
||||
throw new Exception(_("teleportDisabled", player.getDisplayName()));
|
||||
}
|
||||
player.getTeleport().teleport(user, new Trade(this.getName(), ess));
|
||||
player.getTeleport().teleport(user, new Trade(this.getName(), ess), TeleportCause.COMMAND);
|
||||
user.sendMessage(_("teleporting"));
|
||||
player.sendMessage(_("teleporting"));
|
||||
throw new NoChargeException();
|
||||
|
@ -4,6 +4,7 @@ import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.OfflinePlayer;
|
||||
import com.earth2me.essentials.User;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
|
||||
public class Commandtpo extends EssentialsCommand
|
||||
@ -32,7 +33,7 @@ public class Commandtpo extends EssentialsCommand
|
||||
// Verify permission
|
||||
if (!player.isHidden() || user.isAuthorized("essentials.teleport.hidden"))
|
||||
{
|
||||
user.getTeleport().now(player, false);
|
||||
user.getTeleport().now(player, false, TeleportCause.COMMAND);
|
||||
user.sendMessage(_("teleporting"));
|
||||
}
|
||||
else
|
||||
|
@ -4,6 +4,7 @@ import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.OfflinePlayer;
|
||||
import com.earth2me.essentials.User;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
|
||||
public class Commandtpohere extends EssentialsCommand
|
||||
@ -33,7 +34,7 @@ public class Commandtpohere extends EssentialsCommand
|
||||
// Verify permission
|
||||
if (!player.isHidden() || user.isAuthorized("essentials.teleport.hidden"))
|
||||
{
|
||||
player.getTeleport().now(user, false);
|
||||
player.getTeleport().now(user, false, TeleportCause.COMMAND);
|
||||
user.sendMessage(_("teleporting"));
|
||||
}
|
||||
else
|
||||
|
@ -5,6 +5,7 @@ import com.earth2me.essentials.Trade;
|
||||
import com.earth2me.essentials.User;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
|
||||
public class Commandtppos extends EssentialsCommand
|
||||
@ -37,7 +38,7 @@ public class Commandtppos extends EssentialsCommand
|
||||
final Trade charge = new Trade(this.getName(), ess);
|
||||
charge.isAffordableFor(user);
|
||||
user.sendMessage(_("teleporting"));
|
||||
user.getTeleport().teleport(location, charge);
|
||||
user.getTeleport().teleport(location, charge, TeleportCause.COMMAND);
|
||||
throw new NoChargeException();
|
||||
}
|
||||
}
|
@ -10,6 +10,7 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
|
||||
public class Commandwarp extends EssentialsCommand
|
||||
@ -118,11 +119,11 @@ public class Commandwarp extends EssentialsCommand
|
||||
{
|
||||
if (user.isAuthorized("essentials.warp." + name))
|
||||
{
|
||||
user.getTeleport().warp(name, charge);
|
||||
user.getTeleport().warp(name, charge, TeleportCause.COMMAND);
|
||||
return;
|
||||
}
|
||||
throw new Exception(_("warpUsePermission"));
|
||||
}
|
||||
user.getTeleport().warp(name, charge);
|
||||
user.getTeleport().warp(name, charge, TeleportCause.COMMAND);
|
||||
}
|
||||
}
|
@ -7,6 +7,7 @@ import java.util.List;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
|
||||
public class Commandworld extends EssentialsCommand
|
||||
@ -81,7 +82,7 @@ public class Commandworld extends EssentialsCommand
|
||||
|
||||
final Trade charge = new Trade(this.getName(), ess);
|
||||
charge.isAffordableFor(user);
|
||||
user.getTeleport().teleport(target, charge);
|
||||
user.getTeleport().teleport(target, charge, TeleportCause.COMMAND);
|
||||
throw new NoChargeException();
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import com.earth2me.essentials.ChargeException;
|
||||
import com.earth2me.essentials.IEssentials;
|
||||
import com.earth2me.essentials.Trade;
|
||||
import com.earth2me.essentials.User;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
|
||||
public class SignWarp extends EssentialsSign
|
||||
@ -56,7 +57,7 @@ public class SignWarp extends EssentialsSign
|
||||
final Trade charge = getTrade(sign, 3, ess);
|
||||
try
|
||||
{
|
||||
player.getTeleport().warp(warpName, charge);
|
||||
player.getTeleport().warp(warpName, charge, TeleportCause.PLUGIN);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -7,6 +7,7 @@ import com.earth2me.essentials.commands.NotEnoughArgumentsException;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
|
||||
public class Commandspawn extends EssentialsCommand
|
||||
@ -24,7 +25,7 @@ public class Commandspawn extends EssentialsCommand
|
||||
if (args.length > 0 && user.isAuthorized("essentials.spawn.others"))
|
||||
{
|
||||
final User otherUser = getPlayer(server, args, 0);
|
||||
otherUser.getTeleport().respawn(charge);
|
||||
otherUser.getTeleport().respawn(charge, TeleportCause.COMMAND);
|
||||
if (!otherUser.equals(user))
|
||||
{
|
||||
otherUser.sendMessage(_("teleportAtoB", user.getDisplayName(), "spawn"));
|
||||
@ -33,7 +34,7 @@ public class Commandspawn extends EssentialsCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
user.getTeleport().respawn(charge);
|
||||
user.getTeleport().respawn(charge, TeleportCause.COMMAND);
|
||||
}
|
||||
}
|
||||
|
||||
@ -45,7 +46,7 @@ public class Commandspawn extends EssentialsCommand
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
final User user = getPlayer(server, args, 0);
|
||||
user.getTeleport().respawn(null);
|
||||
user.getTeleport().respawn(null, TeleportCause.COMMAND);
|
||||
user.sendMessage(_("teleportAtoB", user.getDisplayName(), "spawn"));
|
||||
sender.sendMessage(_("teleporting"));
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ import org.bukkit.Location;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerListener;
|
||||
import org.bukkit.event.player.PlayerRespawnEvent;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
|
||||
public class EssentialsSpawnPlayerListener extends PlayerListener
|
||||
@ -84,7 +85,7 @@ public class EssentialsSpawnPlayerListener extends PlayerListener
|
||||
{
|
||||
try
|
||||
{
|
||||
user.getTeleport().now(spawns.getSpawn(ess.getSettings().getNewbieSpawn()), false);
|
||||
user.getTeleport().now(spawns.getSpawn(ess.getSettings().getNewbieSpawn()), false, TeleportCause.PLUGIN);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user