An "invoker" is an object which hides multiple registered
37 | * listeners of type T under one instance of type T, executing
38 | * them and leaving early as necessary.
39 | *
40 | * @return The invoker instance.
41 | */
42 | public final T invoker() {
43 | return invoker;
44 | }
45 |
46 | /**
47 | * Register a listener to the event.
48 | *
49 | * @param listener The desired listener.
50 | */
51 | public abstract void register(T listener);
52 | }
--------------------------------------------------------------------------------
/legacy-api-base/src/main/java/net/fabricmc/fabric/impl/base/event/ArrayBackedEvent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package net.fabricmc.fabric.impl.base.event;
18 |
19 | import java.lang.reflect.Array;
20 | import java.util.Arrays;
21 | import java.util.function.Function;
22 |
23 | import net.fabricmc.fabric.api.event.Event;
24 |
25 | class ArrayBackedEvent Upon return:
22 | *
29 | * Get the event for this callback from a given registry using {@linkplain Registry#getEvent}.
30 | */
31 | @FunctionalInterface
32 | public interface RegistryEntryAddedCallback
28 | * Get the event for this callback from a given registry using {@linkplain Registry#getRemapEvent}.
29 | * @since 1.1.0
30 | */
31 | @FunctionalInterface
32 | public interface RegistryRemappedCallback
23 | *
27 | */
28 | @FunctionalInterface
29 | public interface BiomePlacementCallback {
30 | Event