public abstract class LocalPlayer extends Object
| Modifier and Type | Field and Description |
|---|---|
protected ServerInterface |
server
Server.
|
| Modifier | Constructor and Description |
|---|---|
protected |
LocalPlayer(ServerInterface server)
Construct the object.
|
| 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 player can destroy bedrock.
|
void |
checkPermission(String permission) |
boolean |
descendLevel()
Go up one level to the next free space above.
|
void |
dispatchCUIEvent(CUIEvent event)
Send a CUI event.
|
void |
dispatchCUIHandshake()
Deprecated.
Not used anymore; The CUI begins the handshake
|
boolean |
equals(Object other) |
void |
findFreePosition()
Find a position for the player to stand that is not inside a block.
|
void |
findFreePosition(WorldVector searchPos)
Find a position for the player 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.
|
WorldVector |
getBlockIn()
Get the point of the block that is being stood in.
|
BaseBlock |
getBlockInHand()
Get the Block that the player is holding.
|
WorldVector |
getBlockOn()
Get the point of the block that is being stood upon.
|
WorldVector |
getBlockTrace(int range)
Get the point of the block being looked at.
|
WorldVector |
getBlockTrace(int range,
boolean useLastBlock)
Get the point of the block being looked at.
|
WorldVectorFace |
getBlockTraceFace(int range,
boolean useLastBlock) |
PlayerDirection |
getCardinalDirection()
Get the player's cardinal direction (N, W, NW, etc.).
|
PlayerDirection |
getCardinalDirection(int yawOffset)
Get the player's cardinal direction (N, W, NW, etc.) with an offset.
|
abstract String[] |
getGroups()
Get a player's list of groups.
|
abstract BlockBag |
getInventoryBlockBag()
Get this player's block bag.
|
abstract int |
getItemInHand()
Get the ID of the item that the player is holding.
|
abstract String |
getName()
Get the name of the player.
|
abstract double |
getPitch()
Get the player's view pitch.
|
abstract WorldVector |
getPosition()
Get the player's position.
|
WorldVector |
getSolidBlockTrace(int range)
Get the point of the block being looked at.
|
abstract LocalWorld |
getWorld()
Get the player's world.
|
abstract double |
getYaw()
Get the player's view yaw.
|
abstract void |
giveItem(int type,
int amount)
Gives the player an item.
|
boolean |
hasCreativeMode() |
int |
hashCode() |
abstract boolean |
hasPermission(String perm)
Checks if a player has permission.
|
boolean |
isHoldingPickAxe()
Returns true if the player is holding a pick axe.
|
boolean |
isPlayer() |
File |
openFileOpenDialog(String[] extensions)
Open a file open dialog.
|
File |
openFileSaveDialog(String[] extensions)
Open a file save dialog.
|
boolean |
passThroughForwardWall(int range)
Pass through the wall that you are looking at.
|
abstract void |
print(String msg)
Print a WorldEdit message.
|
abstract void |
printDebug(String msg)
Print a WorldEdit message.
|
abstract void |
printError(String msg)
Print a WorldEdit error.
|
abstract void |
printRaw(String msg)
Print a message.
|
void |
setOnGround(WorldVector searchPos)
Set the player on the ground.
|
void |
setPosition(Vector pos)
Move the player.
|
abstract void |
setPosition(Vector pos,
float pitch,
float yaw)
Move the player.
|
protected ServerInterface server
protected LocalPlayer(ServerInterface server)
server - A reference to the server this player is onpublic boolean isHoldingPickAxe()
public void findFreePosition(WorldVector searchPos)
searchPos - search positionpublic void setOnGround(WorldVector searchPos)
searchPos - The location to start searching frompublic void findFreePosition()
public boolean ascendLevel()
public boolean descendLevel()
public boolean ascendToCeiling(int clearance)
clearance - How many blocks to leave above the player's headpublic boolean ascendToCeiling(int clearance,
boolean alwaysGlass)
clearance - How many blocks to leave above the player's headalwaysGlass - Always put glass under the playerpublic boolean ascendUpwards(int distance)
distance - How far up to teleportpublic boolean ascendUpwards(int distance,
boolean alwaysGlass)
distance - How far up to teleportalwaysGlass - Always put glass under the playerpublic void floatAt(int x,
int y,
int z,
boolean alwaysGlass)
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 inpublic WorldVector getBlockIn()
public WorldVector getBlockOn()
public WorldVector getBlockTrace(int range, boolean useLastBlock)
range - How far to checks for blocksuseLastBlock - Try to return the last valid air block found.public WorldVectorFace getBlockTraceFace(int range, boolean useLastBlock)
public WorldVector getBlockTrace(int range)
range - How far to checks for blockspublic WorldVector getSolidBlockTrace(int range)
range - How far to checks for blockspublic PlayerDirection getCardinalDirection()
public PlayerDirection getCardinalDirection(int yawOffset)
yawOffset - offset that is added to the player's yaw before determining the cardinal directionpublic abstract int getItemInHand()
public BaseBlock getBlockInHand() throws WorldEditException
WorldEditExceptionpublic abstract String getName()
public abstract WorldVector getPosition()
public abstract LocalWorld getWorld()
public abstract double getPitch()
public abstract double getYaw()
public abstract void giveItem(int type,
int amount)
type - The item id of the item to be given to the playeramount - How many items in the stackpublic boolean passThroughForwardWall(int range)
range - How far to checks for blockspublic abstract void printRaw(String msg)
msg - The message textpublic abstract void printDebug(String msg)
msg - The message textpublic abstract void print(String msg)
msg - The message textpublic abstract void printError(String msg)
msg - The error message textpublic abstract void setPosition(Vector pos, float pitch, float yaw)
pos - Where to move thempitch - The pitch (up/down) of the player's viewyaw - The yaw (left/right) of the player's viewpublic void setPosition(Vector pos)
pos - Where to move thempublic abstract String[] getGroups()
public abstract BlockBag getInventoryBlockBag()
public abstract boolean hasPermission(String perm)
perm - The permission to checkpublic File openFileOpenDialog(String[] extensions)
extensions - null to allow allpublic File openFileSaveDialog(String[] extensions)
extensions - null to allow allpublic boolean canDestroyBedrock()
public void dispatchCUIEvent(CUIEvent event)
event - @Deprecated public void dispatchCUIHandshake()
public void checkPermission(String permission) throws WorldEditPermissionException
WorldEditPermissionExceptionpublic boolean isPlayer()
public boolean hasCreativeMode()
Copyright © 2010-2014. All Rights Reserved.