Package com.sucy.skill.cast
Class PlayerCastBars
java.lang.Object
com.sucy.skill.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()voidhandle(org.bukkit.event.inventory.InventoryClickEvent event) Handles clicking in the GUIbooleanhandle(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 viewsvoidhandleOpen(org.bukkit.entity.Player player) Handles when the player opens an inventorybooleanvoidload(mc.promcteam.engine.mccore.config.parse.DataSection config, boolean hover) Loads data from the configvoidplayHoverParticles(org.bukkit.entity.Player player, int step) Makes the packets for cast previewsvoidreset()Resets the layout and populates the unused list with all available skillsvoidrestore(org.bukkit.entity.Player player) Restores the players inventory after viewing one of the related viewsvoidsave(mc.promcteam.engine.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
-
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
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 datahover- 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 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
-