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.voidDespawn the standorg.bukkit.inventory.ItemStackgetAmmo()The ammo required to shoot.intThe shooting cooldown.floatThe size of an explosion.Identifier of this turretorg.bukkit.inventory.ItemStackThe Configuration and Addon GUI will call this method to get the item to display.voidsetAmmo(org.bukkit.inventory.ItemStack ammo) The ammo required to shoot.voidsetCooldown(int cooldown) The shooting cooldown.voidsetExplosionSize(float explosionSize) The size of an explosion.voidsetIdentifier(String identifier) Identifier of this turretbooleanshoot()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, updateHolderMethods 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:PartThe Configuration and Addon GUI will call this method to get the item to display.- Specified by:
getPartGUIItemin classPart- Returns:
- The item to display.
-
asString
Description copied from class:PartGet the part as string, for the info command. -
despawnStand
public void despawnStand()Despawn the stand- Overrides:
despawnStandin 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.
-