asset workspace progress

This commit is contained in:
2026-03-24 13:42:44 +00:00
parent 4c8190cc31
commit 59e1ad5ecf
286 changed files with 7156 additions and 8898 deletions
@@ -0,0 +1,5 @@
package p.studio.utilities.events;
public interface EventBusPublisher<T extends SimpleEvent> {
<E extends T> void publish(E event);
}
@@ -7,7 +7,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
import java.util.function.Consumer;
public final class TypedEventBus {
public final class TypedEventBus implements EventBusPublisher<SimpleEvent> {
private final AtomicLong nextSubscriptionId = new AtomicLong(1L);
private final ConcurrentMap<Class<?>, ConcurrentMap<Long, Consumer<Object>>> subscriptionsByType =
new ConcurrentHashMap<>();
@@ -40,7 +40,8 @@ public final class TypedEventBus {
};
}
public void publish(Object event) {
@Override
public <E extends SimpleEvent> void publish(E event) {
Objects.requireNonNull(event, "event");
final ConcurrentMap<Long, Consumer<Object>> subscriptions = subscriptionsByType.get(event.getClass());