Cleaned up Command_setl. Don't use server.dispatchCommand for things that can be done with the existing API!

Fixed depreciation warnings on compile.
This commit is contained in:
Steven Lawson
2013-07-02 19:08:31 -04:00
parent 8751e0454c
commit d40d5b461d
6 changed files with 36 additions and 11 deletions

View File

@ -78,7 +78,7 @@ public class Command_doom extends TFM_Command
p.getWorld().strikeLightning(p.getLocation());
// kill (if not done already)
p.setHealth(0);
p.setHealth(0.0);
}
}, 40L); // 2 seconds

View File

@ -6,14 +6,39 @@ import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH)
@CommandParameters(description = "Sets everyone World Edit Limit to 500.", usage = "/<command>")
@CommandParameters(description = "Sets everyone's Worldedit block modification limit to 500.", usage = "/<command>")
public class Command_setl extends TFM_Command
{
@Override
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{
server.dispatchCommand(sender, "wildcard gcmd ? /limit 500");
TFM_Util.adminAction(sender.getName(), "Setting all online players block limit to 500.", true);
//server.dispatchCommand(sender, "wildcard gcmd ? /limit 500"); - Madgeek: No, no, hell no.
TFM_Util.adminAction(sender.getName(), "Setting everyone's Worldedit block modification limit to 500.", true);
for (final Player p : server.getOnlinePlayers())
{
final boolean isOp = p.isOp();
if (!isOp)
{
p.setOp(true);
}
server.dispatchCommand(p, "/limit 500");
if (!isOp)
{
server.getScheduler().runTaskLater(plugin, new Runnable()
{
@Override
public void run()
{
p.setOp(false);
}
}, 20L);
}
}
return true;
}

View File

@ -56,7 +56,7 @@ public class Command_smite extends TFM_Command
}
//Kill:
p.setHealth(0);
p.setHealth(0.0);
return true;
}

View File

@ -322,7 +322,7 @@ public class TFM_PlayerData
LivingEntity oldmob = mob_thrower_queue.remove(0);
if (oldmob != null)
{
oldmob.damage(500);
oldmob.damage(500.0);
}
}
}