From 2aeadc2dd30c23aac6bb1d0a349720f28f2609ec Mon Sep 17 00:00:00 2001 From: SHsuperCM Date: Sat, 5 Mar 2022 08:25:26 +0200 Subject: Documentation (18/44, 0/35) --- .../shsupercm/fabric/citresewn/mixin/ChatScreenMixin.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/main/java/shcm/shsupercm/fabric/citresewn/mixin/ChatScreenMixin.java') diff --git a/src/main/java/shcm/shsupercm/fabric/citresewn/mixin/ChatScreenMixin.java b/src/main/java/shcm/shsupercm/fabric/citresewn/mixin/ChatScreenMixin.java index 5bacbde..c79143b 100644 --- a/src/main/java/shcm/shsupercm/fabric/citresewn/mixin/ChatScreenMixin.java +++ b/src/main/java/shcm/shsupercm/fabric/citresewn/mixin/ChatScreenMixin.java @@ -9,14 +9,23 @@ import net.minecraft.text.Text; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.ModifyArg; +import shcm.shsupercm.fabric.citresewn.CITResewnCommand; import shcm.shsupercm.fabric.citresewn.config.CITResewnConfigScreenFactory; import static shcm.shsupercm.fabric.citresewn.CITResewnCommand.openConfig; +/** + * Opens the config screen when running the "/citresewn config" command. + * @see CITResewnCommand#openConfig + */ @Mixin(ChatScreen.class) public class ChatScreenMixin { + /** + * If {@link CITResewnCommand#openConfig} is true, changes the screen that's opened when the chat is closed to the config screen. + * @see CITResewnCommand#openConfig + */ @ModifyArg(method = "keyPressed", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/MinecraftClient;setScreen(Lnet/minecraft/client/gui/screen/Screen;)V")) - public Screen redirectConfigScreen(Screen original) { + public Screen citresewn$redirectConfigScreen(Screen original) { if (openConfig) { openConfig = false; return FabricLoader.getInstance().isModLoaded("cloth-config2") ? -- cgit