diff options
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/commands/ScreenCommand.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/commands/ScreenCommand.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/ScreenCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/ScreenCommand.java new file mode 100644 index 00000000..29dd9d55 --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/ScreenCommand.java @@ -0,0 +1,26 @@ +package io.github.moulberry.notenoughupdates.commands; + +import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; + +public class ScreenCommand extends ClientCommandBase { + + private final ScreenOpener opener; + + protected ScreenCommand(String name, ScreenOpener opener) { + super(name); + this.opener = opener; + } + + @Override + public void processCommand(ICommandSender sender, String[] args) throws CommandException { + NotEnoughUpdates.INSTANCE.openGui = opener.open(); + } + + @FunctionalInterface + public interface ScreenOpener { + GuiScreen open(); + } +} |
