forked from public-mirrors/HuskSync
feat: add ModLoaded callback event on Fabric (#346)
Co-authored-by: William <will27528@gmail.com>feat/data-edit-commands
parent
0dee2e8319
commit
e7659255fe
@ -0,0 +1,39 @@
|
||||
/*
|
||||
* This file is part of HuskSync, licensed under the Apache License 2.0.
|
||||
*
|
||||
* Copyright (c) William278 <will27528@gmail.com>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package net.william278.husksync.event;
|
||||
|
||||
import net.fabricmc.fabric.api.event.Event;
|
||||
import net.fabricmc.fabric.api.event.EventFactory;
|
||||
import net.william278.husksync.api.HuskSyncAPI;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public interface ModLoadedCallback {
|
||||
|
||||
@NotNull
|
||||
Event<ModLoadedCallback> EVENT = EventFactory.createArrayBacked(
|
||||
ModLoadedCallback.class,
|
||||
(listeners) -> (api) -> Arrays.stream(listeners).forEach(listener -> listener.post(api))
|
||||
);
|
||||
|
||||
void post(@NotNull HuskSyncAPI api);
|
||||
|
||||
}
|
Loading…
Reference in New Issue