forked from LogBlock/LogBlock
Added total block changes count to /lb me
This commit is contained in:
@@ -243,8 +243,9 @@ public class CommandsHandler implements CommandExecutor
|
||||
final Player player = (Player)sender;
|
||||
final QueryParams params = new QueryParams(logblock);
|
||||
params.setPlayer(player.getName());
|
||||
params.sum = SummarizationMode.TYPES;
|
||||
params.world = player.getWorld();
|
||||
player.sendMessage("Total block changes: " + logblock.getCount(params));
|
||||
params.sum = SummarizationMode.TYPES;
|
||||
new CommandLookup(sender, params, true);
|
||||
} else
|
||||
sender.sendMessage(ChatColor.RED + "You aren't allowed to do this.");
|
||||
|
@@ -302,9 +302,11 @@ public class LogBlock extends JavaPlugin
|
||||
throw new SQLException("No connection");
|
||||
try {
|
||||
state = conn.createStatement();
|
||||
params.needCount = true;
|
||||
final ResultSet rs = state.executeQuery(params.getQuery());
|
||||
rs.next();
|
||||
final QueryParams p = params.clone();
|
||||
p.needCount = true;
|
||||
final ResultSet rs = state.executeQuery(p.getQuery());
|
||||
if (!rs.next())
|
||||
return 0;
|
||||
return rs.getInt(1);
|
||||
} finally {
|
||||
if (state != null)
|
||||
|
Reference in New Issue
Block a user