Package net.jeqo.bloons.balloon.single
Class SingleBalloon
java.lang.Object
org.bukkit.scheduler.BukkitRunnable
net.jeqo.bloons.balloon.single.SingleBalloon
- All Implemented Interfaces:
Runnable
public class SingleBalloon
extends org.bukkit.scheduler.BukkitRunnable
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSingleBalloon
(org.bukkit.entity.Player player, String balloonID) Constructor for the SingleBalloon class -
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
Cancels the current bukkit runnable instance and kills off the entitiesstatic void
checkBalloonRemovalOrAdd
(org.bukkit.entity.Player player, String balloonID) Checks if a balloon needs to be removed or addedorg.bukkit.inventory.ItemStack
getConfiguredBalloonVisual
(String balloonID) Retrieves the item stack object of the visual appearance of the balloonvoid
Initializes the balloon's armor stand entity with the proper configurationsvoid
Initializes the balloon's lead to the player (chicken entity)void
run()
What runs inside the extended bukkit runnable, it's the control center of the core functionality of how the balloon movesvoid
Spawns the particle effect when the balloon is removedMethods inherited from class org.bukkit.scheduler.BukkitRunnable
getTaskId, isCancelled, runTask, runTaskAsynchronously, runTaskLater, runTaskLaterAsynchronously, runTaskTimer, runTaskTimerAsynchronously
-
Field Details
-
chicken
public org.bukkit.entity.Chicken chicken
-
-
Constructor Details
-
SingleBalloon
Constructor for the SingleBalloon class- Parameters:
player
- The player to attach the balloon to, type org.bukkit.entity.PlayerballoonID
- The ID of the balloon to attach to the player, type java.lang.String
-
-
Method Details
-
initializeBalloonArmorStand
public void initializeBalloonArmorStand()Initializes the balloon's armor stand entity with the proper configurations -
initializeBalloonLead
public void initializeBalloonLead()Initializes the balloon's lead to the player (chicken entity) -
run
public void run()What runs inside the extended bukkit runnable, it's the control center of the core functionality of how the balloon moves -
cancel
Cancels the current bukkit runnable instance and kills off the entities- Overrides:
cancel
in classorg.bukkit.scheduler.BukkitRunnable
- Throws:
IllegalStateException
- If the task has already been cancelled
-
spawnRemoveParticle
public void spawnRemoveParticle()Spawns the particle effect when the balloon is removed -
getConfiguredBalloonVisual
Retrieves the item stack object of the visual appearance of the balloon- Parameters:
balloonID
- The balloon ID to get the visual appearance of, type java.lang.String- Returns:
- The item object that contains the configured balloon model, returns a barrier if there is an issue, type org.bukkit.inventory.ItemStack
-
checkBalloonRemovalOrAdd
Checks if a balloon needs to be removed or added- Parameters:
player
- The player to check, type org.bukkit.entity.PlayerballoonID
- The balloon ID to check, type java.lang.String
-