mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-06 23:22:10 -07:00
Tag Lifecycle Events (#10993)
* wip tags * use generics in tag registrars * comment out varargs methods for now * split up patch * cache loaded service provider * finish renames * use builderWithExpectedSize * finalize
This commit is contained in:
@@ -468,6 +468,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public abstract boolean hasHandlers();
|
||||
+
|
||||
+ public abstract void forEachHandler(E event, Consumer<RegisteredHandler<O, E>> consumer, Predicate<RegisteredHandler<O, E>> predicate);
|
||||
+
|
||||
+ public abstract void removeMatching(Predicate<RegisteredHandler<O, E>> predicate);
|
||||
@@ -505,7 +507,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+public final class LifecycleEventTypeProviderImpl implements LifecycleEventTypeProvider {
|
||||
+
|
||||
+ public static LifecycleEventTypeProviderImpl instance() {
|
||||
+ return (LifecycleEventTypeProviderImpl) LifecycleEventTypeProvider.PROVIDER;
|
||||
+ return (LifecycleEventTypeProviderImpl) LifecycleEventTypeProvider.provider();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
@@ -550,6 +552,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean hasHandlers() {
|
||||
+ return !this.handlers.isEmpty();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public MonitorLifecycleEventHandlerConfigurationImpl<O, E> newHandler(final LifecycleEventHandler<? super E> handler) {
|
||||
+ return new MonitorLifecycleEventHandlerConfigurationImpl<>(handler, this);
|
||||
+ }
|
||||
@@ -652,6 +659,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean hasHandlers() {
|
||||
+ return !this.handlers.isEmpty();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ protected void register(final O owner, final AbstractLifecycleEventHandlerConfiguration<O, E> config) {
|
||||
+ Preconditions.checkArgument(config instanceof PrioritizedLifecycleEventHandlerConfigurationImpl<?, ?>, "Configuration must be a PrioritizedLifecycleEventHandlerConfiguration");
|
||||
+ this.handlers.add(new RegisteredHandler<>(owner, config));
|
||||
|
Reference in New Issue
Block a user