Class Turret
java.lang.Object
nl.sbdeveloper.vehiclesplus.api.vehicles.parts.Part
nl.sbdeveloper.vehiclesplus.api.vehicles.parts.EquipablePart
nl.sbdeveloper.vehiclesplus.api.vehicles.parts.impl.skin.Turret
- All Implemented Interfaces:
Cloneable
The Turret part, used for tanks.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionTurret()
Construct a new default Turret partTurret
(double xOffset, double yOffset, double zOffset, org.bukkit.inventory.ItemStack skin, HolderItemPosition position, float explosionSize, org.bukkit.inventory.ItemStack ammo) Construct a new Turret partTurret
(String identifier, double xOffset, double yOffset, double zOffset, org.bukkit.inventory.ItemStack skin, HolderItemPosition position, float explosionSize, org.bukkit.inventory.ItemStack ammo) Construct a new Turret part -
Method Summary
Modifier and TypeMethodDescriptionasString()
Get the part as string, for the info command.void
Despawn the standorg.bukkit.inventory.ItemStack
getAmmo()
The ammo required to shoot.int
The shooting cooldown.float
The size of an explosion.Identifier of this turretorg.bukkit.inventory.ItemStack
The Configuration and Addon GUI will call this method to get the item to display.void
setAmmo
(org.bukkit.inventory.ItemStack ammo) The ammo required to shoot.void
setCooldown
(int cooldown) The shooting cooldown.void
setExplosionSize
(float explosionSize) The size of an explosion.void
setIdentifier
(String identifier) Identifier of this turretboolean
shoot()
Make the turret shootMethods inherited from class nl.sbdeveloper.vehiclesplus.api.vehicles.parts.EquipablePart
canEqual, clone, equals, getColor, getItem, getPosition, hashCode, isColorable, setColor, setItem, spawnStand, toString, updateHolder
Methods inherited from class nl.sbdeveloper.vehiclesplus.api.vehicles.parts.Part
applyExtraOffset, getHolder, getOwningVehicle, getRotationOffset, getXOffset, getYOffset, getZOffset, isAddon, isSpawned, refresh, setAddon, setRotationOffset, setXOffset, setYOffset, setZOffset
-
Constructor Details
-
Turret
public Turret()Construct a new default Turret part -
Turret
public Turret(double xOffset, double yOffset, double zOffset, org.bukkit.inventory.ItemStack skin, HolderItemPosition position, float explosionSize, org.bukkit.inventory.ItemStack ammo) Construct a new Turret part- Parameters:
xOffset
- The x-offsetyOffset
- The y-offsetzOffset
- The z-offsetskin
- The skin of the rotorexplosionSize
- The size of an explosion.ammo
- The ammo required to shoot.
-
Turret
public Turret(String identifier, double xOffset, double yOffset, double zOffset, org.bukkit.inventory.ItemStack skin, HolderItemPosition position, float explosionSize, org.bukkit.inventory.ItemStack ammo) Construct a new Turret part- Parameters:
identifier
- The identifierxOffset
- The x-offsetyOffset
- The y-offsetzOffset
- The z-offsetskin
- The skin of the rotorexplosionSize
- The size of an explosion.ammo
- The ammo required to shoot.
-
-
Method Details
-
shoot
public boolean shoot()Make the turret shoot- Returns:
- True if fired, false if not (because of a cooldown)
-
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.
-
asString
Description copied from class:Part
Get the part as string, for the info command. -
despawnStand
public void despawnStand()Despawn the stand- Overrides:
despawnStand
in classPart
-
getIdentifier
Identifier of this turret -
getExplosionSize
public float getExplosionSize()The size of an explosion. -
getAmmo
public org.bukkit.inventory.ItemStack getAmmo()The ammo required to shoot. -
getCooldown
public int getCooldown()The shooting cooldown. -
setIdentifier
Identifier of this turret -
setExplosionSize
public void setExplosionSize(float explosionSize) The size of an explosion. -
setAmmo
public void setAmmo(org.bukkit.inventory.ItemStack ammo) The ammo required to shoot. -
setCooldown
public void setCooldown(int cooldown) The shooting cooldown.
-