use of net.minecraft.server.EntityPlayer in project Arcade2 by ShootGame.
the class GamePlayer method getAttribute.
@Override
public Attribute getAttribute(AttributeKey key) {
EntityPlayer mojang = this.getMojang();
if (this.attributeMap == null) {
try {
Field mojangMap = EntityLiving.class.getDeclaredField("attributeMap");
mojangMap.setAccessible(true);
this.attributeMap = new TrackingAttributeMap((AttributeMapBase) mojangMap.get(mojang));
} catch (ReflectiveOperationException ex) {
this.game.getPlugin().getLogger().log(Level.SEVERE, "Could not inject attribute map", ex);
return null;
}
}
return this.attributeMap.getAttribute(key);
}
use of net.minecraft.server.EntityPlayer 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);
}
}
Aggregations