diff options
author | Sychic <Sychic@github.com> | 2020-12-17 21:43:37 -0500 |
---|---|---|
committer | Sychic <Sychic@github.com> | 2020-12-17 21:43:37 -0500 |
commit | c64eea238237c80a0c8361685ce8b9e01d61f9cb (patch) | |
tree | 2e14d4b302b3f79d7e1a0f1711bbc7d8636db2a5 /src/main/java/me/Danker/commands/SetPartyCommand.java | |
parent | 7032f3ee8bd86d430e9aac7d641b849171fe2472 (diff) | |
download | SkyblockMod-c64eea238237c80a0c8361685ce8b9e01d61f9cb.tar.gz SkyblockMod-c64eea238237c80a0c8361685ce8b9e01d61f9cb.tar.bz2 SkyblockMod-c64eea238237c80a0c8361685ce8b9e01d61f9cb.zip |
Add Repartying
Diffstat (limited to 'src/main/java/me/Danker/commands/SetPartyCommand.java')
-rw-r--r-- | src/main/java/me/Danker/commands/SetPartyCommand.java | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/main/java/me/Danker/commands/SetPartyCommand.java b/src/main/java/me/Danker/commands/SetPartyCommand.java new file mode 100644 index 0000000..f840527 --- /dev/null +++ b/src/main/java/me/Danker/commands/SetPartyCommand.java @@ -0,0 +1,46 @@ +package me.Danker.commands; + +import me.Danker.DankersSkyblockMod; +import net.minecraft.client.Minecraft; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommand; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; + +public class SetPartyCommand extends CommandBase implements ICommand { + + public static boolean set = false; + + @Override + public String getCommandName() { return "setparty"; } + public static String getName() { return "setparty"; } + + @Override + public String getCommandUsage(ICommandSender sender) { return "/" + getCommandName() + " <Party members>"; } + public static String getUsage(){ return "/" + getName() + " <Party members>"; } + + @Override + public int getRequiredPermissionLevel() { return 0; } + + @Override + public void processCommand(ICommandSender sender, String[] args) throws CommandException { + final EntityPlayer player = (EntityPlayer) sender; + + if(args.length == 0) { + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(sender))); + return; + } + + RepartyCommand.players = args; + + String members = String.join("\n" + EnumChatFormatting.GOLD,RepartyCommand.players); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------\n" + + EnumChatFormatting.GOLD + members + "\n" + + DankersSkyblockMod.DELIMITER_COLOUR + "" + EnumChatFormatting.BOLD + "-------------------")); + + set = true; + } +} |