Java Reference
In-Depth Information
description =
"Turn Creeper Cows on and off"
,
permissions = {
""
},
min = 2,
// Number of arguments
toolTip =
"/creepercows on|off"
)
public void
enabledCommand(MessageReceiver caller,
String[]
args) {
if
(caller
instanceof
Player) {
Player me = (Player)caller;
if
(args[1].equalsIgnoreCase(
"on"
) ||
args[1].equalsIgnoreCase(
"yes"
) ||
args[1].equalsIgnoreCase(
"true"
)) {
enabled = true;
me.chat(
"Creeper Cows are enabled"
);
// Start off with a few right here ;)
spawnCows(me.getLocation(), 25, 5);
}
else
{
enabled = false;
me.chat(
"Creeper Cows are disabled"
);
}
}
}
@Command(aliases = {
"testspawncows"
},
description =
"Test cow spawning"
,
permissions = {
""
},
min = 3,
// Number of arguments
toolTip =
"/testspawncows <size of square> <number to spawn>"
)
public void
testSpawnCommand(MessageReceiver caller,
String[]
args) {
if
(caller
instanceof
Player) {
Player me = (Player)caller;
Location loc = me.getLocation();
spawnCows(loc,
Integer
.parseInt(args[1]),
Integer
.parseInt(args[2]));
}
}
@Command(aliases = {
"testjump"
},
description =
"Test cow jumping"
,
permissions = {
""
},
min = 1,
// Number of arguments
toolTip =
"/testjump"
)
public void
testJumpCommand(MessageReceiver caller,
String[]
args) {
if
(caller
instanceof
Player) {
Player me = (Player)caller;
for
(Cow c : allCows.keySet()) {
CreeperCowTimer superCow = allCows.get(c);
superCow.jump(me.getLocation());
}
}
}