Player

public class Player extends LivingEntity implements CommandSender, PermissionHolder, MetricProvider

Class Player. Provides player functionality for the Hytale server.

java.lang.Object > LivingEntity > Player

Field Summary

playerRef

private PlayerRef playerRef

Field playerRef.

data

private PlayerConfigData data

Field data.

hotbarManager

private HotbarManager hotbarManager

Field hotbarManager.

gameMode

private GameMode gameMode

Field gameMode.

clientViewRadius

private int clientViewRadius

Field clientViewRadius.

lastSpawnTimeNanos

protected long lastSpawnTimeNanos

Field lastSpawnTimeNanos.

velocitySampleCount

private int velocitySampleCount

Field velocitySampleCount.

velocitySampleIndex

private int velocitySampleIndex

Field velocitySampleIndex.

overrideBlockPlacementRestrictions

private boolean overrideBlockPlacementRestrictions

Field overrideBlockPlacementRestrictions.

executeTriggers

public boolean executeTriggers

Field executeTriggers.

executeBlockDamage

public boolean executeBlockDamage

Field executeBlockDamage.

firstSpawn

private boolean firstSpawn

Field firstSpawn.

mountEntityId

private int mountEntityId

Field mountEntityId.

ref

final Ref ref

Field ref.

store

final Store store

Field store.

tracker

final ChunkTracker tracker

Field tracker.

ref2

final Ref ref2

Field ref2.

store2

final Store store2

Field store2.

tracker2

final ChunkTracker tracker2

Field tracker2.

task

final ScheduledFuture task

Field task.

transformComponent

final TransformComponent transformComponent

Field transformComponent.

position

final Vector3d position

Field position.

playerRefComponent

final PlayerRef playerRefComponent

Field playerRefComponent.

oldTask

final ScheduledFuture oldTask

Field oldTask.

movementStatesComponent

final MovementStatesComponent movementStatesComponent

Field movementStatesComponent.

uuidComponent

final UUIDComponent uuidComponent

Field uuidComponent.

cameraManagerComponent

final CameraManager cameraManagerComponent

Field cameraManagerComponent.

movementManagerComponent

final MovementManager movementManagerComponent

Field movementManagerComponent.

world

final World world

Field world.

itemNameMessage

final Message itemNameMessage

Field itemNameMessage.

collisionResultComponent

final CollisionResultComponent collisionResultComponent

Field collisionResultComponent.

x

final double x

Field x.

y

final double y

Field y.

z

final double z

Field z.

weights

final double[] weights

Field weights.

k

final double k

Field k.

velocitySamples

final double[] velocitySamples

Field velocitySamples.

n

final int n

Field n.

velocitySamples2

final double[] velocitySamples2

Field velocitySamples2.

n2

final int n2

Field n2.

velocitySamples3

final double[] velocitySamples3

Field velocitySamples3.

n3

final int n3

Field n3.

playerComponent

final Player playerComponent

Field playerComponent.

playerConfigData

final PlayerConfigData playerConfigData

Field playerConfigData.

respawnPoints

final PlayerRespawnPointData[] respawnPoints

Field respawnPoints.

worldSpawnPoint

final Transform worldSpawnPoint

Field worldSpawnPoint.

playerPosition

final Vector3d playerPosition

Field playerPosition.

sortedRespawnPoints

final List sortedRespawnPoints

Field sortedRespawnPoints.

posB

final Vector3d posB

Field posB.

distA

final double distA

Field distA.

distB

final double distB

Field distB.

playerBoundingBoxComponent

final BoundingBox playerBoundingBoxComponent

Field playerBoundingBoxComponent.

worldSpawnPoint2

final Transform worldSpawnPoint2

Field worldSpawnPoint2.

respawnPosition

final Vector3d respawnPosition

Field respawnPosition.

targetPlayerComponent

final PlayerRef targetPlayerComponent

Field targetPlayerComponent.

transaction

final ItemStackSlotTransaction transaction

Field transaction.

soundEventIndex

final int soundEventIndex

Field soundEventIndex.

oldGameMode

final GameMode oldGameMode

Field oldGameMode.

event

final ChangeGameModeEvent event

Field event.

permissionsModule

final PermissionsModule permissionsModule

Field permissionsModule.

