Use callback-style events for crosshair and hotbar render events

This commit is contained in:
Jonas Herzig
2021-02-27 15:49:40 +01:00
parent da16b0fb78
commit 06a46e6f38
5 changed files with 56 additions and 17 deletions

View File

@@ -0,0 +1,19 @@
package com.replaymod.replay.events;
import de.johni0702.minecraft.gui.utils.Event;
public interface RenderHotbarCallback {
Event<RenderHotbarCallback> EVENT = Event.create((listeners) ->
() -> {
for (RenderHotbarCallback listener : listeners) {
Boolean state = listener.shouldRenderHotbar();
if (state != null) {
return state;
}
}
return null;
}
);
Boolean shouldRenderHotbar();
}

View File

@@ -1,4 +1,3 @@
//#if MC>=11400
package com.replaymod.replay.events;
import de.johni0702.minecraft.gui.utils.Event;
@@ -18,4 +17,3 @@ public interface RenderSpectatorCrosshairCallback {
Boolean shouldRenderSpectatorCrosshair();
}
//#endif