PHP Class pocketmine\entity\Minecart

Inheritance: extends Vehicle
Afficher le fichier Open project: iTXTech/Genisys Class Usage Examples

Méthodes publiques

Свойство Type Description
$drag
$gravity
$height
$isMoving
$moveSpeed
$width

Méthodes publiques

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

Private Methods

Méthode 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 méthode

public getName ( ) : string
Résultat string

getNearestRail() public méthode

public getNearestRail ( ) : Rail
Résultat pocketmine\block\Rail

getType() public méthode

public getType ( ) : integer
Résultat integer

initEntity() public méthode

public initEntity ( )

onUpdate() public méthode

public onUpdate ( $currentTick )

spawnTo() public méthode

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