-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clean(*): expose event4j and remove wrappers
- Loading branch information
1 parent
8b75d74
commit a8bef6b
Showing
18 changed files
with
72 additions
and
291 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
plugins { | ||
id ("chronus.common-conventions") | ||
} | ||
|
||
dependencies { | ||
api(libs.event4j) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
api/src/main/java/net/okocraft/chronus/api/event/listener/ListenerManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package net.okocraft.chronus.api.event.listener; | ||
|
||
import com.github.siroshun09.event4j.listener.SubscribedListener; | ||
import com.github.siroshun09.event4j.priority.Priority; | ||
import net.okocraft.chronus.api.event.ChronusEvent; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.util.function.Consumer; | ||
|
||
public interface ListenerManager { | ||
|
||
<E extends ChronusEvent> @NotNull SubscribedListener<?, E, Priority> subscribe(@NotNull Consumer<? super E> consumer); | ||
|
||
<E extends ChronusEvent> @NotNull SubscribedListener<?, E, Priority> subscribe(@NotNull Consumer<? super E> consumer, @NotNull Priority priority); | ||
|
||
void unsubscribe(@NotNull SubscribedListener<?, ? extends ChronusEvent, Priority> listener); | ||
|
||
void unsubscribeAll(); | ||
|
||
} |
39 changes: 0 additions & 39 deletions
39
api/src/main/java/net/okocraft/chronus/api/eventbus/EventBus.java
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
api/src/main/java/net/okocraft/chronus/api/eventbus/listener/Listener.java
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
api/src/main/java/net/okocraft/chronus/api/eventbus/listener/Priority.java
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
api/src/main/java/net/okocraft/chronus/api/eventbus/listener/SubscribedListener.java
This file was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
api/src/main/java/net/okocraft/chronus/api/eventbus/subscriber/EventSubscriber.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,4 @@ plugins { | |
|
||
dependencies { | ||
implementation(projects.chronusApi) | ||
implementation(libs.event4j) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 5 additions & 13 deletions
18
core/src/main/java/net/okocraft/chronus/core/api/ChronusAPI.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,14 @@ | ||
package net.okocraft.chronus.core.api; | ||
|
||
import com.github.siroshun09.event4j.caller.AsyncEventCaller; | ||
import net.okocraft.chronus.api.Chronus; | ||
import net.okocraft.chronus.core.api.eventbus.EventBusWrapper; | ||
import net.okocraft.chronus.api.event.ChronusEvent; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
/** | ||
* A class for implementing {@link Chronus}. | ||
*/ | ||
public class ChronusAPI implements Chronus { | ||
|
||
private final EventBusWrapper eventBusWrapper; | ||
|
||
public ChronusAPI(@NotNull EventBusWrapper eventBusWrapper) { | ||
this.eventBusWrapper = eventBusWrapper; | ||
} | ||
|
||
@Override | ||
public @NotNull EventBusWrapper getEventBus() { | ||
return eventBusWrapper; | ||
} | ||
public record ChronusAPI( | ||
@NotNull AsyncEventCaller<ChronusEvent> eventCaller | ||
) implements Chronus { | ||
} |
47 changes: 0 additions & 47 deletions
47
core/src/main/java/net/okocraft/chronus/core/api/eventbus/EventBusWrapper.java
This file was deleted.
Oops, something went wrong.
40 changes: 0 additions & 40 deletions
40
core/src/main/java/net/okocraft/chronus/core/api/eventbus/EventSubscriberWrapper.java
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
core/src/main/java/net/okocraft/chronus/core/api/eventbus/ListenerWrapper.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.