aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/example/commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/example/commands')
-rw-r--r--src/main/java/com/example/commands/ClientCommandBase.java27
-rw-r--r--src/main/java/com/example/commands/Commands.java14
-rw-r--r--src/main/java/com/example/commands/EnchantRuneCommand.java23
-rw-r--r--src/main/java/com/example/commands/HelpCommand.java23
4 files changed, 87 insertions, 0 deletions
diff --git a/src/main/java/com/example/commands/ClientCommandBase.java b/src/main/java/com/example/commands/ClientCommandBase.java
new file mode 100644
index 0000000..566fb6e
--- /dev/null
+++ b/src/main/java/com/example/commands/ClientCommandBase.java
@@ -0,0 +1,27 @@
+package com.example.commands;
+
+import net.minecraft.command.CommandBase;
+import net.minecraft.command.ICommandSender;
+
+public abstract class ClientCommandBase extends CommandBase {
+ private final String name;
+
+ protected ClientCommandBase(String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String getCommandName() {
+ return name;
+ }
+
+ @Override
+ public String getCommandUsage(ICommandSender sender) {
+ return "/" + name;
+ }
+
+ @Override
+ public boolean canCommandSenderUseCommand(ICommandSender sender) {
+ return true;
+ }
+}
diff --git a/src/main/java/com/example/commands/Commands.java b/src/main/java/com/example/commands/Commands.java
new file mode 100644
index 0000000..4a3db44
--- /dev/null
+++ b/src/main/java/com/example/commands/Commands.java
@@ -0,0 +1,14 @@
+package com.example.commands;
+
+import com.example.commands.HelpCommand;
+import net.minecraftforge.client.ClientCommandHandler;
+
+public class Commands {
+ public Commands() {
+ // Help Commands
+ ClientCommandHandler.instance.registerCommand(new HelpCommand());
+
+ // General
+ ClientCommandHandler.instance.registerCommand(new EnchantRuneCommand());
+ }
+} \ No newline at end of file
diff --git a/src/main/java/com/example/commands/EnchantRuneCommand.java b/src/main/java/com/example/commands/EnchantRuneCommand.java
new file mode 100644
index 0000000..98296ae
--- /dev/null
+++ b/src/main/java/com/example/commands/EnchantRuneCommand.java
@@ -0,0 +1,23 @@
+package com.example.commands;
+
+import com.example.Settings;
+import com.example.commands.ClientCommandBase;
+import net.minecraft.client.Minecraft;
+import net.minecraft.command.CommandException;
+import net.minecraft.command.ICommandSender;
+import net.minecraft.util.ChatComponentText;
+import net.minecraft.util.EnumChatFormatting;
+
+public class EnchantRuneCommand extends ClientCommandBase {
+
+ public EnchantRuneCommand() {
+ super("enchantrune");
+ }
+
+ @Override
+ public void processCommand(ICommandSender sender, String[] args) throws CommandException {
+ Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(
+ EnumChatFormatting.BLACK+ "" + EnumChatFormatting.BOLD + "TOGGLED."));
+ Settings.EnchantRune = !Settings.EnchantRune;
+ }
+} \ No newline at end of file
diff --git a/src/main/java/com/example/commands/HelpCommand.java b/src/main/java/com/example/commands/HelpCommand.java
new file mode 100644
index 0000000..603fbdc
--- /dev/null
+++ b/src/main/java/com/example/commands/HelpCommand.java
@@ -0,0 +1,23 @@
+package com.example.commands;
+
+import com.example.commands.ClientCommandBase;
+import net.minecraft.client.Minecraft;
+import net.minecraft.command.CommandException;
+import net.minecraft.command.ICommandSender;
+import net.minecraft.util.ChatComponentText;
+import net.minecraft.util.EnumChatFormatting;
+
+public class HelpCommand extends ClientCommandBase {
+
+ public HelpCommand() {
+ super("dulkir");
+ }
+
+ @Override
+ public void processCommand(ICommandSender sender, String[] args) throws CommandException {
+ Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(
+ EnumChatFormatting.GOLD + "HI THIS IS DULKIRMOD"));
+ Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(
+ EnumChatFormatting.GRAY + "/enchantrune - toggles enchant rune visibility."));
+ }
+} \ No newline at end of file