forked from regelneef/necessities
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommandSetHomeCount.java
More file actions
59 lines (41 loc) · 1.53 KB
/
CommandSetHomeCount.java
File metadata and controls
59 lines (41 loc) · 1.53 KB
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
package kdx7214.necessities;
import java.util.List;
import java.util.Set;
import cpw.mods.fml.common.Loader;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.server.MinecraftServer;
import net.minecraft.src.ModLoader;
public class CommandSetHomeCount extends CommandBaseNecessities {
public CommandSetHomeCount() {
}
public String getCommandName()
{
return "sethomecount";
}
public String getCommandUsage(ICommandSender par1ICommandSender)
{
return "/" + getCommandName() + " #" ;
}
public void processCommand(ICommandSender sender, String[] par2ArrayOfStr)
{
EntityPlayer player = getCommandSenderAsPlayer(sender) ;
if (par2ArrayOfStr.length != 1) {
player.addChatMessage("Usage: /" + getCommandName() + " #") ;
return ;
}
int hc = new Integer(par2ArrayOfStr[0]) ;
if (hc < 1 || hc > 10) {
player.addChatMessage("# homes must be between 1 and 10") ;
return ;
}
NecessitiesMain.instance.necessities_data.setInteger("[HomeCount]", hc) ;
} // public void processCommand(...)
@Override
public boolean canCommandSenderUseCommand(ICommandSender sender) {
return hasPermission(sender, "necessities.sethomecount", true, false) ;
} // public boolean canCommandSenderUseCommand(...)
} // public class CommandSetHomeCount