Ensure formatting is consistant across all files.

This commit is contained in:
md_5
2012-06-23 18:16:23 +10:00
parent f1ea45ce83
commit 722c930e85
15 changed files with 315 additions and 295 deletions

View File

@@ -30,11 +30,11 @@ import java.util.logging.Level;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.block.BlockState;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.block.Sign;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
public class Consumer extends TimerTask
@@ -49,7 +49,8 @@ public class Consumer extends TimerTask
this.logblock = logblock;
try {
Class.forName("PlayerLeaveRow");
} catch (final ClassNotFoundException ex) {}
} catch (final ClassNotFoundException ex) {
}
}
/**
@@ -274,7 +275,8 @@ public class Consumer extends TimerTask
state = conn.createStatement();
final long start = System.currentTimeMillis();
int count = 0;
process: while (!queue.isEmpty() && (System.currentTimeMillis() - start < timePerRun || count < forceToProcessAtLeast)) {
process:
while (!queue.isEmpty() && (System.currentTimeMillis() - start < timePerRun || count < forceToProcessAtLeast)) {
final Row r = queue.poll();
if (r == null)
continue;

View File

@@ -62,7 +62,8 @@ public class DumpedLogImporter implements Runnable
if (conn != null)
try {
conn.close();
} catch (final SQLException ex) {}
} catch (final SQLException ex) {
}
}
}
}

View File

@@ -1,10 +1,13 @@
package de.diddiz.LogBlock;
public enum Logging {
BLOCKPLACE(true), BLOCKBREAK(true), SIGNTEXT, TNTEXPLOSION(true), CREEPEREXPLOSION(true), GHASTFIREBALLEXPLOSION(true), ENDERDRAGON(true), MISCEXPLOSION, FIRE(true), LEAVESDECAY, LAVAFLOW, WATERFLOW, CHESTACCESS, KILL, CHAT, SNOWFORM, SNOWFADE, DOORINTERACT, SWITCHINTERACT, CAKEEAT, ENDERMEN, NOTEBLOCKINTERACT, DIODEINTERACT, NATURALSTRUCTUREGROW, BONEMEALSTRUCTUREGROW;
public enum Logging
{
BLOCKPLACE(true), BLOCKBREAK(true), SIGNTEXT, TNTEXPLOSION(true), CREEPEREXPLOSION(true),
GHASTFIREBALLEXPLOSION(true), ENDERDRAGON(true), MISCEXPLOSION, FIRE(true), LEAVESDECAY,
LAVAFLOW, WATERFLOW, CHESTACCESS, KILL, CHAT, SNOWFORM, SNOWFADE, DOORINTERACT,
SWITCHINTERACT, CAKEEAT, ENDERMEN, NOTEBLOCKINTERACT, DIODEINTERACT, NATURALSTRUCTUREGROW,
BONEMEALSTRUCTUREGROW;
public static final int length = Logging.values().length;
private final boolean defaultEnabled;
private Logging() {

View File

@@ -452,7 +452,8 @@ public class QueryParams implements Cloneable
params.players = new ArrayList<String>(players);
params.types = new ArrayList<Integer>(types);
return params;
} catch (final CloneNotSupportedException ex) {}
} catch (final CloneNotSupportedException ex) {
}
return null;
}
@@ -487,15 +488,18 @@ public class QueryParams implements Cloneable
match = p.match;
}
public static enum BlockChangeType {
public static enum BlockChangeType
{
ALL, BOTH, CHESTACCESS, CREATED, DESTROYED, CHAT
}
public static enum Order {
public static enum Order
{
ASC, DESC
}
public static enum SummarizationMode {
public static enum SummarizationMode
{
NONE, PLAYERS, TYPES
}
}

View File

@@ -1,5 +1,6 @@
package de.diddiz.LogBlock;
public enum ToolBehavior {
public enum ToolBehavior
{
TOOL, BLOCK, NONE
}

View File

@@ -1,8 +1,8 @@
package de.diddiz.LogBlock;
public enum ToolMode {
public enum ToolMode
{
CLEARLOG("logblock.clearlog"), LOOKUP("logblock.lookup"), REDO("logblock.rollback"), ROLLBACK("logblock.rollback"), WRITELOGFILE("logblock.rollback");
private final String permission;
private ToolMode(String permission) {

View File

@@ -19,8 +19,8 @@ import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.BlockState;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.block.Sign;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import org.bukkit.material.Bed;
import org.bukkit.material.PistonBaseMaterial;
@@ -109,13 +109,15 @@ public class WorldEditor implements Runnable
for (final LookupCacheElement err : errorList)
writer.println(err.getMessage());
writer.close();
} catch (final Exception ex) {}
} catch (final Exception ex) {
}
errors = errorList.toArray(new WorldEditorException[errorList.size()]);
notify();
}
}
private static enum PerformResult {
private static enum PerformResult
{
SUCCESS, BLACKLISTED, NO_ACTION
}

View File

@@ -54,7 +54,8 @@ public class Config
public static Set<Integer> hiddenBlocks;
public static Set<String> hiddenPlayers;
public static enum LogKillsLevel {
public static enum LogKillsLevel
{
PLAYERS, MONSTERS, ANIMALS;
}

View File

@@ -29,7 +29,8 @@ public class BanListener implements Listener
p.setPlayer(split[1].equalsIgnoreCase("g") ? split[2] : split[1]);
p.since = 0;
p.silent = false;
getScheduler().scheduleAsyncDelayedTask(logblock, new Runnable() {
getScheduler().scheduleAsyncDelayedTask(logblock, new Runnable()
{
@Override
public void run() {
for (final World world : logblock.getServer().getWorlds())
@@ -37,7 +38,8 @@ public class BanListener implements Listener
p.world = world;
try {
handler.new CommandRollback(event.getPlayer(), p, false);
} catch (final Exception ex) {}
} catch (final Exception ex) {
}
}
}
});

View File

@@ -1,6 +1,5 @@
package de.diddiz.LogBlock.listeners;
import de.diddiz.LogBlock.LogBlock;
import static de.diddiz.util.BukkitUtils.compareInventories;
import static de.diddiz.util.BukkitUtils.compressInventory;
import static de.diddiz.util.BukkitUtils.rawData;
@@ -14,6 +13,7 @@ import org.bukkit.event.EventPriority;
import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.event.inventory.InventoryOpenEvent;
import org.bukkit.inventory.ItemStack;
import de.diddiz.LogBlock.LogBlock;
public class ChestAccessLogging extends LoggingListener
{

View File

@@ -4,6 +4,7 @@ import static de.diddiz.LogBlock.Session.getSession;
import static de.diddiz.LogBlock.Session.hasSession;
import static de.diddiz.LogBlock.config.Config.isLogged;
import static de.diddiz.LogBlock.config.Config.toolsByType;
import com.sk89q.worldedit.bukkit.selections.CuboidSelection;
import java.util.Map.Entry;
import org.bukkit.ChatColor;
import org.bukkit.block.Block;
@@ -16,7 +17,6 @@ import org.bukkit.event.player.PlayerChangedWorldEvent;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack;
import com.sk89q.worldedit.bukkit.selections.CuboidSelection;
import de.diddiz.LogBlock.CommandsHandler;
import de.diddiz.LogBlock.LogBlock;
import de.diddiz.LogBlock.QueryParams;

View File

@@ -13,11 +13,11 @@ import org.bukkit.Chunk;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.block.BlockState;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.entity.TNTPrimed;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
public class BukkitUtils

View File

@@ -102,7 +102,8 @@ public class MySQLConnectionPool implements Closeable
while (true) {
try {
Thread.sleep(300000);
} catch (final InterruptedException e) {}
} catch (final InterruptedException e) {
}
reapConnections();
}
}
@@ -428,7 +429,8 @@ public class MySQLConnectionPool implements Closeable
void terminate() {
try {
conn.close();
} catch (final SQLException ex) {}
} catch (final SQLException ex) {
}
}
}
}

View File

@@ -59,7 +59,8 @@ public class Utils
try {
Integer.parseInt(str);
return true;
} catch (final NumberFormatException ex) {}
} catch (final NumberFormatException ex) {
}
return false;
}
@@ -67,7 +68,8 @@ public class Utils
try {
Byte.parseByte(str);
return true;
} catch (final NumberFormatException ex) {}
} catch (final NumberFormatException ex) {
}
return false;
}