Skip to content

Commit

Permalink
Add more documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Emirlol committed Dec 24, 2024
1 parent 074b818 commit 82f1308
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/de/hysky/skyblocker/events/ChatEvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@
import net.fabricmc.fabric.api.event.Event;
import net.fabricmc.fabric.api.event.EventFactory;
import net.minecraft.text.Text;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Environment(EnvType.CLIENT)
public class ChatEvents {
/**
* This will be called when a game message is received, cancelled or not.
*
* @implNote Not fired when {@code overlay} is {@code true}. See {@link de.hysky.skyblocker.mixins.MessageHandlerMixin#skyblocker$monitorGameMessage(Text, boolean, CallbackInfo) the mixin} for more information.
*/
@SuppressWarnings("JavadocReference")
public static final Event<ChatTextEvent> RECEIVE_TEXT = EventFactory.createArrayBacked(ChatTextEvent.class, listeners -> message -> {
for (ChatTextEvent listener : listeners) {
listener.onMessage(message);
Expand All @@ -20,7 +24,10 @@ public class ChatEvents {
/**
* This will be called when a game message is received, cancelled or not.
* This method is called with the result of {@link Text#getString()} to avoid each listener having to call it.
*
* @implNote Not fired when {@code overlay} is {@code true}. See {@link de.hysky.skyblocker.mixins.MessageHandlerMixin#skyblocker$monitorGameMessage(Text, boolean, CallbackInfo) the mixin} for more information.
*/
@SuppressWarnings("JavadocReference")
public static final Event<ChatStringEvent> RECEIVE_STRING = EventFactory.createArrayBacked(ChatStringEvent.class, listeners -> message -> {
for (ChatStringEvent listener : listeners) {
listener.onMessage(message);
Expand Down

0 comments on commit 82f1308

Please sign in to comment.