Class EquipablePart
java.lang.Object
nl.sbdeveloper.vehiclesplus.api.vehicles.parts.Part
nl.sbdeveloper.vehiclesplus.api.vehicles.parts.EquipablePart
- All Implemented Interfaces:
Cloneable
A Part with an item.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionEquipablePart
(double xOffset, double yOffset, double zOffset, int rotationOffset, org.bukkit.inventory.ItemStack item, HolderItemPosition position) Construct a new EquipablePart.EquipablePart
(double xOffset, double yOffset, double zOffset, org.bukkit.inventory.ItemStack item, HolderItemPosition position) Construct a new EquipablePart. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
clone()
boolean
@Nullable org.bukkit.Color
getColor()
Get the color of this part.org.bukkit.inventory.ItemStack
getItem()
The item of the Part.The position of the item on the holder stand of the Part.int
hashCode()
boolean
Check if the item is colorable.void
setColor
(org.bukkit.Color color, boolean updateDirect) Sets the color of this part.protected void
setItem
(org.bukkit.inventory.ItemStack item) The item of the Part.void
spawnStand
(org.bukkit.Location base, Vehicle owningVehicle, boolean persistent) Spawn the stand for this part.toString()
void
Updates the holder with the item.Methods inherited from class nl.sbdeveloper.vehiclesplus.api.vehicles.parts.Part
applyExtraOffset, asString, despawnStand, getHolder, getOwningVehicle, getPartGUIItem, getRotationOffset, getXOffset, getYOffset, getZOffset, isAddon, isSpawned, refresh, setAddon, setRotationOffset, setXOffset, setYOffset, setZOffset
-
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-offsetyOffset
- The y-offsetzOffset
- The z-offsetitem
- The item of the partposition
- 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-offsetyOffset
- The y-offsetzOffset
- The z-offsetrotationOffset
- The rotation offsetitem
- The item of the partposition
- 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 anLeatherArmorMeta
.- 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
Spawn the stand for this part.- Overrides:
spawnStand
in classPart
- 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
-
clone
-
getItem
public org.bukkit.inventory.ItemStack getItem()The item of the Part. -
getPosition
The position of the item on the holder stand of the Part. -
equals
-
canEqual
-
hashCode
public int hashCode() -
setItem
protected void setItem(org.bukkit.inventory.ItemStack item) The item of the Part.
-