oldGameModeType

final GameModeType oldGameModeType

Field oldGameModeType.

gameModeType

final GameModeType gameModeType

Field gameModeType.

interactionManagerComponent

final InteractionManager interactionManagerComponent

Field interactionManagerComponent.

interactions

final String interactions

Field interactions.

context

final InteractionContext context

Field context.

rootInteraction

final RootInteraction rootInteraction

Field rootInteraction.

chain

final InteractionChain chain

Field chain.

player

final Player player

Field player.

Method Detail

getComponentType

public Player> getComponentType ()

Method getComponentType.

Player

public public Player ()

Method Player.

copyFrom

public void copyFrom (@Nonnull final Player oldPlayerComponent)

Method copyFrom.

Parameters:
@Nonnull final Player oldPlayerComponent

init

public void init (@Nonnull final UUID uuid, @Nonnull final PlayerRef playerRef)

Method init.

Parameters:
@Nonnull final UUID uuid
@Nonnull final PlayerRef playerRef

setNetworkId

public void setNetworkId (final int id)

Method setNetworkId.

Parameters:
final int id

createDefaultInventory

protected Inventory createDefaultInventory ()

Method createDefaultInventory.

setInventory

public Inventory setInventory (final Inventory inventory)

Method setInventory.

Parameters:
final Inventory inventory

remove

public boolean remove ()

Method remove.

moveTo

public void moveTo (@Nonnull final Ref ref, final double locX, final double locY, final double locZ, @Nonnull final ComponentAccessor componentAccessor)

Method moveTo.

Parameters:
@Nonnull final Ref ref
final double locX
final double locY
final double locZ
@Nonnull final ComponentAccessor componentAccessor

getPlayerConfigData

public PlayerConfigData getPlayerConfigData ()

Method getPlayerConfigData.

markNeedsSave

public void markNeedsSave ()

Method markNeedsSave.

unloadFromWorld

public void unloadFromWorld ()

Method unloadFromWorld.

applyMovementStates

public void applyMovementStates (@Nonnull final Ref ref, @Nonnull final SavedMovementStates savedMovementStates, @Nonnull final MovementStates movementStates, @Nonnull final ComponentAccessor componentAccessor)

Method applyMovementStates.

Parameters:
@Nonnull final Ref ref
@Nonnull final SavedMovementStates savedMovementStates
@Nonnull final MovementStates movementStates
@Nonnull final ComponentAccessor componentAccessor

SetMovementStates

