Search in sources :

Example 41 with GamePlayer

use of pl.themolka.arcade.game.GamePlayer 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

GamePlayer (pl.themolka.arcade.game.GamePlayer)41 EventHandler (org.bukkit.event.EventHandler)17 Handler (net.engio.mbassy.listener.Handler)13 Player (org.bukkit.entity.Player)6 ItemStack (org.bukkit.inventory.ItemStack)5 Participator (pl.themolka.arcade.game.Participator)5 ArcadePlayer (pl.themolka.arcade.session.ArcadePlayer)5 Block (org.bukkit.block.Block)4 Game (pl.themolka.arcade.game.Game)4 ArrayList (java.util.ArrayList)3 CommandException (pl.themolka.arcade.command.CommandException)3 Map (java.util.Map)2 TextComponent (net.md_5.bungee.api.chat.TextComponent)2 Location (org.bukkit.Location)2 HumanEntity (org.bukkit.entity.HumanEntity)2 BossBar (pl.themolka.arcade.bossbar.BossBar)2 Observers (pl.themolka.arcade.match.Observers)2 SpawnApply (pl.themolka.arcade.spawn.SpawnApply)2 Collection (java.util.Collection)1 HashMap (java.util.HashMap)1