Class AttachmentEventHooks
java.lang.Object
net.ixdarklord.coolcatcore.internal.attachment.AttachmentEventHooks
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ObjectWhatchanging(net.ixdarklord.coolcatcore.api.attachment.AttachmentHolder, net.ixdarklord.coolcatcore.api.attachment.Attachment<T>, T, T)returns when a listener cancelled the change. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> voidchanged(AttachmentHolder holder, Attachment<T> key, T oldValue, T newValue) Tells listeners about a change;nullstands for no stored value.static <T> @Nullable Objectchanging(AttachmentHolder holder, Attachment<T> key, T oldValue, T newValue) Asks the CHANGING listeners about a change.
-
Field Details
-
CANCELLED
Whatchanging(net.ixdarklord.coolcatcore.api.attachment.AttachmentHolder, net.ixdarklord.coolcatcore.api.attachment.Attachment<T>, T, T)returns when a listener cancelled the change.
-
-
Method Details
-
changing
@Nullable public static <T> @Nullable Object changing(AttachmentHolder holder, Attachment<T> key, @Nullable T oldValue, @Nullable T newValue) Asks the CHANGING listeners about a change.- Returns:
CANCELLED, or the value to store (a listener's replacement, ornewValue)
-
changed
public static <T> void changed(AttachmentHolder holder, Attachment<T> key, @Nullable T oldValue, @Nullable T newValue) Tells listeners about a change;nullstands for no stored value.
-