mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-12 04:20:41 +00:00
Code cleanup
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1572 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
parent
09e17a4d6c
commit
3e359b5b48
4 changed files with 21 additions and 18 deletions
|
@ -249,7 +249,7 @@ public class Essentials extends JavaPlugin implements IEssentials
|
||||||
}
|
}
|
||||||
String[] retval = new String[lines.size()];
|
String[] retval = new String[lines.size()];
|
||||||
|
|
||||||
if (lines == null || lines.isEmpty() || lines.get(0) == null)
|
if (lines.isEmpty() || lines.get(0) == null)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,10 +23,9 @@ public class Commandantioch extends EssentialsCommand
|
||||||
ess.broadcastMessage(user.getName(), "...lobbest thou thy Holy Hand Grenade of Antioch towards thy foe,");
|
ess.broadcastMessage(user.getName(), "...lobbest thou thy Holy Hand Grenade of Antioch towards thy foe,");
|
||||||
ess.broadcastMessage(user.getName(), "who being naughty in My sight, shall snuff it.");
|
ess.broadcastMessage(user.getName(), "who being naughty in My sight, shall snuff it.");
|
||||||
|
|
||||||
Location loc = user.getLocation();
|
final World world = ((CraftWorld)user.getWorld()).getHandle();
|
||||||
World world = ((CraftWorld)user.getWorld()).getHandle();
|
final Location loc = new TargetBlock(user).getTargetBlock().getLocation();
|
||||||
loc = new TargetBlock(user).getTargetBlock().getLocation();
|
final EntityTNTPrimed tnt = new EntityTNTPrimed(world, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
|
||||||
EntityTNTPrimed tnt = new EntityTNTPrimed(world, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
|
|
||||||
world.addEntity(tnt);
|
world.addEntity(tnt);
|
||||||
world.makeSound(tnt, "random.fuse", 1.0F, 1.0F);
|
world.makeSound(tnt, "random.fuse", 1.0F, 1.0F);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,23 +22,27 @@ public class Commandban extends EssentialsCommand
|
||||||
throw new NotEnoughArgumentsException();
|
throw new NotEnoughArgumentsException();
|
||||||
}
|
}
|
||||||
|
|
||||||
User p = null;
|
|
||||||
if (server.matchPlayer(args[0]).isEmpty())
|
if (server.matchPlayer(args[0]).isEmpty())
|
||||||
{
|
{
|
||||||
((CraftServer)server).getHandle().a(args[0]);
|
((CraftServer)server).getHandle().a(args[0]);
|
||||||
sender.sendMessage(Util.format("playerBanned",args[0]));
|
sender.sendMessage(Util.format("playerBanned", args[0]));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
p = ess.getUser(server.matchPlayer(args[0]).get(0));
|
final User player = ess.getUser(server.matchPlayer(args[0]).get(0));
|
||||||
String banReason = Util.i18n("defaultBanReason");
|
String banReason;
|
||||||
if(args.length > 1) {
|
if (args.length > 1)
|
||||||
|
{
|
||||||
banReason = getFinalArg(args, 1);
|
banReason = getFinalArg(args, 1);
|
||||||
p.setBanReason(commandLabel);
|
player.setBanReason(commandLabel);
|
||||||
}
|
}
|
||||||
p.kickPlayer(banReason);
|
else
|
||||||
((CraftServer)server).getHandle().a(p.getName());
|
{
|
||||||
sender.sendMessage(Util.format("playerBanned", p.getName()));
|
banReason = Util.i18n("defaultBanReason");
|
||||||
|
}
|
||||||
|
player.kickPlayer(banReason);
|
||||||
|
((CraftServer)server).getHandle().a(player.getName());
|
||||||
|
sender.sendMessage(Util.format("playerBanned", player.getName()));
|
||||||
}
|
}
|
||||||
ess.loadBanList();
|
ess.loadBanList();
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ public class Commandbigtree extends EssentialsCommand
|
||||||
@Override
|
@Override
|
||||||
public void run(Server server, User user, String commandLabel, String[] args) throws Exception
|
public void run(Server server, User user, String commandLabel, String[] args) throws Exception
|
||||||
{
|
{
|
||||||
TreeType tree = TreeType.TREE;
|
TreeType tree;
|
||||||
if (args.length > 0 && args[0].equalsIgnoreCase("redwood"))
|
if (args.length > 0 && args[0].equalsIgnoreCase("redwood"))
|
||||||
{
|
{
|
||||||
tree = TreeType.TALL_REDWOOD;
|
tree = TreeType.TALL_REDWOOD;
|
||||||
|
@ -36,7 +36,7 @@ public class Commandbigtree extends EssentialsCommand
|
||||||
double z = user.getLocation().getZ();
|
double z = user.getLocation().getZ();
|
||||||
|
|
||||||
// offset tree in direction player is facing
|
// offset tree in direction player is facing
|
||||||
int r = (int)user.getCorrectedYaw();
|
final int r = (int)user.getCorrectedYaw();
|
||||||
if (r < 68 || r > 292) // north
|
if (r < 68 || r > 292) // north
|
||||||
{
|
{
|
||||||
x -= 3.0D;
|
x -= 3.0D;
|
||||||
|
@ -54,8 +54,8 @@ public class Commandbigtree extends EssentialsCommand
|
||||||
z += 3.0D;
|
z += 3.0D;
|
||||||
}
|
}
|
||||||
|
|
||||||
Location safeLocation = Util.getSafeDestination(new Location(user.getWorld(), x, y, z));
|
final Location safeLocation = Util.getSafeDestination(new Location(user.getWorld(), x, y, z));
|
||||||
boolean success = user.getWorld().generateTree(safeLocation, (TreeType)tree);
|
final boolean success = user.getWorld().generateTree(safeLocation, (TreeType)tree);
|
||||||
if (success)
|
if (success)
|
||||||
{
|
{
|
||||||
charge(user);
|
charge(user);
|
||||||
|
|
Loading…
Reference in a new issue