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);
}
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());
}
}
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);
}
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);
}
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);
}
Aggregations