forked from LogBlock/LogBlock
v0.5c
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user