diff --git a/src/main/java/com/pahimar/ee3/command/CommandEE.java b/src/main/java/com/pahimar/ee3/command/CommandEE.java index c6f69885..47f6f312 100644 --- a/src/main/java/com/pahimar/ee3/command/CommandEE.java +++ b/src/main/java/com/pahimar/ee3/command/CommandEE.java @@ -65,6 +65,8 @@ public class CommandEE extends CommandBase { modCommands.add(new CommandPlayerLearnEverything()); modCommands.add(new CommandPlayerLearnItem()); + modCommands.add(new CommandPlayerForgetEverything()); + modCommands.add(new CommandPlayerForgetItem()); modCommands.add(new CommandTemplateLearnEverything()); modCommands.add(new CommandTemplateLearnItem()); modCommands.add(new CommandTemplateForgetEverything()); diff --git a/src/main/java/com/pahimar/ee3/command/CommandPlayerForgetEverything.java b/src/main/java/com/pahimar/ee3/command/CommandPlayerForgetEverything.java new file mode 100644 index 00000000..65d385f4 --- /dev/null +++ b/src/main/java/com/pahimar/ee3/command/CommandPlayerForgetEverything.java @@ -0,0 +1,47 @@ +package com.pahimar.ee3.command; + +import com.pahimar.ee3.reference.Messages; +import com.pahimar.ee3.reference.Names; +import cpw.mods.fml.common.FMLCommonHandler; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; + +import java.util.List; + +public class CommandPlayerForgetEverything extends CommandBase +{ + @Override + public String getCommandName() + { + return Names.Commands.PLAYER_FORGET_EVERYTHING; + } + + @Override + public int getRequiredPermissionLevel() + { + return 2; + } + + @Override + public String getCommandUsage(ICommandSender commandSender) + { + return Messages.Commands.PLAYER_FORGET_EVERYTHING_USAGE; + } + + @Override + public void processCommand(ICommandSender commandSender, String[] args) + { + // TODO + } + + @Override + public List addTabCompletionOptions(ICommandSender commandSender, String[] args) + { + if (args.length == 2) + { + return getListOfStringsMatchingLastWord(args, FMLCommonHandler.instance().getMinecraftServerInstance().getAllUsernames()); + } + + return null; + } +} diff --git a/src/main/java/com/pahimar/ee3/command/CommandPlayerForgetItem.java b/src/main/java/com/pahimar/ee3/command/CommandPlayerForgetItem.java new file mode 100644 index 00000000..caaa81a4 --- /dev/null +++ b/src/main/java/com/pahimar/ee3/command/CommandPlayerForgetItem.java @@ -0,0 +1,52 @@ +package com.pahimar.ee3.command; + +import com.pahimar.ee3.reference.Messages; +import com.pahimar.ee3.reference.Names; +import cpw.mods.fml.common.FMLCommonHandler; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.item.Item; + +import java.util.List; + +public class CommandPlayerForgetItem extends CommandBase +{ + @Override + public String getCommandName() + { + return Names.Commands.PLAYER_FORGET_ITEM; + } + + @Override + public int getRequiredPermissionLevel() + { + return 2; + } + + @Override + public String getCommandUsage(ICommandSender commandSender) + { + return Messages.Commands.PLAYER_FORGET_ITEM_USAGE; + } + + @Override + public void processCommand(ICommandSender commandSender, String[] args) + { + // TODO + } + + @Override + public List addTabCompletionOptions(ICommandSender commandSender, String[] args) + { + if (args.length == 2) + { + return getListOfStringsMatchingLastWord(args, FMLCommonHandler.instance().getMinecraftServerInstance().getAllUsernames()); + } + else if (args.length == 3) + { + return getListOfStringsFromIterableMatchingLastWord(args, Item.itemRegistry.getKeys()); + } + + return null; + } +} diff --git a/src/main/java/com/pahimar/ee3/command/CommandPlayerLearnEverything.java b/src/main/java/com/pahimar/ee3/command/CommandPlayerLearnEverything.java index c88cbb3f..1877e699 100644 --- a/src/main/java/com/pahimar/ee3/command/CommandPlayerLearnEverything.java +++ b/src/main/java/com/pahimar/ee3/command/CommandPlayerLearnEverything.java @@ -1,7 +1,7 @@ package com.pahimar.ee3.command; +import com.pahimar.ee3.reference.Messages; import com.pahimar.ee3.reference.Names; -import com.pahimar.ee3.util.LogHelper; import cpw.mods.fml.common.FMLCommonHandler; import net.minecraft.command.CommandBase; import net.minecraft.command.ICommandSender; @@ -25,13 +25,13 @@ public class CommandPlayerLearnEverything extends CommandBase @Override public String getCommandUsage(ICommandSender commandSender) { - return "TODO"; + return Messages.Commands.PLAYER_LEARN_EVERYTHING_USAGE; } @Override public void processCommand(ICommandSender commandSender, String[] args) { - LogHelper.info("Teaching player everything"); + // TODO } @Override diff --git a/src/main/java/com/pahimar/ee3/command/CommandPlayerLearnItem.java b/src/main/java/com/pahimar/ee3/command/CommandPlayerLearnItem.java index cb1f3600..d766fe4a 100644 --- a/src/main/java/com/pahimar/ee3/command/CommandPlayerLearnItem.java +++ b/src/main/java/com/pahimar/ee3/command/CommandPlayerLearnItem.java @@ -1,5 +1,6 @@ package com.pahimar.ee3.command; +import com.pahimar.ee3.reference.Messages; import com.pahimar.ee3.reference.Names; import cpw.mods.fml.common.FMLCommonHandler; import net.minecraft.command.CommandBase; @@ -25,7 +26,7 @@ public class CommandPlayerLearnItem extends CommandBase @Override public String getCommandUsage(ICommandSender commandSender) { - return "TODO"; + return Messages.Commands.PLAYER_LEARN_ITEM_USAGE; } @Override