Start hiding relocated api libs

This commit is contained in:
Draycia committed 2023-07-08 15:16:55 -07:00
1 parent 9f20afc33a
commit 43d2754018
7 files changed
+140 -23

No files matched your search

@@ -19,15 +19,15 @@
*/
package net.draycia.carbon.api.event;
import com.seiama.event.EventSubscriber;
import com.seiama.event.EventSubscription;
import java.util.function.Consumer;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.framework.qual.DefaultQualifier;
/**
* Carbon event dispatcher.
*
* @since 2.1.0
*/
@DefaultQualifier(NonNull.class)
public interface CarbonEventHandler {
/**
@@ -39,9 +39,9 @@ public interface CarbonEventHandler {
* @return the subscription, so that it may be unregistered
* @since 2.0.0
*/
<T extends CarbonEvent> EventSubscription<T> subscribe(
<T extends CarbonEvent> CarbonEventSubscription<T> subscribe(
final Class<T> eventClass,
final EventSubscriber<T> subscriber
final CarbonEventSubscriber<T> subscriber
);
/**
@@ -51,16 +51,16 @@ public interface CarbonEventHandler {
* @param eventClass the class to listen for
* @param order the order of the consumer
* @param acceptsCancelled if the consumer should be executed if the event is cancelled early
* @param consumer the consumer that's executed when the event is emitted
* @param subscriber the consumer that's executed when the event is emitted
* @param <T> the class to listen for
* @return the subscription, so that it may be unregistered
* @since 2.0.0
*/
<T extends CarbonEvent> EventSubscription<T> subscribe(
<T extends CarbonEvent> CarbonEventSubscription<T> subscribe(
final Class<T> eventClass,
final int order,
final boolean acceptsCancelled,
final Consumer<T> consumer
final CarbonEventSubscriber<T> subscriber
);
/**
@@ -69,8 +69,9 @@ public interface CarbonEventHandler {
* the event while it's being emitted.
*
* @param event the event to be emitted
* @param <T> the class to emit
* @since 2.0.0
*/
void emit(final CarbonEvent event);
<T extends CarbonEvent> void emit(final T event);
}
@@ -0,0 +1,38 @@
/*
* CarbonChat
*
* Copyright (c) 2023 Josua Parks (Vicarious)
* Contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package net.draycia.carbon.api.event;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.framework.qual.DefaultQualifier;
import org.jetbrains.annotations.NotNull;
@DefaultQualifier(NonNull.class)
public interface CarbonEventSubscriber<T extends CarbonEvent> {
/**
* Invokes this event consumer.
*
* @param event the event
* @throws Throwable if an exception is thrown
* @since 1.0.0
*/
void on(final @NotNull T event) throws Throwable;
}
@@ -0,0 +1,44 @@
/*
* CarbonChat
*
* Copyright (c) 2023 Josua Parks (Vicarious)
* Contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package net.draycia.carbon.api.event;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.framework.qual.DefaultQualifier;
@DefaultQualifier(NonNull.class)
public interface CarbonEventSubscription<T extends CarbonEvent> {
/**
* Gets the event type.
*
* @return the event type
* @since 2.1.0
*/
Class<T> event();
/**
* Gets the subscriber.
*
* @return the subscriber
* @since 2.1.0
*/
CarbonEventSubscriber<T> subscriber();
}