mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-24 19:45:43 +01:00
Replace removed Commons methods with Bukkit methods
This commit is contained in:
parent
5086bf2531
commit
3a87fa172b
@ -291,8 +291,7 @@ public class DGame implements Game {
|
||||
@Override
|
||||
public void run() {
|
||||
if (teleport) {
|
||||
groups.forEach(g -> g.getMembers().getOnlinePlayers()
|
||||
.forEach(p -> PlayerUtil.secureTeleport(p, world.getStartLocation(plugin.getPlayerGroup(p)))));
|
||||
groups.forEach(g -> g.getMembers().getOnlinePlayers().forEach(p -> p.teleport(world.getStartLocation(plugin.getPlayerGroup(p)))));
|
||||
}
|
||||
|
||||
for (DungeonSign dSign : world.getDungeonSigns()) {
|
||||
|
@ -56,9 +56,9 @@ public class DEditPlayer extends DInstancePlayer implements EditPlayer {
|
||||
|
||||
Location teleport = world.getLobbyLocation();
|
||||
if (teleport == null) {
|
||||
PlayerUtil.secureTeleport(player, world.getWorld().getSpawnLocation());
|
||||
player.teleport(world.getWorld().getSpawnLocation());
|
||||
} else {
|
||||
PlayerUtil.secureTeleport(player, teleport);
|
||||
player.teleport(teleport);
|
||||
}
|
||||
|
||||
// Permission bridge
|
||||
@ -173,7 +173,7 @@ public class DEditPlayer extends DInstancePlayer implements EditPlayer {
|
||||
}
|
||||
|
||||
if (!locationValid) {
|
||||
PlayerUtil.secureTeleport(getPlayer(), teleportLocation);
|
||||
getPlayer().teleport(teleportLocation);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -106,9 +106,9 @@ public class DGamePlayer extends DInstancePlayer implements GamePlayer {
|
||||
|
||||
Location teleport = world.getLobbyLocation();
|
||||
if (teleport == null) {
|
||||
PlayerUtil.secureTeleport(player, world.getWorld().getSpawnLocation());
|
||||
player.teleport(world.getWorld().getSpawnLocation());
|
||||
} else {
|
||||
PlayerUtil.secureTeleport(player, teleport);
|
||||
player.teleport(teleport);
|
||||
}
|
||||
|
||||
if (!((DGameWorld) world).hasReadySign()) {
|
||||
@ -532,7 +532,7 @@ public class DGamePlayer extends DInstancePlayer implements GamePlayer {
|
||||
respawn = getWorld().getSpawnLocation();
|
||||
}
|
||||
|
||||
PlayerUtil.secureTeleport(getPlayer(), respawn);
|
||||
getPlayer().teleport(respawn);
|
||||
|
||||
if (resetClassInventoryOnRespawn) {
|
||||
setPlayerClass(dClass);
|
||||
@ -785,7 +785,7 @@ public class DGamePlayer extends DInstancePlayer implements GamePlayer {
|
||||
}
|
||||
|
||||
if (!locationValid) {
|
||||
PlayerUtil.secureTeleport(getPlayer(), teleportLocation);
|
||||
getPlayer().teleport(teleportLocation);
|
||||
}
|
||||
|
||||
if (teleportWolf) {
|
||||
|
@ -446,7 +446,7 @@ public class DGlobalPlayer implements GlobalPlayer {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
PlayerUtil.respawn(player);
|
||||
player.spigot().respawn();
|
||||
reset(tpLoc, keepInventory);
|
||||
}
|
||||
}.runTaskLater(plugin, 1L);
|
||||
@ -458,7 +458,7 @@ public class DGlobalPlayer implements GlobalPlayer {
|
||||
@Override
|
||||
public void reset(Location tpLoc, boolean keepInventory) {
|
||||
try {
|
||||
PlayerUtil.secureTeleport(player, tpLoc);
|
||||
player.teleport(tpLoc);
|
||||
player.setGameMode(data.getOldGameMode());
|
||||
if (!keepInventory) {
|
||||
while (data.getOldInventory().size() > 36) {
|
||||
|
@ -45,7 +45,7 @@ public class RespawnTask extends BukkitRunnable {
|
||||
return;
|
||||
}
|
||||
if (player.getWorld() != location.getWorld() || player.getLocation().distance(location) > 2) {
|
||||
PlayerUtil.secureTeleport(player, location);
|
||||
player.teleport(location);
|
||||
}
|
||||
if (resetClassInventory) {
|
||||
dPlayer.setPlayerClass(dPlayer.getPlayerClass());
|
||||
|
@ -171,7 +171,7 @@ public abstract class DInstanceWorld implements InstanceWorld {
|
||||
getPlayers().forEach(p -> p.leave());
|
||||
// Players who shouldn't be in the dungeon but still are for some reason
|
||||
if (world != null) {
|
||||
getWorld().getPlayers().forEach(p -> PlayerUtil.secureTeleport(p, Bukkit.getWorlds().get(0).getSpawnLocation()));
|
||||
getWorld().getPlayers().forEach(p -> p.teleport(Bukkit.getWorlds().get(0).getSpawnLocation()));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user