mirror of
https://github.com/architectury/architectury-api.git
synced 2026-03-28 03:56:59 -05:00
Fix invalid events
This commit is contained in:
@@ -89,7 +89,7 @@ public final class EventFactory {
|
||||
@Override
|
||||
protected Object handleInvocation(@NotNull Object proxy, @NotNull Method method, Object @NotNull [] args) throws Throwable {
|
||||
for (T listener : listeners) {
|
||||
InteractionResult result = (InteractionResult) method.invoke(listener, args);
|
||||
InteractionResult result = (InteractionResult) Objects.requireNonNull(method.invoke(listener, args));
|
||||
if (result != InteractionResult.PASS) {
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ import java.util.List;
|
||||
|
||||
public interface ExplosionEvent {
|
||||
Event<Pre> PRE = EventFactory.createInteractionResult();
|
||||
Event<Detonate> DETONATE = EventFactory.createInteractionResult();
|
||||
Event<Detonate> DETONATE = EventFactory.createLoop();
|
||||
|
||||
interface Pre {
|
||||
InteractionResult explode(Level world, Explosion explosion);
|
||||
|
||||
@@ -49,7 +49,7 @@ public interface GuiEvent {
|
||||
*/
|
||||
Event<ScreenInitPost> INIT_POST = EventFactory.createLoop();
|
||||
Event<ScreenRenderPre> RENDER_PRE = EventFactory.createInteractionResult();
|
||||
Event<ScreenRenderPost> RENDER_POST = EventFactory.createInteractionResult();
|
||||
Event<ScreenRenderPost> RENDER_POST = EventFactory.createLoop();
|
||||
|
||||
/**
|
||||
* Invoked during Minecraft#setScreen, equivalent to forge's {@code GuiOpenEvent}.
|
||||
|
||||
@@ -44,8 +44,8 @@ public interface TooltipEvent {
|
||||
* Render forge events are only invoked on the forge side.
|
||||
*/
|
||||
Event<RenderForge> RENDER_FORGE_PRE = EventFactory.createInteractionResult();
|
||||
Event<RenderModifyPosition> RENDER_MODIFY_POSITION = EventFactory.createInteractionResult();
|
||||
Event<RenderModifyColor> RENDER_MODIFY_COLOR = EventFactory.createInteractionResult();
|
||||
Event<RenderModifyPosition> RENDER_MODIFY_POSITION = EventFactory.createLoop();
|
||||
Event<RenderModifyColor> RENDER_MODIFY_COLOR = EventFactory.createLoop();
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
interface Item {
|
||||
|
||||
Reference in New Issue
Block a user