public new SetMovementStates (new SavedMovementStates(movementStates.flying)

Method SetMovementStates.

Parameters:
new SavedMovementStates(movementStates.flying

startClientReadyTimeout

public void startClientReadyTimeout ()

Method startClientReadyTimeout.

handleClientReady

public void handleClientReady (final boolean forced)

Method handleClientReady.

Parameters:
final boolean forced

PlayerReadyEvent

public new PlayerReadyEvent (this.reference, this, this.readyId.getAndIncrement()

Method PlayerReadyEvent.

Parameters:
this.reference this.reference
this this
this.readyId.getAndIncrement( this.readyId.getAndIncrement(

sendInventory

public void sendInventory ()

Method sendInventory.

saveConfig

public CompletableFuture saveConfig (@Nonnull final World world, @Nonnull final Holder holder)

Method saveConfig.

Parameters:
@Nonnull final World world
@Nonnull final Holder holder

getPlayerConnection

public PacketHandler getPlayerConnection ()

Method getPlayerConnection.

getWorldMapTracker

public WorldMapTracker getWorldMapTracker ()

Method getWorldMapTracker.

getWindowManager

public WindowManager getWindowManager ()

Method getWindowManager.

getPageManager

public PageManager getPageManager ()

Method getPageManager.

getHudManager

public HudManager getHudManager ()

Method getHudManager.

getHotbarManager

public HotbarManager getHotbarManager ()

Method getHotbarManager.

isFirstSpawn

public boolean isFirstSpawn ()

Method isFirstSpawn.

setFirstSpawn

public void setFirstSpawn (final boolean firstSpawn)

Method setFirstSpawn.

Parameters:
final boolean firstSpawn

resetManagers

public void resetManagers (@Nonnull final Holder holder)

Method resetManagers.

Parameters:
@Nonnull final Holder holder

notifyPickupItem

public void notifyPickupItem (@Nonnull final Ref ref, @Nonnull final ItemStack itemStack, @Nullable final Vector3d position, @Nonnull final ComponentAccessor componentAccessor)

Method notifyPickupItem.

Parameters:
@Nonnull final Ref ref
@Nonnull final ItemStack itemStack
@Nullable final Vector3d position
@Nonnull final ComponentAccessor componentAccessor

isOverrideBlockPlacementRestrictions

public boolean isOverrideBlockPlacementRestrictions ()

Method isOverrideBlockPlacementRestrictions.

setOverrideBlockPlacementRestrictions

public void setOverrideBlockPlacementRestrictions (@Nonnull final Ref ref, final boolean overrideBlockPlacementRestrictions, @Nonnull final ComponentAccessor componentAccessor)

Method setOverrideBlockPlacementRestrictions.

Parameters:
@Nonnull final Ref ref
final boolean overrideBlockPlacementRestrictions
@Nonnull final ComponentAccessor componentAccessor

SetBlockPlacementOverride

public new SetBlockPlacementOverride (overrideBlockPlacementRestrictions)

Method SetBlockPlacementOverride.

Parameters:
overrideBlockPlacementRestrictions overrideBlockPlacementRestrictions

sendMessage

public void sendMessage (@Nonnull final Message message)

Method sendMessage.

Parameters:
@Nonnull final Message message

hasPermission

public boolean hasPermission (@Nonnull final String id)

Method hasPermission.

Parameters:
@Nonnull final String id

addLocationChange

public void addLocationChange (@Nonnull final Ref ref, final double deltaX, final double deltaY, final double deltaZ, @Nonnull final ComponentAccessor componentAccessor)

Method addLocationChange.

Parameters:
@Nonnull final Ref ref
final double deltaX
final double deltaY
final double deltaZ
@Nonnull final ComponentAccessor componentAccessor

configTriggerBlockProcessing

public void configTriggerBlockProcessing (final boolean triggers, final boolean blockDamage, @Nonnull final CollisionResultComponent collisionResultComponent)

Method configTriggerBlockProcessing.

Parameters:
final boolean triggers
final boolean blockDamage
@Nonnull final CollisionResultComponent collisionResultComponent

resetVelocity

public void resetVelocity (@Nonnull final Velocity velocity)

Method resetVelocity.

Parameters:
@Nonnull final Velocity velocity

processVelocitySample

public void processVelocitySample (final double dt, @Nonnull final Vector3d position, @Nonnull final Velocity velocity)

Method processVelocitySample.

Parameters:
final double dt
@Nonnull final Vector3d position
@Nonnull final Velocity velocity

getRespawnPosition

static Transform getRespawnPosition (@Nonnull final Ref ref, @Nonnull final String worldName, @Nonnull final ComponentAccessor componentAccessor)

Method getRespawnPosition.

Parameters:
@Nonnull final Ref ref
@Nonnull final String worldName
@Nonnull final ComponentAccessor componentAccessor

Transform

public new Transform (sortedRespawnPoints.getFirst()

Method Transform.

Parameters:
sortedRespawnPoints.getFirst( sortedRespawnPoints.getFirst(

ensureNoCollisionAtRespawnPosition

public Vector3d> ensureNoCollisionAtRespawnPosition (final PlayerRespawnPointData playerRespawnPointData, final Box playerHitbox, final World world)

Method ensureNoCollisionAtRespawnPosition.

Parameters:
final PlayerRespawnPointData playerRespawnPointData
final Box playerHitbox
final World world

Vector3d

public new Vector3d (playerRespawnPointData.getRespawnPosition()

Method Vector3d.

Parameters:
playerRespawnPointData.getRespawnPosition( playerRespawnPointData.getRespawnPosition(

CollisionResult

public new CollisionResult ()

Method CollisionResult.

hasSpawnProtection

public boolean hasSpawnProtection ()

Method hasSpawnProtection.

isWaitingForClientReady

public boolean isWaitingForClientReady ()

Method isWaitingForClientReady.

isHiddenFromLivingEntity

public boolean isHiddenFromLivingEntity (@Nonnull final Ref ref, @Nonnull final Ref targetRef, @Nonnull final ComponentAccessor componentAccessor)

Method isHiddenFromLivingEntity.

Parameters:
@Nonnull final Ref ref
@Nonnull final Ref targetRef
@Nonnull final ComponentAccessor componentAccessor

setClientViewRadius

public void setClientViewRadius (final int clientViewRadius)

Method setClientViewRadius.

Parameters:
final int clientViewRadius

getClientViewRadius

public int getClientViewRadius ()

Method getClientViewRadius.

getViewRadius

public int getViewRadius ()

Method getViewRadius.

canDecreaseItemStackDurability

public boolean canDecreaseItemStackDurability (@Nonnull final Ref ref, @Nonnull final ComponentAccessor componentAccessor)

Method canDecreaseItemStackDurability.

Parameters:
@Nonnull final Ref ref
@Nonnull final ComponentAccessor componentAccessor

canApplyItemStackPenalties

public boolean canApplyItemStackPenalties (@Nonnull final Ref ref, @Nonnull final ComponentAccessor componentAccessor)

Method canApplyItemStackPenalties.

Parameters:
@Nonnull final Ref ref
@Nonnull final ComponentAccessor componentAccessor

updateItemStackDurability

public ItemStackSlotTransaction updateItemStackDurability (@Nonnull final Ref ref, @Nonnull final ItemStack itemStack, final ItemContainer container, final int slotId, final double durabilityChange, @Nonnull final ComponentAccessor componentAccessor)

Method updateItemStackDurability.

Parameters:
@Nonnull final Ref ref
@Nonnull final ItemStack itemStack
final ItemContainer container
final int slotId
final double durabilityChange
@Nonnull final ComponentAccessor componentAccessor

toMetricResults

public MetricResults toMetricResults ()

Method toMetricResults.

setLastSpawnTimeNanos

public void setLastSpawnTimeNanos (final long lastSpawnTimeNanos)

Method setLastSpawnTimeNanos.

Parameters:
final long lastSpawnTimeNanos

getSinceLastSpawnNanos

public long getSinceLastSpawnNanos ()

Method getSinceLastSpawnNanos.

getPlayerRef

public PlayerRef getPlayerRef ()

Method getPlayerRef.

getMountEntityId

public int getMountEntityId ()

Method getMountEntityId.

setMountEntityId

public void setMountEntityId (final int mountEntityId)

Method setMountEntityId.

Parameters:
final int mountEntityId

getGameMode

public GameMode getGameMode ()

Method getGameMode.

setGameMode

static void setGameMode (@Nonnull final Ref playerRef, @Nonnull final GameMode gameMode, @Nonnull final ComponentAccessor componentAccessor)

Method setGameMode.

Parameters:
@Nonnull final Ref playerRef
@Nonnull final GameMode gameMode
@Nonnull final ComponentAccessor componentAccessor

initGameMode

static void initGameMode (@Nonnull final Ref playerRef, @Nonnull final ComponentAccessor componentAccessor)

Method initGameMode.

Parameters:
@Nonnull final Ref playerRef
@Nonnull final ComponentAccessor componentAccessor

setGameModeInternal

static void setGameModeInternal (@Nonnull final Ref playerRef, @Nonnull final GameMode gameMode, @Nonnull final MovementManager movementManager, @Nonnull final ComponentAccessor componentAccessor)

Method setGameModeInternal.

Parameters:
@Nonnull final Ref playerRef
@Nonnull final GameMode gameMode
@Nonnull final MovementManager movementManager
@Nonnull final ComponentAccessor componentAccessor

SetGameMode

public new SetGameMode (gameMode)

Method SetGameMode.

Parameters:
gameMode gameMode

runOnSwitchToGameMode

static void runOnSwitchToGameMode (@Nonnull final Ref ref, @Nonnull final GameMode gameMode)

Method runOnSwitchToGameMode.

Parameters:
@Nonnull final Ref ref
@Nonnull final GameMode gameMode

hashCode

public int hashCode ()

Method hashCode.

equals

public boolean equals (@Nullable final Object o)

Method equals.

Parameters:
@Nullable final Object o

toString

public String toString ()

Method toString.

getDisplayName

public String getDisplayName ()

Method getDisplayName.