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.InventoryAdded to satisfy InventoryHolder, though doesn't do anythinggetView()booleanhandle(org.bukkit.event.player.PlayerItemHeldEvent event) Handles changing to a different weapon slotbooleanhandleInteract(org.bukkit.entity.Player player) Handles a click event when in certain viewsvoidHandles when the player opens an inventorybooleanvoidload(studio.magemonkey.codex.mccore.config.parse.DataSection config, boolean hover) Loads data from the configvoidreset()Resets the layout and populates the unused list with all available skillsvoidrestore()Restores the players inventory after viewing one of the related viewsvoidsave(studio.magemonkey.codex.mccore.config.parse.DataSection config, boolean hover) Saves data to the configbooleanshowHoverBar(org.bukkit.entity.Player player) Shows the hover cast bar to the playerbooleanshowInstantBar(org.bukkit.entity.Player player) Shows the instant bar to the playerbooleanshowOrganizer(org.bukkit.entity.Player player) Opens the cast bar organizer GUIvoidunlock(PlayerSkill skill) Adds an unlocked skill to the skill barsvoidvalidate()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:
getInventoryin interfaceorg.bukkit.inventory.InventoryHolder- Returns:
- null
-