1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-12 01:25:26 +02:00
This commit is contained in:
snowleo
2013-01-01 23:17:34 +01:00
parent 3c39ee58e0
commit bca953a96e
2 changed files with 4 additions and 2 deletions

View File

@@ -33,11 +33,12 @@ public class Commandbigtree extends EssentialsCommand
@Override @Override
public void run(final IUser user, final String commandLabel, final String[] args) throws Exception public void run(final IUser user, final String commandLabel, final String[] args) throws Exception
{ {
final TreeType tree = BIGTREE_PARSER.parse(args).getValue().getBukkitType(); final BigTree bigTree = BIGTREE_PARSER.parse(args).getValue();
final TreeType bukkitTree = bigTree.getBukkitType();
final Location loc = LocationUtil.getTarget(user.getPlayer()); final Location loc = LocationUtil.getTarget(user.getPlayer());
final Location safeLocation = LocationUtil.getSafeDestination(loc); final Location safeLocation = LocationUtil.getSafeDestination(loc);
final boolean success = user.getPlayer().getWorld().generateTree(safeLocation, tree); final boolean success = user.getPlayer().getWorld().generateTree(safeLocation, bukkitTree);
if (success) if (success)
{ {
user.sendMessage(_("bigTreeSuccess")); user.sendMessage(_("bigTreeSuccess"));

View File

@@ -20,6 +20,7 @@ public class IntegerConverter implements ArgumentsParser<Integer>, Serializer<In
public ParserResult<Integer> parse(final String... args) public ParserResult<Integer> parse(final String... args)
{ {
Validate.notEmpty(args); Validate.notEmpty(args);
Validate.notEmpty(args[0]);
try try
{ {
final int number = Integer.parseInt(args[0]); final int number = Integer.parseInt(args[0]);