Interface MountController
- All Known Implementing Classes:
AbstractMountController,FlyingMountController,FlyingMountController_v16,FlyingMountForcedController,WalkingMountController,WalkingMountForcedController
public interface MountController
Interface used by
While not strictly necessary, we recommend registering the controller with
MoveController to allow special passenger behavior, such as controlling movement
of the model.While not strictly necessary, we recommend registering the controller with
MountControllerRegistry.register(String, Supplier)
so your custom controller can be accessed by other plugins with a string ID.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classData class containing the movement control sent by a player. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.entity.EntityGet the rider.getInput()Get the movement input.voidsetEntity(org.bukkit.entity.Entity entity) Set the rider using this controller.voidRecord the movement input sent by the rider.
This method is called whenever a new movement control packet is received.voidsetMountable(Mountable mountable) voidupdateDirection(LookController controller, ModeledEntity model) Update the look direction of the vehicle.
This method is called each movement tick of the vehicle, and is only called when the controller is used by a driver.
ExtendAbstractMountControllerto use the default implementation.voidupdateDriverMovement(MoveController controller, ModeledEntity model) Action performed when the rider is controlling the vehicle as a driver.
This method is called each movement tick of the vehicle.voidupdatePassengerMovement(MoveController controller, ModeledEntity model) Action performed when the rider is controlling the vehicle as a passenger.
This method is called each movement tick of the vehicle.
Usually, only dismounting through sneaking is handled here, but there are no limits to what the passenger can do.default voidupdateRiderPosition(MoveController controller, Mountable mountBone) Update the server-side location of the rider.
While the entity is visually at the correct location, the position of the rider is not actually updated and would cause unexpected behavior, such as projectiles phasing through the rider, or the rider dismounting at the wrong location.
This method is called each movement tick of the vehicle.
-
Method Details
-
setEntity
void setEntity(org.bukkit.entity.Entity entity) Set the rider using this controller. ExtendAbstractMountControllerto use the default implementation. -
setInput
Record the movement input sent by the rider.
This method is called whenever a new movement control packet is received. ExtendAbstractMountControllerto use the default implementation. -
setMountable
-
getEntity
org.bukkit.entity.Entity getEntity()Get the rider. ExtendAbstractMountControllerto use the default implementation. -
getInput
MountController.MountInput getInput()Get the movement input. ExtendAbstractMountControllerto use the default implementation. -
getMountable
Mountable getMountable() -
updateDriverMovement
Action performed when the rider is controlling the vehicle as a driver.
This method is called each movement tick of the vehicle.- Parameters:
controller- wrapped movement controller of the vehiclemodel- model of the vehicle
-
updatePassengerMovement
Action performed when the rider is controlling the vehicle as a passenger.
This method is called each movement tick of the vehicle.
Usually, only dismounting through sneaking is handled here, but there are no limits to what the passenger can do.- Parameters:
controller- wrapped movement controller of the vehiclemodel- model of the vehicle
-
updateRiderPosition
Update the server-side location of the rider.
While the entity is visually at the correct location, the position of the rider is not actually updated and would cause unexpected behavior, such as projectiles phasing through the rider, or the rider dismounting at the wrong location.
This method is called each movement tick of the vehicle.- Parameters:
controller- wrapped movement controller of the vehiclemountBone- the mount bone ridden by the rider
-
updateDirection
Update the look direction of the vehicle.
This method is called each movement tick of the vehicle, and is only called when the controller is used by a driver.
ExtendAbstractMountControllerto use the default implementation.- Parameters:
controller- wrapped look controller of the vehiclemodel- model of the vehicle
-