Class AsyncPlayer
java.lang.Object
com.sk89q.worldedit.extension.platform.AbstractPlayerActor
com.sk89q.worldedit.extension.platform.PlayerProxy
com.fastasyncworldedit.core.wrappers.AsyncPlayer
- All Implemented Interfaces:
MapMetadatable
,Metadatable
,Entity
,Player
,Actor
,Locatable
,SessionOwner
,Subject
,Faceted
,Identifiable
,Cloneable
- Direct Known Subclasses:
LocationMaskedPlayerWrapper
,SilentPlayerWrapper
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.fastasyncworldedit.core.entity.Metadatable
Metadatable.METADATA_KEYS
-
Field Summary
Fields inherited from interface com.sk89q.worldedit.util.Identifiable
CONSOLE, EVERYONE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Go up one level to the next free space above.boolean
ascendToCeiling
(int clearance) Ascend to the ceiling above.boolean
ascendToCeiling
(int clearance, boolean alwaysGlass) Ascend to the ceiling above.boolean
ascendUpwards
(int distance) Just go up.boolean
ascendUpwards
(int distance, boolean alwaysGlass) Just go up.boolean
Go up one level to the next free space above.void
Find a position for the player to stand that is not inside a block.void
findFreePosition
(Location searchPos) Find a position for the actor to stand that is not inside a block.void
floatAt
(int x, int y, int z, boolean alwaysGlass) Make the player float in the given blocks.getBlockTrace
(int range, boolean useLastBlock) Get the point of the block being looked at.getBlockTraceFace
(int range, boolean useLastBlock) Get the face that the player is looking at.Get the player's cardinal direction (N, W, NW, etc.).getSolidBlockTrace
(int range) Get the point of the block being looked at.getWorld()
Return the world that the player is on.boolean
passThroughForwardWall
(int range) Pass through the wall that you are looking at.void
setOnGround
(Location searchPos) Set the actor on the ground.void
setPosition
(Vector3 pos, float pitch, float yaw) Move the player.static AsyncPlayer
Methods inherited from class com.sk89q.worldedit.extension.platform.PlayerProxy
dispatchCUIEvent, getBasePlayer, getBlockInHand, getDisplayName, getFacet, getGameMode, getGroups, getInventoryBlockBag, getItemInHand, getLocale, getLocation, getName, getSessionKey, getState, getUniqueId, giveItem, hasPermission, print, print, printDebug, printError, printRaw, runAction, sendAnnouncements, sendFakeBlock, sendTitle, setGameMode, setLocation, setOffset, setPermission, togglePermission, trySetPosition, unwrap
Methods inherited from class com.sk89q.worldedit.extension.platform.AbstractPlayerActor
canDestroyBedrock, checkPermission, clone, equals, getAllowedRegions, getAllowedRegions, getBlockOn, getBlockTrace, getBlockTrace, getBlockTraceFace, getCardinalDirection, getDisallowedRegions, getDisallowedRegions, getExtent, getLargestRegion, getRawMeta, hashCode, isAllowedToFly, isHoldingPickAxe, isPlayer, openFileOpenDialog, openFileSaveDialog, remove, setFlying, setSelection, trySetPosition
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.sk89q.worldedit.extension.platform.Actor
cancel, checkAction, confirm, decline, getLimit, printDebug, printError, printInfo, queueAction, runAsyncIfFree, runIfFree
Methods inherited from interface com.sk89q.worldedit.extension.platform.Locatable
getBlockLocation, setPosition
Methods inherited from interface com.fastasyncworldedit.core.entity.MapMetadatable
deleteMeta, getAndSetMeta, getMeta, getMeta, hasMeta, putIfAbsent, setMeta
Methods inherited from interface com.sk89q.worldedit.entity.Player
getBlockIn, getSelection, getWorldForEditing, loadClipboardFromDisk, setSelection, unregister
Methods inherited from interface com.sk89q.worldedit.session.SessionOwner
getSession
-
Constructor Details
-
AsyncPlayer
-
-
Method Details
-
wrap
-
getWorld
Description copied from interface:Player
Return the world that the player is on.- Specified by:
getWorld
in interfacePlayer
- Overrides:
getWorld
in classPlayerProxy
- Returns:
- the world
-
findFreePosition
Description copied from interface:Player
Find a position for the actor to stand that is not inside a block. Blocks above the player will be iteratively tested until there is a series of two free blocks. The actor will be teleported to that free position.- Specified by:
findFreePosition
in interfacePlayer
- Overrides:
findFreePosition
in classPlayerProxy
- Parameters:
searchPos
- search position
-
setOnGround
Description copied from interface:Player
Set the actor on the ground.- Specified by:
setOnGround
in interfacePlayer
- Overrides:
setOnGround
in classPlayerProxy
- Parameters:
searchPos
- The location to start searching from
-
findFreePosition
public void findFreePosition()Description copied from interface:Player
Find a position for the player to stand that is not inside a block. Blocks above the player will be iteratively tested until there is a series of two free blocks. The player will be teleported to that free position.- Specified by:
findFreePosition
in interfacePlayer
- Overrides:
findFreePosition
in classPlayerProxy
-
ascendLevel
public boolean ascendLevel()Description copied from interface:Player
Go up one level to the next free space above.- Specified by:
ascendLevel
in interfacePlayer
- Overrides:
ascendLevel
in classPlayerProxy
- Returns:
- true if a spot was found
-
descendLevel
public boolean descendLevel()Description copied from interface:Player
Go up one level to the next free space above.- Specified by:
descendLevel
in interfacePlayer
- Overrides:
descendLevel
in classPlayerProxy
- Returns:
- true if a spot was found
-
ascendToCeiling
public boolean ascendToCeiling(int clearance) Description copied from interface:Player
Ascend to the ceiling above.- Specified by:
ascendToCeiling
in interfacePlayer
- Overrides:
ascendToCeiling
in classPlayerProxy
- Parameters:
clearance
- How many blocks to leave above the player's head- Returns:
- whether the player was moved
-
ascendToCeiling
public boolean ascendToCeiling(int clearance, boolean alwaysGlass) Description copied from interface:Player
Ascend to the ceiling above.- Specified by:
ascendToCeiling
in interfacePlayer
- Overrides:
ascendToCeiling
in classPlayerProxy
- Parameters:
clearance
- How many blocks to leave above the player's headalwaysGlass
- Always put glass under the player- Returns:
- whether the player was moved
-
ascendUpwards
public boolean ascendUpwards(int distance) Description copied from interface:Player
Just go up.- Specified by:
ascendUpwards
in interfacePlayer
- Overrides:
ascendUpwards
in classPlayerProxy
- Parameters:
distance
- How far up to teleport- Returns:
- whether the player was moved
-
ascendUpwards
public boolean ascendUpwards(int distance, boolean alwaysGlass) Description copied from interface:Player
Just go up.- Specified by:
ascendUpwards
in interfacePlayer
- Overrides:
ascendUpwards
in classPlayerProxy
- Parameters:
distance
- How far up to teleportalwaysGlass
- Always put glass under the player- Returns:
- whether the player was moved
-
floatAt
public void floatAt(int x, int y, int z, boolean alwaysGlass) Description copied from interface:Player
Make the player float in the given blocks.- Specified by:
floatAt
in interfacePlayer
- Overrides:
floatAt
in classPlayerProxy
- Parameters:
x
- The X coordinate of the block to float iny
- The Y coordinate of the block to float inz
- The Z coordinate of the block to float in
-
setPosition
Description copied from interface:Player
Move the player.- Parameters:
pos
- where to move thempitch
- the pitch (up/down) of the player's view in degreesyaw
- the yaw (left/right) of the player's view in degrees
-
getBlockTrace
Description copied from interface:Player
Get the point of the block being looked at. May return null. Will return the farthest away air block if useLastBlock is true and no other block is found.- Specified by:
getBlockTrace
in interfacePlayer
- Overrides:
getBlockTrace
in classAbstractPlayerActor
- Parameters:
range
- how far to checks for blocksuseLastBlock
- try to return the last valid air block found- Returns:
- point
-
getBlockTraceFace
Description copied from interface:Player
Get the face that the player is looking at.- Specified by:
getBlockTraceFace
in interfacePlayer
- Overrides:
getBlockTraceFace
in classAbstractPlayerActor
- Parameters:
range
- the rangeuseLastBlock
- try to return the last valid air block found- Returns:
- a face
-
getSolidBlockTrace
Description copied from interface:Player
Get the point of the block being looked at. May return null.- Specified by:
getSolidBlockTrace
in interfacePlayer
- Overrides:
getSolidBlockTrace
in classAbstractPlayerActor
- Parameters:
range
- How far to checks for blocks- Returns:
- point
-
getCardinalDirection
Description copied from interface:Player
Get the player's cardinal direction (N, W, NW, etc.). May return null.- Specified by:
getCardinalDirection
in interfacePlayer
- Overrides:
getCardinalDirection
in classAbstractPlayerActor
- Returns:
- the direction
-
passThroughForwardWall
public boolean passThroughForwardWall(int range) Description copied from interface:Player
Pass through the wall that you are looking at.- Specified by:
passThroughForwardWall
in interfacePlayer
- Overrides:
passThroughForwardWall
in classAbstractPlayerActor
- Parameters:
range
- How far to checks for blocks- Returns:
- whether the player was pass through
-