Replace removed Commons methods with Bukkit methods

This commit is contained in:
Daniel Saukel 2020-06-28 01:06:59 +02:00
parent 5086bf2531
commit 3a87fa172b
6 changed files with 12 additions and 13 deletions

View File

@ -291,8 +291,7 @@ public class DGame implements Game {
@Override @Override
public void run() { public void run() {
if (teleport) { if (teleport) {
groups.forEach(g -> g.getMembers().getOnlinePlayers() groups.forEach(g -> g.getMembers().getOnlinePlayers().forEach(p -> p.teleport(world.getStartLocation(plugin.getPlayerGroup(p)))));
.forEach(p -> PlayerUtil.secureTeleport(p, world.getStartLocation(plugin.getPlayerGroup(p)))));
} }
for (DungeonSign dSign : world.getDungeonSigns()) { for (DungeonSign dSign : world.getDungeonSigns()) {

View File

@ -56,9 +56,9 @@ public class DEditPlayer extends DInstancePlayer implements EditPlayer {
Location teleport = world.getLobbyLocation(); Location teleport = world.getLobbyLocation();
if (teleport == null) { if (teleport == null) {
PlayerUtil.secureTeleport(player, world.getWorld().getSpawnLocation()); player.teleport(world.getWorld().getSpawnLocation());
} else { } else {
PlayerUtil.secureTeleport(player, teleport); player.teleport(teleport);
} }
// Permission bridge // Permission bridge
@ -173,7 +173,7 @@ public class DEditPlayer extends DInstancePlayer implements EditPlayer {
} }
if (!locationValid) { if (!locationValid) {
PlayerUtil.secureTeleport(getPlayer(), teleportLocation); getPlayer().teleport(teleportLocation);
} }
} }

View File

@ -106,9 +106,9 @@ public class DGamePlayer extends DInstancePlayer implements GamePlayer {
Location teleport = world.getLobbyLocation(); Location teleport = world.getLobbyLocation();
if (teleport == null) { if (teleport == null) {
PlayerUtil.secureTeleport(player, world.getWorld().getSpawnLocation()); player.teleport(world.getWorld().getSpawnLocation());
} else { } else {
PlayerUtil.secureTeleport(player, teleport); player.teleport(teleport);
} }
if (!((DGameWorld) world).hasReadySign()) { if (!((DGameWorld) world).hasReadySign()) {
@ -532,7 +532,7 @@ public class DGamePlayer extends DInstancePlayer implements GamePlayer {
respawn = getWorld().getSpawnLocation(); respawn = getWorld().getSpawnLocation();
} }
PlayerUtil.secureTeleport(getPlayer(), respawn); getPlayer().teleport(respawn);
if (resetClassInventoryOnRespawn) { if (resetClassInventoryOnRespawn) {
setPlayerClass(dClass); setPlayerClass(dClass);
@ -785,7 +785,7 @@ public class DGamePlayer extends DInstancePlayer implements GamePlayer {
} }
if (!locationValid) { if (!locationValid) {
PlayerUtil.secureTeleport(getPlayer(), teleportLocation); getPlayer().teleport(teleportLocation);
} }
if (teleportWolf) { if (teleportWolf) {

View File

@ -446,7 +446,7 @@ public class DGlobalPlayer implements GlobalPlayer {
new BukkitRunnable() { new BukkitRunnable() {
@Override @Override
public void run() { public void run() {
PlayerUtil.respawn(player); player.spigot().respawn();
reset(tpLoc, keepInventory); reset(tpLoc, keepInventory);
} }
}.runTaskLater(plugin, 1L); }.runTaskLater(plugin, 1L);
@ -458,7 +458,7 @@ public class DGlobalPlayer implements GlobalPlayer {
@Override @Override
public void reset(Location tpLoc, boolean keepInventory) { public void reset(Location tpLoc, boolean keepInventory) {
try { try {
PlayerUtil.secureTeleport(player, tpLoc); player.teleport(tpLoc);
player.setGameMode(data.getOldGameMode()); player.setGameMode(data.getOldGameMode());
if (!keepInventory) { if (!keepInventory) {
while (data.getOldInventory().size() > 36) { while (data.getOldInventory().size() > 36) {

View File

@ -45,7 +45,7 @@ public class RespawnTask extends BukkitRunnable {
return; return;
} }
if (player.getWorld() != location.getWorld() || player.getLocation().distance(location) > 2) { if (player.getWorld() != location.getWorld() || player.getLocation().distance(location) > 2) {
PlayerUtil.secureTeleport(player, location); player.teleport(location);
} }
if (resetClassInventory) { if (resetClassInventory) {
dPlayer.setPlayerClass(dPlayer.getPlayerClass()); dPlayer.setPlayerClass(dPlayer.getPlayerClass());

View File

@ -171,7 +171,7 @@ public abstract class DInstanceWorld implements InstanceWorld {
getPlayers().forEach(p -> p.leave()); getPlayers().forEach(p -> p.leave());
// Players who shouldn't be in the dungeon but still are for some reason // Players who shouldn't be in the dungeon but still are for some reason
if (world != null) { 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()));
} }
} }