Package studio.magemonkey.fabled.cast
Class PlayerCastBars
java.lang.Object
studio.magemonkey.fabled.cast.PlayerCastBars
- All Implemented Interfaces:
org.bukkit.inventory.InventoryHolder
Representation of cast bar data for a single player
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.inventory.Inventory
Added to satisfy InventoryHolder, though doesn't do anythinggetView()
boolean
handle
(org.bukkit.event.player.PlayerItemHeldEvent event) Handles changing to a different weapon slotboolean
handleInteract
(org.bukkit.entity.Player player) Handles a click event when in certain viewsvoid
Handles when the player opens an inventoryboolean
void
load
(studio.magemonkey.codex.mccore.config.parse.DataSection config, boolean hover) Loads data from the configvoid
reset()
Resets the layout and populates the unused list with all available skillsvoid
restore()
Restores the players inventory after viewing one of the related viewsvoid
save
(studio.magemonkey.codex.mccore.config.parse.DataSection config, boolean hover) Saves data to the configboolean
showHoverBar
(org.bukkit.entity.Player player) Shows the hover cast bar to the playerboolean
showInstantBar
(org.bukkit.entity.Player player) Shows the instant bar to the playerboolean
showOrganizer
(org.bukkit.entity.Player player) Opens the cast bar organizer GUIvoid
unlock
(PlayerSkill skill) Adds an unlocked skill to the skill barsvoid
validate()
Validates added skills, making sure they're still unlocked
-
Constructor Details
-
PlayerCastBars
- 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
-
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
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 datahover
- 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 datahover
- 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 interfaceorg.bukkit.inventory.InventoryHolder
- Returns:
- null
-