PHP Class pocketmine\entity\Minecart

Inheritance: extends Vehicle
Mostrar archivo Open project: iTXTech/Genisys Class Usage Examples

Public Properties

Property Type Description
$drag
$gravity
$height
$isMoving
$moveSpeed
$width

Public Methods

Method Description
getName ( ) : string
getNearestRail ( ) : Rail
getType ( ) : integer
initEntity ( )
onUpdate ( $currentTick )
spawnTo ( Player $player )

Private Methods

Method Description
checkForTurn ( Direction $currentDirection, Direction $newDirection ) : Direction Need to alter direction on curves halfway through the turn and reset the minecart to be in the middle of the rail again so as not to collide with nearby blocks.
checkForVertical ( $railType, $currentDirection )
checkIfOnRail ( ) Check if minecart is currently on a rail and if so center the cart.
forwardOnRail ( Player $player ) : boolean Attempt to move forward on rail given the direction the cart is already moving, or if not moving based on the direction the player is looking.
getCurrentRail ( )
getDirectionToMove ( RailType $railType, Direction $candidateDirection ) : Direction Determine the direction the minecart should move based on the candidate direction (current direction minecart is moving, or the direction the player is looking) and the type of rail that the minecart is on.
isRail ( $rail )
moveIfRail ( ) : boolean Move the minecart as long as it will still be moving on to another piece of rail.
moveUsingVector ( Vector3 $desiredPosition ) Invoke the normal move code, but first need to convert the desired position vector into the delta values from the current position.

Method Details

getName() public method

public getName ( ) : string
return string

getNearestRail() public method

public getNearestRail ( ) : Rail
return pocketmine\block\Rail

getType() public method

public getType ( ) : integer
return integer

initEntity() public method

public initEntity ( )

onUpdate() public method

public onUpdate ( $currentTick )

spawnTo() public method

public spawnTo ( Player $player )
$player pocketmine\Player

Property Details

$drag public_oe property

public $drag

$gravity public_oe property

public $gravity

$height public_oe property

public $height

$isMoving public_oe property

public $isMoving

$moveSpeed public_oe property

public $moveSpeed

$width public_oe property

public $width