Class PlayerCastBars

java.lang.Object
com.sucy.skill.cast.PlayerCastBars
All Implemented Interfaces:
org.bukkit.inventory.InventoryHolder

public class PlayerCastBars extends Object implements org.bukkit.inventory.InventoryHolder
Representation of cast bar data for a single player
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.bukkit.inventory.Inventory
    Added to satisfy InventoryHolder, though doesn't do anything
     
    void
    handle(org.bukkit.event.inventory.InventoryClickEvent event)
    Handles clicking in the GUI
    boolean
    handle(org.bukkit.event.player.PlayerItemHeldEvent event)
    Handles changing to a different weapon slot
    boolean
    handleInteract(org.bukkit.entity.Player player)
    Handles a click event when in certain views
    void
    handleOpen(org.bukkit.entity.Player player)
    Handles when the player opens an inventory
    boolean
     
    void
    load(mc.promcteam.engine.mccore.config.parse.DataSection config, boolean hover)
    Loads data from the config
    void
    playHoverParticles(org.bukkit.entity.Player player, int step)
    Makes the packets for cast previews
    void
    Resets the layout and populates the unused list with all available skills
    void
    restore(org.bukkit.entity.Player player)
    Restores the players inventory after viewing one of the related views
    void
    save(mc.promcteam.engine.mccore.config.parse.DataSection config, boolean hover)
    Saves data to the config
    boolean
    showHoverBar(org.bukkit.entity.Player player)
    Shows the hover cast bar to the player
    boolean
    showInstantBar(org.bukkit.entity.Player player)
    Shows the instant bar to the player
    boolean
    showOrganizer(org.bukkit.entity.Player player)
    Opens the cast bar organizer GUI
    void
    Adds an unlocked skill to the skill bars
    void
    Validates added skills, making sure they're still unlocked

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PlayerCastBars

      public PlayerCastBars(PlayerData data)
      Parameters:
      data - player data reference
  • Method Details

    • validate

      public void validate()
      Validates added skills, making sure they're still unlocked
    • isHovering

      public boolean isHovering()
      Returns:
      true if in the hover view, false otherwise
    • getView

      public PlayerView getView()
    • playHoverParticles

      public void playHoverParticles(org.bukkit.entity.Player player, int step)
      Makes the packets for cast previews
      Parameters:
      step - animation step
    • restore

      public void restore(org.bukkit.entity.Player player)
      Restores the players inventory after viewing one of the related views
      Parameters:
      player - player to restore
    • showOrganizer

      public boolean showOrganizer(org.bukkit.entity.Player player)
      Opens the cast bar organizer GUI
      Parameters:
      player - player to open for
      Returns:
      true if opened
    • showHoverBar

      public boolean showHoverBar(org.bukkit.entity.Player player)
      Shows the hover cast bar to the player
      Parameters:
      player - player to show to
    • showInstantBar

      public boolean showInstantBar(org.bukkit.entity.Player player)
      Shows the instant bar to the player
      Parameters:
      player - player to show to
    • handle

      public boolean handle(org.bukkit.event.player.PlayerItemHeldEvent event)
      Handles changing to a different weapon slot
      Parameters:
      event - event details
    • handleInteract

      public boolean handleInteract(org.bukkit.entity.Player player)
      Handles a click event when in certain views
      Parameters:
      player - the player doing the interaction
    • handleOpen

      public void handleOpen(org.bukkit.entity.Player player)
      Handles when the player opens an inventory
      Parameters:
      player - player to handle for
    • handle

      public void handle(org.bukkit.event.inventory.InventoryClickEvent event)
      Handles clicking in the GUI
      Parameters:
      event - event details
    • unlock

      public void unlock(PlayerSkill skill)
      Adds an unlocked skill to the skill bars
      Parameters:
      skill - skill to add
    • reset

      public void reset()
      Resets the layout and populates the unused list with all available skills
    • load

      public void load(mc.promcteam.engine.mccore.config.parse.DataSection config, boolean hover)
      Loads data from the config
      Parameters:
      config - config data
      hover - whether it's for the hover bar
    • save

      public void save(mc.promcteam.engine.mccore.config.parse.DataSection config, boolean hover)
      Saves data to the config
      Parameters:
      config - config data
      hover - whether it's for the hover bar
    • getInventory

      public org.bukkit.inventory.Inventory getInventory()
      Added to satisfy InventoryHolder, though doesn't do anything
      Specified by:
      getInventory in interface org.bukkit.inventory.InventoryHolder
      Returns:
      null