Package org.kingdoms.events
Class KingdomsEvent
java.lang.Object
org.bukkit.event.Event
org.kingdoms.events.KingdomsEvent
- All Implemented Interfaces:
org.kingdoms.constants.namespace.NamespacedMetadataContainer,org.kingdoms.locale.provider.MessageContextProvider
- Direct Known Subclasses:
AsyncBatchLandLoadEvent,ChampionAbilityEvent,ClaimingEvent,GroupColorChangeEvent,GroupFlagChangeEvent,GroupHiddenStateChangeEvent,GroupHomeTeleportEvent,GroupRelationshipChangeEvent,GroupRenameEvent,GroupResourcePointConvertEvent,GroupShieldPurchaseEvent,KingdomCreateEvent,KingdomDisbandEvent,KingdomGUIOpenEvent,KingdomInvadeAttackEvent,KingdomInvadeEndEvent,KingdomInvadeEvent,KingdomItemEmbeddedEvent,KingdomJoinEvent,KingdomKingChangeEvent,KingdomLeaveEvent,KingdomLoreChangeEvent,KingdomPacifismStateChangeEvent,KingdomPreInvadeEvent,LandChangeEvent,LandUnloadEvent,org.kingdoms.events.general.LocationChangeEvent,MailSendEvent,MassWarEndEvent,MassWarStartEvent,NationCreateEvent,NationDisbandEvent,NationJoinEvent,NationLeaveEvent,NexusMoveEvent,OpenProtectedBlockEvent,SiegeCannonHitEvent,TurretActivateEvent
public abstract class KingdomsEvent
extends org.bukkit.event.Event
implements org.kingdoms.constants.namespace.NamespacedMetadataContainer, org.kingdoms.locale.provider.MessageContextProvider
Simply adds metadata system to the default event system.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.kingdoms.constants.namespace.NamespaceIf an event has this namespace it shows that the event was prevented from being called at all, so no event listener would've received this event anyway. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMessageContextEdits(@NotNull MessageBuilder messageBuilder) <T> @Nullable TgetMetadata(@NonNull org.kingdoms.constants.namespace.Namespace namespace) Gets the value associated to the given namespace.booleanvoidMethods inherited from class org.bukkit.event.Event
getEventName, getHandlers, isAsynchronousMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.kingdoms.locale.provider.MessageContextProvider
getMessageContext
-
Field Details
-
SILENCED
public static final org.kingdoms.constants.namespace.Namespace SILENCEDIf an event has this namespace it shows that the event was prevented from being called at all, so no event listener would've received this event anyway.The value of the metadata is recommended to be a string showing the name of the process/plugin/handler that silenced this event.
An event that is
Cancellablewill always be in the cancelled state if it is silenced.
-
-
Constructor Details
-
KingdomsEvent
public KingdomsEvent() -
KingdomsEvent
public KingdomsEvent(boolean isAsync)
-
-
Method Details
-
silence
- See Also:
-
isSilenced
public boolean isSilenced() -
addMessageContextEdits
- Specified by:
addMessageContextEditsin interfaceorg.kingdoms.locale.provider.MessageContextProvider
-
getMetadata
- Specified by:
getMetadatain interfaceorg.kingdoms.constants.namespace.NamespacedMetadataContainer- See Also:
-
metadata
-
getMetadata
public <T> @Nullable T getMetadata(@NonNull org.kingdoms.constants.namespace.Namespace namespace) Gets the value associated to the given namespace.- Type Parameters:
T- the expected type of the value.- Parameters:
namespace- the key of the value.- Returns:
- the value or null if it doesn't exist.
-