diff --git a/src/org/apollo/fs/package-info.java b/src/org/apollo/fs/package-info.java index 1ddba019..6353ab6e 100644 --- a/src/org/apollo/fs/package-info.java +++ b/src/org/apollo/fs/package-info.java @@ -1,5 +1,4 @@ /** - * Contains classes which deal with the file system that the client uses to - * store game data files. + * Contains classes which deal with the file system that the client uses to store game data files. */ package org.apollo.fs; \ No newline at end of file diff --git a/src/org/apollo/game/GameService.java b/src/org/apollo/game/GameService.java index efdbab2a..bb5d39b1 100644 --- a/src/org/apollo/game/GameService.java +++ b/src/org/apollo/game/GameService.java @@ -49,8 +49,7 @@ public final class GameService extends Service { /** * The scheduled executor service. */ - private final ScheduledExecutorService scheduledExecutor = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory( - "GameService")); + private final ScheduledExecutorService scheduledExecutor = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("GameService")); /** * The {@link ClientSynchronizer}. @@ -170,8 +169,7 @@ public final class GameService extends Service { */ @Override public void start() { - scheduledExecutor.scheduleAtFixedRate(new GamePulseHandler(this), GameConstants.PULSE_DELAY, GameConstants.PULSE_DELAY, - TimeUnit.MILLISECONDS); + scheduledExecutor.scheduleAtFixedRate(new GamePulseHandler(this), GameConstants.PULSE_DELAY, GameConstants.PULSE_DELAY, TimeUnit.MILLISECONDS); } /** diff --git a/src/org/apollo/game/action/package-info.java b/src/org/apollo/game/action/package-info.java index ab52281b..a89acf1d 100644 --- a/src/org/apollo/game/action/package-info.java +++ b/src/org/apollo/game/action/package-info.java @@ -1,5 +1,4 @@ /** - * Contains classes related to actions, specialised scheduled tasks which - * mobs perform. + * Contains classes related to actions, specialised scheduled tasks which mobs perform. */ package org.apollo.game.action; \ No newline at end of file diff --git a/src/org/apollo/game/message/handler/MessageHandlerChain.java b/src/org/apollo/game/message/handler/MessageHandlerChain.java index 96e20db5..7954d7ef 100644 --- a/src/org/apollo/game/message/handler/MessageHandlerChain.java +++ b/src/org/apollo/game/message/handler/MessageHandlerChain.java @@ -41,8 +41,8 @@ public final class MessageHandlerChain { } /** - * Handles the message, passing it down the chain until the chain is broken - * or the message reaches the end of the chain. + * Handles the message, passing it down the chain until the chain is broken or the message reaches the end of the + * chain. * * @param player The player. * @param message The message. diff --git a/src/org/apollo/game/message/handler/impl/BankMessageHandler.java b/src/org/apollo/game/message/handler/impl/BankMessageHandler.java index 8e5c5925..02df5c4c 100644 --- a/src/org/apollo/game/message/handler/impl/BankMessageHandler.java +++ b/src/org/apollo/game/message/handler/impl/BankMessageHandler.java @@ -25,16 +25,16 @@ public final class BankMessageHandler extends MessageHandler */ private static final int optionToAmount(int option) { switch (option) { - case 1: - return 1; - case 2: - return 5; - case 3: - return 10; - case 4: - return Integer.MAX_VALUE; - case 5: - return -1; + case 1: + return 1; + case 2: + return 5; + case 3: + return 10; + case 4: + return Integer.MAX_VALUE; + case 5: + return -1; } throw new IllegalArgumentException("Invalid option supplied."); diff --git a/src/org/apollo/game/message/handler/impl/ItemOnItemVerificationHandler.java b/src/org/apollo/game/message/handler/impl/ItemOnItemVerificationHandler.java index f01221a2..e40a3350 100644 --- a/src/org/apollo/game/message/handler/impl/ItemOnItemVerificationHandler.java +++ b/src/org/apollo/game/message/handler/impl/ItemOnItemVerificationHandler.java @@ -21,19 +21,19 @@ public final class ItemOnItemVerificationHandler extends MessageHandler= 0 && message.getNewSlot() >= 0 && message.getOldSlot() < inventory.capacity() - && message.getNewSlot() < inventory.capacity()) { + if (message.getOldSlot() >= 0 && message.getNewSlot() >= 0 && message.getOldSlot() < inventory.capacity() && message.getNewSlot() < inventory.capacity()) { // events must be fired for it to work if a sidebar inventory overlay is used inventory.swap(insertPermitted && message.isInserting(), message.getOldSlot(), message.getNewSlot()); } diff --git a/src/org/apollo/game/message/handler/impl/WalkMessageHandler.java b/src/org/apollo/game/message/handler/impl/WalkMessageHandler.java index 003a9cee..d36728aa 100644 --- a/src/org/apollo/game/message/handler/impl/WalkMessageHandler.java +++ b/src/org/apollo/game/message/handler/impl/WalkMessageHandler.java @@ -36,6 +36,11 @@ public final class WalkMessageHandler extends MessageHandler { player.stopAction(); } player.getInterfaceSet().close(); + + if (player.getInteractingMob() != null) { + player.resetInteractingMob(); + } + } } \ No newline at end of file diff --git a/src/org/apollo/game/message/impl/PlayerSynchronizationMessage.java b/src/org/apollo/game/message/impl/PlayerSynchronizationMessage.java index 8435f6b0..88f8bfde 100644 --- a/src/org/apollo/game/message/impl/PlayerSynchronizationMessage.java +++ b/src/org/apollo/game/message/impl/PlayerSynchronizationMessage.java @@ -53,8 +53,7 @@ public final class PlayerSynchronizationMessage extends Message { * @param localPlayers The number of local players. * @param segments A list of segments. */ - public PlayerSynchronizationMessage(Position lastKnownSector, Position position, boolean sectorChanged, - SynchronizationSegment segment, int localPlayers, List segments) { + public PlayerSynchronizationMessage(Position lastKnownSector, Position position, boolean sectorChanged, SynchronizationSegment segment, int localPlayers, List segments) { this.lastKnownSector = lastKnownSector; this.position = position; this.sectorChanged = sectorChanged; diff --git a/src/org/apollo/game/model/Appearance.java b/src/org/apollo/game/model/Appearance.java index 4ece0496..6bb6a961 100644 --- a/src/org/apollo/game/model/Appearance.java +++ b/src/org/apollo/game/model/Appearance.java @@ -14,8 +14,8 @@ public final class Appearance { /** * The default appearance. */ - public static final Appearance DEFAULT_APPEARANCE = new Appearance(Gender.MALE, new int[] { 0, 10, 18, 26, 33, 36, 42 }, - new int[5]); + public static final Appearance DEFAULT_APPEARANCE = new Appearance(Gender.MALE, new int[] { 0, 10, 18, 26, 33, 36, + 42 }, new int[5]); /** * The array of clothing/skin colors. diff --git a/src/org/apollo/game/model/Direction.java b/src/org/apollo/game/model/Direction.java index 41f3ae6c..61015ca3 100644 --- a/src/org/apollo/game/model/Direction.java +++ b/src/org/apollo/game/model/Direction.java @@ -1,9 +1,5 @@ package org.apollo.game.model; - - - - /** * Represents a single movement direction. * @@ -90,7 +86,7 @@ public enum Direction { return Direction.WEST; } } - + return Direction.NONE; } diff --git a/src/org/apollo/game/model/Position.java b/src/org/apollo/game/model/Position.java index 24c1e3de..ac42c9b7 100644 --- a/src/org/apollo/game/model/Position.java +++ b/src/org/apollo/game/model/Position.java @@ -221,13 +221,12 @@ public final class Position { public boolean isWithinDistance(Position other, int distance) { int deltaX = Math.abs(getX() - other.getX()); int deltaY = Math.abs(getY() - other.getY()); - return deltaX <= distance && deltaY <= distance; + return deltaX <= distance && deltaY <= distance && getHeight() == other.getHeight(); } @Override public String toString() { - return MoreObjects.toStringHelper(this).add("x", getX()).add("y", getY()).add("height", getHeight()) - .add("sector", getSectorCoordinates()).toString(); + return MoreObjects.toStringHelper(this).add("x", getX()).add("y", getY()).add("height", getHeight()).add("sector", getSectorCoordinates()).toString(); } } \ No newline at end of file diff --git a/src/org/apollo/game/model/area/Sector.java b/src/org/apollo/game/model/area/Sector.java index 297e87da..3b2842fe 100644 --- a/src/org/apollo/game/model/area/Sector.java +++ b/src/org/apollo/game/model/area/Sector.java @@ -242,8 +242,7 @@ public final class Sector { * @throws IllegalArgumentException If the specified position is not included in this sector. */ private void checkPosition(Position position) { - Preconditions.checkArgument(coordinates.equals(SectorCoordinates.fromPosition(position)), - "Position is not included in this sector."); + Preconditions.checkArgument(coordinates.equals(SectorCoordinates.fromPosition(position)), "Position is not included in this sector."); } } \ No newline at end of file diff --git a/src/org/apollo/game/model/area/collision/CollisionMatrix.java b/src/org/apollo/game/model/area/collision/CollisionMatrix.java index ea45283e..d56c6ff3 100644 --- a/src/org/apollo/game/model/area/collision/CollisionMatrix.java +++ b/src/org/apollo/game/model/area/collision/CollisionMatrix.java @@ -161,8 +161,7 @@ public final class CollisionMatrix { @Override public String toString() { - return MoreObjects.toStringHelper(this).add("width", width).add("length", length).add("matrix", Arrays.toString(matrix)) - .toString(); + return MoreObjects.toStringHelper(this).add("width", width).add("length", length).add("matrix", Arrays.toString(matrix)).toString(); } /** diff --git a/src/org/apollo/game/model/area/package-info.java b/src/org/apollo/game/model/area/package-info.java index a39c9f88..8a1f2a6b 100644 --- a/src/org/apollo/game/model/area/package-info.java +++ b/src/org/apollo/game/model/area/package-info.java @@ -1,5 +1,5 @@ /** - * Contains classes which represent in-game sectors - blocks of 8x8 tiles used to store ground items, temporary objects, etc. - * efficiently. + * Contains classes which represent in-game sectors - blocks of 8x8 tiles used to store ground items, temporary objects, + * etc. efficiently. */ package org.apollo.game.model.area; \ No newline at end of file diff --git a/src/org/apollo/game/model/def/ObjectDefinition.java b/src/org/apollo/game/model/def/ObjectDefinition.java index a890b4cc..de1af1c9 100644 --- a/src/org/apollo/game/model/def/ObjectDefinition.java +++ b/src/org/apollo/game/model/def/ObjectDefinition.java @@ -178,8 +178,7 @@ public final class ObjectDefinition { /** * Indicates the impenetrability of this object. * - * @return {@code true} if this object is impenetrable, otherwise - * {@code false}. + * @return {@code true} if this object is impenetrable, otherwise {@code false}. */ public boolean isImpenetrable() { return impenetrable; @@ -188,8 +187,7 @@ public final class ObjectDefinition { /** * Indicates the interactivity of this object. * - * @return {@code true} if the object is interactive, otherwise - * {@code false}. + * @return {@code true} if the object is interactive, otherwise {@code false}. */ public boolean isInteractive() { return interactive; @@ -198,8 +196,7 @@ public final class ObjectDefinition { /** * Indicates whether or not this object obstructs the ground. * - * @return {@code true} if the object obstructs the ground otherwise - * {@code false}. + * @return {@code true} if the object obstructs the ground otherwise {@code false}. */ public boolean isObstructive() { return obstructive; diff --git a/src/org/apollo/game/model/def/package-info.java b/src/org/apollo/game/model/def/package-info.java index c214a056..56c13bf9 100644 --- a/src/org/apollo/game/model/def/package-info.java +++ b/src/org/apollo/game/model/def/package-info.java @@ -1,5 +1,4 @@ /** - * Contains definition classes which contain information about types of items, - * NPCs, etc. + * Contains definition classes which contain information about types of items, NPCs, etc. */ package org.apollo.game.model.def; \ No newline at end of file diff --git a/src/org/apollo/game/model/entity/GameObject.java b/src/org/apollo/game/model/entity/GameObject.java index 36b596a2..8592c7a1 100644 --- a/src/org/apollo/game/model/entity/GameObject.java +++ b/src/org/apollo/game/model/entity/GameObject.java @@ -89,8 +89,7 @@ public final class GameObject extends Entity { @Override public String toString() { - return MoreObjects.toStringHelper(this).add("id", getId()).add("type", getType()).add("rotation", getRotation()) - .toString(); + return MoreObjects.toStringHelper(this).add("id", getId()).add("type", getType()).add("rotation", getRotation()).toString(); } } \ No newline at end of file diff --git a/src/org/apollo/game/model/entity/Mob.java b/src/org/apollo/game/model/entity/Mob.java index 022e0692..e5a8cf33 100644 --- a/src/org/apollo/game/model/entity/Mob.java +++ b/src/org/apollo/game/model/entity/Mob.java @@ -194,8 +194,8 @@ public abstract class Mob extends Entity { */ public final Direction[] getDirections() { if (firstDirection != Direction.NONE) { - return secondDirection == Direction.NONE ? new Direction[] { firstDirection } : new Direction[] { firstDirection, - secondDirection }; + return secondDirection == Direction.NONE ? new Direction[] { firstDirection } : new Direction[] { + firstDirection, secondDirection }; } return Direction.EMPTY_DIRECTION_ARRAY; diff --git a/src/org/apollo/game/model/entity/Player.java b/src/org/apollo/game/model/entity/Player.java index 79f9efc1..86692430 100644 --- a/src/org/apollo/game/model/entity/Player.java +++ b/src/org/apollo/game/model/entity/Player.java @@ -943,8 +943,7 @@ public final class Player extends Mob { @Override public String toString() { - return MoreObjects.toStringHelper(this).add("username", getUsername()).add("privilege", privilegeLevel) - .add("client version", getClientVersion()).toString(); + return MoreObjects.toStringHelper(this).add("username", getUsername()).add("privilege", privilegeLevel).add("client version", getClientVersion()).toString(); } /** @@ -968,11 +967,9 @@ public final class Player extends Mob { InventoryListener fullBankListener = new FullInventoryListener(this, FullInventoryListener.FULL_BANK_MESSAGE); InventoryListener appearanceListener = new AppearanceInventoryListener(this); - InventoryListener syncInventoryListener = new SynchronizationInventoryListener(this, - SynchronizationInventoryListener.INVENTORY_ID); + InventoryListener syncInventoryListener = new SynchronizationInventoryListener(this, SynchronizationInventoryListener.INVENTORY_ID); InventoryListener syncBankListener = new SynchronizationInventoryListener(this, BankConstants.BANK_INVENTORY_ID); - InventoryListener syncEquipmentListener = new SynchronizationInventoryListener(this, - SynchronizationInventoryListener.EQUIPMENT_ID); + InventoryListener syncEquipmentListener = new SynchronizationInventoryListener(this, SynchronizationInventoryListener.EQUIPMENT_ID); inventory.addListener(syncInventoryListener); inventory.addListener(fullInventoryListener); diff --git a/src/org/apollo/game/model/entity/Skill.java b/src/org/apollo/game/model/entity/Skill.java index f9f9c54b..5db56e22 100644 --- a/src/org/apollo/game/model/entity/Skill.java +++ b/src/org/apollo/game/model/entity/Skill.java @@ -115,9 +115,9 @@ public final class Skill { /** * The skill names. */ - private static final String[] SKILL_NAMES = { "Attack", "Defence", "Strength", "Hitpoints", "Ranged", "Prayer", "Magic", - "Cooking", "Woodcutting", "Fletching", "Fishing", "Firemaking", "Crafting", "Smithing", "Mining", "Herblore", - "Agility", "Thieving", "Slayer", "Farming", "Runecraft" }; + private static final String[] SKILL_NAMES = { "Attack", "Defence", "Strength", "Hitpoints", "Ranged", "Prayer", + "Magic", "Cooking", "Woodcutting", "Fletching", "Fishing", "Firemaking", "Crafting", "Smithing", "Mining", + "Herblore", "Agility", "Thieving", "Slayer", "Farming", "Runecraft" }; /** * Gets the name of a skill. diff --git a/src/org/apollo/game/model/entity/SkillSet.java b/src/org/apollo/game/model/entity/SkillSet.java index 9cfbf2aa..c3b61223 100644 --- a/src/org/apollo/game/model/entity/SkillSet.java +++ b/src/org/apollo/game/model/entity/SkillSet.java @@ -57,8 +57,7 @@ public final class SkillSet { * @return The minimum level. */ public static int getLevelForExperience(double experience) { - Preconditions.checkArgument(experience >= 0 && experience <= MAXIMUM_EXP, "Experience must be between 0 and " - + MAXIMUM_EXP + ", inclusive."); + Preconditions.checkArgument(experience >= 0 && experience <= MAXIMUM_EXP, "Experience must be between 0 and " + MAXIMUM_EXP + ", inclusive."); for (int level = 1; level <= 98; level++) { if (experience < EXPERIENCE_FOR_LEVEL[level + 1]) { diff --git a/src/org/apollo/game/model/entity/attr/AttributeMap.java b/src/org/apollo/game/model/entity/attr/AttributeMap.java index e1f0ce9b..a4410c8a 100644 --- a/src/org/apollo/game/model/entity/attr/AttributeMap.java +++ b/src/org/apollo/game/model/entity/attr/AttributeMap.java @@ -80,8 +80,7 @@ public final class AttributeMap { AttributeDefinition definition = getDefinition(name); Preconditions.checkNotNull(definition, "Attributes must be defined before their value can be retreived."); - return (Attribute) attributes.computeIfAbsent(name, - key -> createAttribute(definition.getDefault(), definition.getType())); + return (Attribute) attributes.computeIfAbsent(name, key -> createAttribute(definition.getDefault(), definition.getType())); } /** diff --git a/src/org/apollo/game/model/event/Event.java b/src/org/apollo/game/model/event/Event.java index 8d71d84e..fbb225b0 100644 --- a/src/org/apollo/game/model/event/Event.java +++ b/src/org/apollo/game/model/event/Event.java @@ -6,7 +6,7 @@ package org.apollo.game.model.event; * @author Major */ public abstract class Event { - + /** * Indicates whether or not the Event chain has been terminated. */ @@ -27,5 +27,5 @@ public abstract class Event { public final boolean terminated() { return terminated; } - + } \ No newline at end of file diff --git a/src/org/apollo/game/model/inter/InterfaceConstants.java b/src/org/apollo/game/model/inter/InterfaceConstants.java index d0e44330..b356f590 100644 --- a/src/org/apollo/game/model/inter/InterfaceConstants.java +++ b/src/org/apollo/game/model/inter/InterfaceConstants.java @@ -10,8 +10,8 @@ public class InterfaceConstants { /** * The default inventory tab ids. */ - public static final int[] DEFAULT_INVENTORY_TABS = { 2423, 3917, 638, 3213, 1644, 5608, 1151, -1, 5065, 5715, 2449, 904, 147, - 962, }; + public static final int[] DEFAULT_INVENTORY_TABS = { 2423, 3917, 638, 3213, 1644, 5608, 1151, -1, 5065, 5715, 2449, + 904, 147, 962, }; // 6299 = music tab, music disabled // 4445 = settings tab, music disabled // 12855 = ancients magic @@ -19,8 +19,8 @@ public class InterfaceConstants { /** * The level-up dialogue interface ids. */ - public static final int[] LEVEL_UP_INTERFACES = { 6247, 6253, 6206, 6216, 4443, 6242, 6211, 6226, 4272, 6231, 6258, 4282, - 6263, 6221, 4416, 6237, 4277, 4261, 12122, 4887, 4267 }; + public static final int[] LEVEL_UP_INTERFACES = { 6247, 6253, 6206, 6216, 4443, 6242, 6211, 6226, 4272, 6231, 6258, + 4282, 6263, 6221, 4416, 6237, 4277, 4261, 12122, 4887, 4267 }; /** * The quest interface id. @@ -35,12 +35,13 @@ public class InterfaceConstants { /** * The array of widgets that display the text. */ - public static final int[] QUEST_TEXT = { 8144, 8145, 8147, 8148, 8149, 8150, 8151, 8152, 8153, 8154, 8155, 8156, 8157, 8158, - 8159, 8160, 8161, 8162, 8163, 8164, 8165, 8166, 8167, 8168, 8169, 8170, 8171, 8172, 8173, 8174, 8175, 8176, 8177, - 8178, 8179, 8180, 8181, 8182, 8183, 8184, 8185, 8186, 8187, 8188, 8189, 8190, 8191, 8192, 8193, 8194, 8195, 12174, - 12175, 12176, 12177, 12178, 12179, 12180, 12181, 12182, 12183, 12184, 12185, 12186, 12187, 12188, 12189, 12190, - 12191, 12192, 12193, 12194, 12195, 12196, 12197, 12198, 12199, 12200, 12201, 12202, 12203, 12204, 12205, 12206, - 12207, 12208, 12209, 12210, 12211, 12212, 12213, 12214, 12215, 12216, 12217, 12218, 12219, 12220, 12221, 12222, 12223 }; + public static final int[] QUEST_TEXT = { 8144, 8145, 8147, 8148, 8149, 8150, 8151, 8152, 8153, 8154, 8155, 8156, + 8157, 8158, 8159, 8160, 8161, 8162, 8163, 8164, 8165, 8166, 8167, 8168, 8169, 8170, 8171, 8172, 8173, 8174, + 8175, 8176, 8177, 8178, 8179, 8180, 8181, 8182, 8183, 8184, 8185, 8186, 8187, 8188, 8189, 8190, 8191, 8192, + 8193, 8194, 8195, 12174, 12175, 12176, 12177, 12178, 12179, 12180, 12181, 12182, 12183, 12184, 12185, + 12186, 12187, 12188, 12189, 12190, 12191, 12192, 12193, 12194, 12195, 12196, 12197, 12198, 12199, 12200, + 12201, 12202, 12203, 12204, 12205, 12206, 12207, 12208, 12209, 12210, 12211, 12212, 12213, 12214, 12215, + 12216, 12217, 12218, 12219, 12220, 12221, 12222, 12223 }; /** * The quest title widget id. diff --git a/src/org/apollo/game/model/package-info.java b/src/org/apollo/game/model/package-info.java index 109e9321..d0bcf043 100644 --- a/src/org/apollo/game/model/package-info.java +++ b/src/org/apollo/game/model/package-info.java @@ -1,5 +1,4 @@ /** - * Contains classes which represent things in the in-game world such as items, - * players and NPCs. + * Contains classes which represent things in the in-game world such as items, players and NPCs. */ package org.apollo.game.model; \ No newline at end of file diff --git a/src/org/apollo/game/model/skill/LevelUpSkillListener.java b/src/org/apollo/game/model/skill/LevelUpSkillListener.java index 953706f8..3539fb67 100644 --- a/src/org/apollo/game/model/skill/LevelUpSkillListener.java +++ b/src/org/apollo/game/model/skill/LevelUpSkillListener.java @@ -31,8 +31,7 @@ public final class LevelUpSkillListener extends SkillAdapter { // TODO show the interface String name = Skill.getName(id); String article = LanguageUtil.getIndefiniteArticle(name); - player.sendMessage("You've just advanced " + article + " " + name + " level! You have reached level " - + skill.getMaximumLevel() + "."); + player.sendMessage("You've just advanced " + article + " " + name + " level! You have reached level " + skill.getMaximumLevel() + "."); if (Skill.isCombatSkill(id)) { player.getSkillSet().calculateCombatLevel(); diff --git a/src/org/apollo/game/scheduling/package-info.java b/src/org/apollo/game/scheduling/package-info.java index 6fe54d13..2362c0e3 100644 --- a/src/org/apollo/game/scheduling/package-info.java +++ b/src/org/apollo/game/scheduling/package-info.java @@ -1,5 +1,4 @@ /** - * Contains classes related to scheduling which allow tasks to be executed in - * future pulses periodically. + * Contains classes related to scheduling which allow tasks to be executed in future pulses periodically. */ package org.apollo.game.scheduling; \ No newline at end of file diff --git a/src/org/apollo/game/sync/block/AppearanceBlock.java b/src/org/apollo/game/sync/block/AppearanceBlock.java index c37e8cb8..db91ea42 100644 --- a/src/org/apollo/game/sync/block/AppearanceBlock.java +++ b/src/org/apollo/game/sync/block/AppearanceBlock.java @@ -77,8 +77,7 @@ public final class AppearanceBlock extends SynchronizationBlock { * @param isSkulled Whether or not the player is skulled. * @param npcId The npc id of the player, if they are appearing as an npc, (otherwise {@code -1}). */ - AppearanceBlock(long name, Appearance appearance, int combat, int skill, Inventory equipment, int headIcon, - boolean isSkulled, int npcId) { + AppearanceBlock(long name, Appearance appearance, int combat, int skill, Inventory equipment, int headIcon, boolean isSkulled, int npcId) { this.name = name; this.appearance = appearance; this.combat = combat; diff --git a/src/org/apollo/game/sync/block/ForceMovementBlock.java b/src/org/apollo/game/sync/block/ForceMovementBlock.java index b213492a..4b22f050 100644 --- a/src/org/apollo/game/sync/block/ForceMovementBlock.java +++ b/src/org/apollo/game/sync/block/ForceMovementBlock.java @@ -48,8 +48,7 @@ public final class ForceMovementBlock extends SynchronizationBlock { * @param travelDurationY The length of time (in game pulses) the player's movement along the Y-axis will last. * @param direction The direction the player should move. */ - ForceMovementBlock(Position initialPosition, Position finalPosition, int travelDurationX, int travelDurationY, - Direction direction) { + ForceMovementBlock(Position initialPosition, Position finalPosition, int travelDurationX, int travelDurationY, Direction direction) { this.initialPosition = initialPosition; this.finalPosition = finalPosition; this.travelDurationX = travelDurationX; diff --git a/src/org/apollo/game/sync/block/SynchronizationBlock.java b/src/org/apollo/game/sync/block/SynchronizationBlock.java index e40d8a1e..b6817c8c 100644 --- a/src/org/apollo/game/sync/block/SynchronizationBlock.java +++ b/src/org/apollo/game/sync/block/SynchronizationBlock.java @@ -37,8 +37,7 @@ public abstract class SynchronizationBlock { int combat = player.getSkillSet().getCombatLevel(); int id = player.hasNpcDefinition() ? player.getDefinition().getId() : -1; - return new AppearanceBlock(player.getEncodedName(), player.getAppearance(), combat, 0, player.getEquipment(), - player.getPrayerIcon(), player.isSkulled(), id); + return new AppearanceBlock(player.getEncodedName(), player.getAppearance(), combat, 0, player.getEquipment(), player.getPrayerIcon(), player.isSkulled(), id); } /** @@ -72,8 +71,7 @@ public abstract class SynchronizationBlock { * @param direction The {@link Direction} the player should move. * @return The force movement block. */ - public static SynchronizationBlock createForceMovementBlock(Position initialPosition, Position finalPosition, - int travelDurationX, int travelDurationY, Direction direction) { + public static SynchronizationBlock createForceMovementBlock(Position initialPosition, Position finalPosition, int travelDurationX, int travelDurationY, Direction direction) { return new ForceMovementBlock(initialPosition, finalPosition, travelDurationX, travelDurationY, direction); } @@ -98,10 +96,8 @@ public abstract class SynchronizationBlock { * @param secondary If the block is a secondary hit or not. * @return The hit update block. */ - public static SynchronizationBlock createHitUpdateBlock(int damage, int type, int currentHealth, int maximumHealth, - boolean secondary) { - return secondary ? new SecondaryHitUpdateBlock(damage, type, currentHealth, maximumHealth) : new HitUpdateBlock(damage, - type, currentHealth, maximumHealth); + public static SynchronizationBlock createHitUpdateBlock(int damage, int type, int currentHealth, int maximumHealth, boolean secondary) { + return secondary ? new SecondaryHitUpdateBlock(damage, type, currentHealth, maximumHealth) : new HitUpdateBlock(damage, type, currentHealth, maximumHealth); } /** diff --git a/src/org/apollo/game/sync/package-info.java b/src/org/apollo/game/sync/package-info.java index d2a5a620..6aaee3d8 100644 --- a/src/org/apollo/game/sync/package-info.java +++ b/src/org/apollo/game/sync/package-info.java @@ -1,5 +1,5 @@ /** - * Contains classes related to client synchronization - the process where the - * client's state is updated by the server so it matches the server's state. + * Contains classes related to client synchronization - the process where the client's state is updated by the server so + * it matches the server's state. */ package org.apollo.game.sync; \ No newline at end of file diff --git a/src/org/apollo/game/sync/seg/MovementSegment.java b/src/org/apollo/game/sync/seg/MovementSegment.java index cbbaadf0..97376791 100644 --- a/src/org/apollo/game/sync/seg/MovementSegment.java +++ b/src/org/apollo/game/sync/seg/MovementSegment.java @@ -26,8 +26,7 @@ public final class MovementSegment extends SynchronizationSegment { */ public MovementSegment(SynchronizationBlockSet blockSet, Direction[] directions) { super(blockSet); - Preconditions.checkArgument(directions.length >= 0 && directions.length < 3, - "Directions length must be between 0 and 2 inclusive."); + Preconditions.checkArgument(directions.length >= 0 && directions.length < 3, "Directions length must be between 0 and 2 inclusive."); this.directions = directions; } @@ -43,14 +42,14 @@ public final class MovementSegment extends SynchronizationSegment { @Override public SegmentType getType() { switch (directions.length) { - case 0: - return SegmentType.NO_MOVEMENT; - case 1: - return SegmentType.WALK; - case 2: - return SegmentType.RUN; - default: - throw new IllegalStateException("Direction type unsupported."); + case 0: + return SegmentType.NO_MOVEMENT; + case 1: + return SegmentType.WALK; + case 2: + return SegmentType.RUN; + default: + throw new IllegalStateException("Direction type unsupported."); } } diff --git a/src/org/apollo/game/sync/seg/package-info.java b/src/org/apollo/game/sync/seg/package-info.java index 41052407..eb33ad96 100644 --- a/src/org/apollo/game/sync/seg/package-info.java +++ b/src/org/apollo/game/sync/seg/package-info.java @@ -1,6 +1,5 @@ /** - * Contains classes related to synchronization segments. Each segment contains - * multiple blocks and can be used to add, remove, teleport or move a - * mob. + * Contains classes related to synchronization segments. Each segment contains multiple blocks and can be used to add, + * remove, teleport or move a mob. */ package org.apollo.game.sync.seg; \ No newline at end of file diff --git a/src/org/apollo/game/sync/task/NpcSynchronizationTask.java b/src/org/apollo/game/sync/task/NpcSynchronizationTask.java index 0f9255d3..b8d63221 100644 --- a/src/org/apollo/game/sync/task/NpcSynchronizationTask.java +++ b/src/org/apollo/game/sync/task/NpcSynchronizationTask.java @@ -50,8 +50,7 @@ public final class NpcSynchronizationTask extends SynchronizationTask { for (Iterator it = localNpcs.iterator(); it.hasNext();) { Npc npc = it.next(); - if (!npc.isActive() || npc.isTeleporting() - || npc.getPosition().getLongestDelta(playerPosition) > player.getViewingDistance()) { + if (!npc.isActive() || npc.isTeleporting() || npc.getPosition().getLongestDelta(playerPosition) > player.getViewingDistance()) { it.remove(); segments.add(new RemoveMobSegment()); } else { @@ -70,8 +69,7 @@ public final class NpcSynchronizationTask extends SynchronizationTask { } Position npcPosition = npc.getPosition(); - if (npcPosition.isWithinDistance(playerPosition, player.getViewingDistance()) && !localNpcs.contains(npc) - && npcPosition.getHeight() == playerPosition.getHeight()) { + if (npcPosition.isWithinDistance(playerPosition, player.getViewingDistance()) && !localNpcs.contains(npc) && npcPosition.getHeight() == playerPosition.getHeight()) { localNpcs.add(npc); added++; npc.turnTo(npc.getFacingPosition()); diff --git a/src/org/apollo/game/sync/task/PlayerSynchronizationTask.java b/src/org/apollo/game/sync/task/PlayerSynchronizationTask.java index e3155924..5ffd93f2 100644 --- a/src/org/apollo/game/sync/task/PlayerSynchronizationTask.java +++ b/src/org/apollo/game/sync/task/PlayerSynchronizationTask.java @@ -70,8 +70,7 @@ public final class PlayerSynchronizationTask extends SynchronizationTask { for (Iterator it = localPlayers.iterator(); it.hasNext();) { Player other = it.next(); - if (!other.isActive() || other.isTeleporting() - || other.getPosition().getLongestDelta(player.getPosition()) > player.getViewingDistance()) { + if (!other.isActive() || other.isTeleporting() || other.getPosition().getLongestDelta(player.getPosition()) > player.getViewingDistance()) { it.remove(); segments.add(new RemoveMobSegment()); } else { @@ -91,8 +90,7 @@ public final class PlayerSynchronizationTask extends SynchronizationTask { break; } - if (other != player && other.getPosition().isWithinDistance(player.getPosition(), player.getViewingDistance()) - && !localPlayers.contains(other)) { + if (other != player && other.getPosition().isWithinDistance(player.getPosition(), player.getViewingDistance()) && !localPlayers.contains(other)) { localPlayers.add(other); added++; @@ -107,8 +105,7 @@ public final class PlayerSynchronizationTask extends SynchronizationTask { } } - PlayerSynchronizationMessage message = new PlayerSynchronizationMessage(lastKnownSector, player.getPosition(), - sectorChanged, segment, oldLocalPlayers, segments); + PlayerSynchronizationMessage message = new PlayerSynchronizationMessage(lastKnownSector, player.getPosition(), sectorChanged, segment, oldLocalPlayers, segments); player.send(message); } diff --git a/src/org/apollo/game/sync/task/package-info.java b/src/org/apollo/game/sync/task/package-info.java index b45ff20d..bca00016 100644 --- a/src/org/apollo/game/sync/task/package-info.java +++ b/src/org/apollo/game/sync/task/package-info.java @@ -1,6 +1,5 @@ /** - * Contains classes related to - * {@link org.apollo.game.sync.task.SynchronizationTask}s, small chunks of work - * executed during the client synchronization process. + * Contains classes related to {@link org.apollo.game.sync.task.SynchronizationTask}s, small chunks of work executed + * during the client synchronization process. */ package org.apollo.game.sync.task; \ No newline at end of file diff --git a/src/org/apollo/io/MessageHandlerChainParser.java b/src/org/apollo/io/MessageHandlerChainParser.java index 96aa7b8c..27208725 100644 --- a/src/org/apollo/io/MessageHandlerChainParser.java +++ b/src/org/apollo/io/MessageHandlerChainParser.java @@ -53,8 +53,7 @@ public final class MessageHandlerChainParser { * @return A {@link MessageHandlerChainGroup}. */ @SuppressWarnings("unchecked") - public MessageHandlerChainGroup parse() throws IOException, SAXException, ClassNotFoundException, InstantiationException, - IllegalAccessException { + public MessageHandlerChainGroup parse() throws IOException, SAXException, ClassNotFoundException, InstantiationException, IllegalAccessException { XmlNode messages = parser.parse(is); if (!messages.getName().equals("messages")) { throw new IOException("Root node name is not 'messages'."); @@ -94,8 +93,7 @@ public final class MessageHandlerChainParser { throw new IOException("Handler node must have a value."); } - Class> handlerClass = (Class>) Class - .forName(handlerClassName); + Class> handlerClass = (Class>) Class.forName(handlerClassName); MessageHandler handler = handlerClass.newInstance(); handlers.add(handler); } diff --git a/src/org/apollo/io/player/PlayerLoaderResponse.java b/src/org/apollo/io/player/PlayerLoaderResponse.java index 47527d11..69e6541b 100644 --- a/src/org/apollo/io/player/PlayerLoaderResponse.java +++ b/src/org/apollo/io/player/PlayerLoaderResponse.java @@ -32,8 +32,7 @@ public final class PlayerLoaderResponse { * {@link LoginConstants#STATUS_RECONNECTION_OK}. */ public PlayerLoaderResponse(int status) { - Preconditions.checkArgument(status != LoginConstants.STATUS_OK && status != LoginConstants.STATUS_RECONNECTION_OK, - "Player required for this status code."); + Preconditions.checkArgument(status != LoginConstants.STATUS_OK && status != LoginConstants.STATUS_RECONNECTION_OK, "Player required for this status code."); this.status = status; player = Optional.empty(); } @@ -47,8 +46,7 @@ public final class PlayerLoaderResponse { * @throws NullPointerException If the specified player is null. */ public PlayerLoaderResponse(int status, Player player) { - Preconditions.checkArgument(status == LoginConstants.STATUS_OK || status == LoginConstants.STATUS_RECONNECTION_OK, - "Player not required for this status code."); + Preconditions.checkArgument(status == LoginConstants.STATUS_OK || status == LoginConstants.STATUS_RECONNECTION_OK, "Player not required for this status code."); this.status = status; this.player = Optional.of(player); } diff --git a/src/org/apollo/net/ApolloHandler.java b/src/org/apollo/net/ApolloHandler.java index ce0adfc9..3a3a8065 100644 --- a/src/org/apollo/net/ApolloHandler.java +++ b/src/org/apollo/net/ApolloHandler.java @@ -85,13 +85,13 @@ public final class ApolloHandler extends ChannelInboundHandlerAdapter { HandshakeMessage handshakeMessage = (HandshakeMessage) message; switch (handshakeMessage.getServiceId()) { - case HandshakeConstants.SERVICE_GAME: - attribute.set(new LoginSession(ctx, serverContext)); - break; + case HandshakeConstants.SERVICE_GAME: + attribute.set(new LoginSession(ctx, serverContext)); + break; - case HandshakeConstants.SERVICE_UPDATE: - attribute.set(new UpdateSession(ctx.channel(), serverContext)); - break; + case HandshakeConstants.SERVICE_UPDATE: + attribute.set(new UpdateSession(ctx.channel(), serverContext)); + break; } } diff --git a/src/org/apollo/net/codec/game/GamePacketDecoder.java b/src/org/apollo/net/codec/game/GamePacketDecoder.java index 947cd87f..6991d519 100644 --- a/src/org/apollo/net/codec/game/GamePacketDecoder.java +++ b/src/org/apollo/net/codec/game/GamePacketDecoder.java @@ -62,17 +62,17 @@ public final class GamePacketDecoder extends StatefulFrameDecoder out, GameDecoderState state) { switch (state) { - case GAME_OPCODE: - decodeOpcode(in, out); - break; - case GAME_LENGTH: - decodeLength(in); - break; - case GAME_PAYLOAD: - decodePayload(in, out); - break; - default: - throw new IllegalStateException("Invalid game decoder state."); + case GAME_OPCODE: + decodeOpcode(in, out); + break; + case GAME_LENGTH: + decodeLength(in); + break; + case GAME_PAYLOAD: + decodePayload(in, out); + break; + default: + throw new IllegalStateException("Invalid game decoder state."); } } @@ -106,20 +106,20 @@ public final class GamePacketDecoder extends StatefulFrameDecoder @Override protected void decode(ChannelHandlerContext ctx, ByteBuf in, List out, LoginDecoderState state) { switch (state) { - case LOGIN_HANDSHAKE: - decodeHandshake(ctx, in, out); - break; - case LOGIN_HEADER: - decodeHeader(ctx, in, out); - break; - case LOGIN_PAYLOAD: - decodePayload(ctx, in, out); - break; - default: - throw new IllegalStateException("Invalid login decoder state: " + state); + case LOGIN_HANDSHAKE: + decodeHandshake(ctx, in, out); + break; + case LOGIN_HEADER: + decodeHeader(ctx, in, out); + break; + case LOGIN_PAYLOAD: + decodePayload(ctx, in, out); + break; + default: + throw new IllegalStateException("Invalid login decoder state: " + state); } } diff --git a/src/org/apollo/net/codec/login/LoginRequest.java b/src/org/apollo/net/codec/login/LoginRequest.java index cac93c87..c30c620f 100644 --- a/src/org/apollo/net/codec/login/LoginRequest.java +++ b/src/org/apollo/net/codec/login/LoginRequest.java @@ -56,8 +56,7 @@ public final class LoginRequest { * @param archiveCrcs The archive CRCs. * @param clientVersion The client version. */ - public LoginRequest(PlayerCredentials credentials, IsaacRandomPair randomPair, boolean lowMemory, boolean reconnecting, - int releaseNumber, int[] archiveCrcs, int clientVersion) { + public LoginRequest(PlayerCredentials credentials, IsaacRandomPair randomPair, boolean lowMemory, boolean reconnecting, int releaseNumber, int[] archiveCrcs, int clientVersion) { this.credentials = credentials; this.randomPair = randomPair; this.lowMemory = lowMemory; diff --git a/src/org/apollo/net/codec/update/OnDemandRequest.java b/src/org/apollo/net/codec/update/OnDemandRequest.java index 52e32071..86baf132 100644 --- a/src/org/apollo/net/codec/update/OnDemandRequest.java +++ b/src/org/apollo/net/codec/update/OnDemandRequest.java @@ -41,14 +41,14 @@ public final class OnDemandRequest implements Comparable { */ public static Priority valueOf(int value) { switch (value) { - case 0: - return HIGH; - case 1: - return MEDIUM; - case 2: - return LOW; - default: - throw new IllegalArgumentException("Priority out of range - received " + value + "."); + case 0: + return HIGH; + case 1: + return MEDIUM; + case 2: + return LOW; + default: + throw new IllegalArgumentException("Priority out of range - received " + value + "."); } } diff --git a/src/org/apollo/net/package-info.java b/src/org/apollo/net/package-info.java index 26b88ffe..96ae9898 100644 --- a/src/org/apollo/net/package-info.java +++ b/src/org/apollo/net/package-info.java @@ -1,5 +1,5 @@ /** - * Contains classes related to networking. Many of these extend Netty's set of - * classes - such as the pipeline factory, handler and codecs. + * Contains classes related to networking. Many of these extend Netty's set of classes - such as the pipeline factory, + * handler and codecs. */ package org.apollo.net; \ No newline at end of file diff --git a/src/org/apollo/net/release/package-info.java b/src/org/apollo/net/release/package-info.java index 362c1d2b..2a029f38 100644 --- a/src/org/apollo/net/release/package-info.java +++ b/src/org/apollo/net/release/package-info.java @@ -1,5 +1,5 @@ /** - * Contains abstract classes which should be extended by a particular release, - * allowing for portability between various protocol and client releases. + * Contains abstract classes which should be extended by a particular release, allowing for portability between various + * protocol and client releases. */ package org.apollo.net.release; \ No newline at end of file diff --git a/src/org/apollo/net/release/r317/NpcSynchronizationMessageEncoder.java b/src/org/apollo/net/release/r317/NpcSynchronizationMessageEncoder.java index bc2472df..1bd16ca9 100644 --- a/src/org/apollo/net/release/r317/NpcSynchronizationMessageEncoder.java +++ b/src/org/apollo/net/release/r317/NpcSynchronizationMessageEncoder.java @@ -227,8 +227,7 @@ public final class NpcSynchronizationMessageEncoder extends MessageEncoder 0; if (segment.getType() == SegmentType.RUN) { Direction[] directions = ((MovementSegment) segment).getDirections(); diff --git a/src/org/apollo/net/release/r317/PlayerSynchronizationMessageEncoder.java b/src/org/apollo/net/release/r317/PlayerSynchronizationMessageEncoder.java index a1a55d14..a26e7d29 100644 --- a/src/org/apollo/net/release/r317/PlayerSynchronizationMessageEncoder.java +++ b/src/org/apollo/net/release/r317/PlayerSynchronizationMessageEncoder.java @@ -388,8 +388,7 @@ public final class PlayerSynchronizationMessageEncoder extends MessageEncoder 0; if (seg.getType() == SegmentType.TELEPORT) { Position position = ((TeleportSegment) seg).getDestination(); diff --git a/src/org/apollo/net/release/r377/FirstNpcActionMessageDecoder.java b/src/org/apollo/net/release/r377/FirstNpcActionMessageDecoder.java index 089d91af..c9d66859 100644 --- a/src/org/apollo/net/release/r377/FirstNpcActionMessageDecoder.java +++ b/src/org/apollo/net/release/r377/FirstNpcActionMessageDecoder.java @@ -11,11 +11,11 @@ import org.apollo.net.release.MessageDecoder; */ public final class FirstNpcActionMessageDecoder extends MessageDecoder { - @Override - public FirstNpcActionMessage decode(GamePacket packet) { - GamePacketReader reader = new GamePacketReader(packet); - int index = (int) reader.getSigned(DataType.SHORT, DataOrder.LITTLE); - return new FirstNpcActionMessage(index); - } + @Override + public FirstNpcActionMessage decode(GamePacket packet) { + GamePacketReader reader = new GamePacketReader(packet); + int index = (int) reader.getSigned(DataType.SHORT, DataOrder.LITTLE); + return new FirstNpcActionMessage(index); + } } \ No newline at end of file diff --git a/src/org/apollo/net/release/r377/FlaggedMouseEventMessageDecoder.java b/src/org/apollo/net/release/r377/FlaggedMouseEventMessageDecoder.java index a499c6af..61ecf663 100644 --- a/src/org/apollo/net/release/r377/FlaggedMouseEventMessageDecoder.java +++ b/src/org/apollo/net/release/r377/FlaggedMouseEventMessageDecoder.java @@ -29,7 +29,7 @@ public final class FlaggedMouseEventMessageDecoder extends MessageDecoder> 19); x = (read & 0x7f) % 765; y = (read & 0x7f) / 765; diff --git a/src/org/apollo/net/release/r377/MagicOnNpcMessageDecoder.java b/src/org/apollo/net/release/r377/MagicOnNpcMessageDecoder.java index 197a1aa8..e7b87205 100644 --- a/src/org/apollo/net/release/r377/MagicOnNpcMessageDecoder.java +++ b/src/org/apollo/net/release/r377/MagicOnNpcMessageDecoder.java @@ -15,14 +15,14 @@ import org.apollo.net.release.MessageDecoder; */ public final class MagicOnNpcMessageDecoder extends MessageDecoder { - @Override - public MagicOnNpcMessage decode(GamePacket packet) { - GamePacketReader reader = new GamePacketReader(packet); + @Override + public MagicOnNpcMessage decode(GamePacket packet) { + GamePacketReader reader = new GamePacketReader(packet); - int index = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE, DataTransformation.ADD); - int spell = (int) reader.getUnsigned(DataType.SHORT, DataTransformation.ADD); + int index = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE, DataTransformation.ADD); + int spell = (int) reader.getUnsigned(DataType.SHORT, DataTransformation.ADD); - return new MagicOnNpcMessage(index, spell); - } + return new MagicOnNpcMessage(index, spell); + } } \ No newline at end of file diff --git a/src/org/apollo/net/release/r377/PlayerSynchronizationMessageEncoder.java b/src/org/apollo/net/release/r377/PlayerSynchronizationMessageEncoder.java index 341a1b17..5ebfb18f 100644 --- a/src/org/apollo/net/release/r377/PlayerSynchronizationMessageEncoder.java +++ b/src/org/apollo/net/release/r377/PlayerSynchronizationMessageEncoder.java @@ -388,8 +388,7 @@ public final class PlayerSynchronizationMessageEncoder extends MessageEncoder 0; if (seg.getType() == SegmentType.TELEPORT) { Position pos = ((TeleportSegment) seg).getDestination(); diff --git a/src/org/apollo/net/release/r377/SecondNpcActionMessageDecoder.java b/src/org/apollo/net/release/r377/SecondNpcActionMessageDecoder.java index 58949385..a345064e 100644 --- a/src/org/apollo/net/release/r377/SecondNpcActionMessageDecoder.java +++ b/src/org/apollo/net/release/r377/SecondNpcActionMessageDecoder.java @@ -13,9 +13,9 @@ public final class SecondNpcActionMessageDecoder extends MessageDecoder', '<', ',', '"', '[', ']', '|', '?', '/', - '`' }; + private static final char[] NAME_CHARS = { '_', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', + 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '-', '+', '=', ':', ';', '.', '>', '<', ',', + '"', '[', ']', '|', '?', '/', '`' }; /** * Converts a long to a player name. diff --git a/src/org/apollo/util/TextUtil.java b/src/org/apollo/util/TextUtil.java index d401f5a1..fe76006a 100644 --- a/src/org/apollo/util/TextUtil.java +++ b/src/org/apollo/util/TextUtil.java @@ -11,10 +11,10 @@ public final class TextUtil { * An array of characters ordered by frequency - the elements with lower indices (generally) appear more often in * chat messages. */ - public static final char[] FREQUENCY_ORDERED_CHARS = { ' ', 'e', 't', 'a', 'o', 'i', 'h', 'n', 's', 'r', 'd', 'l', 'u', 'm', - 'w', 'c', 'y', 'f', 'g', 'p', 'b', 'v', 'k', 'x', 'j', 'q', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', - ' ', '!', '?', '.', ',', ':', ';', '(', ')', '-', '&', '*', '\\', '\'', '@', '#', '+', '=', '\243', '$', '%', '"', - '[', ']' }; + public static final char[] FREQUENCY_ORDERED_CHARS = { ' ', 'e', 't', 'a', 'o', 'i', 'h', 'n', 's', 'r', 'd', 'l', + 'u', 'm', 'w', 'c', 'y', 'f', 'g', 'p', 'b', 'v', 'k', 'x', 'j', 'q', 'z', '0', '1', '2', '3', '4', '5', + '6', '7', '8', '9', ' ', '!', '?', '.', ',', ':', ';', '(', ')', '-', '&', '*', '\\', '\'', '@', '#', '+', + '=', '\243', '$', '%', '"', '[', ']' }; /** * Capitalizes the string correctly. diff --git a/src/org/apollo/util/plugin/PluginManager.java b/src/org/apollo/util/plugin/PluginManager.java index f4d58d52..f11cb906 100644 --- a/src/org/apollo/util/plugin/PluginManager.java +++ b/src/org/apollo/util/plugin/PluginManager.java @@ -156,8 +156,7 @@ public final class PluginManager { * @throws DependencyException If a dependency error occurs. * @throws IOException If an I/O error occurs. */ - private void start(PluginEnvironment env, PluginMetaData plugin, Map plugins, - Set started) throws DependencyException, IOException { + private void start(PluginEnvironment env, PluginMetaData plugin, Map plugins, Set started) throws DependencyException, IOException { // TODO check for cyclic dependencies! this way just won't cut it, we need an exception if (started.contains(plugin)) { return; diff --git a/src/org/apollo/util/plugin/PluginMetaData.java b/src/org/apollo/util/plugin/PluginMetaData.java index d5fbeb3d..24f9899f 100644 --- a/src/org/apollo/util/plugin/PluginMetaData.java +++ b/src/org/apollo/util/plugin/PluginMetaData.java @@ -61,8 +61,7 @@ public final class PluginMetaData { * @param dependencies The plugin's dependencies. * @param version The plugin's version. */ - public PluginMetaData(String id, File base, String name, String description, String[] authors, String[] scripts, - String[] dependencies, double version) { + public PluginMetaData(String id, File base, String name, String description, String[] authors, String[] scripts, String[] dependencies, double version) { this.id = id; this.base = base; this.name = name;