Use callback-style events for crosshair and hotbar render events
This commit is contained in:
@@ -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();
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user