Package net.risingworld.api.events
Class Event
java.lang.Object
net.risingworld.api.events.Event
- Direct Known Subclasses:
AddAdminEvent
,ExplosionEvent
,InputEvent
,ItemTransformEvent
,LateUpdateEvent
,MetaObjectEvent
,NpcAddClothesEvent
,NpcAddSaddleBagEvent
,NpcAddSaddleEvent
,NpcDamageEvent
,NpcDeathEvent
,NpcHitNpcEvent
,NpcRemoveClothesEvent
,NpcRemoveSaddleBagEvent
,NpcRemoveSaddleEvent
,NpcSpawnEvent
,NpcTransformEvent
,PlantGrowthEvent
,PlayerEvent
,ProjectileFireEvent
,ProjectileHitEvent
,ReadyEvent
,RemoveAdminEvent
,SeasonChangeEvent
,ShutdownEvent
,SkipNightEvent
,UpdateEvent
,WeatherChangeEvent
Base class for all events.
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
Only relevant for cancellable events (seeCancellable
interface)protected long
Pointer to the native event -
Constructor Summary
-
Method Summary
-
Field Details
-
pointer
protected long pointerPointer to the native event -
cancelled
protected boolean cancelledOnly relevant for cancellable events (seeCancellable
interface)
-
-
Constructor Details
-
Event
protected Event()
-
-
Method Details
-
isValid
public final boolean isValid()Checks if the event is still valid.
In general, events have a very short life cycle - they're only valid the moment they're triggered. At the end of the frame, their pointer is set to null (and the native resource gets disposed), so they can no longer be used.
You must not use event instances outside the particular listener methods! For example, never store them in a list or access them from another thread.
Note: This is only relevant for built-in events! When using your custom events (classes derived fromEvent
), you can ignore this method.- Returns:
- true if the event is still valid (and can be used), false if not
-
equals
-
hashCode
public int hashCode()
-