Class SkipNightEvent
java.lang.Object
net.risingworld.api.events.Event
net.risingworld.api.events.general.SkipNightEvent
- All Implemented Interfaces:
Cancellable
Called when the night will be skipped (this happens when all players are sleeping in a bed during night time).
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Gets the current time (hour).int
Gets the current time (minutes).int
Gets the amount of minutes that will be skipped.int
Gets the target time (hour), i.e the new time after skipping the night.int
Gets the target time (minutes), i.e the new time after skipping the night.boolean
Determines if the event is cancelled.void
setCancelled
(boolean cancel) Cancels this event.void
setTargetTime
(int hours, int minutes) Sets a new target time, which is the time that will be set after skipping the night.
-
Method Details
-
getSkippedMinutes
public int getSkippedMinutes()Gets the amount of minutes that will be skipped.- Returns:
- the skipped minutes.
-
getCurrentHour
public int getCurrentHour()Gets the current time (hour).- Returns:
- the current time.
-
getCurrentMinutes
public int getCurrentMinutes()Gets the current time (minutes).- Returns:
- the current time.
-
getTargetHour
public int getTargetHour()Gets the target time (hour), i.e the new time after skipping the night.- Returns:
- the new time (hour).
-
getTargetMinutes
public int getTargetMinutes()Gets the target time (minutes), i.e the new time after skipping the night.- Returns:
- the new time (minutes).
-
setTargetTime
public void setTargetTime(int hours, int minutes) Sets a new target time, which is the time that will be set after skipping the night.- Parameters:
hours
- the new hours.minutes
- the new minutes.- Example: After skipping a night, we want the time to be 3:30 pm
-
isCancelled
public boolean isCancelled()Description copied from interface:Cancellable
Determines if the event is cancelled. If an event is cancelled, it will no longer be executed, but other plugins will still receive the event.
Please note: If the event is threaded, cancellation has no effect, i.e the event will still be executed.- Specified by:
isCancelled
in interfaceCancellable
- Returns:
- true if the event is cancelled, or false if not.
-
setCancelled
public void setCancelled(boolean cancel) Description copied from interface:Cancellable
Cancels this event. This means it will no longer be executed, but other plugins will still receive the event.- Specified by:
setCancelled
in interfaceCancellable
- Parameters:
cancel
- set to true if you want to cancel this event.- Example: Cancel "PlayerEnterAreaEvent", i.e prevent player from entering an area
-