Class VehicleFuelEvent

java.lang.Object
org.bukkit.event.Event
nl.mtvehicles.core.infrastructure.models.MTVEvent
nl.mtvehicles.core.events.VehicleFuelEvent
All Implemented Interfaces:
CanEditLicensePlate, HasJerryCan, HasVehicle, IsCancellable, org.bukkit.event.Cancellable

public class VehicleFuelEvent extends MTVEvent implements IsCancellable, org.bukkit.event.Cancellable, CanEditLicensePlate, HasJerryCan
On vehicle refuel
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.bukkit.event.Event

    org.bukkit.event.Event.Result
  • Field Summary

    Fields inherited from class nl.mtvehicles.core.infrastructure.models.MTVEvent

    cancelled
  • Constructor Summary

    Constructors
    Constructor
    Description
    VehicleFuelEvent​(double vehicleFuel, int jerryCanFuel, int jerryCanSize)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Get current fuel in the jerry can (before the event is executed)
    int
    Get the size of the jerry can (in litres)
    Get license plate of the vehicle used in the event
    double
    Get the current fuel of the vehicle (before the event is executed)
    void
    setCancelled​(boolean cancelled)
    Sets the cancellation state of this event.
    void
    setLicensePlate​(String licensePlate)
    Set the license plate of the vehicle used in the event

    Methods inherited from class nl.mtvehicles.core.infrastructure.models.MTVEvent

    call, getHandlerList, getHandlers, getPlayer, isCancelled, setPlayer

    Methods inherited from class org.bukkit.event.Event

    callEvent, getEventName, isAsynchronous

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.bukkit.event.Cancellable

    isCancelled

    Methods inherited from interface nl.mtvehicles.core.events.interfaces.HasVehicle

    getVehicle
  • Constructor Details

    • VehicleFuelEvent

      public VehicleFuelEvent(double vehicleFuel, int jerryCanFuel, int jerryCanSize)
  • Method Details

    • setCancelled

      public void setCancelled(boolean cancelled)
      Description copied from interface: IsCancellable
      Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
      Specified by:
      setCancelled in interface IsCancellable
      Parameters:
      cancelled - true if you wish to cancel this event
    • getLicensePlate

      public String getLicensePlate()
      Description copied from interface: HasVehicle
      Get license plate of the vehicle used in the event
      Specified by:
      getLicensePlate in interface HasVehicle
      Returns:
      Vehicle's license plate
    • setLicensePlate

      public void setLicensePlate(String licensePlate)
      Description copied from interface: CanEditLicensePlate
      Set the license plate of the vehicle used in the event
      Specified by:
      setLicensePlate in interface CanEditLicensePlate
      Parameters:
      licensePlate - New license plate
    • getJerryCanFuel

      public int getJerryCanFuel()
      Description copied from interface: HasJerryCan
      Get current fuel in the jerry can (before the event is executed)
      Specified by:
      getJerryCanFuel in interface HasJerryCan
      Returns:
      Current fuel in the jerry can
    • getJerryCanSize

      public int getJerryCanSize()
      Description copied from interface: HasJerryCan
      Get the size of the jerry can (in litres)
      Specified by:
      getJerryCanSize in interface HasJerryCan
      Returns:
      Size of the jerry can
    • getVehicleFuel

      public double getVehicleFuel()
      Get the current fuel of the vehicle (before the event is executed)
      Returns:
      Fuel of the vehicle