This commit is contained in:
Robin Kupper
2011-03-10 13:19:15 +01:00
parent 6ad8ddb639
commit 1689f8d433
3 changed files with 14 additions and 3 deletions

View File

@@ -359,7 +359,7 @@ public class LogBlock extends JavaPlugin
event.setCancelled(true);
Connection conn = getConnection();
String table = GetTable(event.getPlayer().getWorld().getName());
if (!CheckPermission(event.getPlayer(),"logblock.rollback")) {
if (!CheckPermission(event.getPlayer(),"logblock.area")) {
event.getPlayer().sendMessage("<EFBFBD>cInsufficient permissions");
return;
}

View File

@@ -84,11 +84,22 @@ public class Rollback implements Runnable
int changes = edits.size();
int rolledBack = 0;
player.sendMessage(ChatColor.GREEN + "" + changes + " Changes found.");
int counter = 0;
Edit e = edits.poll();
while (e != null)
{
if (e.perform())
rolledBack++;
counter++;
if (counter > 100) {
try {
Thread.sleep(100);
} catch (InterruptedException ex) {
LogBlock.log.log(Level.SEVERE, this.getClass().getName() + " SQL exception", ex);
player.sendMessage("<EFBFBD>cError, check server logs.");
}
counter = 0;
}
e = edits.poll();
}
player.sendMessage(ChatColor.GREEN + "Rollback finished successfully");
@@ -116,7 +127,7 @@ public class Rollback implements Runnable
public boolean perform()
{
Block block = world.getBlockAt(x, y, z);
if (block.getTypeId() == type || (block.getTypeId() >= 8 && block.getTypeId() <= 11)) {
if (block.getTypeId() == type || (block.getTypeId() >= 8 && block.getTypeId() <= 11) || block.getTypeId() == 51) {
if (block.setTypeId(replaced)) {
block.setData(data);
return true;

View File

@@ -1,5 +1,5 @@
name: LogBlock
version: 0.5b
version: 0.5c
author: DiddiZ, bootswithdefer
website: http://www.diddiz.de/minecraft/
main: de.diddiz.LogBlock.LogBlock