diff options
author | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2022-05-28 14:33:31 +0700 |
---|---|---|
committer | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2022-05-28 14:33:31 +0700 |
commit | f5cd94bdac8c20e61bc6d7e898618ebf7ea2dc66 (patch) | |
tree | 967a96344046a0bf4e73cf041fc2b2d22aef4568 /src/main/java/cc/polyfrost/oneconfig/events/event | |
parent | 01e4c0dfb2a9726a9bf1c4d1a1fe28edbc3d094c (diff) | |
download | OneConfig-f5cd94bdac8c20e61bc6d7e898618ebf7ea2dc66.tar.gz OneConfig-f5cd94bdac8c20e61bc6d7e898618ebf7ea2dc66.tar.bz2 OneConfig-f5cd94bdac8c20e61bc6d7e898618ebf7ea2dc66.zip |
javadocs for events + TimerUpdateEvent
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/events/event')
10 files changed, 80 insertions, 1 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/events/event/CancellableEvent.java b/src/main/java/cc/polyfrost/oneconfig/events/event/CancellableEvent.java index 2afa613..82cbac4 100644 --- a/src/main/java/cc/polyfrost/oneconfig/events/event/CancellableEvent.java +++ b/src/main/java/cc/polyfrost/oneconfig/events/event/CancellableEvent.java @@ -1,5 +1,11 @@ package cc.polyfrost.oneconfig.events.event; +/** + * Represents an event that can be cancelled. + */ public class CancellableEvent { + /** + * Whether the event has been cancelled. + */ public boolean isCancelled = false; } diff --git a/src/main/java/cc/polyfrost/oneconfig/events/event/ChatReceiveEvent.java b/src/main/java/cc/polyfrost/oneconfig/events/event/ChatReceiveEvent.java index b69b89b..616479e 100644 --- a/src/main/java/cc/polyfrost/oneconfig/events/event/ChatReceiveEvent.java +++ b/src/main/java/cc/polyfrost/oneconfig/events/event/ChatReceiveEvent.java @@ -3,7 +3,13 @@ package cc.polyfrost.oneconfig.events.event; import net.minecraft.util.IChatComponent; +/** + * Called when a chat message is received. + */ public class ChatReceiveEvent extends CancellableEvent { + /** + * The message that was received. + */ public final IChatComponent message; public ChatReceiveEvent(IChatComponent message) { diff --git a/src/main/java/cc/polyfrost/oneconfig/events/event/HudRenderEvent.java b/src/main/java/cc/polyfrost/oneconfig/events/event/HudRenderEvent.java index 974508d..465a2f6 100644 --- a/src/main/java/cc/polyfrost/oneconfig/events/event/HudRenderEvent.java +++ b/src/main/java/cc/polyfrost/oneconfig/events/event/HudRenderEvent.java @@ -1,6 +1,12 @@ package cc.polyfrost.oneconfig.events.event; +/** + * Called when external HUDs can be rendered. + */ public class HudRenderEvent { + /** + * How much time has elapsed since the last tick, in ticks. Used for animations. + */ public final float deltaTicks; public HudRenderEvent(float deltaTicks) { diff --git a/src/main/java/cc/polyfrost/oneconfig/events/event/LocrawEvent.java b/src/main/java/cc/polyfrost/oneconfig/events/event/LocrawEvent.java index 42565f7..da14de3 100644 --- a/src/main/java/cc/polyfrost/oneconfig/events/event/LocrawEvent.java +++ b/src/main/java/cc/polyfrost/oneconfig/events/event/LocrawEvent.java @@ -2,6 +2,12 @@ package cc.polyfrost.oneconfig.events.event; import cc.polyfrost.oneconfig.utils.hypixel.LocrawInfo; +/** + * Called when the player's location in Hypixel is received via the /locraw command. + * + * @see LocrawInfo + * @see cc.polyfrost.oneconfig.utils.hypixel.HypixelUtils + */ public class LocrawEvent { public final LocrawInfo info; diff --git a/src/main/java/cc/polyfrost/oneconfig/events/event/RenderEvent.java b/src/main/java/cc/polyfrost/oneconfig/events/event/RenderEvent.java index aa305a1..5f3be47 100644 --- a/src/main/java/cc/polyfrost/oneconfig/events/event/RenderEvent.java +++ b/src/main/java/cc/polyfrost/oneconfig/events/event/RenderEvent.java @@ -1,7 +1,17 @@ package cc.polyfrost.oneconfig.events.event; +/** + * Called when a game tick is started / ended, represented by a {@link Stage} + */ public class RenderEvent { + /** + * Whether the tick is starting or ending. + */ public final Stage stage; + + /** + * How much time has elapsed since the last tick, in ticks. Used for animations. + */ public final float deltaTicks; public RenderEvent(Stage stage, float deltaTicks) { diff --git a/src/main/java/cc/polyfrost/oneconfig/events/event/ScreenOpenEvent.java b/src/main/java/cc/polyfrost/oneconfig/events/event/ScreenOpenEvent.java index d3a5b66..4593638 100644 --- a/src/main/java/cc/polyfrost/oneconfig/events/event/ScreenOpenEvent.java +++ b/src/main/java/cc/polyfrost/oneconfig/events/event/ScreenOpenEvent.java @@ -1,11 +1,17 @@ package cc.polyfrost.oneconfig.events.event; import net.minecraft.client.gui.GuiScreen; +import org.jetbrains.annotations.Nullable; +/** + * Called when a screen is opened or closed. + * If the screen is closed, {@link ScreenOpenEvent#screen} will be null. + */ public class ScreenOpenEvent extends CancellableEvent { + @Nullable public final GuiScreen screen; - public ScreenOpenEvent(GuiScreen screen) { + public ScreenOpenEvent(@Nullable GuiScreen screen) { this.screen = screen; } } diff --git a/src/main/java/cc/polyfrost/oneconfig/events/event/Stage.java b/src/main/java/cc/polyfrost/oneconfig/events/event/Stage.java index 77c93b8..564058f 100644 --- a/src/main/java/cc/polyfrost/oneconfig/events/event/Stage.java +++ b/src/main/java/cc/polyfrost/oneconfig/events/event/Stage.java @@ -1,5 +1,11 @@ package cc.polyfrost.oneconfig.events.event; +/** + * Represents whether the event is called when the specified action is started or ended. + * + * @see TickEvent + * @see RenderEvent + */ public enum Stage { START, END diff --git a/src/main/java/cc/polyfrost/oneconfig/events/event/TickEvent.java b/src/main/java/cc/polyfrost/oneconfig/events/event/TickEvent.java index 5eb776c..9ddae98 100644 --- a/src/main/java/cc/polyfrost/oneconfig/events/event/TickEvent.java +++ b/src/main/java/cc/polyfrost/oneconfig/events/event/TickEvent.java @@ -1,6 +1,12 @@ package cc.polyfrost.oneconfig.events.event; +/** + * Called when a game tick is started / ended, represented by a {@link Stage} + */ public class TickEvent { + /** + * Whether the tick is starting or ending. + */ public final Stage stage; public TickEvent(Stage stage) { diff --git a/src/main/java/cc/polyfrost/oneconfig/events/event/TimerUpdateEvent.java b/src/main/java/cc/polyfrost/oneconfig/events/event/TimerUpdateEvent.java new file mode 100644 index 0000000..a8b88dc --- /dev/null +++ b/src/main/java/cc/polyfrost/oneconfig/events/event/TimerUpdateEvent.java @@ -0,0 +1,24 @@ +package cc.polyfrost.oneconfig.events.event; + +import net.minecraft.util.Timer; + +/** + * Called when the {@link Timer} is updated. + * Can be used as an alternative to getting instances of {@link Timer} + * via Mixin or Access Wideners / Transformers + */ +public class TimerUpdateEvent { + /** + * Whether the deltaTicks / renderPartialTicks was updated + */ + public final boolean updatedDeltaTicks; + /** + * The {@link Timer} instance + */ + public final Timer timer; + + public TimerUpdateEvent(Timer timer, boolean updatedDeltaTicks) { + this.timer = timer; + this.updatedDeltaTicks = updatedDeltaTicks; + } +}
\ No newline at end of file diff --git a/src/main/java/cc/polyfrost/oneconfig/events/event/WorldLoadEvent.java b/src/main/java/cc/polyfrost/oneconfig/events/event/WorldLoadEvent.java index 1583fe6..560b539 100644 --- a/src/main/java/cc/polyfrost/oneconfig/events/event/WorldLoadEvent.java +++ b/src/main/java/cc/polyfrost/oneconfig/events/event/WorldLoadEvent.java @@ -1,4 +1,7 @@ package cc.polyfrost.oneconfig.events.event; +/** + * Called when the world is loaded. + */ public class WorldLoadEvent { } |