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 booleanclone()boolean@Nullable org.bukkit.ColorgetColor()Get the color of this part.org.bukkit.inventory.ItemStackgetItem()The item of the Part.The position of the item on the holder stand of the Part.inthashCode()booleanCheck if the item is colorable.voidsetColor(org.bukkit.Color color, boolean updateDirect) Sets the color of this part.protected voidsetItem(org.bukkit.inventory.ItemStack item) The item of the Part.voidspawnStand(org.bukkit.Location base, Vehicle owningVehicle, boolean persistent) Spawn the stand for this part.toString()voidUpdates 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
Coloror 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:
spawnStandin 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.
-