Search in sources :

Example 1 with EntityPlayerHandle

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

the class PlayerUtil method getNearbyPlayers.

/**
 * Gets a (referenced) list of all players nearby another Player
 *
 * @param player to get the nearby players of
 * @param radius to look around the player for other playrs
 * @return list of nearby players
 */
public static List<Player> getNearbyPlayers(Player player, double radius) {
    EntityPlayerHandle handle = CommonNMS.getHandle(player);
    List<?> nearbyPlayerHandles = handle.getWorld().getRawEntitiesOfType(EntityPlayerHandle.T.getType(), handle.getBoundingBox().grow(radius, radius, radius));
    return new ConvertingList<Player>(nearbyPlayerHandles, DuplexConversion.player);
}
Also used : ConvertingList(com.bergerkiller.mountiplex.conversion.util.ConvertingList) EntityPlayerHandle(com.bergerkiller.generated.net.minecraft.server.level.EntityPlayerHandle)

Example 2 with EntityPlayerHandle

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

the class PlayerRespawnPoint method applyToPlayer.

/**
 * Applies this respawn point configuration to a player. If {@link #NONE}, then
 * the respawn point is reset to nothing.
 *
 * @param player The player to apply this respawn point to
 */
public void applyToPlayer(Player player) {
    EntityPlayerHandle handle = EntityPlayerHandle.fromBukkit(player);
    if (getWorld() == null) {
        handle.setSpawnWorld(null);
        handle.setSpawnCoord(null);
    } else {
        handle.setSpawnWorld(getWorld());
        handle.setSpawnCoord(new IntVector3(getX(), getY(), getZ()));
        handle.setSpawnAngle(getAngle());
    }
}
Also used : IntVector3(com.bergerkiller.bukkit.common.bases.IntVector3) EntityPlayerHandle(com.bergerkiller.generated.net.minecraft.server.level.EntityPlayerHandle)

Example 3 with EntityPlayerHandle

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

the class PortalHandler_1_14_1 method showEndCredits.

@Override
public void showEndCredits(Player player) {
    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 4 with EntityPlayerHandle

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

the class PortalHandler_1_9 method showEndCredits.

@Override
public void showEndCredits(Player player) {
    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 5 with EntityPlayerHandle

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

the class PortalHandler_1_14 method showEndCredits.

@Override
public void showEndCredits(Player player) {
    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)

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