Class Wheel
java.lang.Object
nl.sbdeveloper.vehiclesplus.api.vehicles.parts.Part
nl.sbdeveloper.vehiclesplus.api.vehicles.parts.EquipablePart
nl.sbdeveloper.vehiclesplus.api.vehicles.parts.impl.Wheel
- All Implemented Interfaces:
Cloneable
The Wheel part, placed on the vehicle.
Note: The item of the wheel is based on the RimDesign.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionWheel()
Construct a new default Wheel part.Wheel
(double xOffset, double yOffset, double zOffset, @NotNull RimDesign rimDesign, @NotNull org.bukkit.Color color) Construct a new Wheel part.Wheel
(double xOffset, double yOffset, double zOffset, @NotNull RimDesign rimDesign, @NotNull org.bukkit.Color color, boolean steering, int rotationOffset) Construct a new Wheel part. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.Location
applyExtraOffset
(org.bukkit.Location loc) Override this method to apply extra offset.asString()
Get the part as string, for the info command.void
Despawn the stand of this wheel.org.bukkit.inventory.ItemStack
getItem()
Overrides the item getter to ignore it for JSON serialization.org.bukkit.inventory.ItemStack
The Configuration and Addon GUI will call this method to get the item to display.Overrides the position getter to ignore it for JSON serialization.The rimdesign of the wheel.float
The steering rotation offset.boolean
Is this wheel moving to left/right?void
setRimDesignId
(String rimDesignId) Change the rim design of this wheel.void
setSteering
(boolean steering) Is this wheel moving to left/right?void
setSteeringOffset
(float steeringOffset) The steering rotation offset.Methods inherited from class nl.sbdeveloper.vehiclesplus.api.vehicles.parts.EquipablePart
canEqual, clone, equals, getColor, hashCode, isColorable, setColor, setItem, spawnStand, toString, updateHolder
Methods inherited from class nl.sbdeveloper.vehiclesplus.api.vehicles.parts.Part
getHolder, getOwningVehicle, getRotationOffset, getXOffset, getYOffset, getZOffset, isAddon, isSpawned, refresh, setAddon, setRotationOffset, setXOffset, setYOffset, setZOffset
-
Constructor Details
-
Wheel
public Wheel()Construct a new default Wheel part. -
Wheel
public Wheel(double xOffset, double yOffset, double zOffset, @NotNull @NotNull RimDesign rimDesign, @NotNull @NotNull org.bukkit.Color color) Construct a new Wheel part.- Parameters:
xOffset
- The x-offsetyOffset
- The y-offsetzOffset
- The z-offsetrimDesign
- The rim designcolor
- The color of the wheel
-
Wheel
public Wheel(double xOffset, double yOffset, double zOffset, @NotNull @NotNull RimDesign rimDesign, @NotNull @NotNull org.bukkit.Color color, boolean steering, int rotationOffset) Construct a new Wheel part.- Parameters:
xOffset
- The x-offsetyOffset
- The y-offsetzOffset
- The z-offsetrimDesign
- The rim designcolor
- The color of the wheelsteering
- Is this wheel moving to left/right?rotationOffset
- The rotation offset
-
-
Method Details
-
asString
Description copied from class:Part
Get the part as string, for the info command. -
applyExtraOffset
public org.bukkit.Location applyExtraOffset(org.bukkit.Location loc) Description copied from class:Part
Override this method to apply extra offset.- Overrides:
applyExtraOffset
in classPart
- Parameters:
loc
- The input location.- Returns:
- The output location, with the extra offset applied.
-
setRimDesignId
Change the rim design of this wheel. This will also update the holder if spawned.- Parameters:
rimDesignId
- The rim design id
-
getItem
public org.bukkit.inventory.ItemStack getItem()Overrides the item getter to ignore it for JSON serialization. This is because the item is already stored in the RimDesign.- Overrides:
getItem
in classEquipablePart
-
getPosition
Overrides the position getter to ignore it for JSON serialization. This is because the position is already stored in the RimDesign.- Overrides:
getPosition
in classEquipablePart
-
getPartGUIItem
public org.bukkit.inventory.ItemStack getPartGUIItem()Description copied from class:Part
The Configuration and Addon GUI will call this method to get the item to display.- Specified by:
getPartGUIItem
in classPart
- Returns:
- The item to display.
-
despawnStand
public void despawnStand()Despawn the stand of this wheel.- Overrides:
despawnStand
in classPart
-
getRimDesignId
The rimdesign of the wheel. -
isSteering
public boolean isSteering()Is this wheel moving to left/right? -
getSteeringOffset
public float getSteeringOffset()The steering rotation offset. -
setSteering
public void setSteering(boolean steering) Is this wheel moving to left/right? -
setSteeringOffset
public void setSteeringOffset(float steeringOffset) The steering rotation offset.
-