Class PlayerCastBars

java.lang.Object
studio.magemonkey.fabled.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
     
    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
    Handles when the player opens an inventory
    boolean
     
    void
    load(studio.magemonkey.codex.mccore.config.parse.DataSection config, boolean hover)
    Loads data from the config
    void
    Resets the layout and populates the unused list with all available skills
    void
    Restores the players inventory after viewing one of the related views
    void
    save(studio.magemonkey.codex.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()
    • restore

      public void restore()
      Restores the players inventory after viewing one of the related views
    • 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()
      Handles when the player opens an inventory
    • 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(studio.magemonkey.codex.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(studio.magemonkey.codex.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