From 8788c9c4b6d48cec94bc86e02a54f650aafff0b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sat, 10 Sep 2011 17:49:12 +0200 Subject: [PATCH] Code-Style --- .../main/java/bukkit/tommytony/war/War.java | 16 +++--- .../tommytony/war/WarBlockListener.java | 10 ++-- .../tommytony/war/WarCommandHandler.java | 4 +- .../tommytony/war/WarEntityListener.java | 14 ++--- .../tommytony/war/WarPlayerListener.java | 6 ++- .../war/command/WarzonesCommand.java | 2 +- .../java/com/tommytony/war/FlagReturn.java | 2 +- .../main/java/com/tommytony/war/Monument.java | 4 +- war/src/main/java/com/tommytony/war/Team.java | 4 +- .../main/java/com/tommytony/war/TeamKind.java | 1 + .../main/java/com/tommytony/war/WarHub.java | 4 +- .../main/java/com/tommytony/war/Warzone.java | 8 ++- .../java/com/tommytony/war/ZoneLobby.java | 12 ++--- .../java/com/tommytony/war/ZoneWallGuard.java | 4 +- .../war/jobs/HelmetProtectionTask.java | 8 +-- .../tommytony/war/jobs/LoadoutResetJob.java | 2 +- .../mappers/PreDeGaulleZoneVolumeMapper.java | 4 +- .../tommytony/war/mappers/PropertiesFile.java | 52 +++++++++---------- .../tommytony/war/mappers/VolumeMapper.java | 4 +- .../com/tommytony/war/mappers/WarMapper.java | 6 +-- .../tommytony/war/mappers/WarzoneMapper.java | 6 +-- .../war/mappers/ZoneVolumeMapper.java | 14 ++--- .../com/tommytony/war/utils/ChatFixUtil.java | 18 +++---- .../com/tommytony/war/volumes/BlockInfo.java | 4 +- .../tommytony/war/volumes/CenteredVolume.java | 2 +- .../tommytony/war/volumes/VerticalVolume.java | 4 +- .../com/tommytony/war/volumes/Volume.java | 4 +- .../com/tommytony/war/volumes/ZoneVolume.java | 4 +- 28 files changed, 116 insertions(+), 107 deletions(-) diff --git a/war/src/main/java/bukkit/tommytony/war/War.java b/war/src/main/java/bukkit/tommytony/war/War.java index ddbdd4f..be44193 100644 --- a/war/src/main/java/bukkit/tommytony/war/War.java +++ b/war/src/main/java/bukkit/tommytony/war/War.java @@ -31,7 +31,7 @@ import com.tommytony.war.utils.*; /** * Main class of War - * + * * @author tommytony, Tim Düsterhus * @package bukkit.tommytony.war */ @@ -164,7 +164,7 @@ public class War extends JavaPlugin { } this.getServer().getScheduler().cancelTasks(this); - + this.log("War v" + this.desc.getVersion() + " is off.", Level.INFO); this.setLoaded(false); } @@ -192,7 +192,7 @@ public class War extends JavaPlugin { /** * Converts the player-inventory to a loadout hashmap - * + * * @param inv * inventory to get the items from * @param loadout @@ -221,7 +221,7 @@ public class War extends JavaPlugin { /** * Converts the player-inventory to a loadout hashmap - * + * * @param player * player to get the inventory to get the items from * @param loadout @@ -497,7 +497,7 @@ public class War extends JavaPlugin { /** * Colors the teams and examples in messages - * + * * @param String * str message-string * @param String @@ -514,7 +514,7 @@ public class War extends JavaPlugin { /** * Logs a specified message with a specified level - * + * * @param String * str message to log * @param Level @@ -866,7 +866,7 @@ public class War extends JavaPlugin { } public TeamSpawnStyle getDefaultSpawnStyle() { - return defaultSpawnStyle; + return this.defaultSpawnStyle; } public void setDefaultSpawnStyle(TeamSpawnStyle defaultSpawnStyle) { @@ -878,7 +878,7 @@ public class War extends JavaPlugin { } public FlagReturn getDefaultFlagReturn() { - return defaultFlagReturn; + return this.defaultFlagReturn; } public HashMap getDisconnected() { diff --git a/war/src/main/java/bukkit/tommytony/war/WarBlockListener.java b/war/src/main/java/bukkit/tommytony/war/WarBlockListener.java index 8f51a7c..d405ace 100644 --- a/war/src/main/java/bukkit/tommytony/war/WarBlockListener.java +++ b/war/src/main/java/bukkit/tommytony/war/WarBlockListener.java @@ -19,9 +19,9 @@ import com.tommytony.war.Team; import com.tommytony.war.Warzone; /** - * + * * @author tommytony - * + * */ public class WarBlockListener extends BlockListener { @@ -187,7 +187,7 @@ public class WarBlockListener extends BlockListener { if (warzone.getFlagReturn() == FlagReturn.FLAG || warzone.getFlagReturn() == FlagReturn.SPAWN) { spawnOrFlag = warzone.getFlagReturn().toString(); } - + for (Team t : warzone.getTeams()) { t.teamcast(team.getKind().getColor() + player.getName() + ChatColor.WHITE + " stole team " + lostFlagTeam.getName() + "'s flag."); if (t.getName().equals(lostFlagTeam.getName())) { @@ -195,8 +195,8 @@ public class WarBlockListener extends BlockListener { + " from reaching team " + team.getName() + "'s " + spawnOrFlag + "."); } } - - + + War.war.msg(player, "You have team " + lostFlagTeam.getName() + "'s flag. Reach your team " + spawnOrFlag + " to capture it!"); } else { War.war.msg(player, "You can't steal team " + lostFlagTeam.getName() + "'s flag since no players are on that team."); diff --git a/war/src/main/java/bukkit/tommytony/war/WarCommandHandler.java b/war/src/main/java/bukkit/tommytony/war/WarCommandHandler.java index 01829b2..9689953 100644 --- a/war/src/main/java/bukkit/tommytony/war/WarCommandHandler.java +++ b/war/src/main/java/bukkit/tommytony/war/WarCommandHandler.java @@ -9,7 +9,7 @@ import bukkit.tommytony.war.command.*; /** * Handles commands received by War - * + * * @author Tim Düsterhus * @package bukkit.tommytony.war */ @@ -17,7 +17,7 @@ public class WarCommandHandler { /** * Handles a command - * + * * @param sender * The sender of the command * @param cmd diff --git a/war/src/main/java/bukkit/tommytony/war/WarEntityListener.java b/war/src/main/java/bukkit/tommytony/war/WarEntityListener.java index f7e259e..c42494e 100644 --- a/war/src/main/java/bukkit/tommytony/war/WarEntityListener.java +++ b/war/src/main/java/bukkit/tommytony/war/WarEntityListener.java @@ -25,7 +25,7 @@ import com.tommytony.war.Warzone; /** * Handles Entity-Events - * + * * @author tommytony, Tim Düsterhus * @package bukkit.tommytony.war */ @@ -33,7 +33,7 @@ public class WarEntityListener extends EntityListener { /** * Handles PVP-Damage - * + * * @param event * fired event */ @@ -133,7 +133,7 @@ public class WarEntityListener extends EntityListener { /** * Protects important structures from explosions - * + * * @see EntityListener.onEntityExplode() */ @Override @@ -166,7 +166,7 @@ public class WarEntityListener extends EntityListener { /** * Handles damage on Players - * + * * @see EntityListener.onEntityDamage() */ @Override @@ -227,7 +227,7 @@ public class WarEntityListener extends EntityListener { /** * Prevents creatures from spawning in warzones if no creatures is active - * + * * @see EntityListener.onCreatureSpawn() */ @Override @@ -246,7 +246,7 @@ public class WarEntityListener extends EntityListener { /** * Prevents health regaining caused by peaceful mode - * + * * @see EntityListener.onEntityRegainHealth() */ @Override @@ -254,7 +254,7 @@ public class WarEntityListener extends EntityListener { if (!War.war.isLoaded() || event.getRegainReason() != RegainReason.REGEN) { return; } - + Entity entity = event.getEntity(); if (!(entity instanceof Player)) { return; diff --git a/war/src/main/java/bukkit/tommytony/war/WarPlayerListener.java b/war/src/main/java/bukkit/tommytony/war/WarPlayerListener.java index e73f0fe..86f288d 100644 --- a/war/src/main/java/bukkit/tommytony/war/WarPlayerListener.java +++ b/war/src/main/java/bukkit/tommytony/war/WarPlayerListener.java @@ -37,7 +37,7 @@ public class WarPlayerListener extends PlayerListener { /** * Correctly removes quitting players from warzones - * + * * @see PlayerListener.onPlayerQuit() */ @Override @@ -376,7 +376,9 @@ public class WarPlayerListener extends PlayerListener { boolean inFlag = (playerTeam.getFlagVolume() != null && playerTeam.getFlagVolume().contains(player.getLocation())); if (playerWarzone.getFlagReturn() == FlagReturn.BOTH) { - if (!inSpawn && !inFlag) return; + if (!inSpawn && !inFlag) { + return; + } } else if (playerWarzone.getFlagReturn() == FlagReturn.SPAWN) { if (inFlag) { War.war.badMsg(player, "You have to capture the enemy flag at your team's spawn."); diff --git a/war/src/main/java/bukkit/tommytony/war/command/WarzonesCommand.java b/war/src/main/java/bukkit/tommytony/war/command/WarzonesCommand.java index c72b7f5..662a19f 100644 --- a/war/src/main/java/bukkit/tommytony/war/command/WarzonesCommand.java +++ b/war/src/main/java/bukkit/tommytony/war/command/WarzonesCommand.java @@ -11,7 +11,7 @@ import com.tommytony.war.Warzone; /** * Lists all warzones - * + * * @author Tim Düsterhus */ public class WarzonesCommand extends AbstractWarCommand { diff --git a/war/src/main/java/com/tommytony/war/FlagReturn.java b/war/src/main/java/com/tommytony/war/FlagReturn.java index eefcb9b..218be89 100644 --- a/war/src/main/java/com/tommytony/war/FlagReturn.java +++ b/war/src/main/java/com/tommytony/war/FlagReturn.java @@ -4,7 +4,7 @@ public enum FlagReturn { BOTH, FLAG, SPAWN; - + @Override public String toString() { return super.toString().toLowerCase(); diff --git a/war/src/main/java/com/tommytony/war/Monument.java b/war/src/main/java/com/tommytony/war/Monument.java index 5f491d3..25a29b2 100644 --- a/war/src/main/java/com/tommytony/war/Monument.java +++ b/war/src/main/java/com/tommytony/war/Monument.java @@ -8,9 +8,9 @@ import org.bukkit.block.BlockFace; import com.tommytony.war.volumes.Volume; /** - * + * * @author tommytony - * + * */ public class Monument { private Location location; diff --git a/war/src/main/java/com/tommytony/war/Team.java b/war/src/main/java/com/tommytony/war/Team.java index ef49278..7fcf2a6 100644 --- a/war/src/main/java/com/tommytony/war/Team.java +++ b/war/src/main/java/com/tommytony/war/Team.java @@ -15,9 +15,9 @@ import com.tommytony.war.utils.SignHelper; import com.tommytony.war.volumes.Volume; /** - * + * * @author tommytony - * + * */ public class Team { private List players = new ArrayList(); diff --git a/war/src/main/java/com/tommytony/war/TeamKind.java b/war/src/main/java/com/tommytony/war/TeamKind.java index 7049d3d..cb00fe6 100644 --- a/war/src/main/java/com/tommytony/war/TeamKind.java +++ b/war/src/main/java/com/tommytony/war/TeamKind.java @@ -52,6 +52,7 @@ public enum TeamKind { return this.material; } + @Override public String toString() { return super.toString().toLowerCase(); } diff --git a/war/src/main/java/com/tommytony/war/WarHub.java b/war/src/main/java/com/tommytony/war/WarHub.java index f461b3f..e03c4e5 100644 --- a/war/src/main/java/com/tommytony/war/WarHub.java +++ b/war/src/main/java/com/tommytony/war/WarHub.java @@ -15,7 +15,7 @@ import com.tommytony.war.volumes.BlockInfo; import com.tommytony.war.volumes.Volume; /** - * + * * @author tommytony, Tim Düsterhus * @package com.tommytony.war */ @@ -192,7 +192,7 @@ public class WarHub { /** * Resets the sign of the given warzone - * + * * @param Warzone * zone */ diff --git a/war/src/main/java/com/tommytony/war/Warzone.java b/war/src/main/java/com/tommytony/war/Warzone.java index f19011d..10b2ef6 100644 --- a/war/src/main/java/com/tommytony/war/Warzone.java +++ b/war/src/main/java/com/tommytony/war/Warzone.java @@ -265,9 +265,13 @@ public class Warzone { // nom drops for(Entity entity : (this.getWorld().getEntities())) { - if (!(entity instanceof Item) && !(entity instanceof CraftItem)) continue; + if (!(entity instanceof Item) && !(entity instanceof CraftItem)) { + continue; + } // validate position - if (!this.getVolume().contains(entity.getLocation())) continue; + if (!this.getVolume().contains(entity.getLocation())) { + continue; + } // omnomnomnom entity.remove(); diff --git a/war/src/main/java/com/tommytony/war/ZoneLobby.java b/war/src/main/java/com/tommytony/war/ZoneLobby.java index d03d822..83eb556 100644 --- a/war/src/main/java/com/tommytony/war/ZoneLobby.java +++ b/war/src/main/java/com/tommytony/war/ZoneLobby.java @@ -18,9 +18,9 @@ import com.tommytony.war.volumes.Volume; import com.tommytony.war.volumes.ZoneVolume; /** - * + * * @author tommytony - * + * */ public class ZoneLobby { private final Warzone warzone; @@ -41,7 +41,7 @@ public class ZoneLobby { /** * Use this constructor with /setzonelobby - * + * * @param war * @param warzone * @param wall @@ -59,7 +59,7 @@ public class ZoneLobby { /** * Use this constructor with /setzonelobby . Makes sure the lobby is not sticking inside the zone. - * + * * @param war * @param warzone * @param wall @@ -115,7 +115,7 @@ public class ZoneLobby { /** * Changes the lobby's position. Orientation is determined from the player location. Creates volume or resets. Saves new lobby blocks. - * + * * @param playerLocation */ public void setLocation(Location playerLocation) { @@ -174,7 +174,7 @@ public class ZoneLobby { /** * Classic way of creating a lobby. Lobby position goes to middle of zone wall. Creates volume or resets. Saves new lobby blocks. - * + * * @param newWall */ public void setWall(BlockFace newWall) { diff --git a/war/src/main/java/com/tommytony/war/ZoneWallGuard.java b/war/src/main/java/com/tommytony/war/ZoneWallGuard.java index 2f7033a..25c0ef6 100644 --- a/war/src/main/java/com/tommytony/war/ZoneWallGuard.java +++ b/war/src/main/java/com/tommytony/war/ZoneWallGuard.java @@ -14,9 +14,9 @@ import com.tommytony.war.volumes.BlockInfo; import bukkit.tommytony.war.War; /** - * + * * @author tommytony - * + * */ public class ZoneWallGuard { private Player player; diff --git a/war/src/main/java/com/tommytony/war/jobs/HelmetProtectionTask.java b/war/src/main/java/com/tommytony/war/jobs/HelmetProtectionTask.java index 812cce5..17db625 100644 --- a/war/src/main/java/com/tommytony/war/jobs/HelmetProtectionTask.java +++ b/war/src/main/java/com/tommytony/war/jobs/HelmetProtectionTask.java @@ -23,7 +23,9 @@ public class HelmetProtectionTask implements Runnable { * @see Runnable.run() */ public void run() { - if (!War.war.isLoaded()) return; + if (!War.war.isLoaded()) { + return; + } for (Warzone zone : War.war.getWarzones()) { for (Team team : zone.getTeams()) { for (Player player : team.getPlayers()) { @@ -33,7 +35,7 @@ public class HelmetProtectionTask implements Runnable { teamBlockMaterial = team.getKind().getMaterial(); // 1) Replace missing block head if (playerInv.getHelmet().getType() != teamBlockMaterial) { - playerInv.setHelmet(createBlockHead(team)); + playerInv.setHelmet(this.createBlockHead(team)); } // 2) Get rid of extra blocks in inventory: only keep one HashMap blocks = playerInv.all(teamBlockMaterial); @@ -48,7 +50,7 @@ public class HelmetProtectionTask implements Runnable { } i++; } - playerInv.setItem(playerInv.firstEmpty(), createBlockHead(team)); + playerInv.setItem(playerInv.firstEmpty(), this.createBlockHead(team)); if (removed > 1) { War.war.badMsg(player, "All that " + team.getName() + " wool must have been heavy!"); } diff --git a/war/src/main/java/com/tommytony/war/jobs/LoadoutResetJob.java b/war/src/main/java/com/tommytony/war/jobs/LoadoutResetJob.java index 2101670..8fca549 100644 --- a/war/src/main/java/com/tommytony/war/jobs/LoadoutResetJob.java +++ b/war/src/main/java/com/tommytony/war/jobs/LoadoutResetJob.java @@ -20,7 +20,7 @@ public class LoadoutResetJob implements Runnable { public void run() { this.zone.resetInventory(this.team, this.player); // Stop fire here, since doing it in the same tick as death doesn't extinguish it - player.setFireTicks(0); + this.player.setFireTicks(0); } } diff --git a/war/src/main/java/com/tommytony/war/mappers/PreDeGaulleZoneVolumeMapper.java b/war/src/main/java/com/tommytony/war/mappers/PreDeGaulleZoneVolumeMapper.java index 30f55ff..f43c6d6 100644 --- a/war/src/main/java/com/tommytony/war/mappers/PreDeGaulleZoneVolumeMapper.java +++ b/war/src/main/java/com/tommytony/war/mappers/PreDeGaulleZoneVolumeMapper.java @@ -30,9 +30,9 @@ import com.tommytony.war.volumes.ZoneVolume; /** * The ZoneVolumeMapper take the blocks from disk and sets them in the worlds, since the ZoneVolume doesn't hold its blocks in memory like regular Volumes. - * + * * @author tommytony - * + * */ public class PreDeGaulleZoneVolumeMapper { diff --git a/war/src/main/java/com/tommytony/war/mappers/PropertiesFile.java b/war/src/main/java/com/tommytony/war/mappers/PropertiesFile.java index 1812c34..254c313 100644 --- a/war/src/main/java/com/tommytony/war/mappers/PropertiesFile.java +++ b/war/src/main/java/com/tommytony/war/mappers/PropertiesFile.java @@ -10,7 +10,7 @@ import java.util.Properties; /** * Used for accessing and creating .[properties] files, reads them as utf-8, saves as utf-8. Internationalization is key importance especially for character codes. - * + * * @author Nijikokun * @version 1.0.4, %G% */ @@ -27,7 +27,7 @@ public final class PropertiesFile { /** * Creates or opens a properties file using specified filename - * + * * @param fileName */ public PropertiesFile(String fileName) { @@ -48,7 +48,7 @@ public final class PropertiesFile { /** * The loader for property files, it reads the file as UTF8 or converts the string into UTF8. Used for simple runthrough's, loading, or reloading of the file. - * + * * @throws IOException */ public void load() throws IOException { @@ -88,20 +88,20 @@ public final class PropertiesFile { * Returns a Map of all key=value properties in the file as <key (java.lang.String), value (java.lang.String)>
*
* Example:
- * + * *
 	 * PropertiesFile settings = new PropertiesFile("settings.properties");
 	 * Map<String, String> mappedSettings;
-	 * 
+	 *
 	 * try {
 	 * 	mappedSettings = settings.returnMap();
 	 * } catch (Exception ex) {
 	 * 	log.info("Failed mapping settings.properties");
 	 * }
 	 * 
- * + * *
- * + * * @return map - Simple Map HashMap of the entire key=value as <key (java.lang.String), value (java.lang.String)> * @throws Exception * If the properties file doesn't exist. @@ -113,7 +113,7 @@ public final class PropertiesFile { /** * Checks to see if the .[properties] file contains the given key. - * + * * @param var * The key we are going to be checking the existance of. * @return Boolean - True if the key exists, false if it cannot be found. @@ -124,7 +124,7 @@ public final class PropertiesFile { /** * Checks to see if this key exists in the .[properties] file. - * + * * @param var * The key we are grabbing the value of. * @return java.lang.String - True if the key exists, false if it cannot be found. @@ -135,7 +135,7 @@ public final class PropertiesFile { /** * Remove a key from the file if it exists. This will save() which will invoke a load() on the file. - * + * * @see #save() * @param var * The key that will be removed from the file @@ -149,7 +149,7 @@ public final class PropertiesFile { /** * Checks the existance of a key. - * + * * @see #containsKey(java.lang.String) * @param key * The key in question of existance. @@ -161,7 +161,7 @@ public final class PropertiesFile { /** * Returns the value of the key given as a String, however we do not set a string if no key is found. - * + * * @see #getProperty(java.lang.String) * @param key * The key we will retrieve the property from, if no key is found default to "" or empty. @@ -176,7 +176,7 @@ public final class PropertiesFile { /** * Returns the value of the key given as a String. If it is not found, it will invoke saving the default value to the properties file. - * + * * @see #setString(java.lang.String, java.lang.String) * @see #getProperty(java.lang.String) * @param key @@ -196,7 +196,7 @@ public final class PropertiesFile { /** * Save the value given as a String on the specified key. - * + * * @see #save() * @param key * The key that we will be addressing the value to. @@ -210,7 +210,7 @@ public final class PropertiesFile { /** * Returns the value of the key given in a Integer, however we do not set a string if no key is found. - * + * * @see #getProperty(String var) * @param key * The key we will retrieve the property from, if no key is found default to 0 @@ -225,7 +225,7 @@ public final class PropertiesFile { /** * Returns the int value of a key - * + * * @see #setInt(String key, int value) * @param key * The key that we will be grabbing the value from, if no value is found set and return value @@ -245,7 +245,7 @@ public final class PropertiesFile { /** * Save the value given as a int on the specified key. - * + * * @see #save() * @param key * The key that we will be addressing the value to. @@ -260,7 +260,7 @@ public final class PropertiesFile { /** * Returns the value of the key given in a Double, however we do not set a string if no key is found. - * + * * @see #getProperty(String var) * @param key * The key we will retrieve the property from, if no key is found default to 0.0 @@ -275,7 +275,7 @@ public final class PropertiesFile { /** * Returns the double value of a key - * + * * @see #setDouble(String key, double value) * @param key * The key that we will be grabbing the value from, if no value is found set and return value @@ -294,7 +294,7 @@ public final class PropertiesFile { /** * Save the value given as a double on the specified key. - * + * * @see #save() * @param key * The key that we will be addressing the value to. @@ -309,7 +309,7 @@ public final class PropertiesFile { /** * Returns the value of the key given in a Long, however we do not set a string if no key is found. - * + * * @see #getProperty(String var) * @param key * The key we will retrieve the property from, if no key is found default to 0L @@ -324,7 +324,7 @@ public final class PropertiesFile { /** * Returns the long value of a key - * + * * @see #setLong(String key, long value) * @param key * The key that we will be grabbing the value from, if no value is found set and return value @@ -343,7 +343,7 @@ public final class PropertiesFile { /** * Save the value given as a long on the specified key. - * + * * @see #save() * @param key * The key that we will be addressing the value to. @@ -358,7 +358,7 @@ public final class PropertiesFile { /** * Returns the value of the key given in a Boolean, however we do not set a string if no key is found. - * + * * @see #getProperty(String var) * @param key * The key we will retrieve the property from, if no key is found default to false @@ -373,7 +373,7 @@ public final class PropertiesFile { /** * Returns the boolean value of a key - * + * * @see #setBoolean(String key, boolean value) * @param key * The key that we will be grabbing the value from, if no value is found set and return value @@ -392,7 +392,7 @@ public final class PropertiesFile { /** * Save the value given as a boolean on the specified key. - * + * * @see #save() * @param key * The key that we will be addressing the value to. diff --git a/war/src/main/java/com/tommytony/war/mappers/VolumeMapper.java b/war/src/main/java/com/tommytony/war/mappers/VolumeMapper.java index 90540f9..1f8f497 100644 --- a/war/src/main/java/com/tommytony/war/mappers/VolumeMapper.java +++ b/war/src/main/java/com/tommytony/war/mappers/VolumeMapper.java @@ -20,9 +20,9 @@ import bukkit.tommytony.war.War; import com.tommytony.war.volumes.Volume; /** - * + * * @author tommytony - * + * */ public class VolumeMapper { diff --git a/war/src/main/java/com/tommytony/war/mappers/WarMapper.java b/war/src/main/java/com/tommytony/war/mappers/WarMapper.java index d1894f1..e186deb 100644 --- a/war/src/main/java/com/tommytony/war/mappers/WarMapper.java +++ b/war/src/main/java/com/tommytony/war/mappers/WarMapper.java @@ -17,9 +17,9 @@ import com.tommytony.war.jobs.RestoreWarhubJob; import com.tommytony.war.jobs.RestoreWarzonesJob; /** - * + * * @author tommytony - * + * */ public class WarMapper { @@ -239,7 +239,7 @@ public class WarMapper { // spawnStyle warConfig.setString("flagReturn", War.war.getDefaultFlagReturn().toString()); - + // defaultReward String defaultRewardStr = ""; HashMap rewardItems = War.war.getDefaultReward(); diff --git a/war/src/main/java/com/tommytony/war/mappers/WarzoneMapper.java b/war/src/main/java/com/tommytony/war/mappers/WarzoneMapper.java index 49cb442..2fe8233 100644 --- a/war/src/main/java/com/tommytony/war/mappers/WarzoneMapper.java +++ b/war/src/main/java/com/tommytony/war/mappers/WarzoneMapper.java @@ -24,9 +24,9 @@ import com.tommytony.war.volumes.Volume; import com.tommytony.war.volumes.ZoneVolume; /** - * + * * @author tommytony - * + * */ public class WarzoneMapper { @@ -370,7 +370,7 @@ public class WarzoneMapper { // spawnStyle warzoneConfig.setString("spawnStyle", warzone.getSpawnStyle().toString()); - + // flagReturn warzoneConfig.setString("flagReturn", warzone.getFlagReturn().toString()); diff --git a/war/src/main/java/com/tommytony/war/mappers/ZoneVolumeMapper.java b/war/src/main/java/com/tommytony/war/mappers/ZoneVolumeMapper.java index ba1265b..16e42ad 100644 --- a/war/src/main/java/com/tommytony/war/mappers/ZoneVolumeMapper.java +++ b/war/src/main/java/com/tommytony/war/mappers/ZoneVolumeMapper.java @@ -34,7 +34,7 @@ import com.tommytony.war.volumes.ZoneVolume; /** * The ZoneVolumeMapper take the blocks from disk and sets them in the worlds, since the ZoneVolume doesn't hold its blocks in memory like regular Volumes. - * + * * @author tommytony, Tim Düsterhus * @package com.tommytony.war.mappers */ @@ -42,7 +42,7 @@ public class ZoneVolumeMapper { /** * Loads the given volume - * + * * @param ZoneVolume * volume Volume to load * @param String @@ -277,7 +277,7 @@ public class ZoneVolumeMapper { /** * Parses an inventory string - * + * * @param String * invString string to parse * @return List Parsed items @@ -309,7 +309,7 @@ public class ZoneVolumeMapper { /** * Saves the given volume - * + * * @param Volume * volume Volume to save * @param String @@ -478,7 +478,7 @@ public class ZoneVolumeMapper { /** * Saves the Volume as a background-job - * + * * @param ZoneVolme * volume volume to save * @param String @@ -494,7 +494,7 @@ public class ZoneVolumeMapper { /** * Deletes the given volume - * + * * @param Volume * volume volume to delete * @param War @@ -510,7 +510,7 @@ public class ZoneVolumeMapper { /** * Deletes a volume file - * + * * @param String * path path of file * @param War diff --git a/war/src/main/java/com/tommytony/war/utils/ChatFixUtil.java b/war/src/main/java/com/tommytony/war/utils/ChatFixUtil.java index 192b7ee..361c98c 100644 --- a/war/src/main/java/com/tommytony/war/utils/ChatFixUtil.java +++ b/war/src/main/java/com/tommytony/war/utils/ChatFixUtil.java @@ -6,15 +6,15 @@ import org.bukkit.command.CommandSender; /** * The purpose of this tool is twofold: 1: Avoid client crashes due to bad color formating. 2: Make color continue on word wrapping - * + * * In minecraft the degree sign is used as a prefix to another char to create a color. For example the code for white is "\u00A7f". The "\u00A7" is the unicode notation for the degree sign and the "f" means white. - * + * * When does minecraft wrap the text? After how many chars? Answer: Because the font isn't monospace this differs depending on what you write. However we can fit 53 "M" without wrapping and the 54th char would then wrap (be at the beginning of the next line instead) As there is no broader char than "M" we can know for sure the minimum line length is 53. Note that this means the number of DISPLAYED chars per row is 53. A degree sign and the char after will NOT count, as they will not be displayed as chars. - * + * * Good to know: Numbers have the same font width as an M. - * + * * When does the client crash? Answer: When a row ends with a degree char and optionally another sign after. Another way to say the same: When a line ends with either a broken or valid color notation. AND The client will ALWAYS crash if the sign after the last displayed char in a row is a degree char. A goofy way to explatin it: For a line with only "M" and numbers, the fiftyfourth "displayed char" musn't be a degree sign. - * + * * WARNING: Above is a hypothesis I have created based on what my experiments have shown. I am fairly sure it is correct but please help me test it further. */ public class ChatFixUtil { @@ -23,13 +23,13 @@ public class ChatFixUtil { /** * This method wraps the msg for you at row lengths of 53, avoids client crash scenarios and makes the previous color continue on the next line. - * + * * The upsides with filtering your messages through this method are: - No client crashes. - Line wrapping with preserved color. - * + * * The downsides are: - The width of the chat window will not be used to it's fullest. For example you can fit more that 53 commas (,) in a chatwindow row but the line would break after 53 displayed chars. - * + * * Suggested usage: NO NEED TO USE the fix method for static help pages in your plugin. As the text is static you can make sure there is no client crash yourself and be able to use the full line length. - * + * * DO USE in cases like where you output colored messages with playernames in your plugin. As the player names have different length there is potential for client crash. */ public static ArrayList fix(String msg) { diff --git a/war/src/main/java/com/tommytony/war/volumes/BlockInfo.java b/war/src/main/java/com/tommytony/war/volumes/BlockInfo.java index 6e55f07..83d78ee 100644 --- a/war/src/main/java/com/tommytony/war/volumes/BlockInfo.java +++ b/war/src/main/java/com/tommytony/war/volumes/BlockInfo.java @@ -5,9 +5,9 @@ import org.bukkit.World; import org.bukkit.block.Block; /** - * + * * @author tommytony - * + * */ public class BlockInfo { private int x; diff --git a/war/src/main/java/com/tommytony/war/volumes/CenteredVolume.java b/war/src/main/java/com/tommytony/war/volumes/CenteredVolume.java index c3894d1..3898357 100644 --- a/war/src/main/java/com/tommytony/war/volumes/CenteredVolume.java +++ b/war/src/main/java/com/tommytony/war/volumes/CenteredVolume.java @@ -5,7 +5,7 @@ import org.bukkit.World; import org.bukkit.block.Block; /** - * + * * @author tommytony * @deprecated Broken, don't use. */ diff --git a/war/src/main/java/com/tommytony/war/volumes/VerticalVolume.java b/war/src/main/java/com/tommytony/war/volumes/VerticalVolume.java index 4644e73..fad1a4d 100644 --- a/war/src/main/java/com/tommytony/war/volumes/VerticalVolume.java +++ b/war/src/main/java/com/tommytony/war/volumes/VerticalVolume.java @@ -10,9 +10,9 @@ import org.bukkit.block.BlockFace; import bukkit.tommytony.war.War; /** - * + * * @author tommytony - * + * */ @Deprecated public class VerticalVolume extends Volume { diff --git a/war/src/main/java/com/tommytony/war/volumes/Volume.java b/war/src/main/java/com/tommytony/war/volumes/Volume.java index caf04b5..1af4790 100644 --- a/war/src/main/java/com/tommytony/war/volumes/Volume.java +++ b/war/src/main/java/com/tommytony/war/volumes/Volume.java @@ -22,9 +22,9 @@ import bukkit.tommytony.war.War; import com.tommytony.war.jobs.BlockResetJob; /** - * + * * @author tommytony - * + * */ public class Volume { private final String name; diff --git a/war/src/main/java/com/tommytony/war/volumes/ZoneVolume.java b/war/src/main/java/com/tommytony/war/volumes/ZoneVolume.java index 1f669da..1013398 100644 --- a/war/src/main/java/com/tommytony/war/volumes/ZoneVolume.java +++ b/war/src/main/java/com/tommytony/war/volumes/ZoneVolume.java @@ -11,9 +11,9 @@ import com.tommytony.war.Warzone; import com.tommytony.war.mappers.ZoneVolumeMapper; /** - * + * * @author tommytony - * + * */ public class ZoneVolume extends Volume {