2022-11-24 19:17:51 +01:00
|
|
|
package org.dynmap.fabric_1_19_3.event;
|
2022-11-24 19:16:07 +01:00
|
|
|
|
|
|
|
import net.fabricmc.fabric.api.event.Event;
|
|
|
|
import net.fabricmc.fabric.api.event.EventFactory;
|
|
|
|
import net.minecraft.server.network.ServerPlayerEntity;
|
|
|
|
|
|
|
|
public class ServerChatEvents {
|
|
|
|
private ServerChatEvents() {
|
|
|
|
}
|
|
|
|
|
|
|
|
public static Event<ServerChatCallback> EVENT = EventFactory.createArrayBacked(ServerChatCallback.class,
|
|
|
|
(listeners) -> (player, message) -> {
|
|
|
|
for (ServerChatCallback callback : listeners) {
|
|
|
|
callback.onChatMessage(player, message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
@FunctionalInterface
|
|
|
|
public interface ServerChatCallback {
|
|
|
|
void onChatMessage(ServerPlayerEntity player, String message);
|
|
|
|
}
|
|
|
|
}
|