From 714ccd7778affaaf3b5c685c8fdd5c8319fbab6d Mon Sep 17 00:00:00 2001 From: Gabriel Harris-Rouquette Date: Wed, 9 Oct 2024 17:54:31 -0700 Subject: [PATCH] fix: generate specific events that are being omitted --- build.gradle.kts | 3 --- .../org/spongepowered/api/event/block/InteractBlockEvent.java | 2 ++ .../api/event/item/inventory/InteractItemEvent.java | 2 ++ .../api/event/lifecycle/ConstructPluginEvent.java | 2 ++ .../org/spongepowered/api/event/lifecycle/LoadedGameEvent.java | 2 ++ .../spongepowered/api/event/lifecycle/RefreshGameEvent.java | 2 ++ .../spongepowered/api/event/lifecycle/StartedEngineEvent.java | 2 ++ .../spongepowered/api/event/lifecycle/StartingEngineEvent.java | 2 ++ .../spongepowered/api/event/lifecycle/StoppedGameEvent.java | 2 ++ .../spongepowered/api/event/lifecycle/StoppingEngineEvent.java | 2 ++ .../org/spongepowered/api/event/message/PlayerChatEvent.java | 1 - 11 files changed, 18 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 68de6da7881..c1a495c3f69 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -219,9 +219,6 @@ idea { delegateBuildRunToGradle = false testRunner = org.jetbrains.gradle.ext.ActionDelegationConfig.TestRunner.PLATFORM } - taskTriggers { -// beforeBuild(tasks.genEventImpl) - } } } } diff --git a/src/main/java/org/spongepowered/api/event/block/InteractBlockEvent.java b/src/main/java/org/spongepowered/api/event/block/InteractBlockEvent.java index 545d415dcf5..bac5293da0e 100644 --- a/src/main/java/org/spongepowered/api/event/block/InteractBlockEvent.java +++ b/src/main/java/org/spongepowered/api/event/block/InteractBlockEvent.java @@ -35,6 +35,7 @@ import org.spongepowered.api.item.inventory.ItemStack; import org.spongepowered.api.util.Direction; import org.spongepowered.api.util.Tristate; +import org.spongepowered.eventgen.annotations.GenerateFactoryMethod; import org.spongepowered.eventgen.annotations.ImplementedBy; import org.spongepowered.api.world.server.ServerLocation; import org.spongepowered.math.vector.Vector3d; @@ -104,6 +105,7 @@ interface Finish extends Primary, Cancellable { * *

This is usually right-click.

*/ + @GenerateFactoryMethod interface Secondary extends InteractBlockEvent { Tristate originalUseItemResult(); diff --git a/src/main/java/org/spongepowered/api/event/item/inventory/InteractItemEvent.java b/src/main/java/org/spongepowered/api/event/item/inventory/InteractItemEvent.java index 98e4c87014f..412652a6204 100644 --- a/src/main/java/org/spongepowered/api/event/item/inventory/InteractItemEvent.java +++ b/src/main/java/org/spongepowered/api/event/item/inventory/InteractItemEvent.java @@ -32,6 +32,7 @@ import org.spongepowered.api.event.entity.living.AnimateHandEvent; import org.spongepowered.api.item.inventory.ItemStack; import org.spongepowered.api.item.inventory.ItemStackSnapshot; +import org.spongepowered.eventgen.annotations.GenerateFactoryMethod; /** * Base event for all interactions with an {@link ItemStack} in hand. @@ -65,6 +66,7 @@ interface Primary extends InteractItemEvent { * *

Vanilla minecraft does not call an event when interacting with an empty hand in air.

*/ + @GenerateFactoryMethod interface Secondary extends InteractItemEvent, Cancellable { interface Pre extends Secondary { diff --git a/src/main/java/org/spongepowered/api/event/lifecycle/ConstructPluginEvent.java b/src/main/java/org/spongepowered/api/event/lifecycle/ConstructPluginEvent.java index dcdf4d33485..5befd25781b 100644 --- a/src/main/java/org/spongepowered/api/event/lifecycle/ConstructPluginEvent.java +++ b/src/main/java/org/spongepowered/api/event/lifecycle/ConstructPluginEvent.java @@ -24,8 +24,10 @@ */ package org.spongepowered.api.event.lifecycle; +import org.spongepowered.eventgen.annotations.GenerateFactoryMethod; import org.spongepowered.plugin.PluginContainer; +@GenerateFactoryMethod public interface ConstructPluginEvent extends LifecycleEvent { PluginContainer plugin(); diff --git a/src/main/java/org/spongepowered/api/event/lifecycle/LoadedGameEvent.java b/src/main/java/org/spongepowered/api/event/lifecycle/LoadedGameEvent.java index f68a02615ca..f7b31ccd64d 100644 --- a/src/main/java/org/spongepowered/api/event/lifecycle/LoadedGameEvent.java +++ b/src/main/java/org/spongepowered/api/event/lifecycle/LoadedGameEvent.java @@ -25,11 +25,13 @@ package org.spongepowered.api.event.lifecycle; import org.spongepowered.api.Game; +import org.spongepowered.eventgen.annotations.GenerateFactoryMethod; /** * Called when the implementation signals that all the aspects of the * {@link Game} have completed loading. */ +@GenerateFactoryMethod public interface LoadedGameEvent extends LifecycleEvent { } diff --git a/src/main/java/org/spongepowered/api/event/lifecycle/RefreshGameEvent.java b/src/main/java/org/spongepowered/api/event/lifecycle/RefreshGameEvent.java index 148585a47d8..6f06938d92b 100644 --- a/src/main/java/org/spongepowered/api/event/lifecycle/RefreshGameEvent.java +++ b/src/main/java/org/spongepowered/api/event/lifecycle/RefreshGameEvent.java @@ -25,6 +25,7 @@ package org.spongepowered.api.event.lifecycle; import org.spongepowered.api.Game; +import org.spongepowered.eventgen.annotations.GenerateFactoryMethod; /** * Fired when something within a {@link Game} triggers a refresh of @@ -37,6 +38,7 @@ * plugin use. *

*/ +@GenerateFactoryMethod public interface RefreshGameEvent extends LifecycleEvent { } diff --git a/src/main/java/org/spongepowered/api/event/lifecycle/StartedEngineEvent.java b/src/main/java/org/spongepowered/api/event/lifecycle/StartedEngineEvent.java index d413aa6442b..35992a63577 100644 --- a/src/main/java/org/spongepowered/api/event/lifecycle/StartedEngineEvent.java +++ b/src/main/java/org/spongepowered/api/event/lifecycle/StartedEngineEvent.java @@ -25,6 +25,8 @@ package org.spongepowered.api.event.lifecycle; import org.spongepowered.api.Engine; +import org.spongepowered.eventgen.annotations.GenerateFactoryMethod; +@GenerateFactoryMethod public interface StartedEngineEvent extends EngineLifecycleEvent { } diff --git a/src/main/java/org/spongepowered/api/event/lifecycle/StartingEngineEvent.java b/src/main/java/org/spongepowered/api/event/lifecycle/StartingEngineEvent.java index 4da26e16426..02556c6cd54 100644 --- a/src/main/java/org/spongepowered/api/event/lifecycle/StartingEngineEvent.java +++ b/src/main/java/org/spongepowered/api/event/lifecycle/StartingEngineEvent.java @@ -25,6 +25,8 @@ package org.spongepowered.api.event.lifecycle; import org.spongepowered.api.Engine; +import org.spongepowered.eventgen.annotations.GenerateFactoryMethod; +@GenerateFactoryMethod public interface StartingEngineEvent extends EngineLifecycleEvent { } diff --git a/src/main/java/org/spongepowered/api/event/lifecycle/StoppedGameEvent.java b/src/main/java/org/spongepowered/api/event/lifecycle/StoppedGameEvent.java index 024fe1945b3..e1bf3f544a3 100644 --- a/src/main/java/org/spongepowered/api/event/lifecycle/StoppedGameEvent.java +++ b/src/main/java/org/spongepowered/api/event/lifecycle/StoppedGameEvent.java @@ -25,6 +25,7 @@ package org.spongepowered.api.event.lifecycle; import org.spongepowered.api.Game; +import org.spongepowered.eventgen.annotations.GenerateFactoryMethod; /** * This event is called at the end of a {@link Game} instance, after the game's @@ -38,6 +39,7 @@ *

Most users will want to listen to {@link StoppingEngineEvent} instead, to * do operations tied to the lifecycle of one single engine.

*/ +@GenerateFactoryMethod public interface StoppedGameEvent extends LifecycleEvent { } diff --git a/src/main/java/org/spongepowered/api/event/lifecycle/StoppingEngineEvent.java b/src/main/java/org/spongepowered/api/event/lifecycle/StoppingEngineEvent.java index 414579881a0..a57dbbe9ae4 100644 --- a/src/main/java/org/spongepowered/api/event/lifecycle/StoppingEngineEvent.java +++ b/src/main/java/org/spongepowered/api/event/lifecycle/StoppingEngineEvent.java @@ -25,6 +25,8 @@ package org.spongepowered.api.event.lifecycle; import org.spongepowered.api.Engine; +import org.spongepowered.eventgen.annotations.GenerateFactoryMethod; +@GenerateFactoryMethod public interface StoppingEngineEvent extends EngineLifecycleEvent { } diff --git a/src/main/java/org/spongepowered/api/event/message/PlayerChatEvent.java b/src/main/java/org/spongepowered/api/event/message/PlayerChatEvent.java index 51d900df732..1634ad55e2c 100644 --- a/src/main/java/org/spongepowered/api/event/message/PlayerChatEvent.java +++ b/src/main/java/org/spongepowered/api/event/message/PlayerChatEvent.java @@ -39,7 +39,6 @@ * Fired when sending a chat message. * To modify the message use {@link Decorate}. */ -@NoFactoryMethod(ignoreNested = true) public interface PlayerChatEvent extends MessageEvent { /**