aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/events
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/events')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/events/EventManager.java17
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/events/event/CancellableEvent.java5
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/events/event/HudRenderEvent.java9
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/events/event/RenderEvent.java11
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/events/event/ScreenOpenEvent.java11
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/events/event/Stage.java6
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/events/event/TickEvent.java9
7 files changed, 68 insertions, 0 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/events/EventManager.java b/src/main/java/cc/polyfrost/oneconfig/events/EventManager.java
new file mode 100644
index 0000000..956c9b6
--- /dev/null
+++ b/src/main/java/cc/polyfrost/oneconfig/events/EventManager.java
@@ -0,0 +1,17 @@
+package cc.polyfrost.oneconfig.events;
+
+import cc.polyfrost.oneconfig.libs.eventbus.EventBus;
+import cc.polyfrost.oneconfig.libs.eventbus.invokers.LMFInvoker;
+
+public final class EventManager {
+ private EventManager() {
+
+ }
+
+ public static final EventManager INSTANCE = new EventManager();
+ private final EventBus eventBus = new EventBus(new LMFInvoker(), Throwable::printStackTrace);
+
+ public EventBus getEventBus() {
+ return eventBus;
+ }
+}
diff --git a/src/main/java/cc/polyfrost/oneconfig/events/event/CancellableEvent.java b/src/main/java/cc/polyfrost/oneconfig/events/event/CancellableEvent.java
new file mode 100644
index 0000000..2afa613
--- /dev/null
+++ b/src/main/java/cc/polyfrost/oneconfig/events/event/CancellableEvent.java
@@ -0,0 +1,5 @@
+package cc.polyfrost.oneconfig.events.event;
+
+public class CancellableEvent {
+ public boolean isCancelled = false;
+}
diff --git a/src/main/java/cc/polyfrost/oneconfig/events/event/HudRenderEvent.java b/src/main/java/cc/polyfrost/oneconfig/events/event/HudRenderEvent.java
new file mode 100644
index 0000000..974508d
--- /dev/null
+++ b/src/main/java/cc/polyfrost/oneconfig/events/event/HudRenderEvent.java
@@ -0,0 +1,9 @@
+package cc.polyfrost.oneconfig.events.event;
+
+public class HudRenderEvent {
+ public final float deltaTicks;
+
+ public HudRenderEvent(float deltaTicks) {
+ this.deltaTicks = deltaTicks;
+ }
+}
diff --git a/src/main/java/cc/polyfrost/oneconfig/events/event/RenderEvent.java b/src/main/java/cc/polyfrost/oneconfig/events/event/RenderEvent.java
new file mode 100644
index 0000000..aa305a1
--- /dev/null
+++ b/src/main/java/cc/polyfrost/oneconfig/events/event/RenderEvent.java
@@ -0,0 +1,11 @@
+package cc.polyfrost.oneconfig.events.event;
+
+public class RenderEvent {
+ public final Stage stage;
+ public final float deltaTicks;
+
+ public RenderEvent(Stage stage, float deltaTicks) {
+ this.stage = stage;
+ this.deltaTicks = 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
new file mode 100644
index 0000000..d3a5b66
--- /dev/null
+++ b/src/main/java/cc/polyfrost/oneconfig/events/event/ScreenOpenEvent.java
@@ -0,0 +1,11 @@
+package cc.polyfrost.oneconfig.events.event;
+
+import net.minecraft.client.gui.GuiScreen;
+
+public class ScreenOpenEvent extends CancellableEvent {
+ public final GuiScreen screen;
+
+ public ScreenOpenEvent(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
new file mode 100644
index 0000000..77c93b8
--- /dev/null
+++ b/src/main/java/cc/polyfrost/oneconfig/events/event/Stage.java
@@ -0,0 +1,6 @@
+package cc.polyfrost.oneconfig.events.event;
+
+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
new file mode 100644
index 0000000..5eb776c
--- /dev/null
+++ b/src/main/java/cc/polyfrost/oneconfig/events/event/TickEvent.java
@@ -0,0 +1,9 @@
+package cc.polyfrost.oneconfig.events.event;
+
+public class TickEvent {
+ public final Stage stage;
+
+ public TickEvent(Stage stage) {
+ this.stage = stage;
+ }
+}