Class EquipablePart

java.lang.Object
nl.sbdeveloper.vehiclesplus.api.vehicles.parts.Part
nl.sbdeveloper.vehiclesplus.api.vehicles.parts.EquipablePart
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
Rotor, Skin, Turret, Wheel

public abstract class EquipablePart extends Part
A Part with an item.
  • Constructor Details

    • EquipablePart

      public EquipablePart(double xOffset, double yOffset, double zOffset, org.bukkit.inventory.ItemStack item, HolderItemPosition position)
      Construct a new EquipablePart.
      Parameters:
      xOffset - The x-offset
      yOffset - The y-offset
      zOffset - The z-offset
      item - The item of the part
      position - The position of the item on the holder stand of the Part
    • EquipablePart

      public EquipablePart(double xOffset, double yOffset, double zOffset, int rotationOffset, org.bukkit.inventory.ItemStack item, HolderItemPosition position)
      Construct a new EquipablePart.
      Parameters:
      xOffset - The x-offset
      yOffset - The y-offset
      zOffset - The z-offset
      rotationOffset - The rotation offset
      item - The item of the part
      position - The position of the item on the holder stand of the Part
    • EquipablePart

      public EquipablePart()
  • Method Details

    • isColorable

      public boolean isColorable()
      Check if the item is colorable. This is the case if the item has an LeatherArmorMeta.
      Returns:
      If the item is colorable
    • getColor

      @Nullable public @Nullable org.bukkit.Color getColor()
      Get the color of this part.
      Returns:
      The Color or null if the item is not colorable
    • setColor

      public void setColor(org.bukkit.Color color, boolean updateDirect)
      Sets the color of this part.
      Parameters:
      color - The color to set.
      updateDirect - If true, it updates the holder direct.
    • updateHolder

      public void updateHolder()
      Updates the holder with the item.
    • spawnStand

      public void spawnStand(org.bukkit.Location base, Vehicle owningVehicle, boolean persistent)
      Spawn the stand for this part.
      Overrides:
      spawnStand in class Part
      Parameters:
      base - The base location, where the offset will be applied on.
      owningVehicle - The vehicle that owns this part.
      persistent - If the stand should be persistent.
    • toString

      public String toString()
      Overrides:
      toString in class Part
    • clone

      public EquipablePart clone()
      Overrides:
      clone in class Part
    • getItem

      public org.bukkit.inventory.ItemStack getItem()
      The item of the Part.
    • getPosition

      public HolderItemPosition getPosition()
      The position of the item on the holder stand of the Part.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Part
    • canEqual

      protected boolean canEqual(Object other)
      Overrides:
      canEqual in class Part
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Part
    • setItem

      protected void setItem(org.bukkit.inventory.ItemStack item)
      The item of the Part.