Search in sources :

Example 6 with EntityPlayerHandle

use of com.bergerkiller.generated.net.minecraft.server.level.EntityPlayerHandle in project BKCommonLib by bergerhealer.

the class PortalHandler_1_8 method showEndCredits.

@Override
public void showEndCredits(Player player) {
    _ignorePortalEventPlayers.add(player);
    _ignorePortalEventPlayersCleanup.start();
    EntityPlayerHandle ep = EntityPlayerHandle.fromBukkit(player);
    _pta.showEndCredits(HandleConversion.toEntityHandle(player), ep.hasSeenCredits());
    ep.setHasSeenCredits(true);
}
Also used : EntityPlayerHandle(com.bergerkiller.generated.net.minecraft.server.level.EntityPlayerHandle)

Example 7 with EntityPlayerHandle

use of com.bergerkiller.generated.net.minecraft.server.level.EntityPlayerHandle in project BKCommonLib by bergerhealer.

the class PlayerRespawnPoint method forPlayer.

/**
 * Reads the respawn point set for a particular player. Returns {@link #NONE} if none is set.
 *
 * @param player The player to read the respawn point from
 * @return respawn point set for the player
 */
public static PlayerRespawnPoint forPlayer(Player player) {
    EntityPlayerHandle handle = EntityPlayerHandle.fromBukkit(player);
    World world = handle.getSpawnWorld();
    if (world == null) {
        return NONE;
    }
    IntVector3 coord = handle.getSpawnCoord();
    if (coord == null) {
        return NONE;
    }
    float angle = handle.getSpawnAngle();
    return new PlayerRespawnPoint(world, coord.x, coord.y, coord.z, angle);
}
Also used : World(org.bukkit.World) IntVector3(com.bergerkiller.bukkit.common.bases.IntVector3) EntityPlayerHandle(com.bergerkiller.generated.net.minecraft.server.level.EntityPlayerHandle)

Aggregations

EntityPlayerHandle (com.bergerkiller.generated.net.minecraft.server.level.EntityPlayerHandle)7 IntVector3 (com.bergerkiller.bukkit.common.bases.IntVector3)2 ConvertingList (com.bergerkiller.mountiplex.conversion.util.ConvertingList)1 World (org.bukkit.World)1