public abstract class AbstractPlayerActor extends java.lang.Object implements Actor, Player, java.lang.Cloneable
Constructor and Description |
---|
AbstractPlayerActor() |
Modifier and Type | Method and Description |
---|---|
boolean |
ascendLevel()
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 |
canDestroyBedrock()
Returns true if the actor can destroy bedrock.
|
void |
checkPermission(java.lang.String permission)
Check whether this subject has been granted the given permission
and throw an exception on error.
|
java.lang.Object |
clone() |
boolean |
descendLevel()
Go up one level to the next free space above.
|
void |
dispatchCUIEvent(CUIEvent event)
Send a CUI event.
|
boolean |
equals(java.lang.Object other) |
void |
findFreePosition()
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.
|
BaseBlock |
getBlockInHand(HandSide handSide)
Get the Block that the player is holding.
|
Location |
getBlockOn()
Get the point of the block that is being stood upon.
|
Location |
getBlockTrace(int range)
Get the point of the block being looked at.
|
Location |
getBlockTrace(int range,
boolean useLastBlock)
Get the point of the block being looked at.
|
Location |
getBlockTrace(int range,
boolean useLastBlock,
Mask stopMask)
Get the point of the block being looked at.
|
Location |
getBlockTraceFace(int range,
boolean useLastBlock)
Get the face that the player is looking at.
|
Location |
getBlockTraceFace(int range,
boolean useLastBlock,
Mask stopMask)
Get the face that the player is looking at.
|
Direction |
getCardinalDirection()
Get the player's cardinal direction (N, W, NW, etc.).
|
Direction |
getCardinalDirection(int yawOffset)
Get the player's cardinal direction (N, W, NW, etc.) with an offset.
|
Extent |
getExtent()
Get the extent that this actor is in.
|
GameMode |
getGameMode()
Return this actor's game mode.
|
Location |
getSolidBlockTrace(int range)
Get the point of the block being looked at.
|
int |
hashCode() |
protected boolean |
isAllowedToFly()
Check whether the player is allowed to fly.
|
boolean |
isHoldingPickAxe()
Returns true if the entity is holding a pick axe.
|
boolean |
isPlayer()
Return whether this actor is a player.
|
java.io.File |
openFileOpenDialog(java.lang.String[] extensions)
Open a file open dialog.
|
java.io.File |
openFileSaveDialog(java.lang.String[] extensions)
Open a file save dialog.
|
boolean |
passThroughForwardWall(int range)
Pass through the wall that you are looking at.
|
boolean |
remove()
Remove this entity from it container.
|
<B extends BlockStateHolder<B>> |
sendFakeBlock(BlockVector3 pos,
B block)
Sends a fake block to the client.
|
protected void |
setFlying(boolean flying)
Set whether the player is currently flying.
|
void |
setGameMode(GameMode gameMode)
Sets the player to the given game mode.
|
void |
setOnGround(Location searchPos)
Set the actor on the ground.
|
boolean |
trySetPosition(Vector3 pos)
Attempts to set the position of this actor.
|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getBlockIn, getInventoryBlockBag, getItemInHand, getWorld, giveItem, setPosition, trySetPosition
getBlockLocation, getLocation, setLocation, setPosition
getDisplayName, getLocale, getName, print, print, printDebug, printDebug, printError, printError, printInfo, printRaw, sendAnnouncements
getUniqueId
getSessionKey
public final Extent getExtent()
Locatable
public boolean isHoldingPickAxe()
Player
isHoldingPickAxe
in interface Player
public void findFreePosition(Location searchPos)
Player
findFreePosition
in interface Player
searchPos
- search positionpublic void setOnGround(Location searchPos)
Player
setOnGround
in interface Player
searchPos
- The location to start searching frompublic void findFreePosition()
Player
findFreePosition
in interface Player
public boolean ascendLevel()
Player
ascendLevel
in interface Player
public boolean descendLevel()
Player
descendLevel
in interface Player
public boolean ascendToCeiling(int clearance)
Player
ascendToCeiling
in interface Player
clearance
- How many blocks to leave above the player's headpublic boolean ascendToCeiling(int clearance, boolean alwaysGlass)
Player
ascendToCeiling
in interface Player
clearance
- How many blocks to leave above the player's headalwaysGlass
- Always put glass under the playerpublic boolean ascendUpwards(int distance)
Player
ascendUpwards
in interface Player
distance
- How far up to teleportpublic boolean ascendUpwards(int distance, boolean alwaysGlass)
Player
ascendUpwards
in interface Player
distance
- How far up to teleportalwaysGlass
- Always put glass under the playerpublic void floatAt(int x, int y, int z, boolean alwaysGlass)
Player
protected boolean isAllowedToFly()
protected void setFlying(boolean flying)
flying
- true to flypublic Location getBlockOn()
Player
getBlockOn
in interface Player
public Location getBlockTrace(int range, boolean useLastBlock)
Player
getBlockTrace
in interface Player
range
- how far to checks for blocksuseLastBlock
- try to return the last valid air block foundpublic Location getBlockTraceFace(int range, boolean useLastBlock)
Player
getBlockTraceFace
in interface Player
range
- the rangeuseLastBlock
- try to return the last valid air block foundpublic Location getBlockTrace(int range, boolean useLastBlock, @Nullable Mask stopMask)
Player
getBlockTrace
in interface Player
range
- how far to checks for blocksuseLastBlock
- try to return the last valid block not matching the stop mask foundstopMask
- the mask used to determine when to stop tracingpublic Location getBlockTraceFace(int range, boolean useLastBlock, @Nullable Mask stopMask)
Player
getBlockTraceFace
in interface Player
range
- the rangeuseLastBlock
- try to return the last valid block not matching the stop mask foundstopMask
- the mask used to determine when to stop tracingpublic Location getBlockTrace(int range)
Player
getBlockTrace
in interface Player
range
- How far to checks for blockspublic Location getSolidBlockTrace(int range)
Player
getSolidBlockTrace
in interface Player
range
- How far to checks for blockspublic Direction getCardinalDirection()
Player
getCardinalDirection
in interface Player
public Direction getCardinalDirection(int yawOffset)
Player
getCardinalDirection
in interface Player
yawOffset
- offset that is added to the player's yaw before determining the cardinal directionpublic BaseBlock getBlockInHand(HandSide handSide) throws WorldEditException
Player
getBlockInHand
in interface Player
WorldEditException
public boolean passThroughForwardWall(int range)
Player
passThroughForwardWall
in interface Player
range
- How far to checks for blockspublic boolean trySetPosition(Vector3 pos)
Locatable
This action may fail, due to other mods cancelling the move.
If so, this method will return false
.
trySetPosition
in interface Locatable
pos
- the position to setpublic java.io.File openFileOpenDialog(java.lang.String[] extensions)
Actor
openFileOpenDialog
in interface Actor
extensions
- null to allow allpublic java.io.File openFileSaveDialog(java.lang.String[] extensions)
Actor
openFileSaveDialog
in interface Actor
extensions
- null to allow allpublic boolean canDestroyBedrock()
Actor
canDestroyBedrock
in interface Actor
public void dispatchCUIEvent(CUIEvent event)
Actor
dispatchCUIEvent
in interface Actor
event
- the eventpublic boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public void checkPermission(java.lang.String permission) throws AuthorizationException
Subject
checkPermission
in interface Subject
permission
- the permissionAuthorizationException
- thrown if not permittedpublic boolean isPlayer()
Actor
public GameMode getGameMode()
Player
getGameMode
in interface Player
public void setGameMode(GameMode gameMode)
Player
setGameMode
in interface Player
gameMode
- The game modepublic java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public boolean remove()
Entity
public <B extends BlockStateHolder<B>> void sendFakeBlock(BlockVector3 pos, B block)
Player
This block isn't real.
sendFakeBlock
in interface Player
pos
- The position of the blockblock
- The block to send, null to reset