Search in sources :

Example 1 with CraftWorld

use of org.bukkit.craftbukkit.CraftWorld in project Arcade2 by ShootGame.

the class ArcadePlayer method respawn.

/**
 * @deprecated Will not fire {@link pl.themolka.arcade.respawn.PlayerRespawnEvent}
 * and {@link org.bukkit.event.player.PlayerRespawnEvent}!
 */
@Deprecated
public void respawn(Location at) {
    // 'worldId' is not used if 'at' is null
    int worldId = -1;
    if (at != null) {
        worldId = ((CraftWorld) at.getWorld()).getHandle().dimension;
    }
    GamePlayer gamePlayer = this.getGamePlayer();
    if (gamePlayer != null) {
        gamePlayer.resetHealth();
    }
    EntityPlayer mojang = this.getMojang();
    if (mojang != null) {
        mojang.server.getPlayerList().moveToWorld(mojang, worldId, false, at, false);
    }
}
Also used : GamePlayer(pl.themolka.arcade.game.GamePlayer) EntityPlayer(net.minecraft.server.EntityPlayer) CraftWorld(org.bukkit.craftbukkit.CraftWorld)

Aggregations

EntityPlayer (net.minecraft.server.EntityPlayer)1 CraftWorld (org.bukkit.craftbukkit.CraftWorld)1 GamePlayer (pl.themolka.arcade.game.GamePlayer)1