Package simplexity.villagerinfo.events
Class ZombieVillagerOutputEvent
java.lang.Object
org.bukkit.event.Event
simplexity.villagerinfo.events.ZombieVillagerOutputEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class ZombieVillagerOutputEvent
extends org.bukkit.event.Event
implements org.bukkit.event.Cancellable
Called when information is to be displayed on a zombie villager
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Constructor Summary
ConstructorDescriptionZombieVillagerOutputEvent
(org.bukkit.entity.ZombieVillager zombieVillager, org.bukkit.entity.Player player) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Builds the Component to send to the player
Uses getTimeUntilConvertedMessageComponent(), getZombieVillagerHealthMessageComponent(), getZombieVillagerProfessionMessageComponent() if not null
If all messages are null, uses NO_INFORMATION_TO_DISPLAY message from VillagerMessage enum
Uses PLUGIN_PREFIX message from ServerMessage enumvoid
Checks player's output toggle state and sets playerOutputToggleEnabledstatic org.bukkit.event.HandlerList
Gets the handler list for this evene@NotNull org.bukkit.event.HandlerList
Gets the handler list for this evenenet.kyori.adventure.text.Component
Get the Component that is to be sent to the playerorg.bukkit.entity.Player
Gets the player involved in this eventGets the number of ticks until convertednet.kyori.adventure.text.Component
Gets the Component for the Time Until Converted message
Uses ZOMBIE_VILLAGER_NOT_CURRENTLY_CONVERTING and ZOMBIE_VILLAGER_CONVERSION_TIME messages from VillagerMessage enum
Returns null if ConfigToggle.DISPLAY_ZOMBIE_VILLAGER_CONVERSION_TIME.isEnabled() is falseorg.bukkit.entity.ZombieVillager
Gets the zombie villager involved in this eventGets zombie villager's current healthnet.kyori.adventure.text.Component
Gets the component for the Zombie Villager Health Message
Uses VILLAGER_HEALTH message from VillagerMessage enum
Returns null if ConfigToggle.DISPLAY_HEALTH.isEnabled() is falseGets zombie villager's max healthorg.bukkit.entity.Villager.Profession
Gets zombie villager's professionnet.kyori.adventure.text.Component
Gets the Component for the Zombie Villager Profession Message
Uses VILLAGER_PROFESSION message from VillagerMessage enum
Returns null if ConfigToggle.DISPLAY_PROFESSION.isEnabled() is falseboolean
Gets whether this event has been cancelledboolean
Gets whether this zombie villager is currently convertingboolean
Gets playerOutputToggleEnabledvoid
Sends outputComponent to player if the player's toggle is enabledvoid
setCancelled
(boolean cancel) Gets whether this event should be cancelledvoid
setOutputComponent
(net.kyori.adventure.text.Component outputComponent) Set the component that should be sent to the playervoid
setOverridePlayerOutputToggleEnabled
(boolean playerOutputToggleEnabled) Overrides the playerOutputToggleEnabled value, sets it to a new value regardless of the player's settingsMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
ZombieVillagerOutputEvent
public ZombieVillagerOutputEvent(org.bukkit.entity.ZombieVillager zombieVillager, org.bukkit.entity.Player player)
-
-
Method Details
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()Gets the handler list for this evene- Specified by:
getHandlers
in classorg.bukkit.event.Event
- Returns:
- HandlerList
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()Gets the handler list for this evene- Returns:
- HandlerList
-
getCurrentGameTime
-
isConverting
public boolean isConverting()Gets whether this zombie villager is currently converting- Returns:
- boolean
-
getZombieVillagerCurrentHealth
Gets zombie villager's current health- Returns:
- Double
-
getZombieVillagerMaxHealth
Gets zombie villager's max health- Returns:
- Double
-
getZombieVillagerHealthMessageComponent
public net.kyori.adventure.text.Component getZombieVillagerHealthMessageComponent()Gets the component for the Zombie Villager Health Message
Uses VILLAGER_HEALTH message from VillagerMessage enum
Returns null if ConfigToggle.DISPLAY_HEALTH.isEnabled() is false- Returns:
- Component
-
getZombieVillagerProfession
public org.bukkit.entity.Villager.Profession getZombieVillagerProfession()Gets zombie villager's profession- Returns:
- Villager.Profession
-
getZombieVillagerProfessionMessageComponent
public net.kyori.adventure.text.Component getZombieVillagerProfessionMessageComponent()Gets the Component for the Zombie Villager Profession Message
Uses VILLAGER_PROFESSION message from VillagerMessage enum
Returns null if ConfigToggle.DISPLAY_PROFESSION.isEnabled() is false- Returns:
- Component
-
getTimeUntilConverted
Gets the number of ticks until converted- Returns:
- Integer
-
getTimeUntilConvertedMessageComponent
public net.kyori.adventure.text.Component getTimeUntilConvertedMessageComponent()Gets the Component for the Time Until Converted message
Uses ZOMBIE_VILLAGER_NOT_CURRENTLY_CONVERTING and ZOMBIE_VILLAGER_CONVERSION_TIME messages from VillagerMessage enum
Returns null if ConfigToggle.DISPLAY_ZOMBIE_VILLAGER_CONVERSION_TIME.isEnabled() is false- Returns:
- Component
-
buildOutputComponent
public void buildOutputComponent()Builds the Component to send to the player
Uses getTimeUntilConvertedMessageComponent(), getZombieVillagerHealthMessageComponent(), getZombieVillagerProfessionMessageComponent() if not null
If all messages are null, uses NO_INFORMATION_TO_DISPLAY message from VillagerMessage enum
Uses PLUGIN_PREFIX message from ServerMessage enum -
sendOutputToPlayer
public void sendOutputToPlayer()Sends outputComponent to player if the player's toggle is enabled -
setOutputComponent
public void setOutputComponent(net.kyori.adventure.text.Component outputComponent) Set the component that should be sent to the player- Parameters:
outputComponent
- Component
-
getOutputComponent
public net.kyori.adventure.text.Component getOutputComponent()Get the Component that is to be sent to the player- Returns:
- Component
-
checkPlayerPDC
public void checkPlayerPDC()Checks player's output toggle state and sets playerOutputToggleEnabled -
isCancelled
public boolean isCancelled()Gets whether this event has been cancelled- Specified by:
isCancelled
in interfaceorg.bukkit.event.Cancellable
- Returns:
- boolean
-
setCancelled
public void setCancelled(boolean cancel) Gets whether this event should be cancelled- Specified by:
setCancelled
in interfaceorg.bukkit.event.Cancellable
- Parameters:
cancel
- true if you wish to cancel this event
-
getZombieVillager
public org.bukkit.entity.ZombieVillager getZombieVillager()Gets the zombie villager involved in this event- Returns:
- ZombieVillager
-
getPlayer
public org.bukkit.entity.Player getPlayer()Gets the player involved in this event- Returns:
- Player
-
isPlayerOutputToggleEnabled
public boolean isPlayerOutputToggleEnabled()Gets playerOutputToggleEnabled- Returns:
- boolean
-
setOverridePlayerOutputToggleEnabled
public void setOverridePlayerOutputToggleEnabled(boolean playerOutputToggleEnabled) Overrides the playerOutputToggleEnabled value, sets it to a new value regardless of the player's settings- Parameters:
playerOutputToggleEnabled
- boolean
-