I want to make my players spawn but cannot spawn certain items
I can't figure out with this framework
my spawn method
Code:
case "add":
case "spawn":
case "pickup":
case "item":
if (parser.hasNext()) {
int id = parser.nextInt();
int amount = 1;
if (parser.hasNext()) {
long temp = Long.parseLong(parser.nextString().toLowerCase().replaceAll("k", "000").replaceAll("m", "000000").replaceAll("b","000000000"));
if (temp > Integer.MAX_VALUE) {
amount = Integer.MAX_VALUE;
} else {
amount = (int) temp;
}
}
if (player.inWGGame()) {
return true;
}
player.getInventory().add(id, amount);
ItemDefinition def = GameDefinitionLoader.getItemDef(id);
player.send(new SendMessage("You have spawed x@red@" + Utility.format(amount) + "</col> of the item @red@" + def.getName() + "</col>."));
}