-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommandToggleEditWand.java
More file actions
48 lines (38 loc) · 1.46 KB
/
CommandToggleEditWand.java
File metadata and controls
48 lines (38 loc) · 1.46 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
package kdx7214.necessities;
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 CommandToggleEditWand extends CommandBaseNecessities {
public CommandToggleEditWand() {
}
@Override
public String getCommandName()
{
return "toggleeditwand";
}
@Override
public String getCommandUsage(ICommandSender par1ICommandSender)
{
return "/" + getCommandName() ;
}
@Override
public void processCommand(ICommandSender sender, String[] par2ArrayOfStr)
{
boolean t = false ;
EntityPlayer player = getCommandSenderAsPlayer(sender) ;
NBTTagCompound playerdata = NecessitiesMain.instance.necessities_data.getCompoundTag(player.username) ;
NecessitiesMain.instance.necessities_data.setCompoundTag(player.username, playerdata) ;
if (playerdata.hasKey("[ToggleEditWand]")) {
t = playerdata.getBoolean("[ToggleEditWand]") ;
t = !t ;
}
playerdata.setBoolean("[ToggleEditWand]", t) ;
sender.sendChatToPlayer("Wand Status changed.") ;
} // public void processCommand(...)
@Override
public boolean canCommandSenderUseCommand(ICommandSender sender) {
return hasPermission(sender, "necessities.toggleeditwand", false, false) ;
} // public boolean canCommandSenderUseCommand(...)
} // public class CommandToggleEditWand