blob: d05c6be6cd66440d581357dcf5482ab5c2f8fe98 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
package rosegoldaddons.commands;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiChest;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ContainerChest;
import net.minecraft.inventory.Slot;
import net.minecraft.util.BlockPos;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.StringUtils;
import net.minecraftforge.client.event.GuiScreenEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import org.jetbrains.annotations.NotNull;
import rosegoldaddons.Main;
import rosegoldaddons.utils.ChatUtils;
import scala.actors.threadpool.Arrays;
import java.util.ArrayList;
import java.util.List;
public class Rosedrobe implements ICommand {
public static boolean openWardrobe = false;
public static int slot = 0;
int windowId;
@Override
public String getCommandName() {
return "rosedrobe";
}
@Override
public String getCommandUsage(ICommandSender sender) {
return "/" + getCommandName();
}
@Override
public List<String> getCommandAliases() {
return new ArrayList<>();
}
@Override
public void processCommand(ICommandSender sender, String[] args) throws CommandException {
if (args.length == 0) {
Minecraft.getMinecraft().thePlayer.sendChatMessage("/pets");
slot = 0;
openWardrobe = true;
} else {
if (isNumeric(args[0])) {
Minecraft.getMinecraft().thePlayer.sendChatMessage("/pets");
openWardrobe = true;
slot = Integer.parseInt(args[0]);
} else {
ChatUtils.sendMessage("§cInvalid Arguments.");
return;
}
}
}
@Override
public boolean canCommandSenderUseCommand(ICommandSender sender) {
return true;
}
@Override
public List<String> addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) {
return new ArrayList<>();
}
@Override
public boolean isUsernameIndex(String[] args, int index) {
return false;
}
private boolean isNumeric(String str) {
try {
Double.parseDouble(str);
return true;
} catch (NumberFormatException e) {
return false;
}
}
@Override
public int compareTo(@NotNull ICommand o) {
return 0;
}
}
|