mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-12 01:25:26 +02:00
Cleanup
This commit is contained in:
@@ -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"));
|
||||||
|
@@ -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]);
|
||||||
|
Reference in New Issue
Block a user