diff --git a/src/net/burtleburtle/bob/rand/IsaacRandom.java b/src/net/burtleburtle/bob/rand/IsaacRandom.java
index 80667e63..00cef02f 100644
--- a/src/net/burtleburtle/bob/rand/IsaacRandom.java
+++ b/src/net/burtleburtle/bob/rand/IsaacRandom.java
@@ -1,9 +1,11 @@
package net.burtleburtle.bob.rand;
/**
- *
An implementation of the
- * ISAAC
- * psuedorandom number generator.
+ *
+ * An implementation of the ISAAC psuedorandom number
+ * generator.
+ *
+ *
*
* ------------------------------------------------------------------------------
* Rand.java: By Bob Jenkins. My random number generator, ISAAC.
@@ -15,8 +17,10 @@ package net.burtleburtle.bob.rand;
* 980224: Translate to Java
* ------------------------------------------------------------------------------
*
- * This class has been changed to be more conformant to Java and javadoc
- * conventions.
+ *
+ * This class has been changed to be more conformant to Java and javadoc conventions.
+ *
+ *
* @author Bob Jenkins
*/
public final class IsaacRandom {
@@ -82,6 +86,7 @@ public final class IsaacRandom {
/**
* Creates the random number generator with the specified seed.
+ *
* @param seed The seed.
*/
public IsaacRandom(int[] seed) {
@@ -155,6 +160,7 @@ public final class IsaacRandom {
/**
* Initialises this random number generator.
+ *
* @param flag Set to {@code true} if a seed was passed to the constructor.
*/
private void init(boolean flag) {
@@ -285,6 +291,7 @@ public final class IsaacRandom {
/**
* Gets the next random value.
+ *
* @return The next random value.
*/
public int nextInt() {
diff --git a/src/net/burtleburtle/bob/rand/package-info.java b/src/net/burtleburtle/bob/rand/package-info.java
index 78035da4..3b0f5388 100644
--- a/src/net/burtleburtle/bob/rand/package-info.java
+++ b/src/net/burtleburtle/bob/rand/package-info.java
@@ -2,3 +2,4 @@
* Contains a Java implementation of Bob Jenkins' ISAAC algorithm.
*/
package net.burtleburtle.bob.rand;
+
diff --git a/src/org/apollo/Server.java b/src/org/apollo/Server.java
index 500fa10a..1b855521 100644
--- a/src/org/apollo/Server.java
+++ b/src/org/apollo/Server.java
@@ -28,6 +28,7 @@ import org.jboss.netty.util.Timer;
/**
* The core class of the Apollo server.
+ *
* @author Graham
*/
public final class Server {
@@ -39,6 +40,7 @@ public final class Server {
/**
* The entry point of the Apollo server application.
+ *
* @param args The command-line arguments passed to the application.
*/
public static void main(String[] args) {
@@ -74,8 +76,8 @@ public final class Server {
private final ServerBootstrap jagGrabBootstrap = new ServerBootstrap();
/**
- * The {@link ExecutorService} used for network events. The named thread
- * factory is unused as Netty names threads itself.
+ * The {@link ExecutorService} used for network events. The named thread factory is unused as Netty names threads
+ * itself.
*/
private final ExecutorService networkExecutor = Executors.newCachedThreadPool();
@@ -96,6 +98,7 @@ public final class Server {
/**
* Creates the Apollo server.
+ *
* @throws Exception if an error occurs whilst creating services.
*/
public Server() throws Exception {
@@ -105,13 +108,14 @@ public final class Server {
/**
* Initialises the server.
- * @param releaseClassName The class name of the current active
- * {@link Release}.
+ *
+ * @param releaseClassName The class name of the current active {@link Release}.
* @throws ClassNotFoundException if the release class could not be found.
* @throws IllegalAccessException if the release class could not be accessed.
* @throws InstantiationException if the release class could not be instantiated.
*/
- public void init(String releaseClassName) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
+ public void init(String releaseClassName) throws ClassNotFoundException, InstantiationException,
+ IllegalAccessException {
Class> clazz = Class.forName(releaseClassName);
Release release = (Release) clazz.newInstance();
@@ -137,6 +141,7 @@ public final class Server {
/**
* Binds the server to the specified address.
+ *
* @param serviceAddress The service address to bind to.
* @param httpAddress The HTTP address to bind to.
* @param jagGrabAddress The JAGGRAB address to bind to.
@@ -149,7 +154,8 @@ public final class Server {
try {
httpBootstrap.bind(httpAddress);
} catch (Throwable t) {
- logger.log(Level.WARNING, "Binding to HTTP failed: client will use JAGGRAB as a fallback (not reccomended)!", t);
+ logger.log(Level.WARNING,
+ "Binding to HTTP failed: client will use JAGGRAB as a fallback (not reccomended)!", t);
}
logger.info("Binding JAGGRAB listener to address: " + jagGrabAddress + "...");
@@ -160,6 +166,7 @@ public final class Server {
/**
* Starts the server.
+ *
* @throws Exception if an error occurs.
*/
public void start() throws Exception {
diff --git a/src/org/apollo/ServerContext.java b/src/org/apollo/ServerContext.java
index e95e1b4c..19fa4113 100644
--- a/src/org/apollo/ServerContext.java
+++ b/src/org/apollo/ServerContext.java
@@ -5,12 +5,12 @@ import org.jboss.netty.channel.group.ChannelGroup;
import org.jboss.netty.channel.group.DefaultChannelGroup;
/**
- * A {@link ServerContext} is created along with the {@link Server} object. The
- * primary difference is that a reference to the current context should be
- * passed around within the server. The {@link Server} should not be as it
- * allows access to some methods such as
- * {@link Server#bind(java.net.SocketAddress, java.net.SocketAddress, java.net.SocketAddress)}
- * which user scripts/code should not be able to access.
+ * A {@link ServerContext} is created along with the {@link Server} object. The primary difference is that a reference
+ * to the current context should be passed around within the server. The {@link Server} should not be as it allows
+ * access to some methods such as
+ * {@link Server#bind(java.net.SocketAddress, java.net.SocketAddress, java.net.SocketAddress)} which user scripts/code
+ * should not be able to access.
+ *
* @author Graham
*/
public final class ServerContext {
@@ -32,6 +32,7 @@ public final class ServerContext {
/**
* Creates a new server context.
+ *
* @param release The current release.
* @param serviceManager The service manager.
*/
@@ -43,6 +44,7 @@ public final class ServerContext {
/**
* Gets the channel group.
+ *
* @return The channel group.
*/
public ChannelGroup getChannelGroup() {
@@ -51,6 +53,7 @@ public final class ServerContext {
/**
* Gets the current release.
+ *
* @return The current release.
*/
public Release getRelease() {
@@ -59,6 +62,7 @@ public final class ServerContext {
/**
* Gets the service manager.
+ *
* @return The service manager.
*/
public ServiceManager getServiceManager() {
@@ -66,8 +70,8 @@ public final class ServerContext {
}
/**
- * Gets a service. This method is shorthand for
- * {@code getServiceManager().getService(...)}.
+ * Gets a service. This method is shorthand for {@code getServiceManager().getService(...)}.
+ *
* @param The type of service.
* @param clazz The service class.
* @return The service, or {@code null} if it could not be found.
diff --git a/src/org/apollo/Service.java b/src/org/apollo/Service.java
index 2a4cfc34..d4a4dfae 100644
--- a/src/org/apollo/Service.java
+++ b/src/org/apollo/Service.java
@@ -2,6 +2,7 @@ package org.apollo;
/**
* Represents a service that the server provides.
+ *
* @author Graham
*/
public abstract class Service {
@@ -13,6 +14,7 @@ public abstract class Service {
/**
* Gets the server context.
+ *
* @return The context.
*/
public final ServerContext getContext() {
@@ -21,6 +23,7 @@ public abstract class Service {
/**
* Sets the server context.
+ *
* @param ctx The context.
*/
public final void setContext(ServerContext ctx) {
diff --git a/src/org/apollo/ServiceManager.java b/src/org/apollo/ServiceManager.java
index 46fea592..725c44bb 100644
--- a/src/org/apollo/ServiceManager.java
+++ b/src/org/apollo/ServiceManager.java
@@ -11,6 +11,7 @@ import org.apollo.util.xml.XmlParser;
/**
* A class which manages {@link Service}s.
+ *
* @author Graham
*/
public final class ServiceManager {
@@ -27,6 +28,7 @@ public final class ServiceManager {
/**
* Creates and initializes the {@link ServiceManager}.
+ *
* @throws Exception if an error occurs.
*/
public ServiceManager() throws Exception {
@@ -35,6 +37,7 @@ public final class ServiceManager {
/**
* Initializes this service manager.
+ *
* @throws Exception if an error occurs.
*/
@SuppressWarnings("unchecked")
@@ -71,6 +74,7 @@ public final class ServiceManager {
/**
* Registers a service.
+ *
* @param The type of service.
* @param clazz The service's class.
* @param service The service.
@@ -82,6 +86,7 @@ public final class ServiceManager {
/**
* Gets a service.
+ *
* @param The type of service.
* @param clazz The service class.
* @return The service.
@@ -104,6 +109,7 @@ public final class ServiceManager {
/**
* Sets the context of all services.
+ *
* @param ctx The server context.
*/
public void setContext(ServerContext ctx) {
diff --git a/src/org/apollo/fs/FileDescriptor.java b/src/org/apollo/fs/FileDescriptor.java
index 21270358..6d07aa57 100644
--- a/src/org/apollo/fs/FileDescriptor.java
+++ b/src/org/apollo/fs/FileDescriptor.java
@@ -2,6 +2,7 @@ package org.apollo.fs;
/**
* A class which points to a file in the cache.
+ *
* @author Graham
*/
public final class FileDescriptor {
@@ -18,6 +19,7 @@ public final class FileDescriptor {
/**
* Creates the file descriptor.
+ *
* @param type The file type.
* @param file The file id.
*/
@@ -28,6 +30,7 @@ public final class FileDescriptor {
/**
* Gets the file type.
+ *
* @return The file type.
*/
public int getType() {
@@ -36,6 +39,7 @@ public final class FileDescriptor {
/**
* Gets the file id.
+ *
* @return The file id.
*/
public int getFile() {
diff --git a/src/org/apollo/fs/FileSystemConstants.java b/src/org/apollo/fs/FileSystemConstants.java
index 2c308162..bc7ae9d0 100644
--- a/src/org/apollo/fs/FileSystemConstants.java
+++ b/src/org/apollo/fs/FileSystemConstants.java
@@ -2,6 +2,7 @@ package org.apollo.fs;
/**
* Holds file system related constants.
+ *
* @author Graham
*/
public final class FileSystemConstants {
diff --git a/src/org/apollo/fs/Index.java b/src/org/apollo/fs/Index.java
index 505034f1..9009cce0 100644
--- a/src/org/apollo/fs/Index.java
+++ b/src/org/apollo/fs/Index.java
@@ -2,12 +2,14 @@ package org.apollo.fs;
/**
* An {@link Index} points to a file in the {@code main_file_cache.dat} file.
+ *
* @author Graham
*/
public final class Index {
/**
* Decodes a buffer into an index.
+ *
* @param buffer The buffer.
* @return The decoded {@link Index}.
* @throws IllegalArgumentException if the buffer length is invalid.
@@ -35,6 +37,7 @@ public final class Index {
/**
* Creates the index.
+ *
* @param size The size of the file.
* @param block The first block of the file.
*/
@@ -45,6 +48,7 @@ public final class Index {
/**
* Gets the size of the file.
+ *
* @return The size of the file.
*/
public int getSize() {
@@ -53,6 +57,7 @@ public final class Index {
/**
* Gets the first block of the file.
+ *
* @return The first block of the file.
*/
public int getBlock() {
diff --git a/src/org/apollo/fs/IndexedFileSystem.java b/src/org/apollo/fs/IndexedFileSystem.java
index c8110e05..0d79a16a 100644
--- a/src/org/apollo/fs/IndexedFileSystem.java
+++ b/src/org/apollo/fs/IndexedFileSystem.java
@@ -9,9 +9,9 @@ import java.nio.ByteBuffer;
import java.util.zip.CRC32;
/**
- * A file system based on top of the operating system's file system. It
- * consists of a data file and index files. Index files point to blocks in the
- * data file, which contains the actual data.
+ * A file system based on top of the operating system's file system. It consists of a data file and index files. Index
+ * files point to blocks in the data file, which contains the actual data.
+ *
* @author Graham
*/
public final class IndexedFileSystem implements Closeable {
@@ -38,6 +38,7 @@ public final class IndexedFileSystem implements Closeable {
/**
* Creates the file system with the specified base directory.
+ *
* @param base The base directory.
* @param readOnly A flag indicating if the file system will be read only.
* @throws Exception if the file system is invalid.
@@ -49,6 +50,7 @@ public final class IndexedFileSystem implements Closeable {
/**
* Checks if this {@link IndexedFileSystem} is read only.
+ *
* @return {@code true} if so, {@code false} if not.
*/
public boolean isReadOnly() {
@@ -57,6 +59,7 @@ public final class IndexedFileSystem implements Closeable {
/**
* Automatically detect the layout of the specified directory.
+ *
* @param base The base directory.
* @throws Exception if the file system is invalid.
*/
@@ -86,6 +89,7 @@ public final class IndexedFileSystem implements Closeable {
/**
* Gets the index of a file.
+ *
* @param fd The {@link FileDescriptor} which points to the file.
* @return The {@link Index}.
* @throws IOException if an I/O error occurs.
@@ -113,6 +117,7 @@ public final class IndexedFileSystem implements Closeable {
/**
* Gets the number of files with the specified type.
+ *
* @param type The type.
* @return The number of files.
* @throws IOException if an I/O error occurs.
@@ -130,6 +135,7 @@ public final class IndexedFileSystem implements Closeable {
/**
* Gets the CRC table.
+ *
* @return The CRC table.
* @throws IOException if an I/O erorr occurs.
*/
@@ -185,6 +191,7 @@ public final class IndexedFileSystem implements Closeable {
/**
* Gets a file.
+ *
* @param type The file type.
* @param file The file id.
* @return A {@link ByteBuffer} which contains the contents of the file.
@@ -196,6 +203,7 @@ public final class IndexedFileSystem implements Closeable {
/**
* Gets a file.
+ *
* @param fd The {@link FileDescriptor} which points to the file.
* @return A {@link ByteBuffer} which contains the contents of the file.
* @throws IOException if an I/O error occurs.
diff --git a/src/org/apollo/fs/archive/Archive.java b/src/org/apollo/fs/archive/Archive.java
index 329a7789..c405c14b 100644
--- a/src/org/apollo/fs/archive/Archive.java
+++ b/src/org/apollo/fs/archive/Archive.java
@@ -17,11 +17,9 @@ public final class Archive {
/**
* Decodes the archive in the specified buffer.
*
- * @param buffer
- * The buffer.
+ * @param buffer The buffer.
* @return The archive.
- * @throws IOException
- * if an I/O error occurs.
+ * @throws IOException if an I/O error occurs.
*/
public static Archive decode(ByteBuffer buffer) throws IOException {
int extractedSize = ByteBufferUtil.readUnsignedTriByte(buffer);
@@ -71,8 +69,7 @@ public final class Archive {
/**
* Creates a new archive.
*
- * @param entries
- * The entries in this archive.
+ * @param entries The entries in this archive.
*/
public Archive(ArchiveEntry[] entries) {
this.entries = entries;
@@ -81,11 +78,9 @@ public final class Archive {
/**
* Gets an entry by its name.
*
- * @param name
- * The name.
+ * @param name The name.
* @return The entry.
- * @throws FileNotFoundException
- * if the file could not be found.
+ * @throws FileNotFoundException if the file could not be found.
*/
public ArchiveEntry getEntry(String name) throws FileNotFoundException {
int hash = 0;
diff --git a/src/org/apollo/fs/archive/ArchiveEntry.java b/src/org/apollo/fs/archive/ArchiveEntry.java
index 1688483c..6d1e31ef 100644
--- a/src/org/apollo/fs/archive/ArchiveEntry.java
+++ b/src/org/apollo/fs/archive/ArchiveEntry.java
@@ -4,6 +4,7 @@ import java.nio.ByteBuffer;
/**
* Represents a single entry in an {@link Archive}.
+ *
* @author Graham
*/
public final class ArchiveEntry {
@@ -20,6 +21,7 @@ public final class ArchiveEntry {
/**
* Creates a new archive entry.
+ *
* @param identifier The identifier.
* @param buffer The buffer.
*/
@@ -30,6 +32,7 @@ public final class ArchiveEntry {
/**
* Gets the identifier of this entry.
+ *
* @return The identifier of this entry.
*/
public int getIdentifier() {
@@ -38,6 +41,7 @@ public final class ArchiveEntry {
/**
* Gets the buffer of this entry.
+ *
* @return This buffer of this entry.
*/
public ByteBuffer getBuffer() {
diff --git a/src/org/apollo/fs/archive/package-info.java b/src/org/apollo/fs/archive/package-info.java
index 0d21259c..edf1f79a 100644
--- a/src/org/apollo/fs/archive/package-info.java
+++ b/src/org/apollo/fs/archive/package-info.java
@@ -2,3 +2,4 @@
* Contains classes which deal with archives.
*/
package org.apollo.fs.archive;
+
diff --git a/src/org/apollo/fs/package-info.java b/src/org/apollo/fs/package-info.java
index 14c2a3bd..60330723 100644
--- a/src/org/apollo/fs/package-info.java
+++ b/src/org/apollo/fs/package-info.java
@@ -3,3 +3,4 @@
* store game data files.
*/
package org.apollo.fs;
+
diff --git a/src/org/apollo/fs/parser/ItemDefinitionParser.java b/src/org/apollo/fs/parser/ItemDefinitionParser.java
index fa4b0aa0..ba88ea63 100644
--- a/src/org/apollo/fs/parser/ItemDefinitionParser.java
+++ b/src/org/apollo/fs/parser/ItemDefinitionParser.java
@@ -23,8 +23,7 @@ public final class ItemDefinitionParser {
/**
* Creates the item definition parser.
*
- * @param fs
- * The indexed file system.
+ * @param fs The indexed file system.
*/
public ItemDefinitionParser(IndexedFileSystem fs) {
this.fs = fs;
@@ -34,8 +33,7 @@ public final class ItemDefinitionParser {
* Parses the item definitions.
*
* @return The item definitions.
- * @throws IOException
- * if an I/O error occurs.
+ * @throws IOException if an I/O error occurs.
*/
public ItemDefinition[] parse() throws IOException {
Archive config = Archive.decode(fs.getFile(0, 2));
@@ -62,10 +60,8 @@ public final class ItemDefinitionParser {
/**
* Parses a single definition.
*
- * @param id
- * The item's id.
- * @param buffer
- * The buffer.
+ * @param id The item's id.
+ * @param buffer The buffer.
* @return The definition.
*/
private ItemDefinition parseDefinition(int id, ByteBuffer buffer) {
diff --git a/src/org/apollo/fs/parser/package-info.java b/src/org/apollo/fs/parser/package-info.java
index c08852a9..e3ac1a67 100644
--- a/src/org/apollo/fs/parser/package-info.java
+++ b/src/org/apollo/fs/parser/package-info.java
@@ -2,3 +2,4 @@
* Contains classes which parse files within the game's cache.
*/
package org.apollo.fs.parser;
+
diff --git a/src/org/apollo/game/GameConstants.java b/src/org/apollo/game/GameConstants.java
index 576d3e0f..f49dff44 100644
--- a/src/org/apollo/game/GameConstants.java
+++ b/src/org/apollo/game/GameConstants.java
@@ -2,6 +2,7 @@ package org.apollo.game;
/**
* Contains game-related constants.
+ *
* @author Graham
*/
public final class GameConstants {
diff --git a/src/org/apollo/game/GamePulseHandler.java b/src/org/apollo/game/GamePulseHandler.java
index aeea5b22..037d9908 100644
--- a/src/org/apollo/game/GamePulseHandler.java
+++ b/src/org/apollo/game/GamePulseHandler.java
@@ -5,6 +5,7 @@ import java.util.logging.Logger;
/**
* A class which handles the logic for each pulse of the {@link GameService}.
+ *
* @author Graham
*/
public final class GamePulseHandler implements Runnable {
@@ -21,6 +22,7 @@ public final class GamePulseHandler implements Runnable {
/**
* Creates the game pulse handler object.
+ *
* @param service The {@link GameService}.
*/
GamePulseHandler(GameService service) {
diff --git a/src/org/apollo/game/GameService.java b/src/org/apollo/game/GameService.java
index 45878138..27b7b567 100644
--- a/src/org/apollo/game/GameService.java
+++ b/src/org/apollo/game/GameService.java
@@ -22,23 +22,23 @@ import org.apollo.util.xml.XmlNode;
import org.apollo.util.xml.XmlParser;
/**
- * The {@link GameService} class schedules and manages the execution of the
- * {@link GamePulseHandler} class.
+ * The {@link GameService} class schedules and manages the execution of the {@link GamePulseHandler} class.
+ *
* @author Graham
*/
public final class GameService extends Service {
/**
- * The number of times to unregister players per cycle. This is to ensure
- * the saving threads don't get swamped with requests and slow everything
- * down.
+ * The number of times to unregister players per cycle. This is to ensure the saving threads don't get swamped with
+ * requests and slow everything down.
*/
private static final int UNREGISTERS_PER_CYCLE = 50;
/**
* The scheduled executor service.
*/
- private final ScheduledExecutorService scheduledExecutor = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("GameService"));
+ private final ScheduledExecutorService scheduledExecutor = Executors
+ .newSingleThreadScheduledExecutor(new NamedThreadFactory("GameService"));
/**
* A queue of players to remove.
@@ -57,6 +57,7 @@ public final class GameService extends Service {
/**
* Creates the game service.
+ *
* @throws Exception if an error occurs during initialization.
*/
public GameService() throws Exception {
@@ -65,6 +66,7 @@ public final class GameService extends Service {
/**
* Gets the event handler chains.
+ *
* @return The event handler chains.
*/
public EventHandlerChainGroup getEventHandlerChains() {
@@ -73,6 +75,7 @@ public final class GameService extends Service {
/**
* Initializes the game service.
+ *
* @throws Exception if an error occurs.
*/
private void init() throws Exception {
@@ -110,7 +113,8 @@ 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);
}
/**
@@ -143,6 +147,7 @@ public final class GameService extends Service {
/**
* Registers a player (may block!).
+ *
* @param player The player.
* @return A {@link RegistrationStatus}.
*/
@@ -153,8 +158,8 @@ public final class GameService extends Service {
}
/**
- * Unregisters a player. Returns immediately. The player is unregistered
- * at the start of the next cycle.
+ * Unregisters a player. Returns immediately. The player is unregistered at the start of the next cycle.
+ *
* @param player The player.
*/
public void unregisterPlayer(Player player) {
@@ -163,6 +168,7 @@ public final class GameService extends Service {
/**
* Finalizes the unregistration of a player.
+ *
* @param player The player.
*/
public void finalizePlayerUnregistration(Player player) {
diff --git a/src/org/apollo/game/action/Action.java b/src/org/apollo/game/action/Action.java
index 00370f23..6d088bca 100644
--- a/src/org/apollo/game/action/Action.java
+++ b/src/org/apollo/game/action/Action.java
@@ -4,14 +4,12 @@ import org.apollo.game.model.Character;
import org.apollo.game.scheduling.ScheduledTask;
/**
- * An action is a specialised {@link ScheduledTask} which is specific to a
- * character.
+ * An action is a specialised {@link ScheduledTask} which is specific to a character.
*
- * ALL actions MUST implement the
- * {@link #equals(Object)} method. This is to check if two actions are
- * identical: if they are, then the new action does not replace the old one (so
- * spam/accidental clicking won't cancel your action, and start another from
- * scratch).
+ * ALL actions MUST implement the {@link #equals(Object)} method. This is to check if
+ * two actions are identical: if they are, then the new action does not replace the old one (so spam/accidental clicking
+ * won't cancel your action, and start another from scratch).
+ *
* @author Graham
*/
public abstract class Action extends ScheduledTask {
@@ -28,9 +26,9 @@ public abstract class Action extends ScheduledTask {
/**
* Creates a new action.
+ *
* @param delay The delay in pulses.
- * @param immediate A flag indicating if the action should happen
- * immediately.
+ * @param immediate A flag indicating if the action should happen immediately.
* @param character The character performing the action.
*/
public Action(int delay, boolean immediate, T character) {
@@ -40,6 +38,7 @@ public abstract class Action extends ScheduledTask {
/**
* Gets the character which performed the action.
+ *
* @return The character.
*/
public T getCharacter() {
diff --git a/src/org/apollo/game/action/DistancedAction.java b/src/org/apollo/game/action/DistancedAction.java
index 60d098e9..d679f583 100644
--- a/src/org/apollo/game/action/DistancedAction.java
+++ b/src/org/apollo/game/action/DistancedAction.java
@@ -5,6 +5,7 @@ import org.apollo.game.model.Position;
/**
* An @{link Action} which fires when a distance requirement is met.
+ *
* @author Blake
* @author Graham
*/
@@ -26,8 +27,7 @@ public abstract class DistancedAction extends Action {
private final int delay;
/**
- * A flag indicating if this action fires immediately after the threshold
- * is reached.
+ * A flag indicating if this action fires immediately after the threshold is reached.
*/
private final boolean immediate;
@@ -38,10 +38,9 @@ public abstract class DistancedAction extends Action {
/**
* Creates a new DistancedAction.
- * @param delay The delay between executions once the distance threshold is
- * reached.
- * @param immediate Whether or not this action fires immediately after the
- * distance threshold is reached.
+ *
+ * @param delay The delay between executions once the distance threshold is reached.
+ * @param immediate Whether or not this action fires immediately after the distance threshold is reached.
* @param character The character.
* @param position The position.
* @param distance The distance.
@@ -60,7 +59,7 @@ public abstract class DistancedAction extends Action {
// some actions (e.g. agility) will cause the player to move away again
// so we don't check once the player got close enough once
executeAction();
- } else if (getCharacter().getPosition().getDistance(position) <= distance) {
+ } else if (getCharacter().getPosition().getDistance(position) <= distance) {
reached = true;
setDelay(delay);
if (immediate) { // TODO: required?
diff --git a/src/org/apollo/game/action/package-info.java b/src/org/apollo/game/action/package-info.java
index 3c36cc53..f90b955b 100644
--- a/src/org/apollo/game/action/package-info.java
+++ b/src/org/apollo/game/action/package-info.java
@@ -3,3 +3,4 @@
* characters perform.
*/
package org.apollo.game.action;
+
diff --git a/src/org/apollo/game/command/Command.java b/src/org/apollo/game/command/Command.java
index 3365d832..7d7c49ea 100644
--- a/src/org/apollo/game/command/Command.java
+++ b/src/org/apollo/game/command/Command.java
@@ -2,6 +2,7 @@ package org.apollo.game.command;
/**
* Represents a command.
+ *
* @author Graham
*/
public final class Command {
@@ -18,6 +19,7 @@ public final class Command {
/**
* Creates the command.
+ *
* @param name The name of the command.
* @param arguments The command's arguments.
*/
@@ -28,6 +30,7 @@ public final class Command {
/**
* Gets the name of the command.
+ *
* @return The name of the command.
*/
public String getName() {
@@ -36,6 +39,7 @@ public final class Command {
/**
* Gets the command's arguments.
+ *
* @return The command's arguments.
*/
public String[] getArguments() {
diff --git a/src/org/apollo/game/command/CommandDispatcher.java b/src/org/apollo/game/command/CommandDispatcher.java
index 60f094b4..31fb1db7 100644
--- a/src/org/apollo/game/command/CommandDispatcher.java
+++ b/src/org/apollo/game/command/CommandDispatcher.java
@@ -7,6 +7,7 @@ import org.apollo.game.model.Player;
/**
* A class which dispatches {@link Command}s to {@link CommandListener}s.
+ *
* @author Graham
*/
public final class CommandDispatcher {
@@ -17,8 +18,7 @@ public final class CommandDispatcher {
private final Map listeners = new HashMap();
/**
- * Creates the command dispatcher and registers a listener for the credits
- * command.
+ * Creates the command dispatcher and registers a listener for the credits command.
*/
public CommandDispatcher() {
// not in a plugin so it is harder for people to remove!
@@ -27,6 +27,7 @@ public final class CommandDispatcher {
/**
* Registers a listener with the
+ *
* @param command The command's name.
* @param listener The listener.
*/
@@ -36,6 +37,7 @@ public final class CommandDispatcher {
/**
* Dispatches a command to the appropriate listener.
+ *
* @param player The player.
* @param command The command.
*/
diff --git a/src/org/apollo/game/command/CommandListener.java b/src/org/apollo/game/command/CommandListener.java
index 6b3dd3e9..59bd758a 100644
--- a/src/org/apollo/game/command/CommandListener.java
+++ b/src/org/apollo/game/command/CommandListener.java
@@ -3,14 +3,15 @@ package org.apollo.game.command;
import org.apollo.game.model.Player;
/**
- * An interface which should be implemented by classes to listen to
- * {@link Command}s.
+ * An interface which should be implemented by classes to listen to {@link Command}s.
+ *
* @author Graham
*/
public interface CommandListener {
/**
* Executes the action for this command.
+ *
* @param player The player.
* @param command The command.
*/
diff --git a/src/org/apollo/game/command/CreditsCommandListener.java b/src/org/apollo/game/command/CreditsCommandListener.java
index 0016243e..a18cad9c 100644
--- a/src/org/apollo/game/command/CreditsCommandListener.java
+++ b/src/org/apollo/game/command/CreditsCommandListener.java
@@ -9,22 +9,19 @@ import org.apollo.game.model.inter.quest.QuestConstants;
import org.apollo.util.plugin.PluginManager;
/**
- * Implements a {@code ::credits} command that lists the authors of all plugins
- * used in the server.
+ * Implements a {@code ::credits} command that lists the authors of all plugins used in the server.
+ *
* @author Graham
*/
public final class CreditsCommandListener implements CommandListener {
/*
- * If you are considering removing this command, please bear in mind that
- * Apollo took several people thousands of hours to create. We released it
- * to the world for free and it isn't much to ask to leave this command in.
- * It isn't very obtrusive and gives us some well-deserved recognition for
- * the work we have done. Thank you!
- *
- * The list of authors is generated from the plugin manager. If you create
- * a custom plugin, make sure you add your name to the plugin.xml file and
- * it'll appear here automatically!
+ * If you are considering removing this command, please bear in mind that Apollo took several people thousands of
+ * hours to create. We released it to the world for free and it isn't much to ask to leave this command in. It isn't
+ * very obtrusive and gives us some well-deserved recognition for the work we have done. Thank you!
+ *
+ * The list of authors is generated from the plugin manager. If you create a custom plugin, make sure you add your
+ * name to the plugin.xml file and it'll appear here automatically!
*/
@Override
@@ -36,13 +33,19 @@ public final class CreditsCommandListener implements CommandListener {
player.send(new SetInterfaceTextEvent(QuestConstants.QUEST_TEXT[pos++], "@dre@Apollo"));
player.send(new SetInterfaceTextEvent(QuestConstants.QUEST_TEXT[pos++], "@dre@Introduction"));
player.send(new SetInterfaceTextEvent(QuestConstants.QUEST_TEXT[pos++], ""));
- player.send(new SetInterfaceTextEvent(QuestConstants.QUEST_TEXT[pos++], "This server is based on Apollo, a lightweight, fast, secure"));
- player.send(new SetInterfaceTextEvent(QuestConstants.QUEST_TEXT[pos++], "and open-source RuneScape emulator. For more"));
- player.send(new SetInterfaceTextEvent(QuestConstants.QUEST_TEXT[pos++], "information about Apollo, visit the website at:"));
- player.send(new SetInterfaceTextEvent(QuestConstants.QUEST_TEXT[pos++], "@dbl@https://github.com/apollo-rsps/apollo"));
+ player.send(new SetInterfaceTextEvent(QuestConstants.QUEST_TEXT[pos++],
+ "This server is based on Apollo, a lightweight, fast, secure"));
+ player.send(new SetInterfaceTextEvent(QuestConstants.QUEST_TEXT[pos++],
+ "and open-source RuneScape emulator. For more"));
+ player.send(new SetInterfaceTextEvent(QuestConstants.QUEST_TEXT[pos++],
+ "information about Apollo, visit the website at:"));
+ player.send(new SetInterfaceTextEvent(QuestConstants.QUEST_TEXT[pos++],
+ "@dbl@https://github.com/apollo-rsps/apollo"));
player.send(new SetInterfaceTextEvent(QuestConstants.QUEST_TEXT[pos++], ""));
- player.send(new SetInterfaceTextEvent(QuestConstants.QUEST_TEXT[pos++], "Apollo is released under the terms of the ISC"));
- player.send(new SetInterfaceTextEvent(QuestConstants.QUEST_TEXT[pos++], "license, details can be found in the root folder of the "));
+ player.send(new SetInterfaceTextEvent(QuestConstants.QUEST_TEXT[pos++],
+ "Apollo is released under the terms of the ISC"));
+ player.send(new SetInterfaceTextEvent(QuestConstants.QUEST_TEXT[pos++],
+ "license, details can be found in the root folder of the "));
player.send(new SetInterfaceTextEvent(QuestConstants.QUEST_TEXT[pos++], "Apollo distribution."));
player.send(new SetInterfaceTextEvent(QuestConstants.QUEST_TEXT[pos++], ""));
player.send(new SetInterfaceTextEvent(QuestConstants.QUEST_TEXT[pos++], "@dre@Credits"));
diff --git a/src/org/apollo/game/command/PrivilegedCommandListener.java b/src/org/apollo/game/command/PrivilegedCommandListener.java
index dfbc931d..a24eb94a 100644
--- a/src/org/apollo/game/command/PrivilegedCommandListener.java
+++ b/src/org/apollo/game/command/PrivilegedCommandListener.java
@@ -4,8 +4,8 @@ import org.apollo.game.model.Player;
import org.apollo.game.model.Player.PrivilegeLevel;
/**
- * A {@link CommandListener} which checks the {@link PrivilegeLevel} of the
- * {@link Player} executing the command.
+ * A {@link CommandListener} which checks the {@link PrivilegeLevel} of the {@link Player} executing the command.
+ *
* @author Graham
*/
public abstract class PrivilegedCommandListener implements CommandListener {
@@ -17,6 +17,7 @@ public abstract class PrivilegedCommandListener implements CommandListener {
/**
* Creates the privileged command listener with the specified minimum level.
+ *
* @param level The minimum privilege level.
*/
public PrivilegedCommandListener(PrivilegeLevel level) {
@@ -25,6 +26,7 @@ public abstract class PrivilegedCommandListener implements CommandListener {
/**
* Executes a privileged command.
+ *
* @param player The player.
* @param command The command.
*/
diff --git a/src/org/apollo/game/command/package-info.java b/src/org/apollo/game/command/package-info.java
index ad8d8123..84f11f0b 100644
--- a/src/org/apollo/game/command/package-info.java
+++ b/src/org/apollo/game/command/package-info.java
@@ -2,3 +2,4 @@
* Contains classes related to in-game commands.
*/
package org.apollo.game.command;
+
diff --git a/src/org/apollo/game/event/Event.java b/src/org/apollo/game/event/Event.java
index 91b9e2ea..ac851206 100644
--- a/src/org/apollo/game/event/Event.java
+++ b/src/org/apollo/game/event/Event.java
@@ -2,6 +2,7 @@ package org.apollo.game.event;
/**
* Represents an event that can occur in the game world.
+ *
* @author Graham
*/
public abstract class Event {
diff --git a/src/org/apollo/game/event/handler/EventHandler.java b/src/org/apollo/game/event/handler/EventHandler.java
index c4e5b236..e245375d 100644
--- a/src/org/apollo/game/event/handler/EventHandler.java
+++ b/src/org/apollo/game/event/handler/EventHandler.java
@@ -5,6 +5,7 @@ import org.apollo.game.model.Player;
/**
* A class which handles events.
+ *
* @author Graham
* @param The type of event this class handles.
*/
@@ -12,6 +13,7 @@ public abstract class EventHandler {
/**
* Handles an event.
+ *
* @param ctx The context.
* @param player The player.
* @param event The event.
diff --git a/src/org/apollo/game/event/handler/EventHandlerContext.java b/src/org/apollo/game/event/handler/EventHandlerContext.java
index 12597531..6730d5c7 100644
--- a/src/org/apollo/game/event/handler/EventHandlerContext.java
+++ b/src/org/apollo/game/event/handler/EventHandlerContext.java
@@ -3,8 +3,8 @@ package org.apollo.game.event.handler;
import org.apollo.game.event.handler.chain.EventHandlerChain;
/**
- * Provides operations specific to an {@link EventHandler} in an
- * {@link EventHandlerChain}.
+ * Provides operations specific to an {@link EventHandler} in an {@link EventHandlerChain}.
+ *
* @author Graham
*/
public abstract class EventHandlerContext {
diff --git a/src/org/apollo/game/event/handler/chain/EventHandlerChain.java b/src/org/apollo/game/event/handler/chain/EventHandlerChain.java
index 12b6a675..c1dd430e 100644
--- a/src/org/apollo/game/event/handler/chain/EventHandlerChain.java
+++ b/src/org/apollo/game/event/handler/chain/EventHandlerChain.java
@@ -7,6 +7,7 @@ import org.apollo.game.model.Player;
/**
* A chain of event handlers.
+ *
* @author Graham
* @param The type of event the handlers in this chain handle.
*/
@@ -19,6 +20,7 @@ public final class EventHandlerChain {
/**
* Creates the event handler chain.
+ *
* @param handlers The handlers.
*/
@SafeVarargs
@@ -28,6 +30,7 @@ public final class EventHandlerChain {
/**
* Dynamically adds an event handler to the end of the chain.
+ *
* @param handler The handler.
*/
@SuppressWarnings("unchecked")
@@ -39,8 +42,8 @@ public final class EventHandlerChain {
}
/**
- * Handles the event, passing it down the chain until the chain is broken
- * or the event reaches the end of the chain.
+ * Handles the event, passing it down the chain until the chain is broken or the event reaches the end of the chain.
+ *
* @param player The player.
* @param event The event.
*/
diff --git a/src/org/apollo/game/event/handler/chain/EventHandlerChainGroup.java b/src/org/apollo/game/event/handler/chain/EventHandlerChainGroup.java
index 294221fd..4d31ecd7 100644
--- a/src/org/apollo/game/event/handler/chain/EventHandlerChainGroup.java
+++ b/src/org/apollo/game/event/handler/chain/EventHandlerChainGroup.java
@@ -6,6 +6,7 @@ import org.apollo.game.event.Event;
/**
* A group of {@link EventHandlerChain}s classified by the {@link Event} type.
+ *
* @author Graham
*/
public final class EventHandlerChainGroup {
@@ -17,6 +18,7 @@ public final class EventHandlerChainGroup {
/**
* Creates the event handler chain group.
+ *
* @param chains The chains map.
*/
public EventHandlerChainGroup(Map, EventHandlerChain>> chains) {
@@ -25,10 +27,10 @@ public final class EventHandlerChainGroup {
/**
* Gets an {@link EventHandlerChain} from this group.
+ *
* @param The type of event.
* @param clazz The event class.
- * @return The {@link EventHandlerChain} if one was found, {@code null}
- * otherwise.
+ * @return The {@link EventHandlerChain} if one was found, {@code null} otherwise.
*/
@SuppressWarnings("unchecked")
public EventHandlerChain getChain(Class clazz) {
diff --git a/src/org/apollo/game/event/handler/chain/package-info.java b/src/org/apollo/game/event/handler/chain/package-info.java
index 4f2c1ead..4e03fa83 100644
--- a/src/org/apollo/game/event/handler/chain/package-info.java
+++ b/src/org/apollo/game/event/handler/chain/package-info.java
@@ -2,3 +2,4 @@
* Contains classes related to the chaining of event handlers.
*/
package org.apollo.game.event.handler.chain;
+
diff --git a/src/org/apollo/game/event/handler/impl/BankButtonEventHandler.java b/src/org/apollo/game/event/handler/impl/BankButtonEventHandler.java
index fbd36316..afd846e6 100644
--- a/src/org/apollo/game/event/handler/impl/BankButtonEventHandler.java
+++ b/src/org/apollo/game/event/handler/impl/BankButtonEventHandler.java
@@ -6,8 +6,8 @@ import org.apollo.game.event.impl.ButtonEvent;
import org.apollo.game.model.Player;
/**
- * An {@link EventHandler} which responds to {@link ButtonEvent}s for
- * withdrawing items as notes.
+ * An {@link EventHandler} which responds to {@link ButtonEvent}s for withdrawing items as notes.
+ *
* @author Graham
*/
public final class BankButtonEventHandler extends EventHandler {
diff --git a/src/org/apollo/game/event/handler/impl/BankEventHandler.java b/src/org/apollo/game/event/handler/impl/BankEventHandler.java
index 219c015d..198bf446 100644
--- a/src/org/apollo/game/event/handler/impl/BankEventHandler.java
+++ b/src/org/apollo/game/event/handler/impl/BankEventHandler.java
@@ -10,14 +10,15 @@ import org.apollo.game.model.inter.bank.BankUtils;
import org.apollo.game.model.inter.bank.BankWithdrawEnterAmountListener;
/**
- * An event handler which handles withdrawing and depositing items from/to a
- * player's bank.
+ * An event handler which handles withdrawing and depositing items from/to a player's bank.
+ *
* @author Graham
*/
public final class BankEventHandler extends EventHandler {
/**
* Converts an option to an amount.
+ *
* @param option The option.
* @return The amount.
* @throws IllegalArgumentException if the option is not legal.
@@ -53,6 +54,7 @@ public final class BankEventHandler extends EventHandler {
/**
* Handles a withdraw action.
+ *
* @param ctx The event handler context.
* @param player The player.
* @param event The event.
@@ -60,7 +62,8 @@ public final class BankEventHandler extends EventHandler {
private void withdraw(EventHandlerContext ctx, Player player, ItemActionEvent event) {
int amount = optionToAmount(event.getOption());
if (amount == -1) {
- player.getInterfaceSet().openEnterAmountDialog(new BankWithdrawEnterAmountListener(player, event.getSlot(), event.getId()));
+ player.getInterfaceSet().openEnterAmountDialog(
+ new BankWithdrawEnterAmountListener(player, event.getSlot(), event.getId()));
} else {
if (!BankUtils.withdraw(player, event.getSlot(), event.getId(), amount)) {
ctx.breakHandlerChain();
@@ -70,6 +73,7 @@ public final class BankEventHandler extends EventHandler {
/**
* Handles a deposit action.
+ *
* @param ctx The event handler context.
* @param player The player.
* @param event The event.
@@ -77,7 +81,8 @@ public final class BankEventHandler extends EventHandler {
private void deposit(EventHandlerContext ctx, Player player, ItemActionEvent event) {
int amount = optionToAmount(event.getOption());
if (amount == -1) {
- player.getInterfaceSet().openEnterAmountDialog(new BankDepositEnterAmountListener(player, event.getSlot(), event.getId()));
+ player.getInterfaceSet().openEnterAmountDialog(
+ new BankDepositEnterAmountListener(player, event.getSlot(), event.getId()));
} else {
if (!BankUtils.deposit(player, event.getSlot(), event.getId(), amount)) {
ctx.breakHandlerChain();
diff --git a/src/org/apollo/game/event/handler/impl/CharacterDesignEventHandler.java b/src/org/apollo/game/event/handler/impl/CharacterDesignEventHandler.java
index ba796681..49161712 100644
--- a/src/org/apollo/game/event/handler/impl/CharacterDesignEventHandler.java
+++ b/src/org/apollo/game/event/handler/impl/CharacterDesignEventHandler.java
@@ -8,6 +8,7 @@ import org.apollo.game.model.Player;
/**
* A handler which handles {@link CharacterDesignEvent}s.
+ *
* @author Graham
*/
public final class CharacterDesignEventHandler extends EventHandler {
diff --git a/src/org/apollo/game/event/handler/impl/CharacterDesignVerificationHandler.java b/src/org/apollo/game/event/handler/impl/CharacterDesignVerificationHandler.java
index af790242..5264cdaa 100644
--- a/src/org/apollo/game/event/handler/impl/CharacterDesignVerificationHandler.java
+++ b/src/org/apollo/game/event/handler/impl/CharacterDesignVerificationHandler.java
@@ -9,6 +9,7 @@ import org.apollo.game.model.Player;
/**
* A handler which verifies {@link CharacterDesignEvent}s.
+ *
* @author Graham
*/
public final class CharacterDesignVerificationHandler extends EventHandler {
@@ -22,6 +23,7 @@ public final class CharacterDesignVerificationHandler extends EventHandler {
diff --git a/src/org/apollo/game/event/handler/impl/ChatVerificationHandler.java b/src/org/apollo/game/event/handler/impl/ChatVerificationHandler.java
index 6a041c9c..7c5a0b7e 100644
--- a/src/org/apollo/game/event/handler/impl/ChatVerificationHandler.java
+++ b/src/org/apollo/game/event/handler/impl/ChatVerificationHandler.java
@@ -7,6 +7,7 @@ import org.apollo.game.model.Player;
/**
* An event handler which verifies chat events.
+ *
* @author Graham
*/
public final class ChatVerificationHandler extends EventHandler {
diff --git a/src/org/apollo/game/event/handler/impl/ClosedInterfaceEventHandler.java b/src/org/apollo/game/event/handler/impl/ClosedInterfaceEventHandler.java
index 0eeca824..ab3acbb7 100644
--- a/src/org/apollo/game/event/handler/impl/ClosedInterfaceEventHandler.java
+++ b/src/org/apollo/game/event/handler/impl/ClosedInterfaceEventHandler.java
@@ -7,6 +7,7 @@ import org.apollo.game.model.Player;
/**
* An {@link EventHandler} for the {@link ClosedInterfaceEvent}.
+ *
* @author Graham
*/
public final class ClosedInterfaceEventHandler extends EventHandler {
diff --git a/src/org/apollo/game/event/handler/impl/CommandEventHandler.java b/src/org/apollo/game/event/handler/impl/CommandEventHandler.java
index 93fad89f..7a60a037 100644
--- a/src/org/apollo/game/event/handler/impl/CommandEventHandler.java
+++ b/src/org/apollo/game/event/handler/impl/CommandEventHandler.java
@@ -9,6 +9,7 @@ import org.apollo.game.model.World;
/**
* An {@link EventHandler} which dispatches {@link CommandEvent}s.
+ *
* @author Graham
*/
public final class CommandEventHandler extends EventHandler {
diff --git a/src/org/apollo/game/event/handler/impl/EnteredAmountEventHandler.java b/src/org/apollo/game/event/handler/impl/EnteredAmountEventHandler.java
index 9a3ca8cc..b98b09e1 100644
--- a/src/org/apollo/game/event/handler/impl/EnteredAmountEventHandler.java
+++ b/src/org/apollo/game/event/handler/impl/EnteredAmountEventHandler.java
@@ -7,6 +7,7 @@ import org.apollo.game.model.Player;
/**
* An {@link EventHandler} for the {@link EnteredAmountEvent}.
+ *
* @author Graham
*/
public final class EnteredAmountEventHandler extends EventHandler {
diff --git a/src/org/apollo/game/event/handler/impl/EquipEventHandler.java b/src/org/apollo/game/event/handler/impl/EquipEventHandler.java
index 3fe0711a..d759dd53 100644
--- a/src/org/apollo/game/event/handler/impl/EquipEventHandler.java
+++ b/src/org/apollo/game/event/handler/impl/EquipEventHandler.java
@@ -15,6 +15,7 @@ import org.apollo.game.model.inv.SynchronizationInventoryListener;
/**
* An event handler which equips items.
+ *
* @author Graham
*/
public final class EquipEventHandler extends EventHandler {
@@ -48,7 +49,8 @@ public final class EquipEventHandler extends EventHandler {
return;
}
if (skillSet.getSkill(Skill.STRENGTH).getMaximumLevel() < equipDef.getStrengthLevel()) {
- player.sendMessage("You need a Strength level of " + equipDef.getStrengthLevel() + " to equip this item.");
+ player.sendMessage("You need a Strength level of " + equipDef.getStrengthLevel()
+ + " to equip this item.");
ctx.breakHandlerChain();
return;
}
@@ -77,12 +79,12 @@ public final class EquipEventHandler extends EventHandler {
// TODO: put all this into another method somewhere
// check if there is enough space for a two handed weapon
- if (equipDef.isTwoHanded()) {
- if(equipment.get(EquipmentConstants.SHIELD) != null){
- Item shield = equipment.reset(EquipmentConstants.SHIELD);
- inventory.add(shield);
- }
- }
+ if (equipDef.isTwoHanded()) {
+ if (equipment.get(EquipmentConstants.SHIELD) != null) {
+ Item shield = equipment.reset(EquipmentConstants.SHIELD);
+ inventory.add(shield);
+ }
+ }
// check if a shield is being added with a two handed weapon
boolean removeWeapon = false;
diff --git a/src/org/apollo/game/event/handler/impl/RemoveEventHandler.java b/src/org/apollo/game/event/handler/impl/RemoveEventHandler.java
index a5482aae..dead8afc 100644
--- a/src/org/apollo/game/event/handler/impl/RemoveEventHandler.java
+++ b/src/org/apollo/game/event/handler/impl/RemoveEventHandler.java
@@ -5,42 +5,31 @@ import org.apollo.game.event.handler.EventHandlerContext;
import org.apollo.game.event.impl.ItemActionEvent;
import org.apollo.game.model.Inventory;
import org.apollo.game.model.Item;
-import org.apollo.game.model.Player;
+import org.apollo.game.model.def.ItemDefinition;
import org.apollo.game.model.inv.SynchronizationInventoryListener;
+import org.apollo.game.model.Player;
/**
* An event handler which removes equipped items.
*
* @author Graham
+ * @author Major
*/
public final class RemoveEventHandler extends EventHandler {
@Override
- public void handle(EventHandlerContext ctx, Player player,
- ItemActionEvent event) {
+ public void handle(EventHandlerContext ctx, Player player, ItemActionEvent event) {
- if (event.getOption() == 1
- && event.getInterfaceId() == SynchronizationInventoryListener.EQUIPMENT_ID) {
+ if (event.getOption() == 1 && event.getInterfaceId() == SynchronizationInventoryListener.EQUIPMENT_ID) {
Inventory inventory = player.getInventory();
Inventory equipment = player.getEquipment();
- if (inventory.freeSlots() < 1) { // TODO what if the item is
- // stackable and the player has
- // the item in his inventory
- // already.
- inventory.forceCapacityExceeded();
- ctx.breakHandlerChain();
- return;
- }
-
int slot = event.getSlot();
- if (slot < 0 || slot >= equipment.capacity()) {
- ctx.breakHandlerChain();
- return;
- }
-
Item item = equipment.get(slot);
- if (item == null || item.getId() != event.getId()) {
+ int id = item.getId();
+
+ if (inventory.freeSlots() == 0 && !ItemDefinition.forId(id).isStackable()) {
+ inventory.forceCapacityExceeded();
ctx.breakHandlerChain();
return;
}
@@ -51,22 +40,17 @@ public final class RemoveEventHandler extends EventHandler {
equipment.stopFiringEvents();
try {
- equipment.set(slot, null);
- Item copy = item;
- inventory.add(item.getId(), item.getAmount());
- if (copy != null) {
- removed = false;
- equipment.set(slot, copy);
- }
+ int remaining = inventory.add(id, item.getAmount());
+ removed = remaining == 0;
+ equipment.set(slot, removed ? null : new Item(id, remaining));
} finally {
inventory.startFiringEvents();
equipment.startFiringEvents();
}
if (removed) {
- inventory.forceRefresh(); // TODO find out the specific slot
- // that got used?
- equipment.forceRefresh();
+ inventory.forceRefresh();
+ equipment.forceRefresh(slot);
} else {
inventory.forceCapacityExceeded();
}
diff --git a/src/org/apollo/game/event/handler/impl/SwitchItemEventHandler.java b/src/org/apollo/game/event/handler/impl/SwitchItemEventHandler.java
index 2bc5e820..83184833 100644
--- a/src/org/apollo/game/event/handler/impl/SwitchItemEventHandler.java
+++ b/src/org/apollo/game/event/handler/impl/SwitchItemEventHandler.java
@@ -9,8 +9,9 @@ import org.apollo.game.model.inter.bank.BankConstants;
import org.apollo.game.model.inv.SynchronizationInventoryListener;
/**
- * An {@link EventHandler} which updates an {@link Inventory} when the client
- * sends a {@link SwitchItemEvent} to the server.
+ * An {@link EventHandler} which updates an {@link Inventory} when the client sends a {@link SwitchItemEvent} to the
+ * server.
+ *
* @author Graham
*/
public final class SwitchItemEventHandler extends EventHandler {
@@ -37,7 +38,8 @@ public final class SwitchItemEventHandler extends EventHandler
return; // not a known inventory, ignore
}
- if (event.getOldSlot() >= 0 && event.getNewSlot() >= 0 && event.getOldSlot() < inventory.capacity() && event.getNewSlot() < inventory.capacity()) {
+ if (event.getOldSlot() >= 0 && event.getNewSlot() >= 0 && event.getOldSlot() < inventory.capacity()
+ && event.getNewSlot() < inventory.capacity()) {
// events must be fired for it to work if a sidebar inv overlay is used
inventory.swap(insertPermitted ? event.isInserting() : false, event.getOldSlot(), event.getNewSlot());
}
diff --git a/src/org/apollo/game/event/handler/impl/WalkEventHandler.java b/src/org/apollo/game/event/handler/impl/WalkEventHandler.java
index a688a1cc..b1c09dfa 100644
--- a/src/org/apollo/game/event/handler/impl/WalkEventHandler.java
+++ b/src/org/apollo/game/event/handler/impl/WalkEventHandler.java
@@ -9,6 +9,7 @@ import org.apollo.game.model.WalkingQueue;
/**
* A handler for the {@link WalkEvent}.
+ *
* @author Graham
*/
public final class WalkEventHandler extends EventHandler {
diff --git a/src/org/apollo/game/event/handler/impl/package-info.java b/src/org/apollo/game/event/handler/impl/package-info.java
index 97bc82ef..9fcecd6a 100644
--- a/src/org/apollo/game/event/handler/impl/package-info.java
+++ b/src/org/apollo/game/event/handler/impl/package-info.java
@@ -2,3 +2,4 @@
* Contains event handler implementations.
*/
package org.apollo.game.event.handler.impl;
+
diff --git a/src/org/apollo/game/event/handler/package-info.java b/src/org/apollo/game/event/handler/package-info.java
index 99c6999b..e434b8c3 100644
--- a/src/org/apollo/game/event/handler/package-info.java
+++ b/src/org/apollo/game/event/handler/package-info.java
@@ -2,3 +2,4 @@
* Contains classes which define abstract event handlers.
*/
package org.apollo.game.event.handler;
+
diff --git a/src/org/apollo/game/event/impl/ButtonEvent.java b/src/org/apollo/game/event/impl/ButtonEvent.java
index f33f46b1..6a249cb2 100644
--- a/src/org/apollo/game/event/impl/ButtonEvent.java
+++ b/src/org/apollo/game/event/impl/ButtonEvent.java
@@ -4,6 +4,7 @@ import org.apollo.game.event.Event;
/**
* An event sent when the client clicks a button.
+ *
* @author Graham
*/
public final class ButtonEvent extends Event {
@@ -15,6 +16,7 @@ public final class ButtonEvent extends Event {
/**
* Creates the button event.
+ *
* @param interfaceId The interface id.
*/
public ButtonEvent(int interfaceId) {
@@ -23,6 +25,7 @@ public final class ButtonEvent extends Event {
/**
* Gets the interface id.
+ *
* @return The interface id.
*/
public int getInterfaceId() {
diff --git a/src/org/apollo/game/event/impl/CharacterDesignEvent.java b/src/org/apollo/game/event/impl/CharacterDesignEvent.java
index bb3f5fa8..a44827ef 100644
--- a/src/org/apollo/game/event/impl/CharacterDesignEvent.java
+++ b/src/org/apollo/game/event/impl/CharacterDesignEvent.java
@@ -4,8 +4,8 @@ import org.apollo.game.event.Event;
import org.apollo.game.model.Appearance;
/**
- * An event sent by the client when the player modifies their character's
- * design.
+ * An event sent by the client when the player modifies their character's design.
+ *
* @author Graham
*/
public final class CharacterDesignEvent extends Event {
@@ -17,6 +17,7 @@ public final class CharacterDesignEvent extends Event {
/**
* Creates the character design event.
+ *
* @param appearance The appearance.
*/
public CharacterDesignEvent(Appearance appearance) {
@@ -25,6 +26,7 @@ public final class CharacterDesignEvent extends Event {
/**
* Gets the appearance.
+ *
* @return The appearance.
*/
public Appearance getAppearance() {
diff --git a/src/org/apollo/game/event/impl/ChatEvent.java b/src/org/apollo/game/event/impl/ChatEvent.java
index e85275b0..09446e8d 100644
--- a/src/org/apollo/game/event/impl/ChatEvent.java
+++ b/src/org/apollo/game/event/impl/ChatEvent.java
@@ -4,6 +4,7 @@ import org.apollo.game.event.Event;
/**
* An event sent by the client to send a public chat message to other players.
+ *
* @author Graham
*/
public final class ChatEvent extends Event {
@@ -30,6 +31,7 @@ public final class ChatEvent extends Event {
/**
* Creates a new chat event.
+ *
* @param message The message.
* @param compressedMessage The compressed message.
* @param color The text color.
@@ -44,6 +46,7 @@ public final class ChatEvent extends Event {
/**
* Gets the message.
+ *
* @return The message.
*/
public String getMessage() {
@@ -52,6 +55,7 @@ public final class ChatEvent extends Event {
/**
* Gets the text color.
+ *
* @return The text color.
*/
public int getTextColor() {
@@ -60,6 +64,7 @@ public final class ChatEvent extends Event {
/**
* Gets the text effects.
+ *
* @return The text effects.
*/
public int getTextEffects() {
@@ -68,6 +73,7 @@ public final class ChatEvent extends Event {
/**
* Gets the compressed message.
+ *
* @return The compressed message.
*/
public byte[] getCompressedMessage() {
diff --git a/src/org/apollo/game/event/impl/CloseInterfaceEvent.java b/src/org/apollo/game/event/impl/CloseInterfaceEvent.java
index 1e4f8758..ee755504 100644
--- a/src/org/apollo/game/event/impl/CloseInterfaceEvent.java
+++ b/src/org/apollo/game/event/impl/CloseInterfaceEvent.java
@@ -4,6 +4,7 @@ import org.apollo.game.event.Event;
/**
* An event which closes the open interface.
+ *
* @author Graham
*/
public final class CloseInterfaceEvent extends Event {
diff --git a/src/org/apollo/game/event/impl/ClosedInterfaceEvent.java b/src/org/apollo/game/event/impl/ClosedInterfaceEvent.java
index 48165e26..6c9278cd 100644
--- a/src/org/apollo/game/event/impl/ClosedInterfaceEvent.java
+++ b/src/org/apollo/game/event/impl/ClosedInterfaceEvent.java
@@ -4,6 +4,7 @@ import org.apollo.game.event.Event;
/**
* Sent by the client when the current interface is closed.
+ *
* @author Graham
*/
public final class ClosedInterfaceEvent extends Event {
diff --git a/src/org/apollo/game/event/impl/CommandEvent.java b/src/org/apollo/game/event/impl/CommandEvent.java
index 3842e8ef..0cceac6d 100644
--- a/src/org/apollo/game/event/impl/CommandEvent.java
+++ b/src/org/apollo/game/event/impl/CommandEvent.java
@@ -4,6 +4,7 @@ import org.apollo.game.event.Event;
/**
* An event issued by the client to send a {@code ::} command/
+ *
* @author Graham
*/
public final class CommandEvent extends Event {
@@ -15,6 +16,7 @@ public final class CommandEvent extends Event {
/**
* Creates the command event.
+ *
* @param command The command.
*/
public CommandEvent(String command) {
@@ -23,6 +25,7 @@ public final class CommandEvent extends Event {
/**
* Gets the command.
+ *
* @return The command.
*/
public String getCommand() {
diff --git a/src/org/apollo/game/event/impl/EnterAmountEvent.java b/src/org/apollo/game/event/impl/EnterAmountEvent.java
index 3d0fe675..6345fd33 100644
--- a/src/org/apollo/game/event/impl/EnterAmountEvent.java
+++ b/src/org/apollo/game/event/impl/EnterAmountEvent.java
@@ -3,8 +3,8 @@ package org.apollo.game.event.impl;
import org.apollo.game.event.Event;
/**
- * An {@link Event} which is sent to the client to open up the enter amount
- * interface.
+ * An {@link Event} which is sent to the client to open up the enter amount interface.
+ *
* @author Graham
*/
public final class EnterAmountEvent extends Event {
diff --git a/src/org/apollo/game/event/impl/EnteredAmountEvent.java b/src/org/apollo/game/event/impl/EnteredAmountEvent.java
index ced89675..3024762d 100644
--- a/src/org/apollo/game/event/impl/EnteredAmountEvent.java
+++ b/src/org/apollo/game/event/impl/EnteredAmountEvent.java
@@ -4,6 +4,7 @@ import org.apollo.game.event.Event;
/**
* An event sent by the client when the player has entered an amount.
+ *
* @author Graham
*/
public final class EnteredAmountEvent extends Event {
@@ -15,6 +16,7 @@ public final class EnteredAmountEvent extends Event {
/**
* Creates the entered amount event.
+ *
* @param amount The amount.
*/
public EnteredAmountEvent(int amount) {
@@ -23,6 +25,7 @@ public final class EnteredAmountEvent extends Event {
/**
* Gets the amount.
+ *
* @return The amount.
*/
public int getAmount() {
diff --git a/src/org/apollo/game/event/impl/EquipEvent.java b/src/org/apollo/game/event/impl/EquipEvent.java
index f1b2c661..dfea7c56 100644
--- a/src/org/apollo/game/event/impl/EquipEvent.java
+++ b/src/org/apollo/game/event/impl/EquipEvent.java
@@ -4,6 +4,7 @@ import org.apollo.game.event.Event;
/**
* An event sent by the client to request that an item is equipped.
+ *
* @author Graham
*/
public final class EquipEvent extends Event {
@@ -25,6 +26,7 @@ public final class EquipEvent extends Event {
/**
* Creates the equip event.
+ *
* @param interfaceId The interface id.
* @param id The id.
* @param slot The slot.
@@ -37,6 +39,7 @@ public final class EquipEvent extends Event {
/**
* Gets the interface id.
+ *
* @return The interface id.
*/
public int getInterfaceId() {
@@ -45,6 +48,7 @@ public final class EquipEvent extends Event {
/**
* Gets the item id.
+ *
* @return The item id.
*/
public int getId() {
@@ -53,6 +57,7 @@ public final class EquipEvent extends Event {
/**
* Gets the slot.
+ *
* @return The slot.
*/
public int getSlot() {
diff --git a/src/org/apollo/game/event/impl/FifthItemActionEvent.java b/src/org/apollo/game/event/impl/FifthItemActionEvent.java
index 07104f2d..92177404 100644
--- a/src/org/apollo/game/event/impl/FifthItemActionEvent.java
+++ b/src/org/apollo/game/event/impl/FifthItemActionEvent.java
@@ -2,12 +2,14 @@ package org.apollo.game.event.impl;
/**
* The fifth {@link ItemActionEvent}.
+ *
* @author Graham
*/
public final class FifthItemActionEvent extends ItemActionEvent {
/**
* Creates the fifth item action event.
+ *
* @param interfaceId The interface id.
* @param id The item id.
* @param slot The item slot.
diff --git a/src/org/apollo/game/event/impl/FirstItemActionEvent.java b/src/org/apollo/game/event/impl/FirstItemActionEvent.java
index 179f87ba..58096c91 100644
--- a/src/org/apollo/game/event/impl/FirstItemActionEvent.java
+++ b/src/org/apollo/game/event/impl/FirstItemActionEvent.java
@@ -2,12 +2,14 @@ package org.apollo.game.event.impl;
/**
* The first {@link ItemActionEvent}.
+ *
* @author Graham
*/
public final class FirstItemActionEvent extends ItemActionEvent {
/**
* Creates the first item action event.
+ *
* @param interfaceId The interface id.
* @param id The item id.
* @param slot The item slot.
diff --git a/src/org/apollo/game/event/impl/FirstObjectActionEvent.java b/src/org/apollo/game/event/impl/FirstObjectActionEvent.java
index 9d2973ce..b0d28c3a 100644
--- a/src/org/apollo/game/event/impl/FirstObjectActionEvent.java
+++ b/src/org/apollo/game/event/impl/FirstObjectActionEvent.java
@@ -4,12 +4,14 @@ import org.apollo.game.model.Position;
/**
* An event sent when the first option at an object is used.
+ *
* @author Graham
*/
public final class FirstObjectActionEvent extends ObjectActionEvent {
/**
* Creates the first object action event.
+ *
* @param id The id.
* @param position The position.
*/
diff --git a/src/org/apollo/game/event/impl/FourthItemActionEvent.java b/src/org/apollo/game/event/impl/FourthItemActionEvent.java
index 18404118..4532d29b 100644
--- a/src/org/apollo/game/event/impl/FourthItemActionEvent.java
+++ b/src/org/apollo/game/event/impl/FourthItemActionEvent.java
@@ -2,12 +2,14 @@ package org.apollo.game.event.impl;
/**
* The fourth {@link ItemActionEvent}.
+ *
* @author Graham
*/
public final class FourthItemActionEvent extends ItemActionEvent {
/**
* Creates the fourth item action event.
+ *
* @param interfaceId The interface id.
* @param id The item id.
* @param slot The item slot.
diff --git a/src/org/apollo/game/event/impl/IdAssignmentEvent.java b/src/org/apollo/game/event/impl/IdAssignmentEvent.java
index c4d77701..029a5e11 100644
--- a/src/org/apollo/game/event/impl/IdAssignmentEvent.java
+++ b/src/org/apollo/game/event/impl/IdAssignmentEvent.java
@@ -3,8 +3,8 @@ package org.apollo.game.event.impl;
import org.apollo.game.event.Event;
/**
- * An event which specifies the local id and membership status of the current
- * player.
+ * An event which specifies the local id and membership status of the current player.
+ *
* @author Graham
*/
public final class IdAssignmentEvent extends Event {
@@ -21,6 +21,7 @@ public final class IdAssignmentEvent extends Event {
/**
* Creates the local id event.
+ *
* @param id The id.
* @param members The membership flag.
*/
@@ -31,6 +32,7 @@ public final class IdAssignmentEvent extends Event {
/**
* Gets the id.
+ *
* @return The id.
*/
public int getId() {
@@ -39,6 +41,7 @@ public final class IdAssignmentEvent extends Event {
/**
* Gets the membership flag.
+ *
* @return The membership flag.
*/
public boolean isMembers() {
diff --git a/src/org/apollo/game/event/impl/ItemActionEvent.java b/src/org/apollo/game/event/impl/ItemActionEvent.java
index a48015ae..b82b72b6 100644
--- a/src/org/apollo/game/event/impl/ItemActionEvent.java
+++ b/src/org/apollo/game/event/impl/ItemActionEvent.java
@@ -4,6 +4,7 @@ import org.apollo.game.event.Event;
/**
* An {@link Event} which represents some sort of action on an item.
+ *
* @author Graham
*/
public abstract class ItemActionEvent extends Event {
@@ -30,6 +31,7 @@ public abstract class ItemActionEvent extends Event {
/**
* Creates the item action event.
+ *
* @param option The option number.
* @param interfaceId The interface id.
* @param id The id.
@@ -44,6 +46,7 @@ public abstract class ItemActionEvent extends Event {
/**
* Gets the option number.
+ *
* @return The option number.
*/
public int getOption() {
@@ -52,6 +55,7 @@ public abstract class ItemActionEvent extends Event {
/**
* Gets the interface id.
+ *
* @return The interface id.
*/
public int getInterfaceId() {
@@ -60,6 +64,7 @@ public abstract class ItemActionEvent extends Event {
/**
* Gets the item id.
+ *
* @return The item id.
*/
public int getId() {
@@ -68,6 +73,7 @@ public abstract class ItemActionEvent extends Event {
/**
* Gets the slot.
+ *
* @return The slot.
*/
public int getSlot() {
diff --git a/src/org/apollo/game/event/impl/KeepAliveEvent.java b/src/org/apollo/game/event/impl/KeepAliveEvent.java
index 0dc80f0d..25ce1ad2 100644
--- a/src/org/apollo/game/event/impl/KeepAliveEvent.java
+++ b/src/org/apollo/game/event/impl/KeepAliveEvent.java
@@ -3,8 +3,8 @@ package org.apollo.game.event.impl;
import org.apollo.game.event.Event;
/**
- * An event which is periodically sent by the client to keep a connection
- * alive.
+ * An event which is periodically sent by the client to keep a connection alive.
+ *
* @author Graham
*/
public final class KeepAliveEvent extends Event {
@@ -23,6 +23,7 @@ public final class KeepAliveEvent extends Event {
/**
* Gets the time when this event was created.
+ *
* @return The time when this event was created.
*/
public long getCreatedAt() {
diff --git a/src/org/apollo/game/event/impl/LogoutEvent.java b/src/org/apollo/game/event/impl/LogoutEvent.java
index 7e43385f..406cd415 100644
--- a/src/org/apollo/game/event/impl/LogoutEvent.java
+++ b/src/org/apollo/game/event/impl/LogoutEvent.java
@@ -4,6 +4,7 @@ import org.apollo.game.event.Event;
/**
* An event sent to the client which logs it out cleanly.
+ *
* @author Graham
*/
public final class LogoutEvent extends Event {
diff --git a/src/org/apollo/game/event/impl/ObjectActionEvent.java b/src/org/apollo/game/event/impl/ObjectActionEvent.java
index e0d5be5a..8c24af43 100644
--- a/src/org/apollo/game/event/impl/ObjectActionEvent.java
+++ b/src/org/apollo/game/event/impl/ObjectActionEvent.java
@@ -5,6 +5,7 @@ import org.apollo.game.model.Position;
/**
* An {@link Event} which represents some sort of action at an object.
+ *
* @author Graham
*/
public abstract class ObjectActionEvent extends Event {
@@ -26,6 +27,7 @@ public abstract class ObjectActionEvent extends Event {
/**
* Creates a new object action event.
+ *
* @param option The option number.
* @param id The id of the object.
* @param position The position of the object.
@@ -38,6 +40,7 @@ public abstract class ObjectActionEvent extends Event {
/**
* Gets the option number.
+ *
* @return The option number.
*/
public int getOption() {
@@ -46,6 +49,7 @@ public abstract class ObjectActionEvent extends Event {
/**
* Gets the id of the object.
+ *
* @return The id of the object.
*/
public int getId() {
@@ -54,6 +58,7 @@ public abstract class ObjectActionEvent extends Event {
/**
* Gets the position of the object.
+ *
* @return The position of the object.
*/
public Position getPosition() {
diff --git a/src/org/apollo/game/event/impl/OpenInterfaceEvent.java b/src/org/apollo/game/event/impl/OpenInterfaceEvent.java
index 6b567e43..5c478b70 100644
--- a/src/org/apollo/game/event/impl/OpenInterfaceEvent.java
+++ b/src/org/apollo/game/event/impl/OpenInterfaceEvent.java
@@ -4,6 +4,7 @@ import org.apollo.game.event.Event;
/**
* An event which opens an interface.
+ *
* @author Graham
*/
public final class OpenInterfaceEvent extends Event {
@@ -15,6 +16,7 @@ public final class OpenInterfaceEvent extends Event {
/**
* Creates the event with the specified interface id.
+ *
* @param id The interface id.
*/
public OpenInterfaceEvent(int id) {
@@ -23,6 +25,7 @@ public final class OpenInterfaceEvent extends Event {
/**
* Gets the interface id.
+ *
* @return The interface id.
*/
public int getId() {
diff --git a/src/org/apollo/game/event/impl/OpenInterfaceSidebarEvent.java b/src/org/apollo/game/event/impl/OpenInterfaceSidebarEvent.java
index b627cc01..3ef9f21d 100644
--- a/src/org/apollo/game/event/impl/OpenInterfaceSidebarEvent.java
+++ b/src/org/apollo/game/event/impl/OpenInterfaceSidebarEvent.java
@@ -4,6 +4,7 @@ import org.apollo.game.event.Event;
/**
* An {@link Event} sent to open an interface and temporary sidebar overlay.
+ *
* @author Graham
*/
public final class OpenInterfaceSidebarEvent extends Event {
@@ -20,6 +21,7 @@ public final class OpenInterfaceSidebarEvent extends Event {
/**
* Creates the open interface sidebar event.
+ *
* @param interfaceId The interface id.
* @param sidebarId The sidebar id.
*/
@@ -30,6 +32,7 @@ public final class OpenInterfaceSidebarEvent extends Event {
/**
* Gets the interface id.
+ *
* @return The interface id.
*/
public int getInterfaceId() {
@@ -38,6 +41,7 @@ public final class OpenInterfaceSidebarEvent extends Event {
/**
* Gets the sidebar id.
+ *
* @return The sidebar id.
*/
public int getSidebarId() {
diff --git a/src/org/apollo/game/event/impl/PlayerSynchronizationEvent.java b/src/org/apollo/game/event/impl/PlayerSynchronizationEvent.java
index 1654355e..48920556 100644
--- a/src/org/apollo/game/event/impl/PlayerSynchronizationEvent.java
+++ b/src/org/apollo/game/event/impl/PlayerSynchronizationEvent.java
@@ -8,6 +8,7 @@ import org.apollo.game.sync.seg.SynchronizationSegment;
/**
* An event which is sent to synchronize the players.
+ *
* @author Graham
*/
public final class PlayerSynchronizationEvent extends Event {
@@ -44,6 +45,7 @@ public final class PlayerSynchronizationEvent extends Event {
/**
* Creates the player synchronization event.
+ *
* @param lastKnownRegion The last known region.
* @param position The player's current position.
* @param regionChanged A flag indicating if the region has changed.
@@ -51,7 +53,8 @@ public final class PlayerSynchronizationEvent extends Event {
* @param localPlayers The number of local players.
* @param segments A list of segments.
*/
- public PlayerSynchronizationEvent(Position lastKnownRegion, Position position, boolean regionChanged, SynchronizationSegment segment, int localPlayers, List segments) {
+ public PlayerSynchronizationEvent(Position lastKnownRegion, Position position, boolean regionChanged,
+ SynchronizationSegment segment, int localPlayers, List segments) {
this.lastKnownRegion = lastKnownRegion;
this.position = position;
this.regionChanged = regionChanged;
@@ -62,6 +65,7 @@ public final class PlayerSynchronizationEvent extends Event {
/**
* Gets the last known region.
+ *
* @return The last known region.
*/
public Position getLastKnownRegion() {
@@ -70,6 +74,7 @@ public final class PlayerSynchronizationEvent extends Event {
/**
* Gets the player's position.
+ *
* @return The player's position.
*/
public Position getPosition() {
@@ -78,6 +83,7 @@ public final class PlayerSynchronizationEvent extends Event {
/**
* Checks if the region has changed.
+ *
* @return {@code true} if so, {@code false} if not.
*/
public boolean hasRegionChanged() {
@@ -86,6 +92,7 @@ public final class PlayerSynchronizationEvent extends Event {
/**
* Gets the current player's segment.
+ *
* @return The current player's segment.
*/
public SynchronizationSegment getSegment() {
@@ -94,6 +101,7 @@ public final class PlayerSynchronizationEvent extends Event {
/**
* Gets the number of local players.
+ *
* @return The number of local players.
*/
public int getLocalPlayers() {
@@ -102,6 +110,7 @@ public final class PlayerSynchronizationEvent extends Event {
/**
* Gets the synchronization segments.
+ *
* @return The segments.
*/
public List getSegments() {
diff --git a/src/org/apollo/game/event/impl/RegionChangeEvent.java b/src/org/apollo/game/event/impl/RegionChangeEvent.java
index 192cf343..7277a643 100644
--- a/src/org/apollo/game/event/impl/RegionChangeEvent.java
+++ b/src/org/apollo/game/event/impl/RegionChangeEvent.java
@@ -5,6 +5,7 @@ import org.apollo.game.model.Position;
/**
* An event which indicates that the client should load the specified region.
+ *
* @author Graham
*/
public final class RegionChangeEvent extends Event {
@@ -16,6 +17,7 @@ public final class RegionChangeEvent extends Event {
/**
* Creates the region changed event.
+ *
* @param position The position of the region.
*/
public RegionChangeEvent(Position position) {
@@ -24,6 +26,7 @@ public final class RegionChangeEvent extends Event {
/**
* Gets the position of the region to load.
+ *
* @return The position of the region to load.
*/
public Position getPosition() {
diff --git a/src/org/apollo/game/event/impl/SecondItemActionEvent.java b/src/org/apollo/game/event/impl/SecondItemActionEvent.java
index d4c5dc11..5a4d8ddc 100644
--- a/src/org/apollo/game/event/impl/SecondItemActionEvent.java
+++ b/src/org/apollo/game/event/impl/SecondItemActionEvent.java
@@ -2,12 +2,14 @@ package org.apollo.game.event.impl;
/**
* The second {@link ItemActionEvent}.
+ *
* @author Graham
*/
public final class SecondItemActionEvent extends ItemActionEvent {
/**
* Creates the second item action event.
+ *
* @param interfaceId The interface id.
* @param id The item id.
* @param slot The item slot.
diff --git a/src/org/apollo/game/event/impl/SecondObjectActionEvent.java b/src/org/apollo/game/event/impl/SecondObjectActionEvent.java
index 1cc45542..7200b37b 100644
--- a/src/org/apollo/game/event/impl/SecondObjectActionEvent.java
+++ b/src/org/apollo/game/event/impl/SecondObjectActionEvent.java
@@ -4,12 +4,14 @@ import org.apollo.game.model.Position;
/**
* An event sent when the second option at an object is used.
+ *
* @author Graham
*/
public final class SecondObjectActionEvent extends ObjectActionEvent {
/**
* Creates the second object action event.
+ *
* @param id The id.
* @param position The position.
*/
diff --git a/src/org/apollo/game/event/impl/ServerMessageEvent.java b/src/org/apollo/game/event/impl/ServerMessageEvent.java
index 9744725b..fc37cfe8 100644
--- a/src/org/apollo/game/event/impl/ServerMessageEvent.java
+++ b/src/org/apollo/game/event/impl/ServerMessageEvent.java
@@ -4,6 +4,7 @@ import org.apollo.game.event.Event;
/**
* An event which is sent to the client with a server-side message.
+ *
* @author Graham
*/
public final class ServerMessageEvent extends Event {
@@ -15,6 +16,7 @@ public final class ServerMessageEvent extends Event {
/**
* Creates the {@link ServerMessageEvent}.
+ *
* @param message The message.
*/
public ServerMessageEvent(String message) {
@@ -23,6 +25,7 @@ public final class ServerMessageEvent extends Event {
/**
* Gets the message.
+ *
* @return The message.
*/
public String getMessage() {
diff --git a/src/org/apollo/game/event/impl/SetInterfaceTextEvent.java b/src/org/apollo/game/event/impl/SetInterfaceTextEvent.java
index 70d96040..7e3c29b0 100644
--- a/src/org/apollo/game/event/impl/SetInterfaceTextEvent.java
+++ b/src/org/apollo/game/event/impl/SetInterfaceTextEvent.java
@@ -4,6 +4,7 @@ import org.apollo.game.event.Event;
/**
* An event sent to the client to update an interface's text.
+ *
* @author Graham
*/
public final class SetInterfaceTextEvent extends Event {
@@ -20,6 +21,7 @@ public final class SetInterfaceTextEvent extends Event {
/**
* Creates the set interface text event.
+ *
* @param interfaceId The interface's id.
* @param text The interface's text.
*/
@@ -30,6 +32,7 @@ public final class SetInterfaceTextEvent extends Event {
/**
* Gets the interface id.
+ *
* @return The interface id.
*/
public int getInterfaceId() {
@@ -38,6 +41,7 @@ public final class SetInterfaceTextEvent extends Event {
/**
* Gets the interface's text.
+ *
* @return The interface's text.
*/
public String getText() {
diff --git a/src/org/apollo/game/event/impl/SwitchItemEvent.java b/src/org/apollo/game/event/impl/SwitchItemEvent.java
index c9bce9f4..956168b7 100644
--- a/src/org/apollo/game/event/impl/SwitchItemEvent.java
+++ b/src/org/apollo/game/event/impl/SwitchItemEvent.java
@@ -4,6 +4,7 @@ import org.apollo.game.event.Event;
/**
* An event sent by the client when two items are switched.
+ *
* @author Graham
*/
public final class SwitchItemEvent extends Event {
@@ -30,9 +31,9 @@ public final class SwitchItemEvent extends Event {
/**
* Creates a new switch item event.
+ *
* @param interfaceId The interface id.
- * @param inserting A flag indicating if the interface is in 'insert' mode
- * instead of swap mode.
+ * @param inserting A flag indicating if the interface is in 'insert' mode instead of swap mode.
* @param oldSlot The old slot.
* @param newSlot The new slot.
*/
@@ -45,6 +46,7 @@ public final class SwitchItemEvent extends Event {
/**
* Gets the interface id.
+ *
* @return The interface id.
*/
public int getInterfaceId() {
@@ -53,6 +55,7 @@ public final class SwitchItemEvent extends Event {
/**
* Checks if this event is in insertion mode.
+ *
* @return The insertion flag.
*/
public boolean isInserting() {
@@ -61,6 +64,7 @@ public final class SwitchItemEvent extends Event {
/**
* Checks if this event is in swap mode.
+ *
* @return The swap flag.
*/
public boolean isSwapping() {
@@ -69,6 +73,7 @@ public final class SwitchItemEvent extends Event {
/**
* Gets the old slot.
+ *
* @return The old slot.
*/
public int getOldSlot() {
@@ -77,6 +82,7 @@ public final class SwitchItemEvent extends Event {
/**
* Gets the new slot.
+ *
* @return The new slot.
*/
public int getNewSlot() {
diff --git a/src/org/apollo/game/event/impl/SwitchTabInterfaceEvent.java b/src/org/apollo/game/event/impl/SwitchTabInterfaceEvent.java
index 9e5a4bfa..0eec9536 100644
--- a/src/org/apollo/game/event/impl/SwitchTabInterfaceEvent.java
+++ b/src/org/apollo/game/event/impl/SwitchTabInterfaceEvent.java
@@ -4,6 +4,7 @@ import org.apollo.game.event.Event;
/**
* An event sent to the client to change the interface of a tab.
+ *
* @author Graham
*/
public final class SwitchTabInterfaceEvent extends Event {
@@ -20,6 +21,7 @@ public final class SwitchTabInterfaceEvent extends Event {
/**
* Creates the switch interface event.
+ *
* @param tab The tab id.
* @param interfaceId The interface id.
*/
@@ -30,6 +32,7 @@ public final class SwitchTabInterfaceEvent extends Event {
/**
* Gets the tab id.
+ *
* @return The tab id.
*/
public int getTabId() {
@@ -38,6 +41,7 @@ public final class SwitchTabInterfaceEvent extends Event {
/**
* Gets the interface id.
+ *
* @return The interface id.
*/
public int getInterfaceId() {
diff --git a/src/org/apollo/game/event/impl/ThirdItemActionEvent.java b/src/org/apollo/game/event/impl/ThirdItemActionEvent.java
index 7bc1f0b2..0b069c94 100644
--- a/src/org/apollo/game/event/impl/ThirdItemActionEvent.java
+++ b/src/org/apollo/game/event/impl/ThirdItemActionEvent.java
@@ -2,12 +2,14 @@ package org.apollo.game.event.impl;
/**
* The third {@link ItemActionEvent}.
+ *
* @author Graham
*/
public final class ThirdItemActionEvent extends ItemActionEvent {
/**
* Creates the third item action event.
+ *
* @param interfaceId The interface id.
* @param id The item id.
* @param slot The item slot.
diff --git a/src/org/apollo/game/event/impl/ThirdObjectActionEvent.java b/src/org/apollo/game/event/impl/ThirdObjectActionEvent.java
index 577c5cf6..9d335e77 100644
--- a/src/org/apollo/game/event/impl/ThirdObjectActionEvent.java
+++ b/src/org/apollo/game/event/impl/ThirdObjectActionEvent.java
@@ -4,12 +4,14 @@ import org.apollo.game.model.Position;
/**
* An event sent when the third option at an object is used.
+ *
* @author Graham
*/
public final class ThirdObjectActionEvent extends ObjectActionEvent {
/**
* Creates the third object action event.
+ *
* @param id The id.
* @param position The position.
*/
diff --git a/src/org/apollo/game/event/impl/UpdateItemsEvent.java b/src/org/apollo/game/event/impl/UpdateItemsEvent.java
index 9536333a..47c01439 100644
--- a/src/org/apollo/game/event/impl/UpdateItemsEvent.java
+++ b/src/org/apollo/game/event/impl/UpdateItemsEvent.java
@@ -5,6 +5,7 @@ import org.apollo.game.model.Item;
/**
* An event which updates all the items in an interface.
+ *
* @author Graham
*/
public final class UpdateItemsEvent extends Event {
@@ -21,6 +22,7 @@ public final class UpdateItemsEvent extends Event {
/**
* Creates the update inventory interface event.
+ *
* @param interfaceId The interface id.
* @param items The items.
*/
@@ -31,6 +33,7 @@ public final class UpdateItemsEvent extends Event {
/**
* Gets the interface id.
+ *
* @return The interface id.
*/
public int getInterfaceId() {
@@ -39,6 +42,7 @@ public final class UpdateItemsEvent extends Event {
/**
* Gets the items.
+ *
* @return The items.
*/
public Item[] getItems() {
diff --git a/src/org/apollo/game/event/impl/UpdateSkillEvent.java b/src/org/apollo/game/event/impl/UpdateSkillEvent.java
index d628b012..5fc45367 100644
--- a/src/org/apollo/game/event/impl/UpdateSkillEvent.java
+++ b/src/org/apollo/game/event/impl/UpdateSkillEvent.java
@@ -5,6 +5,7 @@ import org.apollo.game.model.Skill;
/**
* An {@link Event} sent to the client to update a player's skill level.
+ *
* @author Graham
*/
public final class UpdateSkillEvent extends Event {
@@ -21,6 +22,7 @@ public final class UpdateSkillEvent extends Event {
/**
* Creates an update skill event.
+ *
* @param id The id.
* @param skill The skill.
*/
@@ -31,6 +33,7 @@ public final class UpdateSkillEvent extends Event {
/**
* Gets the skill's id.
+ *
* @return The skill's id.
*/
public int getId() {
@@ -39,6 +42,7 @@ public final class UpdateSkillEvent extends Event {
/**
* Gets the skill.
+ *
* @return The skill.
*/
public Skill getSkill() {
diff --git a/src/org/apollo/game/event/impl/UpdateSlottedItemsEvent.java b/src/org/apollo/game/event/impl/UpdateSlottedItemsEvent.java
index 378fda54..01c96d35 100644
--- a/src/org/apollo/game/event/impl/UpdateSlottedItemsEvent.java
+++ b/src/org/apollo/game/event/impl/UpdateSlottedItemsEvent.java
@@ -5,6 +5,7 @@ import org.apollo.game.model.SlottedItem;
/**
* An event which updates a single item in an interface.
+ *
* @author Graham
*/
public final class UpdateSlottedItemsEvent extends Event {
@@ -21,6 +22,7 @@ public final class UpdateSlottedItemsEvent extends Event {
/**
* Creates the update item in interface event.
+ *
* @param interfaceId The interface id.
* @param items The slotted items.
*/
@@ -31,6 +33,7 @@ public final class UpdateSlottedItemsEvent extends Event {
/**
* Gets the interface id.
+ *
* @return The interface id.
*/
public int getInterfaceId() {
@@ -39,6 +42,7 @@ public final class UpdateSlottedItemsEvent extends Event {
/**
* Gets an array of slotted items.
+ *
* @return The slotted items.
*/
public SlottedItem[] getSlottedItems() {
diff --git a/src/org/apollo/game/event/impl/WalkEvent.java b/src/org/apollo/game/event/impl/WalkEvent.java
index 819da616..b1540ee1 100644
--- a/src/org/apollo/game/event/impl/WalkEvent.java
+++ b/src/org/apollo/game/event/impl/WalkEvent.java
@@ -5,6 +5,7 @@ import org.apollo.game.model.Position;
/**
* An event which the client sends to request that the player walks somewhere.
+ *
* @author Graham
*/
public final class WalkEvent extends Event {
@@ -21,6 +22,7 @@ public final class WalkEvent extends Event {
/**
* Creates the event.
+ *
* @param steps The steps array.
* @param run The run flag.
*/
@@ -34,6 +36,7 @@ public final class WalkEvent extends Event {
/**
* Gets the steps array.
+ *
* @return An array of steps.
*/
public Position[] getSteps() {
@@ -42,6 +45,7 @@ public final class WalkEvent extends Event {
/**
* Checks if the steps should be ran (ctrl+click).
+ *
* @return {@code true} if so, {@code false} otherwise.
*/
public boolean isRunning() {
diff --git a/src/org/apollo/game/event/impl/package-info.java b/src/org/apollo/game/event/impl/package-info.java
index af5a3a65..c3abafb0 100644
--- a/src/org/apollo/game/event/impl/package-info.java
+++ b/src/org/apollo/game/event/impl/package-info.java
@@ -2,3 +2,4 @@
* Contains event implementations.
*/
package org.apollo.game.event.impl;
+
diff --git a/src/org/apollo/game/event/package-info.java b/src/org/apollo/game/event/package-info.java
index 6ca5b084..202dbe6f 100644
--- a/src/org/apollo/game/event/package-info.java
+++ b/src/org/apollo/game/event/package-info.java
@@ -2,3 +2,4 @@
* Contains classes related to the event management in the game.
*/
package org.apollo.game.event;
+
diff --git a/src/org/apollo/game/model/Animation.java b/src/org/apollo/game/model/Animation.java
index 9f04eaa3..2925b6b5 100644
--- a/src/org/apollo/game/model/Animation.java
+++ b/src/org/apollo/game/model/Animation.java
@@ -2,6 +2,7 @@ package org.apollo.game.model;
/**
* Represents an animation.
+ *
* @author Graham
*/
public final class Animation {
@@ -77,7 +78,7 @@ public final class Animation {
public static final Animation PANIC = new Animation(2105);
/**
- * The jig animation.
+ * The jig animation.
*/
public static final Animation JIG = new Animation(2106);
@@ -163,6 +164,7 @@ public final class Animation {
/**
* Creates a new animation with no delay.
+ *
* @param id The id.
*/
public Animation(int id) {
@@ -171,6 +173,7 @@ public final class Animation {
/**
* Creates a new animation.
+ *
* @param id The id.
* @param delay The delay.
*/
@@ -181,6 +184,7 @@ public final class Animation {
/**
* Gets the animation's id.
+ *
* @return The animation's id.
*/
public int getId() {
@@ -189,6 +193,7 @@ public final class Animation {
/**
* Gets the animation's delay.
+ *
* @return The animation's delay.
*/
public int getDelay() {
diff --git a/src/org/apollo/game/model/Appearance.java b/src/org/apollo/game/model/Appearance.java
index 65b4581c..29f5223b 100644
--- a/src/org/apollo/game/model/Appearance.java
+++ b/src/org/apollo/game/model/Appearance.java
@@ -2,6 +2,7 @@ package org.apollo.game.model;
/**
* Represents the appearance of a player.
+ *
* @author Graham
*/
public final class Appearance {
@@ -9,7 +10,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 player's gender.
@@ -28,6 +30,7 @@ public final class Appearance {
/**
* Creates the appearance with the specified gender, style and colors.
+ *
* @param gender The gender.
* @param style The style.
* @param colors The colors.
@@ -49,6 +52,7 @@ public final class Appearance {
/**
* Gets the gender of the player.
+ *
* @return The gender of the player.
*/
public Gender getGender() {
@@ -57,6 +61,7 @@ public final class Appearance {
/**
* Checks if the player is male.
+ *
* @return {@code true} if so, {@code false} if not.
*/
public boolean isMale() {
@@ -65,6 +70,7 @@ public final class Appearance {
/**
* Checks if the player is female.
+ *
* @return {@code true} if so, {@code false} if not.
*/
public boolean isFemale() {
@@ -73,25 +79,21 @@ public final class Appearance {
/**
* Gets the player's styles.
+ *
* @return The player's styles.
*/
public int[] getStyle() {
/*
* Info on the elements of the array itself:
- *
- * 0 = head
- * 1 = chin/beard
- * 2 = chest
- * 3 = arms
- * 4 = hands
- * 5 = legs
- * 6 = feet
+ *
+ * 0 = head 1 = chin/beard 2 = chest 3 = arms 4 = hands 5 = legs 6 = feet
*/
return style;
}
/**
* Gets the player's colors.
+ *
* @return The player's colors.
*/
public int[] getColors() {
diff --git a/src/org/apollo/game/model/Character.java b/src/org/apollo/game/model/Character.java
index 2f2f4e73..535633fa 100644
--- a/src/org/apollo/game/model/Character.java
+++ b/src/org/apollo/game/model/Character.java
@@ -13,15 +13,14 @@ import org.apollo.game.sync.block.SynchronizationBlockSet;
import org.apollo.util.CharacterRepository;
/**
- * A {@link Character} is a living creature in the world, such as a player or
- * NPC.
+ * A {@link Character} is a living creature in the world, such as a player or NPC.
+ *
* @author Graham
*/
public abstract class Character {
/**
- * The index of this character in the {@link CharacterRepository} it
- * belongs to.
+ * The index of this character in the {@link CharacterRepository} it belongs to.
*/
private int index = -1;
@@ -87,6 +86,7 @@ public abstract class Character {
/**
* Creates a new character with the specified initial position.
+ *
* @param position The initial position of this character.
*/
public Character(Position position) {
@@ -103,6 +103,7 @@ public abstract class Character {
/**
* Gets the character's inventory.
+ *
* @return The character's inventory.
*/
public Inventory getInventory() {
@@ -111,6 +112,7 @@ public abstract class Character {
/**
* Gets the character's equipment.
+ *
* @return The character's equipment.
*/
public Inventory getEquipment() {
@@ -119,6 +121,7 @@ public abstract class Character {
/**
* Gets the character's bank.
+ *
* @return The character's bank.
*/
public Inventory getBank() {
@@ -127,6 +130,7 @@ public abstract class Character {
/**
* Gets the local player list.
+ *
* @return The local player list.
*/
public List getLocalPlayerList() {
@@ -135,6 +139,7 @@ public abstract class Character {
/**
* Checks if this player is currently teleporting.
+ *
* @return {@code true} if so, {@code false} if not.
*/
public boolean isTeleporting() {
@@ -143,8 +148,8 @@ public abstract class Character {
/**
* Sets the teleporting flag.
- * @param teleporting {@code true} if the player is teleporting,
- * {@code false} if not.
+ *
+ * @param teleporting {@code true} if the player is teleporting, {@code false} if not.
*/
public void setTeleporting(boolean teleporting) {
this.teleporting = teleporting;
@@ -152,6 +157,7 @@ public abstract class Character {
/**
* Gets the walking queue.
+ *
* @return The walking queue.
*/
public WalkingQueue getWalkingQueue() {
@@ -160,6 +166,7 @@ public abstract class Character {
/**
* Sets the next directions for this character.
+ *
* @param first The first direction.
* @param second The second direction.
*/
@@ -170,6 +177,7 @@ public abstract class Character {
/**
* Gets the first direction.
+ *
* @return The first direction.
*/
public Direction getFirstDirection() {
@@ -178,6 +186,7 @@ public abstract class Character {
/**
* Gets the second direction.
+ *
* @return The second direction.
*/
public Direction getSecondDirection() {
@@ -186,8 +195,8 @@ public abstract class Character {
/**
* Gets the directions as an array.
- * @return A zero, one or two element array containing the directions (in
- * order).
+ *
+ * @return A zero, one or two element array containing the directions (in order).
*/
public Direction[] getDirections() {
if (firstDirection != Direction.NONE) {
@@ -203,6 +212,7 @@ public abstract class Character {
/**
* Gets the position of this character.
+ *
* @return The position of this character.
*/
public Position getPosition() {
@@ -211,6 +221,7 @@ public abstract class Character {
/**
* Sets the position of this character.
+ *
* @param position The position of this character.
*/
public void setPosition(Position position) {
@@ -219,6 +230,7 @@ public abstract class Character {
/**
* Checks if this character is active.
+ *
* @return {@code true} if so, {@code false} if not.
*/
public boolean isActive() {
@@ -227,6 +239,7 @@ public abstract class Character {
/**
* Gets the index of this character.
+ *
* @return The index of this character.
*/
public int getIndex() {
@@ -237,6 +250,7 @@ public abstract class Character {
/**
* Sets the index of this character.
+ *
* @param index The index of this character.
*/
public void setIndex(int index) {
@@ -247,6 +261,7 @@ public abstract class Character {
/**
* Gets the {@link SynchronizationBlockSet}.
+ *
* @return The block set.
*/
public SynchronizationBlockSet getBlockSet() {
@@ -263,16 +278,17 @@ public abstract class Character {
/**
* Sends an {@link Event} to either:
*
- * - The client if this {@link Character} is a {@link Player}.
- * - The AI routines if this {@link Character} is an NPC
+ * - The client if this {@link Character} is a {@link Player}.
+ * - The AI routines if this {@link Character} is an NPC
*
+ *
* @param event The event.
*/
public abstract void send(Event event);
/**
- * Teleports this character to the specified position, setting the
- * appropriate flags and clearing the walking queue.
+ * Teleports this character to the specified position, setting the appropriate flags and clearing the walking queue.
+ *
* @param position The position.
*/
public void teleport(Position position) {
@@ -284,6 +300,7 @@ public abstract class Character {
/**
* Plays the specified animation.
+ *
* @param animation The animation.
*/
public void playAnimation(Animation animation) {
@@ -299,6 +316,7 @@ public abstract class Character {
/**
* Plays the specified graphic.
+ *
* @param graphic The graphic.
*/
public void playGraphic(Graphic graphic) {
@@ -314,6 +332,7 @@ public abstract class Character {
/**
* Gets the character's skill set.
+ *
* @return The character's skill set.
*/
public SkillSet getSkillSet() {
@@ -322,6 +341,7 @@ public abstract class Character {
/**
* Starts a new action, stopping the current one if it exists.
+ *
* @param action The new action.
* @return A flag indicating if the action was started.
*/
@@ -349,6 +369,7 @@ public abstract class Character {
/**
* Turns the character to face the specified position.
+ *
* @param position The position to face.
*/
public void turnTo(Position position) {
@@ -357,6 +378,7 @@ public abstract class Character {
/**
* Sends a message to the character.
+ *
* @param message The message.
*/
public void sendMessage(String message) {
diff --git a/src/org/apollo/game/model/Direction.java b/src/org/apollo/game/model/Direction.java
index dca39c2a..744dc3de 100644
--- a/src/org/apollo/game/model/Direction.java
+++ b/src/org/apollo/game/model/Direction.java
@@ -2,6 +2,7 @@ package org.apollo.game.model;
/**
* Represents a single movement direction.
+ *
* @author Graham
*/
public enum Direction {
@@ -57,8 +58,9 @@ public enum Direction {
public static final Direction[] EMPTY_DIRECTION_ARRAY = new Direction[0];
/**
- * Checks if the direction represented by the two delta values can connect
- * two points together in a single direction.
+ * Checks if the direction represented by the two delta values can connect two points together in a single
+ * direction.
+ *
* @param deltaX The difference in X coordinates.
* @param deltaY The difference in X coordinates.
* @return {@code true} if so, {@code false} if not.
@@ -69,6 +71,7 @@ public enum Direction {
/**
* Creates a direction from the differences between X and Y.
+ *
* @param deltaX The difference between two X coordinates.
* @param deltaY The difference between two Y coordinates.
* @return The direction.
@@ -107,6 +110,7 @@ public enum Direction {
/**
* Creates the direction.
+ *
* @param intValue The direction as an integer.
*/
private Direction(int intValue) {
@@ -115,6 +119,7 @@ public enum Direction {
/**
* Gets the direction as an integer which the client can understand.
+ *
* @return The movement as an integer.
*/
public int toInteger() {
diff --git a/src/org/apollo/game/model/EquipmentConstants.java b/src/org/apollo/game/model/EquipmentConstants.java
index 8ebff71f..b5a8ab3b 100644
--- a/src/org/apollo/game/model/EquipmentConstants.java
+++ b/src/org/apollo/game/model/EquipmentConstants.java
@@ -2,6 +2,7 @@ package org.apollo.game.model;
/**
* Contains equipment-related constants.
+ *
* @author Graham
*/
public final class EquipmentConstants {
diff --git a/src/org/apollo/game/model/Gender.java b/src/org/apollo/game/model/Gender.java
index 63ee6f59..da4b648e 100644
--- a/src/org/apollo/game/model/Gender.java
+++ b/src/org/apollo/game/model/Gender.java
@@ -2,6 +2,7 @@ package org.apollo.game.model;
/**
* An enumeration containing the two genders (male and female).
+ *
* @author Graham
*/
public enum Gender {
@@ -23,6 +24,7 @@ public enum Gender {
/**
* Creates the gender.
+ *
* @param intValue The integer representation.
*/
private Gender(int intValue) {
@@ -31,6 +33,7 @@ public enum Gender {
/**
* Converts this gender to an integer.
+ *
* @return The integer representation used by the client.
*/
public int toInteger() {
diff --git a/src/org/apollo/game/model/Graphic.java b/src/org/apollo/game/model/Graphic.java
index 7a521b47..c3c0f963 100644
--- a/src/org/apollo/game/model/Graphic.java
+++ b/src/org/apollo/game/model/Graphic.java
@@ -2,6 +2,7 @@ package org.apollo.game.model;
/**
* Represents a 'still graphic'.
+ *
* @author Graham
*/
public final class Graphic {
@@ -28,6 +29,7 @@ public final class Graphic {
/**
* Creates a new graphic with no delay and a height of zero.
+ *
* @param id The id.
*/
public Graphic(int id) {
@@ -36,6 +38,7 @@ public final class Graphic {
/**
* Creates a new graphic with a height of zero.
+ *
* @param id The id.
* @param delay The delay.
*/
@@ -45,6 +48,7 @@ public final class Graphic {
/**
* Creates a new graphic.
+ *
* @param id The id.
* @param delay The delay.
* @param height The height.
@@ -57,6 +61,7 @@ public final class Graphic {
/**
* Gets the graphic's id.
+ *
* @return The graphic's id.
*/
public int getId() {
@@ -65,6 +70,7 @@ public final class Graphic {
/**
* Gets the graphic's delay.
+ *
* @return The graphic's delay.
*/
public int getDelay() {
@@ -73,6 +79,7 @@ public final class Graphic {
/**
* Gets the graphic's height.
+ *
* @return The graphic's height.
*/
public int getHeight() {
diff --git a/src/org/apollo/game/model/InterfaceSet.java b/src/org/apollo/game/model/InterfaceSet.java
index 3b86e37f..9c074529 100644
--- a/src/org/apollo/game/model/InterfaceSet.java
+++ b/src/org/apollo/game/model/InterfaceSet.java
@@ -13,25 +13,20 @@ import org.apollo.game.model.inter.InterfaceListener;
/**
* Represents the set of interfaces the player has open.
*
- * This class manages all six distinct types of interface (the last two are not
- * present on 317 servers).
+ * This class manages all six distinct types of interface (the last two are not present on 317 servers).
*
*
- * - Windows: the ones people mostly associate with the
- * word interfaces. Things like your bank, the wildy warning screen, the
- * trade screen, etc.
- * - Overlays: display in the same place as windows, but
- * don't prevent you from moving. For example, the wilderness level
- * indicator.
- * - Dialogues: interfaces which are displayed over the
- * chat box.
- * - Sidebars: an interface which displays over the
- * inventory area.
- * - Fullscreen windows: a window which displays over the
- * whole screen e.g. the 377 welcome screen.
- * - Fullscreen background: an interface displayed behind
- * the fullscreen window, typically a blank, black screen.
+ * - Windows: the ones people mostly associate with the word interfaces. Things like your bank, the
+ * wildy warning screen, the trade screen, etc.
+ * - Overlays: display in the same place as windows, but don't prevent you from moving. For example,
+ * the wilderness level indicator.
+ * - Dialogues: interfaces which are displayed over the chat box.
+ * - Sidebars: an interface which displays over the inventory area.
+ * - Fullscreen windows: a window which displays over the whole screen e.g. the 377 welcome screen.
+ * - Fullscreen background: an interface displayed behind the fullscreen window, typically a blank,
+ * black screen.
*
+ *
* @author Graham
*/
public final class InterfaceSet {
@@ -59,6 +54,7 @@ public final class InterfaceSet {
/**
* Creates an interface set.
+ *
* @param player The player.
*/
public InterfaceSet(Player player) {
@@ -83,6 +79,7 @@ public final class InterfaceSet {
/**
* Opens the enter amount dialog.
+ *
* @param listener The enter amount listener.
*/
public void openEnterAmountDialog(EnterAmountListener listener) {
@@ -93,6 +90,7 @@ public final class InterfaceSet {
/**
* Opens a window and inventory sidebar.
+ *
* @param windowId The window's id.
* @param sidebarId The sidebar's id.
*/
@@ -102,6 +100,7 @@ public final class InterfaceSet {
/**
* Opens a window and inventory sidebar with the specified listener.
+ *
* @param listener The listener for this interface.
* @param windowId The window's id.
* @param sidebarId The sidebar's id.
@@ -118,6 +117,7 @@ public final class InterfaceSet {
/**
* Opens a window.
+ *
* @param windowId The window's id.
*/
public void openWindow(int windowId) {
@@ -126,6 +126,7 @@ public final class InterfaceSet {
/**
* Opens a window with the specified listener.
+ *
* @param listener The listener for this interface.
* @param windowId The window's id.
*/
@@ -140,6 +141,7 @@ public final class InterfaceSet {
/**
* Checks if this interface sets contains the specified interface.
+ *
* @param id The interface's id.
* @return {@code true} if so, {@code false} if not.
*/
@@ -148,8 +150,7 @@ public final class InterfaceSet {
}
/**
- * An internal method for closing the interface, notifying the listener if
- * appropriate, but not sending any events.
+ * An internal method for closing the interface, notifying the listener if appropriate, but not sending any events.
*/
private void closeAndNotify() {
amountListener = null; // TODO should we notify??
@@ -162,8 +163,8 @@ public final class InterfaceSet {
}
/**
- * Called when the client has entered the specified amount. Notifies the
- * current listener.
+ * Called when the client has entered the specified amount. Notifies the current listener.
+ *
* @param amount The amount.
*/
public void enteredAmount(int amount) {
diff --git a/src/org/apollo/game/model/InterfaceType.java b/src/org/apollo/game/model/InterfaceType.java
index 4eb42cf3..bf5d9852 100644
--- a/src/org/apollo/game/model/InterfaceType.java
+++ b/src/org/apollo/game/model/InterfaceType.java
@@ -2,6 +2,7 @@ package org.apollo.game.model;
/**
* Represents the different types of interfaces.
+ *
* @author Graham
*/
public enum InterfaceType {
@@ -12,8 +13,8 @@ public enum InterfaceType {
WINDOW,
/**
- * An overlay is an interface which occupies the game screen like a window,
- * however, you can walk around and perform actions still.
+ * An overlay is an interface which occupies the game screen like a window, however, you can walk around and perform
+ * actions still.
*/
OVERLAY,
diff --git a/src/org/apollo/game/model/Inventory.java b/src/org/apollo/game/model/Inventory.java
index 5dcfd602..73f8b82c 100644
--- a/src/org/apollo/game/model/Inventory.java
+++ b/src/org/apollo/game/model/Inventory.java
@@ -8,32 +8,32 @@ import org.apollo.game.model.inv.InventoryListener;
/**
* Represents an inventory - a collection of {@link Item}s.
+ *
* @author Graham
*/
public final class Inventory implements Cloneable {
/**
- * An enumeration containing the different 'stacking modes' of an
- * {@link Inventory}.
+ * An enumeration containing the different 'stacking modes' of an {@link Inventory}.
+ *
* @author Graham
*/
public enum StackMode {
/**
- * When in {@link #STACK_ALWAYS} mode, an {@link Inventory} will stack
- * every single item, regardless of the settings of individual items.
+ * When in {@link #STACK_ALWAYS} mode, an {@link Inventory} will stack every single item, regardless of the
+ * settings of individual items.
*/
STACK_ALWAYS,
/**
- * When in {@link #STACK_STACKABLE_ITEMS} mode, an {@link Inventory}
- * will stack items depending on their settings.
+ * When in {@link #STACK_STACKABLE_ITEMS} mode, an {@link Inventory} will stack items depending on their
+ * settings.
*/
STACK_STACKABLE_ITEMS,
/**
- * When in {@link #STACK_NEVER} mode, an {@link Inventory} will never
- * stack items.
+ * When in {@link #STACK_NEVER} mode, an {@link Inventory} will never stack items.
*/
STACK_NEVER;
@@ -71,6 +71,7 @@ public final class Inventory implements Cloneable {
/**
* Creates an inventory.
+ *
* @param capacity The capacity.
* @throws IllegalArgumentException if the capacity is negative.
*/
@@ -80,6 +81,7 @@ public final class Inventory implements Cloneable {
/**
* Creates an inventory.
+ *
* @param capacity The capacity.
* @param mode The stacking mode.
* @throws IllegalArgumentException if the capacity is negative.
@@ -98,9 +100,8 @@ public final class Inventory implements Cloneable {
}
/**
- * Creates a copy of this inventory. Listeners are not copied, they must be
- * added again yourself! This is so cloned copies don't send updates to
- * their counterparts.
+ * Creates a copy of this inventory. Listeners are not copied, they must be added again yourself! This is so cloned
+ * copies don't send updates to their counterparts.
*/
@Override
public Inventory clone() {
@@ -112,6 +113,7 @@ public final class Inventory implements Cloneable {
/**
* Checks if this inventory contains an item with the specified id.
+ *
* @param id The item's id.
* @return {@code true} if so, {@code false} if not.
*/
@@ -127,6 +129,7 @@ public final class Inventory implements Cloneable {
/**
* Gets the number of free slots.
+ *
* @return The number of free slots.
*/
public int freeSlots() {
@@ -144,6 +147,7 @@ public final class Inventory implements Cloneable {
/**
* Gets the capacity of this inventory.
+ *
* @return The capacity.
*/
public int capacity() {
@@ -152,6 +156,7 @@ public final class Inventory implements Cloneable {
/**
* Gets the size of this inventory - the number of used slots.
+ *
* @return The size.
*/
public int size() {
@@ -160,6 +165,7 @@ public final class Inventory implements Cloneable {
/**
* Gets the item in the specified slot.
+ *
* @param slot The slot.
* @return The item, or {@code null} if the slot is empty.
* @throws IndexOutOfBoundsException if the slot is out of bounds.
@@ -171,9 +177,9 @@ public final class Inventory implements Cloneable {
/**
* Sets the item that is in the specified slot.
+ *
* @param slot The slot.
- * @param item The item, or {@code null} to remove the item that is in the
- * slot.
+ * @param item The item, or {@code null} to remove the item that is in the slot.
* @return The item that was in the slot.
* @throws IndexOutOfBoundsException if the slot is out of bounds.
*/
@@ -194,6 +200,7 @@ public final class Inventory implements Cloneable {
/**
* Removes the item (if any) that is in the specified slot.
+ *
* @param slot
* @return The item that was in the slot.
* @throws IndexOutOfBoundsException if the slot is out of bounds.
@@ -212,9 +219,9 @@ public final class Inventory implements Cloneable {
/**
* An alias for {@code add(id, 1)}.
+ *
* @param id The id.
- * @return {@code true} if the item was added, {@code false} if there was
- * not enough room.
+ * @return {@code true} if the item was added, {@code false} if there was not enough room.
*/
public boolean add(int id) {
return add(id, 1) == 0;
@@ -222,6 +229,7 @@ public final class Inventory implements Cloneable {
/**
* An alias for {@code add(new Item(id, amount)}.
+ *
* @param id The id.
* @param amount The amount.
* @return The amount that remains.
@@ -235,15 +243,13 @@ public final class Inventory implements Cloneable {
}
/**
- * Adds an item to this inventory. This will attempt to add as much of the
- * item that is possible. If the item remains, it will be returned (in the
- * case of stackable items, any quantity that remains in the stack is
- * returned). If nothing remains, the method will return {@code null}. If
- * something remains, the listener will also be notified which could be
- * used, for example, to send a message to the player.
+ * Adds an item to this inventory. This will attempt to add as much of the item that is possible. If the item
+ * remains, it will be returned (in the case of stackable items, any quantity that remains in the stack is
+ * returned). If nothing remains, the method will return {@code null}. If something remains, the listener will also
+ * be notified which could be used, for example, to send a message to the player.
+ *
* @param item The item to add to this inventory.
- * @return The item that remains if there is not enough room in the
- * inventory. If nothing remains, {@code null}.
+ * @return The item that remains if there is not enough room in the inventory. If nothing remains, {@code null}.
*/
public Item add(Item item) {
int id = item.getId();
@@ -264,7 +270,7 @@ public final class Inventory implements Cloneable {
remaining = 0;
}
set(slot, new Item(id, amount));
- return remaining > 0 ? new Item(id, remaining): null;
+ return remaining > 0 ? new Item(id, remaining) : null;
}
}
for (int slot = 0; slot < capacity; slot++) {
@@ -308,6 +314,7 @@ public final class Inventory implements Cloneable {
/**
* Removes one item with the specified id.
+ *
* @param id The id.
* @return {@code true} if the item was removed, {@code false} otherwise.
*/
@@ -317,6 +324,7 @@ public final class Inventory implements Cloneable {
/**
* An alias for {@code remove(item.getId(), item.getAmount())}.
+ *
* @param item The item to remove.
* @return The amount that was removed.
*/
@@ -325,9 +333,9 @@ public final class Inventory implements Cloneable {
}
/**
- * Removes {@code amount} of the item with the specified {@code id}. If the
- * item is stackable, it will remove it from the stack. If not, it'll
- * remove {@code amount} items.
+ * Removes {@code amount} of the item with the specified {@code id}. If the item is stackable, it will remove it
+ * from the stack. If not, it'll remove {@code amount} items.
+ *
* @param id The id.
* @param amount The amount.
* @return The amount that was removed.
@@ -383,6 +391,7 @@ public final class Inventory implements Cloneable {
/**
* Swaps the two items at the specified slots.
+ *
* @param oldSlot The old slot.
* @param newSlot The new slot.
* @throws IndexOutOufBoundsException if the slot is out of bounds.
@@ -393,6 +402,7 @@ public final class Inventory implements Cloneable {
/**
* Swaps the two items at the specified slots.
+ *
* @param insert If the swap should be done in insertion mode.
* @param oldSlot The old slot.
* @param newSlot The new slot.
@@ -422,6 +432,7 @@ public final class Inventory implements Cloneable {
/**
* Adds a listener.
+ *
* @param listener The listener to add.
*/
public void addListener(InventoryListener listener) {
@@ -430,6 +441,7 @@ public final class Inventory implements Cloneable {
/**
* Removes a listener.
+ *
* @param listener The listener to remove.
*/
public void removeListener(InventoryListener listener) {
@@ -444,8 +456,7 @@ public final class Inventory implements Cloneable {
}
/**
- * Notifies listeners that the capacity of this inventory has been
- * exceeded.
+ * Notifies listeners that the capacity of this inventory has been exceeded.
*/
private void notifyCapacityExceeded() {
if (firingEvents) {
@@ -468,6 +479,7 @@ public final class Inventory implements Cloneable {
/**
* Notifies listeners that the specified slot has been updated.
+ *
* @param slot The slot.
*/
private void notifyItemUpdated(int slot) {
@@ -481,6 +493,7 @@ public final class Inventory implements Cloneable {
/**
* Checks the bounds of the specified slot.
+ *
* @param slot The slot.
* @throws IndexOutOfBoundsException if the slot is out of bounds.
*/
@@ -492,9 +505,9 @@ public final class Inventory implements Cloneable {
/**
* Checks if the item specified by the definition should be stacked.
+ *
* @param def The definition.
- * @return {@code true} if the item should be stacked, {@code false}
- * otherwise.
+ * @return {@code true} if the item should be stacked, {@code false} otherwise.
*/
private boolean isStackable(ItemDefinition def) {
if (mode == StackMode.STACK_ALWAYS) {
@@ -508,6 +521,7 @@ public final class Inventory implements Cloneable {
/**
* Gets a clone of the items array.
+ *
* @return A clone of the items array.
*/
public Item[] getItems() {
@@ -537,6 +551,7 @@ public final class Inventory implements Cloneable {
/**
* Forces a refresh of a specific slot.
+ *
* @param slot The slot.
*/
public void forceRefresh(int slot) {
diff --git a/src/org/apollo/game/model/InventoryConstants.java b/src/org/apollo/game/model/InventoryConstants.java
index 5a3fd8c5..095ad347 100644
--- a/src/org/apollo/game/model/InventoryConstants.java
+++ b/src/org/apollo/game/model/InventoryConstants.java
@@ -2,6 +2,7 @@ package org.apollo.game.model;
/**
* Holds {@link Inventory}-related constants.
+ *
* @author Graham
*/
public final class InventoryConstants {
diff --git a/src/org/apollo/game/model/Item.java b/src/org/apollo/game/model/Item.java
index deed50f6..9265572e 100644
--- a/src/org/apollo/game/model/Item.java
+++ b/src/org/apollo/game/model/Item.java
@@ -4,6 +4,7 @@ import org.apollo.game.model.def.ItemDefinition;
/**
* Represents a single item.
+ *
* @author Graham
*/
public final class Item {
@@ -20,6 +21,7 @@ public final class Item {
/**
* Creates an item with an amount of {@code 1}.
+ *
* @param id The item's id.
*/
public Item(int id) {
@@ -28,6 +30,7 @@ public final class Item {
/**
* Creates an item with the specified the amount.
+ *
* @param id The item's id.
* @param amount The amount.
* @throws IllegalArgumentException if the amount is negative.
@@ -42,6 +45,7 @@ public final class Item {
/**
* Gets the id.
+ *
* @return The id.
*/
public int getId() {
@@ -50,6 +54,7 @@ public final class Item {
/**
* Gets the amount.
+ *
* @return The amount.
*/
public int getAmount() {
@@ -58,6 +63,7 @@ public final class Item {
/**
* Gets the {@link ItemDefinition} which describes this item.
+ *
* @return The definition.
*/
public ItemDefinition getDefinition() {
diff --git a/src/org/apollo/game/model/Player.java b/src/org/apollo/game/model/Player.java
index c9f475dd..7ef19511 100644
--- a/src/org/apollo/game/model/Player.java
+++ b/src/org/apollo/game/model/Player.java
@@ -21,12 +21,14 @@ import org.apollo.security.PlayerCredentials;
/**
* A {@link Player} is a {@link Character} that a user is controlling.
+ *
* @author Graham
*/
public final class Player extends Character {
/**
* An enumeration with the different privilege levels a player can have.
+ *
* @author Graham
*/
public enum PrivilegeLevel {
@@ -48,6 +50,7 @@ public final class Player extends Character {
/**
* Gets the privilege level for the specified numerical level.
+ *
* @param numericalLevel The numerical level.
* @return The privilege level.
* @throws IllegalArgumentException if the numerical level is invalid.
@@ -68,6 +71,7 @@ public final class Player extends Character {
/**
* Creates a privilege level.
+ *
* @param numericalLevel The numerical level.
*/
private PrivilegeLevel(int numericalLevel) {
@@ -76,6 +80,7 @@ public final class Player extends Character {
/**
* Gets the numerical level.
+ *
* @return The numerical level used in the protocol.
*/
public int toInteger() {
@@ -151,6 +156,7 @@ public final class Player extends Character {
/**
* Creates the {@link Player}.
+ *
* @param credentials The player's credentials.
* @param position The initial position.
*/
@@ -162,6 +168,7 @@ public final class Player extends Character {
/**
* Gets this player's interface set.
+ *
* @return The interface set for this player.
*/
public InterfaceSet getInterfaceSet() {
@@ -170,6 +177,7 @@ public final class Player extends Character {
/**
* Checks if there are excessive players.
+ *
* @return {@code true} if so, {@code false} if not.
*/
public boolean isExcessivePlayersSet() {
@@ -199,6 +207,7 @@ public final class Player extends Character {
/**
* Gets this player's viewing distance.
+ *
* @return The viewing distance.
*/
public int getViewingDistance() {
@@ -206,8 +215,7 @@ public final class Player extends Character {
}
/**
- * Increments this player's viewing distance if it is less than the maximum
- * viewing distance.
+ * Increments this player's viewing distance if it is less than the maximum viewing distance.
*/
public void incrementViewingDistance() {
if (viewingDistance < Position.MAX_DISTANCE) {
@@ -226,6 +234,7 @@ public final class Player extends Character {
/**
* Checks if this player has ever known a region.
+ *
* @return {@code true} if so, {@code false} if not.
*/
public boolean hasLastKnownRegion() {
@@ -234,8 +243,8 @@ public final class Player extends Character {
/**
* Gets the last known region.
- * @return The last known region, or {@code null} if the player has never
- * known a region.
+ *
+ * @return The last known region, or {@code null} if the player has never known a region.
*/
public Position getLastKnownRegion() {
return lastKnownRegion;
@@ -243,6 +252,7 @@ public final class Player extends Character {
/**
* Sets the last known region.
+ *
* @param lastKnownRegion The last known region.
*/
public void setLastKnownRegion(Position lastKnownRegion) {
@@ -251,6 +261,7 @@ public final class Player extends Character {
/**
* Gets the privilege level.
+ *
* @return The privilege level.
*/
public PrivilegeLevel getPrivilegeLevel() {
@@ -259,6 +270,7 @@ public final class Player extends Character {
/**
* Sets the privilege level.
+ *
* @param privilegeLevel The privilege level.
*/
public void setPrivilegeLevel(PrivilegeLevel privilegeLevel) {
@@ -267,6 +279,7 @@ public final class Player extends Character {
/**
* Checks if this player account has membership.
+ *
* @return {@code true} if so, {@code false} if not.
*/
public boolean isMembers() {
@@ -275,6 +288,7 @@ public final class Player extends Character {
/**
* Changes the membership status of this player.
+ *
* @param members The new membership flag.
*/
public void setMembers(boolean members) {
@@ -283,6 +297,7 @@ public final class Player extends Character {
/**
* Sets the player's {@link GameSession}.
+ *
* @param session The player's {@link GameSession}.
* @param reconnecting The reconnecting flag.
*/
@@ -296,6 +311,7 @@ public final class Player extends Character {
/**
* Gets the player's credentials.
+ *
* @return The player's credentials.
*/
public PlayerCredentials getCredentials() {
@@ -353,17 +369,21 @@ public final class Player extends Character {
// TODO only add bank listener when it is open? (like Hyperion)
// inventory full listeners
- InventoryListener fullInventoryListener = new FullInventoryListener(this, FullInventoryListener.FULL_INVENTORY_MESSAGE);
+ InventoryListener fullInventoryListener = new FullInventoryListener(this,
+ FullInventoryListener.FULL_INVENTORY_MESSAGE);
InventoryListener fullBankListener = new FullInventoryListener(this, FullInventoryListener.FULL_BANK_MESSAGE);
- InventoryListener fullEquipmentListener = new FullInventoryListener(this, FullInventoryListener.FULL_EQUIPMENT_MESSAGE);
+ InventoryListener fullEquipmentListener = new FullInventoryListener(this,
+ FullInventoryListener.FULL_EQUIPMENT_MESSAGE);
// equipment appearance listener
InventoryListener appearanceListener = new AppearanceInventoryListener(this);
// synchronization listeners
- 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);
// add the listeners
inventory.addListener(syncInventoryListener);
@@ -390,11 +410,10 @@ public final class Player extends Character {
// tabs TODO make a constant? look at player settings
int[] tabs = {
- // 6299 = music tab, music disabled
- // 4445 = settings tab, music disabled
- // 12855 = ancients magic
- 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
+ 2423, 3917, 638, 3213, 1644, 5608, 1151, -1, 5065, 5715, 2449, 904, 147, 962, };
for (int i = 0; i < tabs.length; i++) {
send(new SwitchTabInterfaceEvent(i, tabs[i]));
}
@@ -410,11 +429,13 @@ public final class Player extends Character {
@Override
public String toString() {
- return Player.class.getName() + " [username=" + credentials.getUsername() + ", privilegeLevel=" + privilegeLevel +"]";
+ return Player.class.getName() + " [username=" + credentials.getUsername() + ", privilegeLevel="
+ + privilegeLevel + "]";
}
/**
* Sets the region changed flag.
+ *
* @param regionChanged A flag indicating if the region has changed.
*/
public void setRegionChanged(boolean regionChanged) {
@@ -423,6 +444,7 @@ public final class Player extends Character {
/**
* Checks if the region has changed.
+ *
* @return {@code true} if so, {@code false} if not.
*/
public boolean hasRegionChanged() {
@@ -431,6 +453,7 @@ public final class Player extends Character {
/**
* Gets the player's appearance.
+ *
* @return The appearance.
*/
public Appearance getAppearance() {
@@ -439,6 +462,7 @@ public final class Player extends Character {
/**
* Sets the player's appearance.
+ *
* @param appearance The new appearance.
*/
public void setAppearance(Appearance appearance) {
@@ -448,6 +472,7 @@ public final class Player extends Character {
/**
* Gets the player's name.
+ *
* @return The player's name.
*/
public String getName() {
@@ -456,6 +481,7 @@ public final class Player extends Character {
/**
* Gets the player's name, encoded as a long.
+ *
* @return The encoded player name.
*/
public long getEncodedName() {
@@ -471,6 +497,7 @@ public final class Player extends Character {
/**
* Gets the game session.
+ *
* @return The game session.
*/
public GameSession getSession() {
@@ -479,8 +506,8 @@ public final class Player extends Character {
/**
* Sets the character design flag.
- * @param designedCharacter A flag indicating if the character has been
- * designed.
+ *
+ * @param designedCharacter A flag indicating if the character has been designed.
*/
public void setDesignedCharacter(boolean designedCharacter) {
this.designedCharacter = designedCharacter;
@@ -488,6 +515,7 @@ public final class Player extends Character {
/**
* Checks if the player has designed their character.
+ *
* @return A flag indicating if the player has designed their character.
*/
public boolean hasDesignedCharacter() {
@@ -496,6 +524,7 @@ public final class Player extends Character {
/**
* Gets the withdrawing notes flag.
+ *
* @return The flag.
*/
public boolean isWithdrawingNotes() {
@@ -504,6 +533,7 @@ public final class Player extends Character {
/**
* Sets the withdrawing notes flag.
+ *
* @param withdrawingNotes The flag.
*/
public void setWithdrawingNotes(boolean withdrawingNotes) {
diff --git a/src/org/apollo/game/model/Position.java b/src/org/apollo/game/model/Position.java
index 78d1e773..3a3eb08e 100644
--- a/src/org/apollo/game/model/Position.java
+++ b/src/org/apollo/game/model/Position.java
@@ -2,6 +2,7 @@ package org.apollo.game.model;
/**
* Represents a position in the world.
+ *
* @author Graham
*/
public final class Position {
@@ -33,6 +34,7 @@ public final class Position {
/**
* Creates a position at the default height.
+ *
* @param x The x coordinate.
* @param y The y coordinate.
*/
@@ -42,6 +44,7 @@ public final class Position {
/**
* Creates a position with the specified height.
+ *
* @param x The x coordinate.
* @param y The y coordinate.
* @param height The height.
@@ -57,6 +60,7 @@ public final class Position {
/**
* Gets the x coordinate.
+ *
* @return The x coordinate.
*/
public int getX() {
@@ -65,6 +69,7 @@ public final class Position {
/**
* Gets the y coordinate.
+ *
* @return The y coordinate.
*/
public int getY() {
@@ -73,6 +78,7 @@ public final class Position {
/**
* Gets the height level.
+ *
* @return The height level.
*/
public int getHeight() {
@@ -81,6 +87,7 @@ public final class Position {
/**
* Gets the x coordinate of the region.
+ *
* @return The region x coordinate.
*/
public int getTopLeftRegionX() {
@@ -89,6 +96,7 @@ public final class Position {
/**
* Gets the y coordinate of the region.
+ *
* @return The region y coordinate.
*/
public int getTopLeftRegionY() {
@@ -97,6 +105,7 @@ public final class Position {
/**
* Gets the x coordinate of the central region.
+ *
* @return The x coordinate of the central region.
*/
public int getCentralRegionX() {
@@ -105,6 +114,7 @@ public final class Position {
/**
* Gets the y coordinate of the central region.
+ *
* @return The y coordinate of the central region.
*/
public int getCentralRegionY() {
@@ -113,6 +123,7 @@ public final class Position {
/**
* Gets the x coordinate inside the region of this position.
+ *
* @return The local x coordinate.
*/
public int getLocalX() {
@@ -121,6 +132,7 @@ public final class Position {
/**
* Gets the y coordinate inside the region of this position.
+ *
* @return The local y coordinate.
*/
public int getLocalY() {
@@ -128,8 +140,8 @@ public final class Position {
}
/**
- * Gets the local x coordinate inside the region of the {@code base}
- * position.
+ * Gets the local x coordinate inside the region of the {@code base} position.
+ *
* @param base The base position.
* @return The local x coordinate.
*/
@@ -138,8 +150,8 @@ public final class Position {
}
/**
- * Gets the local y coordinate inside the region of the {@code base}
- * position.
+ * Gets the local y coordinate inside the region of the {@code base} position.
+ *
* @param base The base position.
* @return The local y coordinate.
*/
@@ -153,8 +165,8 @@ public final class Position {
}
/**
- * Gets the distance between this position and another position. Only X and
- * Y are considered (i.e. 2 dimensions).
+ * Gets the distance between this position and another position. Only X and Y are considered (i.e. 2 dimensions).
+ *
* @param other The other position.
* @return The distance.
*/
@@ -167,6 +179,7 @@ public final class Position {
/**
* Gets the longest horizontal or vertical delta between the two positions.
+ *
* @param other The other position.
* @return The longest horizontal or vertical delta.
*/
@@ -178,6 +191,7 @@ public final class Position {
/**
* Checks if the position is within distance of another.
+ *
* @param other The other position.
* @param distance The distance.
* @return {@code true} if so, {@code false} if not.
diff --git a/src/org/apollo/game/model/Skill.java b/src/org/apollo/game/model/Skill.java
index e95780d5..f542b60c 100644
--- a/src/org/apollo/game/model/Skill.java
+++ b/src/org/apollo/game/model/Skill.java
@@ -2,6 +2,7 @@ package org.apollo.game.model;
/**
* Represents a single skill.
+ *
* @author Graham
*/
public final class Skill {
@@ -115,11 +116,12 @@ 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" };
+ "Magic", "Cooking", "Woodcutting", "Fletching", "Fishing", "Firemaking", "Crafting", "Smithing", "Mining",
+ "Herblore", "Agility", "Thieving", "Slayer", "Farming", "Runecraft" };
/**
* Gets the name of a skill.
+ *
* @param id The skill's id.
* @return The skill's name.
*/
@@ -144,6 +146,7 @@ public final class Skill {
/**
* Creates a skill.
+ *
* @param experience The experience.
* @param currentLevel The current level.
* @param maximumLevel The maximum level.
@@ -156,6 +159,7 @@ public final class Skill {
/**
* Gets the experience.
+ *
* @return The experience.
*/
public double getExperience() {
@@ -164,6 +168,7 @@ public final class Skill {
/**
* Gets the current level.
+ *
* @return The current level.
*/
public int getCurrentLevel() {
@@ -172,6 +177,7 @@ public final class Skill {
/**
* Gets the maximum level.
+ *
* @return The maximum level.
*/
public int getMaximumLevel() {
diff --git a/src/org/apollo/game/model/SkillSet.java b/src/org/apollo/game/model/SkillSet.java
index f02c88f8..fc9daa92 100644
--- a/src/org/apollo/game/model/SkillSet.java
+++ b/src/org/apollo/game/model/SkillSet.java
@@ -70,11 +70,9 @@ public final class SkillSet {
/**
* Gets a skill by its id.
*
- * @param id
- * The id.
+ * @param id The id.
* @return The skill.
- * @throws IndexOutOfBoundsException
- * if the id is out of bounds.
+ * @throws IndexOutOfBoundsException if the id is out of bounds.
*/
public Skill getSkill(int id) {
checkBounds(id);
@@ -84,10 +82,8 @@ public final class SkillSet {
/**
* Adds experience to the specified skill.
*
- * @param id
- * The skill id.
- * @param experience
- * The amount of experience.
+ * @param id The skill id.
+ * @param experience The amount of experience.
*/
public void addExperience(int id, double experience) {
checkBounds(id);
@@ -162,8 +158,7 @@ public final class SkillSet {
/**
* Gets the minimum experience required for the specified level.
*
- * @param level
- * The level.
+ * @param level The level.
* @return The minimum experience.
*/
public static double getExperienceForLevel(int level) {
@@ -182,8 +177,7 @@ public final class SkillSet {
/**
* Gets the minimum level to get the specified experience.
*
- * @param experience
- * The experience.
+ * @param experience The experience.
* @return The minimum level.
*/
public static int getLevelForExperience(double experience) {
@@ -223,12 +217,9 @@ public final class SkillSet {
/**
* Sets a skill.
*
- * @param id
- * The id.
- * @param skill
- * The skill.
- * @throws IndexOutOfBoundsException
- * if the id is out of bounds.
+ * @param id The id.
+ * @param skill The skill.
+ * @throws IndexOutOfBoundsException if the id is out of bounds.
*/
public void setSkill(int id, Skill skill) {
checkBounds(id);
@@ -239,10 +230,8 @@ public final class SkillSet {
/**
* Checks the bounds of the id.
*
- * @param id
- * The id.
- * @throws IndexOutOfBoundsException
- * if the id is out of bounds.
+ * @param id The id.
+ * @throws IndexOutOfBoundsException if the id is out of bounds.
*/
private void checkBounds(int id) {
if (id < 0 || id >= skills.length) {
@@ -253,10 +242,8 @@ public final class SkillSet {
/**
* Notifies listeners that a skill has been levelled up.
*
- * @param id
- * The skill's id.
- * @throws IndexOutOfBoundsException
- * if the id is out of bounds.
+ * @param id The skill's id.
+ * @throws IndexOutOfBoundsException if the id is out of bounds.
*/
private void notifyLevelledUp(int id) {
checkBounds(id);
@@ -270,10 +257,8 @@ public final class SkillSet {
/**
* Notifies listeners that a skill has been updated.
*
- * @param id
- * The skill's id.
- * @throws IndexOutOfBoundsException
- * if the id is out of bounds.
+ * @param id The skill's id.
+ * @throws IndexOutOfBoundsException if the id is out of bounds.
*/
private void notifySkillUpdated(int id) {
checkBounds(id);
@@ -319,8 +304,7 @@ public final class SkillSet {
/**
* Adds a listener.
*
- * @param listener
- * The listener to add.
+ * @param listener The listener to add.
*/
public void addListener(SkillListener listener) {
listeners.add(listener);
@@ -329,8 +313,7 @@ public final class SkillSet {
/**
* Removes a listener.
*
- * @param listener
- * The listener to remove.
+ * @param listener The listener to remove.
*/
public void removeListener(SkillListener listener) {
listeners.remove(listener);
diff --git a/src/org/apollo/game/model/SlottedItem.java b/src/org/apollo/game/model/SlottedItem.java
index cb59bcd1..a7687c59 100644
--- a/src/org/apollo/game/model/SlottedItem.java
+++ b/src/org/apollo/game/model/SlottedItem.java
@@ -2,6 +2,7 @@ package org.apollo.game.model;
/**
* A class which contains an {@link Item} and its corresponding slot.
+ *
* @author Graham
*/
public final class SlottedItem {
@@ -18,6 +19,7 @@ public final class SlottedItem {
/**
* Creates a new slotted item.
+ *
* @param slot The slot.
* @param item The item.
*/
@@ -28,6 +30,7 @@ public final class SlottedItem {
/**
* Gets the slot.
+ *
* @return The slot.
*/
public int getSlot() {
@@ -36,6 +39,7 @@ public final class SlottedItem {
/**
* Gets the item.
+ *
* @return The item.
*/
public Item getItem() {
diff --git a/src/org/apollo/game/model/WalkingQueue.java b/src/org/apollo/game/model/WalkingQueue.java
index d9416b64..9aceeaf0 100644
--- a/src/org/apollo/game/model/WalkingQueue.java
+++ b/src/org/apollo/game/model/WalkingQueue.java
@@ -12,8 +12,7 @@ import java.util.Queue;
public final class WalkingQueue {
/**
- * The maximum size of the queue. If any additional steps are added, they
- * are discarded.
+ * The maximum size of the queue. If any additional steps are added, they are discarded.
*/
private static final int MAXIMUM_SIZE = 128;
@@ -37,10 +36,8 @@ public final class WalkingQueue {
/**
* Creates a point.
*
- * @param position
- * The position.
- * @param direction
- * The direction.
+ * @param position The position.
+ * @param direction The direction.
*/
public Point(Position position, Direction direction) {
this.position = position;
@@ -49,8 +46,7 @@ public final class WalkingQueue {
@Override
public String toString() {
- return Point.class.getName() + " [direction=" + direction
- + ", position=" + position + "]";
+ return Point.class.getName() + " [direction=" + direction + ", position=" + position + "]";
}
}
@@ -78,8 +74,7 @@ public final class WalkingQueue {
/**
* Creates a walking queue for the specified character.
*
- * @param character
- * The character.
+ * @param character The character.
*/
public WalkingQueue(Character character) {
this.character = character;
@@ -115,21 +110,18 @@ public final class WalkingQueue {
/**
* Sets the running queue flag.
*
- * @param running
- * The running queue flag.
+ * @param running The running queue flag.
*/
public void setRunningQueue(boolean running) {
this.runningQueue = running;
}
/**
- * Adds the first step to the queue, attempting to connect the server and
- * client position by looking at the previous queue.
+ * Adds the first step to the queue, attempting to connect the server and client position by looking at the previous
+ * queue.
*
- * @param clientConnectionPosition
- * The first step.
- * @return {@code true} if the queues could be connected correctly,
- * {@code false} if not.
+ * @param clientConnectionPosition The first step.
+ * @return {@code true} if the queues could be connected correctly, {@code false} if not.
*/
public boolean addFirstStep(Position clientConnectionPosition) {
Position serverPosition = character.getPosition();
@@ -176,8 +168,7 @@ public final class WalkingQueue {
/**
* Adds a step to the queue.
*
- * @param step
- * The step to add.
+ * @param step The step to add.
*/
public void addStep(Position step) {
Point last = getLast();
@@ -210,10 +201,8 @@ public final class WalkingQueue {
/**
* Adds a step.
*
- * @param x
- * The x coordinate of this step.
- * @param y
- * The y coordinate of this step.
+ * @param x The x coordinate of this step.
+ * @param y The y coordinate of this step.
*/
private void addStep(int x, int y) {
if (points.size() >= MAXIMUM_SIZE) {
@@ -228,8 +217,7 @@ public final class WalkingQueue {
Direction direction = Direction.fromDeltas(deltaX, deltaY);
if (direction != Direction.NONE) {
- Point p = new Point(new Position(x, y, character.getPosition()
- .getHeight()), direction);
+ Point p = new Point(new Position(x, y, character.getPosition().getHeight()), direction);
points.add(p);
oldPoints.add(p);
}
diff --git a/src/org/apollo/game/model/World.java b/src/org/apollo/game/model/World.java
index 496a28a2..86767edd 100644
--- a/src/org/apollo/game/model/World.java
+++ b/src/org/apollo/game/model/World.java
@@ -19,11 +19,10 @@ import org.apollo.util.CharacterRepository;
import org.apollo.util.plugin.PluginManager;
/**
- * The world class is a singleton which contains objects like the
- * {@link CharacterRepository} for players and NPCs. It should only contain
- * things relevant to the in-game world and not classes which deal with I/O and
- * such (these may be better off inside some custom {@link Service} or other
- * code, however, the circumstances are rare).
+ * The world class is a singleton which contains objects like the {@link CharacterRepository} for players and NPCs. It
+ * should only contain things relevant to the in-game world and not classes which deal with I/O and such (these may be
+ * better off inside some custom {@link Service} or other code, however, the circumstances are rare).
+ *
* @author Graham
*/
public final class World {
@@ -40,6 +39,7 @@ public final class World {
/**
* Represents the different status codes for registering a player.
+ *
* @author Graham
*/
public enum RegistrationStatus {
@@ -62,6 +62,7 @@ public final class World {
/**
* Gets the world.
+ *
* @return The world.
*/
public static World getWorld() {
@@ -86,7 +87,8 @@ public final class World {
/**
* The {@link CharacterRepository} of {@link Player}s.
*/
- private final CharacterRepository playerRepository = new CharacterRepository(WorldConstants.MAXIMUM_PLAYERS);
+ private final CharacterRepository playerRepository = new CharacterRepository(
+ WorldConstants.MAXIMUM_PLAYERS);
/**
* Creates the world.
@@ -96,8 +98,8 @@ public final class World {
}
/**
- * Initialises the world by loading definitions from the specified file
- * system.
+ * Initialises the world by loading definitions from the specified file system.
+ *
* @param release The release number.
* @param fs The file system.
* @param mgr The plugin manager. TODO move this.
@@ -131,15 +133,13 @@ public final class World {
}
/**
- * Gets the character repository. NOTE:
- * {@link CharacterRepository#add(Character)} and
- * {@link CharacterRepository#remove(Character)} should not be called
- * directly! These mutation methods are not guaranteed to work in future
- * releases!
+ * Gets the character repository. NOTE: {@link CharacterRepository#add(Character)} and
+ * {@link CharacterRepository#remove(Character)} should not be called directly! These mutation methods are not
+ * guaranteed to work in future releases!
*
- * Instead, use the {@link World#register(Player)} and
- * {@link World#unregister(Player)} methods which do the same thing and
- * will continue to work as normal in future releases.
+ * Instead, use the {@link World#register(Player)} and {@link World#unregister(Player)} methods which do the same
+ * thing and will continue to work as normal in future releases.
+ *
* @return The character repository.
*/
public CharacterRepository getPlayerRepository() {
@@ -148,6 +148,7 @@ public final class World {
/**
* Registers the specified player.
+ *
* @param player The player.
* @return A {@link RegistrationStatus}.
*/
@@ -161,13 +162,15 @@ public final class World {
logger.info("Registered player: " + player + " [online=" + playerRepository.size() + "]");
return RegistrationStatus.OK;
} else {
- logger.warning("Failed to register player (server full): " + player + " [online=" + playerRepository.size() + "]");
+ logger.warning("Failed to register player (server full): " + player + " [online=" + playerRepository.size()
+ + "]");
return RegistrationStatus.WORLD_FULL;
}
}
/**
* Checks if the specified player is online.
+ *
* @param name The player's name.
* @return {@code true} if so, {@code false} if not.
*/
@@ -183,6 +186,7 @@ public final class World {
/**
* Unregisters the specified player.
+ *
* @param player The player.
*/
public void unregister(Player player) {
@@ -195,6 +199,7 @@ public final class World {
/**
* Schedules a new task.
+ *
* @param task The {@link ScheduledTask}.
*/
public void schedule(ScheduledTask task) {
@@ -210,6 +215,7 @@ public final class World {
/**
* Gets the command dispatcher. TODO should this be here?
+ *
* @return The command dispatcher.
*/
public CommandDispatcher getCommandDispatcher() {
@@ -218,6 +224,7 @@ public final class World {
/**
* Gets the plugin manager. TODO should this be here?
+ *
* @return The plugin manager.
*/
public PluginManager getPluginManager() {
diff --git a/src/org/apollo/game/model/WorldConstants.java b/src/org/apollo/game/model/WorldConstants.java
index 079c73e8..43629c00 100644
--- a/src/org/apollo/game/model/WorldConstants.java
+++ b/src/org/apollo/game/model/WorldConstants.java
@@ -2,6 +2,7 @@ package org.apollo.game.model;
/**
* Holds world-related constants.
+ *
* @author Graham
*/
public final class WorldConstants {
diff --git a/src/org/apollo/game/model/def/EquipmentDefinition.java b/src/org/apollo/game/model/def/EquipmentDefinition.java
index e4771d20..53570fd8 100644
--- a/src/org/apollo/game/model/def/EquipmentDefinition.java
+++ b/src/org/apollo/game/model/def/EquipmentDefinition.java
@@ -7,6 +7,7 @@ import org.apollo.game.model.Item;
/**
* Represents a type of {@link Item} which may be equipped.
+ *
* @author Graham
*/
public final class EquipmentDefinition {
@@ -18,6 +19,7 @@ public final class EquipmentDefinition {
/**
* Initialises the equipment definitions.
+ *
* @param definitions The definitions.
*/
public static void init(EquipmentDefinition[] definitions) {
@@ -34,9 +36,9 @@ public final class EquipmentDefinition {
/**
* Gets an equipment definition by its id.
+ *
* @param id The id.
- * @return {@code null} if the item is not equipment, the definition
- * otherwise.
+ * @return {@code null} if the item is not equipment, the definition otherwise.
* @throws IndexOutOfBoundsException if the id is out of bounds.
*/
public static EquipmentDefinition forId(int id) {
@@ -68,6 +70,7 @@ public final class EquipmentDefinition {
/**
* Creates a new equipment definition.
+ *
* @param id The id.
*/
public EquipmentDefinition(int id) {
@@ -76,6 +79,7 @@ public final class EquipmentDefinition {
/**
* Gets the id.
+ *
* @return The id.
*/
public int getId() {
@@ -84,6 +88,7 @@ public final class EquipmentDefinition {
/**
* Sets the required levels.
+ *
* @param attack The required attack level.
* @param strength The required strength level.
* @param defence The required defence level.
@@ -100,6 +105,7 @@ public final class EquipmentDefinition {
/**
* Gets the minimum attack level.
+ *
* @return The minimum attack level.
*/
public int getAttackLevel() {
@@ -108,6 +114,7 @@ public final class EquipmentDefinition {
/**
* Gets the minimum strength level.
+ *
* @return The minimum strength level.
*/
public int getStrengthLevel() {
@@ -116,6 +123,7 @@ public final class EquipmentDefinition {
/**
* Gets the minimum defence level.
+ *
* @return The minimum defence level.
*/
public int getDefenceLevel() {
@@ -124,6 +132,7 @@ public final class EquipmentDefinition {
/**
* Gets the minimum ranged level.
+ *
* @return The minimum ranged level.
*/
public int getRangedLevel() {
@@ -132,6 +141,7 @@ public final class EquipmentDefinition {
/**
* Gets the minimum magic level.
+ *
* @return The minimum magic level.
*/
public int getMagicLevel() {
@@ -140,6 +150,7 @@ public final class EquipmentDefinition {
/**
* Sets the target slot.
+ *
* @param slot The target slot.
*/
public void setSlot(int slot) {
@@ -148,6 +159,7 @@ public final class EquipmentDefinition {
/**
* Gets the target slot.
+ *
* @return The target slot.
*/
public int getSlot() {
@@ -156,6 +168,7 @@ public final class EquipmentDefinition {
/**
* Checks if this equipment is two-handed.
+ *
* @return {@code true} if so, {@code false} if not.
*/
public boolean isTwoHanded() {
@@ -164,6 +177,7 @@ public final class EquipmentDefinition {
/**
* Checks if this equipment is a full body.
+ *
* @return {@code true} if so, {@code false} if not.
*/
public boolean isFullBody() {
@@ -172,6 +186,7 @@ public final class EquipmentDefinition {
/**
* Checks if this equipment is a full hat.
+ *
* @return {@code true} if so, {@code false} if not.
*/
public boolean isFullHat() {
@@ -180,6 +195,7 @@ public final class EquipmentDefinition {
/**
* Checks if this equipment is a full mask.
+ *
* @return {@code true} if so, {@code false} if not.
*/
public boolean isFullMask() {
@@ -188,6 +204,7 @@ public final class EquipmentDefinition {
/**
* Sets the flags.
+ *
* @param twoHanded The two handed flag.
* @param fullBody The full body flag.
* @param fullHat The full hat flag.
diff --git a/src/org/apollo/game/model/def/ItemDefinition.java b/src/org/apollo/game/model/def/ItemDefinition.java
index 6d3e12e6..146b9537 100644
--- a/src/org/apollo/game/model/def/ItemDefinition.java
+++ b/src/org/apollo/game/model/def/ItemDefinition.java
@@ -7,6 +7,7 @@ import com.google.common.collect.HashBiMap;
/**
* Represents a type of {@link Item}.
+ *
* @author Graham
*/
public final class ItemDefinition {
@@ -28,6 +29,7 @@ public final class ItemDefinition {
/**
* Converts an item id to a noted id.
+ *
* @param id The item id.
* @return The noted id.
*/
@@ -41,6 +43,7 @@ public final class ItemDefinition {
/**
* Converts a noted id to the normal item id.
+ *
* @param id The note id.
* @return The item id.
*/
@@ -54,6 +57,7 @@ public final class ItemDefinition {
/**
* Initialises the class with the specified set of definitions.
+ *
* @param definitions The definitions.
* @throws RuntimeException if there is an id mismatch.
*/
@@ -73,6 +77,7 @@ public final class ItemDefinition {
/**
* Gets the total number of items.
+ *
* @return The total number of items.
*/
public static int count() {
@@ -81,6 +86,7 @@ public final class ItemDefinition {
/**
* Gets the item definition for the specified id.
+ *
* @param id The id.
* @return The definition.
* @throws IndexOutOfBoundsException if the id is out of bounds.
@@ -144,6 +150,7 @@ public final class ItemDefinition {
/**
* Creates an item definition with the default values.
+ *
* @param id The item's id.
*/
public ItemDefinition(int id) {
@@ -152,6 +159,7 @@ public final class ItemDefinition {
/**
* Gets the note info id.
+ *
* @return The note info id.
*/
public int getNoteInfoId() {
@@ -160,6 +168,7 @@ public final class ItemDefinition {
/**
* Gets the note graphic id.
+ *
* @return The note graphic id.
*/
public int getNoteGraphicId() {
@@ -168,6 +177,7 @@ public final class ItemDefinition {
/**
* Gets the item's id.
+ *
* @return The item's id.
*/
public int getId() {
@@ -176,6 +186,7 @@ public final class ItemDefinition {
/**
* Sets the note info id.
+ *
* @param noteInfoId The note info id.
*/
public void setNoteInfoId(int noteInfoId) {
@@ -184,6 +195,7 @@ public final class ItemDefinition {
/**
* Sets the note graphic id.
+ *
* @param noteGraphicId The note graphic id.
*/
public void setNoteGraphicId(int noteGraphicId) {
@@ -192,6 +204,7 @@ public final class ItemDefinition {
/**
* Checks if this item is a note.
+ *
* @return {@code true} if so, {@code false} otherwise.
*/
public boolean isNote() {
@@ -200,8 +213,8 @@ public final class ItemDefinition {
/**
* Converts this item to a note, if possible.
- * @throws IllegalStateException if {@link ItemDefinition#isNote()} returns
- * {@code false}.
+ *
+ * @throws IllegalStateException if {@link ItemDefinition#isNote()} returns {@code false}.
*/
public void toNote() {
if (isNote()) {
@@ -230,6 +243,7 @@ public final class ItemDefinition {
/**
* Sets the name of this item.
+ *
* @param name The item's name.
*/
public void setName(String name) {
@@ -238,6 +252,7 @@ public final class ItemDefinition {
/**
* Gets the name of this item.
+ *
* @return The name of this item, or {@code null} if it has no name.
*/
public String getName() {
@@ -246,6 +261,7 @@ public final class ItemDefinition {
/**
* Sets the description of this item.
+ *
* @param description The item's description.
*/
public void setDescription(String description) {
@@ -254,6 +270,7 @@ public final class ItemDefinition {
/**
* Gets the description of this item.
+ *
* @return The item's description.
*/
public String getDescription() {
@@ -262,6 +279,7 @@ public final class ItemDefinition {
/**
* Sets the stackable flag.
+ *
* @param stackable The stackable flag.
*/
public void setStackable(boolean stackable) {
@@ -270,6 +288,7 @@ public final class ItemDefinition {
/**
* Checks if the item specified by this definition is stackable.
+ *
* @return {@code true} if so, {@code false} if not.
*/
public boolean isStackable() {
@@ -278,6 +297,7 @@ public final class ItemDefinition {
/**
* Sets the value of this item.
+ *
* @param value The value of this item.
*/
public void setValue(int value) {
@@ -286,6 +306,7 @@ public final class ItemDefinition {
/**
* Gets the value of this item.
+ *
* @return The value of this item.
*/
public int getValue() {
@@ -294,6 +315,7 @@ public final class ItemDefinition {
/**
* Sets the members only flag.
+ *
* @param members The members only flag.
*/
public void setMembersOnly(boolean members) {
@@ -302,6 +324,7 @@ public final class ItemDefinition {
/**
* Checks if this item is members only.
+ *
* @return {@code true} if so, {@code false} if not.
*/
public boolean isMembersOnly() {
@@ -310,6 +333,7 @@ public final class ItemDefinition {
/**
* Sets a ground action.
+ *
* @param id The id.
* @param action The action.
* @throws IndexOutOfBoundsException if the id is out of bounds.
@@ -323,6 +347,7 @@ public final class ItemDefinition {
/**
* Gets a ground action.
+ *
* @param id The id.
* @return The action.
* @throws IndexOutOfBoundsException if the id is out of bounds.
@@ -336,6 +361,7 @@ public final class ItemDefinition {
/**
* Sets an inventory action.
+ *
* @param id The id.
* @param action The action.
* @throws IndexOutOfBoundsException if the id is out of bounds.
@@ -349,6 +375,7 @@ public final class ItemDefinition {
/**
* Gets an inventory action.
+ *
* @param id The id.
* @return The action.
* @throws IndexOutOfBoundsException if the id is out of bounds.
diff --git a/src/org/apollo/game/model/def/StaticObjectDefinition.java b/src/org/apollo/game/model/def/StaticObjectDefinition.java
index d45bc0ed..ba60cf6d 100644
--- a/src/org/apollo/game/model/def/StaticObjectDefinition.java
+++ b/src/org/apollo/game/model/def/StaticObjectDefinition.java
@@ -4,6 +4,7 @@ import org.apollo.game.model.obj.StaticObject;
/**
* Represents a type of {@link StaticObject}.
+ *
* @author Graham
*/
public final class StaticObjectDefinition {
diff --git a/src/org/apollo/game/model/def/package-info.java b/src/org/apollo/game/model/def/package-info.java
index 70a6c2b3..25517904 100644
--- a/src/org/apollo/game/model/def/package-info.java
+++ b/src/org/apollo/game/model/def/package-info.java
@@ -3,3 +3,4 @@
* NPCs, etc.
*/
package org.apollo.game.model.def;
+
diff --git a/src/org/apollo/game/model/inter/EnterAmountListener.java b/src/org/apollo/game/model/inter/EnterAmountListener.java
index 2e7d8b08..003bb1e8 100644
--- a/src/org/apollo/game/model/inter/EnterAmountListener.java
+++ b/src/org/apollo/game/model/inter/EnterAmountListener.java
@@ -2,12 +2,14 @@ package org.apollo.game.model.inter;
/**
* A listener for the enter amount dialog.
+ *
* @author Graham
*/
public interface EnterAmountListener {
/**
* Called when the player enters the specified amount.
+ *
* @param amount The amount.
*/
public void amountEntered(int amount);
diff --git a/src/org/apollo/game/model/inter/InterfaceListener.java b/src/org/apollo/game/model/inter/InterfaceListener.java
index 71d3e77c..665f86bc 100644
--- a/src/org/apollo/game/model/inter/InterfaceListener.java
+++ b/src/org/apollo/game/model/inter/InterfaceListener.java
@@ -2,6 +2,7 @@ package org.apollo.game.model.inter;
/**
* Listens to interface-related events.
+ *
* @author Graham
*/
public interface InterfaceListener {
diff --git a/src/org/apollo/game/model/inter/bank/BankConstants.java b/src/org/apollo/game/model/inter/bank/BankConstants.java
index 6e2748ec..ebc6058c 100644
--- a/src/org/apollo/game/model/inter/bank/BankConstants.java
+++ b/src/org/apollo/game/model/inter/bank/BankConstants.java
@@ -2,6 +2,7 @@ package org.apollo.game.model.inter.bank;
/**
* Contains bank-related constants.
+ *
* @author Graham
*/
public final class BankConstants {
diff --git a/src/org/apollo/game/model/inter/bank/BankDepositEnterAmountListener.java b/src/org/apollo/game/model/inter/bank/BankDepositEnterAmountListener.java
index aa2e5329..fc116157 100644
--- a/src/org/apollo/game/model/inter/bank/BankDepositEnterAmountListener.java
+++ b/src/org/apollo/game/model/inter/bank/BankDepositEnterAmountListener.java
@@ -5,6 +5,7 @@ import org.apollo.game.model.inter.EnterAmountListener;
/**
* An {@link EnterAmountListener} for depositing items.
+ *
* @author Graham
*/
public final class BankDepositEnterAmountListener implements EnterAmountListener {
@@ -26,6 +27,7 @@ public final class BankDepositEnterAmountListener implements EnterAmountListener
/**
* Creates the bank deposit amount listener.
+ *
* @param player The player.
* @param slot The slot.
* @param id The id.
diff --git a/src/org/apollo/game/model/inter/bank/BankInterfaceListener.java b/src/org/apollo/game/model/inter/bank/BankInterfaceListener.java
index 92649093..d1e5a2c2 100644
--- a/src/org/apollo/game/model/inter/bank/BankInterfaceListener.java
+++ b/src/org/apollo/game/model/inter/bank/BankInterfaceListener.java
@@ -5,8 +5,8 @@ import org.apollo.game.model.inter.InterfaceListener;
import org.apollo.game.model.inv.InventoryListener;
/**
- * An {@link InterfaceListener} which removes the {@link InventoryListener}s
- * when the bank is closed.
+ * An {@link InterfaceListener} which removes the {@link InventoryListener}s when the bank is closed.
+ *
* @author Graham
*/
public final class BankInterfaceListener implements InterfaceListener {
@@ -28,6 +28,7 @@ public final class BankInterfaceListener implements InterfaceListener {
/**
* Creates the bank interface listener.
+ *
* @param player The player.
* @param invListener The inventory listener.
* @param bankListener The bank listener.
diff --git a/src/org/apollo/game/model/inter/bank/BankUtils.java b/src/org/apollo/game/model/inter/bank/BankUtils.java
index 20cb5a21..b969510a 100644
--- a/src/org/apollo/game/model/inter/bank/BankUtils.java
+++ b/src/org/apollo/game/model/inter/bank/BankUtils.java
@@ -10,12 +10,14 @@ import org.apollo.game.model.inv.SynchronizationInventoryListener;
/**
* Contains bank-related utility methods.
+ *
* @author Graham
*/
public final class BankUtils {
/**
* Opens a player's bank.
+ *
* @param player The player.
*/
public static void openBank(Player player) {
@@ -30,11 +32,13 @@ public final class BankUtils {
InterfaceListener interListener = new BankInterfaceListener(player, invListener, bankListener);
- player.getInterfaceSet().openWindowWithSidebar(interListener, BankConstants.BANK_WINDOW_ID, BankConstants.SIDEBAR_ID);
+ player.getInterfaceSet().openWindowWithSidebar(interListener, BankConstants.BANK_WINDOW_ID,
+ BankConstants.SIDEBAR_ID);
}
/**
* Deposits an item into the player's bank.
+ *
* @param player The player.
* @param slot The slot.
* @param id The id.
@@ -86,6 +90,7 @@ public final class BankUtils {
/**
* Withdraws an item from a player's bank.
+ *
* @param player The player.
* @param slot The slot.
* @param id The id.
diff --git a/src/org/apollo/game/model/inter/bank/BankWithdrawEnterAmountListener.java b/src/org/apollo/game/model/inter/bank/BankWithdrawEnterAmountListener.java
index c6d2c640..10c6e1aa 100644
--- a/src/org/apollo/game/model/inter/bank/BankWithdrawEnterAmountListener.java
+++ b/src/org/apollo/game/model/inter/bank/BankWithdrawEnterAmountListener.java
@@ -5,6 +5,7 @@ import org.apollo.game.model.inter.EnterAmountListener;
/**
* An {@link EnterAmountListener} for withdrawing items.
+ *
* @author Graham
*/
public final class BankWithdrawEnterAmountListener implements EnterAmountListener {
@@ -26,6 +27,7 @@ public final class BankWithdrawEnterAmountListener implements EnterAmountListene
/**
* Creates the bank withdraw amount listener.
+ *
* @param player The player.
* @param slot The slot.
* @param id The id.
diff --git a/src/org/apollo/game/model/inter/bank/package-info.java b/src/org/apollo/game/model/inter/bank/package-info.java
index c1423845..c3da0078 100644
--- a/src/org/apollo/game/model/inter/bank/package-info.java
+++ b/src/org/apollo/game/model/inter/bank/package-info.java
@@ -2,3 +2,4 @@
* Contains bank-related classes.
*/
package org.apollo.game.model.inter.bank;
+
diff --git a/src/org/apollo/game/model/inter/package-info.java b/src/org/apollo/game/model/inter/package-info.java
index c1bab094..3fd5f3f4 100644
--- a/src/org/apollo/game/model/inter/package-info.java
+++ b/src/org/apollo/game/model/inter/package-info.java
@@ -2,3 +2,4 @@
* Contains interface listeners.
*/
package org.apollo.game.model.inter;
+
diff --git a/src/org/apollo/game/model/inter/quest/QuestConstants.java b/src/org/apollo/game/model/inter/quest/QuestConstants.java
index 6c21d6d8..25141188 100644
--- a/src/org/apollo/game/model/inter/quest/QuestConstants.java
+++ b/src/org/apollo/game/model/inter/quest/QuestConstants.java
@@ -2,6 +2,7 @@ package org.apollo.game.model.inter.quest;
/**
* Contains quest-related constants.
+ *
* @author Graham
*/
public final class QuestConstants {
@@ -19,15 +20,13 @@ public final class QuestConstants {
/**
* The array of sub interfaces which 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 };
/**
* Default private constructor to prevent instantiation.
diff --git a/src/org/apollo/game/model/inter/quest/package-info.java b/src/org/apollo/game/model/inter/quest/package-info.java
index 9a27ca69..75803a02 100644
--- a/src/org/apollo/game/model/inter/quest/package-info.java
+++ b/src/org/apollo/game/model/inter/quest/package-info.java
@@ -2,3 +2,4 @@
* Contains classes related to the quest interfaces.
*/
package org.apollo.game.model.inter.quest;
+
diff --git a/src/org/apollo/game/model/inv/AppearanceInventoryListener.java b/src/org/apollo/game/model/inv/AppearanceInventoryListener.java
index 76c14d8e..3a7a384c 100644
--- a/src/org/apollo/game/model/inv/AppearanceInventoryListener.java
+++ b/src/org/apollo/game/model/inv/AppearanceInventoryListener.java
@@ -6,8 +6,8 @@ import org.apollo.game.model.Player;
import org.apollo.game.sync.block.SynchronizationBlock;
/**
- * An {@link InventoryListener} which updates the player's appearance when
- * any items are updated.
+ * An {@link InventoryListener} which updates the player's appearance when any items are updated.
+ *
* @author Graham
*/
public final class AppearanceInventoryListener extends InventoryAdapter {
@@ -19,6 +19,7 @@ public final class AppearanceInventoryListener extends InventoryAdapter {
/**
* Creates the appearance inventory listener.
+ *
* @param player The player.
*/
public AppearanceInventoryListener(Player player) {
diff --git a/src/org/apollo/game/model/inv/FullInventoryListener.java b/src/org/apollo/game/model/inv/FullInventoryListener.java
index a614ca80..db7dabfb 100644
--- a/src/org/apollo/game/model/inv/FullInventoryListener.java
+++ b/src/org/apollo/game/model/inv/FullInventoryListener.java
@@ -6,8 +6,8 @@ import org.apollo.game.model.Inventory;
import org.apollo.game.model.Player;
/**
- * An {@link InventoryListener} which sends a message to a player when an
- * inventory has run out of space.
+ * An {@link InventoryListener} which sends a message to a player when an inventory has run out of space.
+ *
* @author Graham
*/
public final class FullInventoryListener extends InventoryAdapter {
@@ -39,6 +39,7 @@ public final class FullInventoryListener extends InventoryAdapter {
/**
* Creates the empty inventory listener.
+ *
* @param player The player.
* @param message The message to send when the inventory is empty.
*/
diff --git a/src/org/apollo/game/model/inv/InventoryAdapter.java b/src/org/apollo/game/model/inv/InventoryAdapter.java
index 4f959d53..513d3551 100644
--- a/src/org/apollo/game/model/inv/InventoryAdapter.java
+++ b/src/org/apollo/game/model/inv/InventoryAdapter.java
@@ -5,6 +5,7 @@ import org.apollo.game.model.Item;
/**
* An adapter for the {@link InventoryListener}.
+ *
* @author Graham
*/
public abstract class InventoryAdapter implements InventoryListener {
diff --git a/src/org/apollo/game/model/inv/InventoryListener.java b/src/org/apollo/game/model/inv/InventoryListener.java
index e0a41ff6..c821b197 100644
--- a/src/org/apollo/game/model/inv/InventoryListener.java
+++ b/src/org/apollo/game/model/inv/InventoryListener.java
@@ -5,18 +5,21 @@ import org.apollo.game.model.Item;
/**
* An interface which listens to events from an {@link Inventory}.
+ *
* @author Graham
*/
public interface InventoryListener {
/**
* Called when the capacity of an inventory has been exceeded.
+ *
* @param inventory The inventory.
*/
public void capacityExceeded(Inventory inventory);
/**
* Called when an item has been updated.
+ *
* @param inventory The inventory.
* @param slot The slot.
* @param item The new item, or {@code null} if there is no new item.
@@ -25,6 +28,7 @@ public interface InventoryListener {
/**
* Called when items have been updated in bulk.
+ *
* @param inventory The inventory.
*/
public void itemsUpdated(Inventory inventory);
diff --git a/src/org/apollo/game/model/inv/SynchronizationInventoryListener.java b/src/org/apollo/game/model/inv/SynchronizationInventoryListener.java
index cd00d915..1c44cfc7 100644
--- a/src/org/apollo/game/model/inv/SynchronizationInventoryListener.java
+++ b/src/org/apollo/game/model/inv/SynchronizationInventoryListener.java
@@ -8,8 +8,8 @@ import org.apollo.game.model.Player;
import org.apollo.game.model.SlottedItem;
/**
- * An {@link InventoryListener} which synchronizes the state of the server's
- * inventory with the client's.
+ * An {@link InventoryListener} which synchronizes the state of the server's inventory with the client's.
+ *
* @author Graham
*/
public final class SynchronizationInventoryListener extends InventoryAdapter {
@@ -36,6 +36,7 @@ public final class SynchronizationInventoryListener extends InventoryAdapter {
/**
* Creates the syncrhonization inventory listener.
+ *
* @param player The player.
* @param interfaceId The interface id.
*/
diff --git a/src/org/apollo/game/model/inv/package-info.java b/src/org/apollo/game/model/inv/package-info.java
index 99da1e1b..61061cba 100644
--- a/src/org/apollo/game/model/inv/package-info.java
+++ b/src/org/apollo/game/model/inv/package-info.java
@@ -2,3 +2,4 @@
* Contains inventory listeners.
*/
package org.apollo.game.model.inv;
+
diff --git a/src/org/apollo/game/model/obj/StaticObject.java b/src/org/apollo/game/model/obj/StaticObject.java
index 4d5086d3..4201b22f 100644
--- a/src/org/apollo/game/model/obj/StaticObject.java
+++ b/src/org/apollo/game/model/obj/StaticObject.java
@@ -17,8 +17,7 @@ public final class StaticObject {
/**
* Creates the game object.
*
- * @param definition
- * The object's definition.
+ * @param definition The object's definition.
*/
public StaticObject(StaticObjectDefinition definition) {
this.definition = definition;
diff --git a/src/org/apollo/game/model/obj/package-info.java b/src/org/apollo/game/model/obj/package-info.java
index da59fb47..b5a38dd4 100644
--- a/src/org/apollo/game/model/obj/package-info.java
+++ b/src/org/apollo/game/model/obj/package-info.java
@@ -2,3 +2,4 @@
* Contains models related to in-game objects.
*/
package org.apollo.game.model.obj;
+
diff --git a/src/org/apollo/game/model/package-info.java b/src/org/apollo/game/model/package-info.java
index d5a3ac5f..9756ce4c 100644
--- a/src/org/apollo/game/model/package-info.java
+++ b/src/org/apollo/game/model/package-info.java
@@ -3,3 +3,4 @@
* players and NPCs.
*/
package org.apollo.game.model;
+
diff --git a/src/org/apollo/game/model/region/Region.java b/src/org/apollo/game/model/region/Region.java
index 3da6fb41..9de0d124 100644
--- a/src/org/apollo/game/model/region/Region.java
+++ b/src/org/apollo/game/model/region/Region.java
@@ -2,6 +2,7 @@ package org.apollo.game.model.region;
/**
* Represents an 8x8 region.
+ *
* @author Graham
*/
public final class Region {
diff --git a/src/org/apollo/game/model/region/RegionCoordinates.java b/src/org/apollo/game/model/region/RegionCoordinates.java
index e8242df4..4d4a804a 100644
--- a/src/org/apollo/game/model/region/RegionCoordinates.java
+++ b/src/org/apollo/game/model/region/RegionCoordinates.java
@@ -2,6 +2,7 @@ package org.apollo.game.model.region;
/**
* An immutable class which contains the coordinates of a region.
+ *
* @author Graham
*/
public final class RegionCoordinates {
@@ -18,6 +19,7 @@ public final class RegionCoordinates {
/**
* Creates the region coordinates.
+ *
* @param x The x coordinate.
* @param y The y coordinate.
*/
@@ -28,6 +30,7 @@ public final class RegionCoordinates {
/**
* Gets the X coordinate.
+ *
* @return The X coordinate.
*/
public int getX() {
@@ -36,6 +39,7 @@ public final class RegionCoordinates {
/**
* Gets the Y coordinate.
+ *
* @return The Y coordinate.
*/
public int getY() {
diff --git a/src/org/apollo/game/model/region/RegionRepository.java b/src/org/apollo/game/model/region/RegionRepository.java
index 2d2c1946..7f1e9562 100644
--- a/src/org/apollo/game/model/region/RegionRepository.java
+++ b/src/org/apollo/game/model/region/RegionRepository.java
@@ -2,6 +2,7 @@ package org.apollo.game.model.region;
/**
* Manages the repository of regions.
+ *
* @author Graham
*/
public class RegionRepository {
diff --git a/src/org/apollo/game/model/region/package-info.java b/src/org/apollo/game/model/region/package-info.java
index aeef1d23..1d4e5a59 100644
--- a/src/org/apollo/game/model/region/package-info.java
+++ b/src/org/apollo/game/model/region/package-info.java
@@ -4,3 +4,4 @@
* efficiently.
*/
package org.apollo.game.model.region;
+
diff --git a/src/org/apollo/game/model/skill/LevelUpSkillListener.java b/src/org/apollo/game/model/skill/LevelUpSkillListener.java
index 35eab5f8..32ec8fab 100644
--- a/src/org/apollo/game/model/skill/LevelUpSkillListener.java
+++ b/src/org/apollo/game/model/skill/LevelUpSkillListener.java
@@ -6,8 +6,8 @@ import org.apollo.game.model.SkillSet;
import org.apollo.util.LanguageUtil;
/**
- * A {@link SkillListener} which notifies the player when they have levelled up
- * a skill.
+ * A {@link SkillListener} which notifies the player when they have levelled up a skill.
+ *
* @author Graham
*/
public final class LevelUpSkillListener extends SkillAdapter {
@@ -19,6 +19,7 @@ public final class LevelUpSkillListener extends SkillAdapter {
/**
* Creates the level up listener for the specified player.
+ *
* @param player The player.
*/
public LevelUpSkillListener(Player player) {
@@ -30,7 +31,8 @@ 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() + ".");
}
}
diff --git a/src/org/apollo/game/model/skill/SkillAdapter.java b/src/org/apollo/game/model/skill/SkillAdapter.java
index b348d1c6..b301b036 100644
--- a/src/org/apollo/game/model/skill/SkillAdapter.java
+++ b/src/org/apollo/game/model/skill/SkillAdapter.java
@@ -5,6 +5,7 @@ import org.apollo.game.model.SkillSet;
/**
* An adapter for the {@link SkillListener}.
+ *
* @author Graham
*/
public abstract class SkillAdapter implements SkillListener {
diff --git a/src/org/apollo/game/model/skill/SkillListener.java b/src/org/apollo/game/model/skill/SkillListener.java
index c6ada64d..8b43b3d6 100644
--- a/src/org/apollo/game/model/skill/SkillListener.java
+++ b/src/org/apollo/game/model/skill/SkillListener.java
@@ -5,12 +5,14 @@ import org.apollo.game.model.SkillSet;
/**
* An interface which listens to events from a {@link SkillSet}.
+ *
* @author Graham
*/
public interface SkillListener {
/**
* Called when a single skill is updated.
+ *
* @param set The skill set.
* @param id The skill's id.
* @param skill The skill.
@@ -19,12 +21,14 @@ public interface SkillListener {
/**
* Called when all the skills are updated.
+ *
* @param set The skill set.
*/
public void skillsUpdated(SkillSet set);
/**
* Called when a skill is levelled up.
+ *
* @param set The skill set.
* @param id The skill's id.
* @param skill The skill.
diff --git a/src/org/apollo/game/model/skill/SynchronizationSkillListener.java b/src/org/apollo/game/model/skill/SynchronizationSkillListener.java
index e8717657..29b58a1d 100644
--- a/src/org/apollo/game/model/skill/SynchronizationSkillListener.java
+++ b/src/org/apollo/game/model/skill/SynchronizationSkillListener.java
@@ -7,8 +7,8 @@ import org.apollo.game.model.SkillSet;
import org.apollo.game.sync.block.SynchronizationBlock;
/**
- * A {@link SkillListener} which synchronizes the state of a {@link SkillSet}
- * with a client.
+ * A {@link SkillListener} which synchronizes the state of a {@link SkillSet} with a client.
+ *
* @author Graham
*/
public final class SynchronizationSkillListener extends SkillAdapter {
@@ -20,6 +20,7 @@ public final class SynchronizationSkillListener extends SkillAdapter {
/**
* Creates the skill synchronization listener.
+ *
* @param player The player.
*/
public SynchronizationSkillListener(Player player) {
diff --git a/src/org/apollo/game/model/skill/package-info.java b/src/org/apollo/game/model/skill/package-info.java
index 1d4d6794..6a08b997 100644
--- a/src/org/apollo/game/model/skill/package-info.java
+++ b/src/org/apollo/game/model/skill/package-info.java
@@ -2,3 +2,4 @@
* Contains skill listeners.
*/
package org.apollo.game.model.skill;
+
diff --git a/src/org/apollo/game/package-info.java b/src/org/apollo/game/package-info.java
index a63cfcac..f72c44ca 100644
--- a/src/org/apollo/game/package-info.java
+++ b/src/org/apollo/game/package-info.java
@@ -2,3 +2,4 @@
* Contains classes related to the game server.
*/
package org.apollo.game;
+
diff --git a/src/org/apollo/game/scheduling/ScheduledTask.java b/src/org/apollo/game/scheduling/ScheduledTask.java
index 44354a43..7561a751 100644
--- a/src/org/apollo/game/scheduling/ScheduledTask.java
+++ b/src/org/apollo/game/scheduling/ScheduledTask.java
@@ -2,6 +2,7 @@ package org.apollo.game.scheduling;
/**
* A game-related task that is scheduled to run in the future.
+ *
* @author Graham
*/
public abstract class ScheduledTask {
@@ -23,11 +24,11 @@ public abstract class ScheduledTask {
/**
* Creates a new scheduled task.
+ *
* @param delay The delay between executions of the task, in pulses.
- * @param immediate A flag indicating if this task should (for the first
- * execution) be ran immediately, or after the {@code delay}.
- * @throws IllegalArgumentException if the delay is less than or equal to
- * zero.
+ * @param immediate A flag indicating if this task should (for the first execution) be ran immediately, or after the
+ * {@code delay}.
+ * @throws IllegalArgumentException if the delay is less than or equal to zero.
*/
public ScheduledTask(int delay, boolean immediate) {
setDelay(delay);
@@ -36,6 +37,7 @@ public abstract class ScheduledTask {
/**
* Checks if this task is running.
+ *
* @return {@code true} if so, {@code false} if not.
*/
public final boolean isRunning() {
@@ -44,9 +46,9 @@ public abstract class ScheduledTask {
/**
* Sets the delay.
+ *
* @param delay The delay.
- * @throws IllegalArgumentException if the delay is less than or equal to
- * zero.
+ * @throws IllegalArgumentException if the delay is less than or equal to zero.
*/
public void setDelay(int delay) {
if (delay < 0) {
@@ -63,8 +65,7 @@ public abstract class ScheduledTask {
}
/**
- * Pulses this task: updates the delay and calls {@link #execute()} if
- * necessary.
+ * Pulses this task: updates the delay and calls {@link #execute()} if necessary.
*/
final void pulse() {
if (running && pulses-- == 0) {
diff --git a/src/org/apollo/game/scheduling/Scheduler.java b/src/org/apollo/game/scheduling/Scheduler.java
index 698df719..73f4291a 100644
--- a/src/org/apollo/game/scheduling/Scheduler.java
+++ b/src/org/apollo/game/scheduling/Scheduler.java
@@ -8,6 +8,7 @@ import java.util.Queue;
/**
* A class which manages {@link ScheduledTask}s.
+ *
* @author Graham
*/
public final class Scheduler {
@@ -24,6 +25,7 @@ public final class Scheduler {
/**
* Schedules a new task.
+ *
* @param task The task to schedule.
*/
public void schedule(ScheduledTask task) {
@@ -31,8 +33,7 @@ public final class Scheduler {
}
/**
- * Called every pulse: executes tasks that are still pending, adds new
- * tasks and stops old tasks.
+ * Called every pulse: executes tasks that are still pending, adds new tasks and stops old tasks.
*/
public void pulse() {
ScheduledTask task;
@@ -40,7 +41,7 @@ public final class Scheduler {
tasks.add(task);
}
- for (Iterator it = tasks.iterator(); it.hasNext(); ) {
+ for (Iterator it = tasks.iterator(); it.hasNext();) {
task = it.next();
task.pulse();
if (!task.isRunning()) {
diff --git a/src/org/apollo/game/scheduling/impl/SkillNormalizationTask.java b/src/org/apollo/game/scheduling/impl/SkillNormalizationTask.java
index 3bdd0ccf..38ea76c8 100644
--- a/src/org/apollo/game/scheduling/impl/SkillNormalizationTask.java
+++ b/src/org/apollo/game/scheduling/impl/SkillNormalizationTask.java
@@ -4,8 +4,9 @@ import org.apollo.game.model.Character;
import org.apollo.game.scheduling.ScheduledTask;
/**
- * A {@link ScheduledTask} which normalizes the skills of a player: gradually
- * brings them back to their normal value as specified by the experience.
+ * A {@link ScheduledTask} which normalizes the skills of a player: gradually brings them back to their normal value as
+ * specified by the experience.
+ *
* @author Graham
*/
public final class SkillNormalizationTask extends ScheduledTask {
@@ -17,6 +18,7 @@ public final class SkillNormalizationTask extends ScheduledTask {
/**
* Creates the skill normalization task.
+ *
* @param character The character.
*/
public SkillNormalizationTask(Character character) {
diff --git a/src/org/apollo/game/scheduling/impl/package-info.java b/src/org/apollo/game/scheduling/impl/package-info.java
index 1372163d..cc41bb35 100644
--- a/src/org/apollo/game/scheduling/impl/package-info.java
+++ b/src/org/apollo/game/scheduling/impl/package-info.java
@@ -2,3 +2,4 @@
* Contains scheduled task implementations.
*/
package org.apollo.game.scheduling.impl;
+
diff --git a/src/org/apollo/game/scheduling/package-info.java b/src/org/apollo/game/scheduling/package-info.java
index 497f26e6..5b08e429 100644
--- a/src/org/apollo/game/scheduling/package-info.java
+++ b/src/org/apollo/game/scheduling/package-info.java
@@ -3,3 +3,4 @@
* future pulses periodically.
*/
package org.apollo.game.scheduling;
+
diff --git a/src/org/apollo/game/sync/ClientSynchronizer.java b/src/org/apollo/game/sync/ClientSynchronizer.java
index 756793df..6e3f6dff 100644
--- a/src/org/apollo/game/sync/ClientSynchronizer.java
+++ b/src/org/apollo/game/sync/ClientSynchronizer.java
@@ -1,17 +1,15 @@
package org.apollo.game.sync;
/**
- * The {@link ClientSynchronizer} manages the update sequence which keeps clients
- * synchronized with the in-game world. There are two implementations
- * distributed with Apollo: {@link SequentialClientSynchronizer} which is
- * optimized for a single-core/single-processor machine and
- * {@link ParallelClientSynchronizer} which is optimized for a multi-processor/
+ * The {@link ClientSynchronizer} manages the update sequence which keeps clients synchronized with the in-game world.
+ * There are two implementations distributed with Apollo: {@link SequentialClientSynchronizer} which is optimized for a
+ * single-core/single-processor machine and {@link ParallelClientSynchronizer} which is optimized for a multi-processor/
* multi-core machines.
*
- * To switch between the two synchronizer implementations, edit the
- * {@code synchronizers.xml} configuration file. The default implementation is
- * currently {@link ParallelClientSynchronizer} as the vast majority of
- * machines today have two or more cores.
+ * To switch between the two synchronizer implementations, edit the {@code synchronizers.xml} configuration file. The
+ * default implementation is currently {@link ParallelClientSynchronizer} as the vast majority of machines today have
+ * two or more cores.
+ *
* @author Graham
*/
public abstract class ClientSynchronizer {
diff --git a/src/org/apollo/game/sync/ParallelClientSynchronizer.java b/src/org/apollo/game/sync/ParallelClientSynchronizer.java
index ff81541e..5377fe23 100644
--- a/src/org/apollo/game/sync/ParallelClientSynchronizer.java
+++ b/src/org/apollo/game/sync/ParallelClientSynchronizer.java
@@ -17,12 +17,12 @@ import org.apollo.util.CharacterRepository;
import org.apollo.util.NamedThreadFactory;
/**
- * An implementation of {@link ClientSynchronizer} which runs in a thread pool.
- * A {@link Phaser} is used to ensure that the synchronization is complete,
- * allowing control to return to the {@link GameService} that started the
- * synchronization. This class will scale well with machines that have multiple
- * cores/processors. The {@link SequentialClientSynchronizer} will work better
- * on machines with a single core/processor, however, both classes will work.
+ * An implementation of {@link ClientSynchronizer} which runs in a thread pool. A {@link Phaser} is used to ensure that
+ * the synchronization is complete, allowing control to return to the {@link GameService} that started the
+ * synchronization. This class will scale well with machines that have multiple cores/processors. The
+ * {@link SequentialClientSynchronizer} will work better on machines with a single core/processor, however, both classes
+ * will work.
+ *
* @author Graham
*/
public final class ParallelClientSynchronizer extends ClientSynchronizer {
@@ -38,9 +38,8 @@ public final class ParallelClientSynchronizer extends ClientSynchronizer {
private final Phaser phaser = new Phaser(1);
/**
- * Creates the parallel client synchronizer backed by a thread pool with a
- * number of threads equal to the number of processing cores available
- * (this is found by the {@link Runtime#availableProcessors()} method.
+ * Creates the parallel client synchronizer backed by a thread pool with a number of threads equal to the number of
+ * processing cores available (this is found by the {@link Runtime#availableProcessors()} method.
*/
public ParallelClientSynchronizer() {
int processors = Runtime.getRuntime().availableProcessors();
diff --git a/src/org/apollo/game/sync/SequentialClientSynchronizer.java b/src/org/apollo/game/sync/SequentialClientSynchronizer.java
index 4508a97d..46f6558b 100644
--- a/src/org/apollo/game/sync/SequentialClientSynchronizer.java
+++ b/src/org/apollo/game/sync/SequentialClientSynchronizer.java
@@ -10,12 +10,11 @@ import org.apollo.game.sync.task.SynchronizationTask;
import org.apollo.util.CharacterRepository;
/**
- * An implementation of {@link ClientSynchronizer} which runs in a single
- * thread (the {@link GameService} thread from which this is called). Each
- * client is processed sequentially. Therefore this class will work well on
- * machines with a single core/processor. The {@link ParallelClientSynchronizer}
- * will work better on machines with multiple cores/processors, however, both
- * classes will work.
+ * An implementation of {@link ClientSynchronizer} which runs in a single thread (the {@link GameService} thread from
+ * which this is called). Each client is processed sequentially. Therefore this class will work well on machines with a
+ * single core/processor. The {@link ParallelClientSynchronizer} will work better on machines with multiple
+ * cores/processors, however, both classes will work.
+ *
* @author Graham
*/
public final class SequentialClientSynchronizer extends ClientSynchronizer {
diff --git a/src/org/apollo/game/sync/block/AnimationBlock.java b/src/org/apollo/game/sync/block/AnimationBlock.java
index a4a4d06a..7cb723bb 100644
--- a/src/org/apollo/game/sync/block/AnimationBlock.java
+++ b/src/org/apollo/game/sync/block/AnimationBlock.java
@@ -4,6 +4,7 @@ import org.apollo.game.model.Animation;
/**
* The animation {@link SynchronizationBlock}.
+ *
* @author Graham
*/
public final class AnimationBlock extends SynchronizationBlock {
@@ -15,6 +16,7 @@ public final class AnimationBlock extends SynchronizationBlock {
/**
* Creates the animation block.
+ *
* @param animation The animation.
*/
AnimationBlock(Animation animation) {
@@ -23,6 +25,7 @@ public final class AnimationBlock extends SynchronizationBlock {
/**
* Gets the animation.
+ *
* @return The animation.
*/
public Animation getAnimation() {
diff --git a/src/org/apollo/game/sync/block/AppearanceBlock.java b/src/org/apollo/game/sync/block/AppearanceBlock.java
index bfd62dab..d3b22949 100644
--- a/src/org/apollo/game/sync/block/AppearanceBlock.java
+++ b/src/org/apollo/game/sync/block/AppearanceBlock.java
@@ -5,6 +5,7 @@ import org.apollo.game.model.Inventory;
/**
* The appearance {@link SynchronizationBlock}.
+ *
* @author Graham
*/
public final class AppearanceBlock extends SynchronizationBlock {
@@ -38,6 +39,7 @@ public final class AppearanceBlock extends SynchronizationBlock {
/**
* Creates the appearance block.
+ *
* @param name The player's name.
* @param appearance The appearance.
* @param combat The player's combat.
@@ -54,6 +56,7 @@ public final class AppearanceBlock extends SynchronizationBlock {
/**
* Gets the player's name.
+ *
* @return The player's name.
*/
public long getName() {
@@ -62,6 +65,7 @@ public final class AppearanceBlock extends SynchronizationBlock {
/**
* Gets the player's appearance.
+ *
* @return The player's appearance.
*/
public Appearance getAppearance() {
@@ -70,6 +74,7 @@ public final class AppearanceBlock extends SynchronizationBlock {
/**
* Gets the player's combat level.
+ *
* @return The player's combat level.
*/
public int getCombatLevel() {
@@ -78,6 +83,7 @@ public final class AppearanceBlock extends SynchronizationBlock {
/**
* Gets the player's skill level.
+ *
* @return The player's skill level.
*/
public int getSkillLevel() {
@@ -86,6 +92,7 @@ public final class AppearanceBlock extends SynchronizationBlock {
/**
* Gets the player's equipment.
+ *
* @return The player's equipment.
*/
public Inventory getEquipment() {
diff --git a/src/org/apollo/game/sync/block/ChatBlock.java b/src/org/apollo/game/sync/block/ChatBlock.java
index 5087accc..6374d458 100644
--- a/src/org/apollo/game/sync/block/ChatBlock.java
+++ b/src/org/apollo/game/sync/block/ChatBlock.java
@@ -5,6 +5,7 @@ import org.apollo.game.model.Player.PrivilegeLevel;
/**
* The chat {@link SynchronizationBlock}.
+ *
* @author Graham
*/
public final class ChatBlock extends SynchronizationBlock {
@@ -29,6 +30,7 @@ public final class ChatBlock extends SynchronizationBlock {
/**
* Gets the privilege level of the player who said the message.
+ *
* @return The privilege level.
*/
public PrivilegeLevel getPrivilegeLevel() {
@@ -37,6 +39,7 @@ public final class ChatBlock extends SynchronizationBlock {
/**
* Gets the message.
+ *
* @return The message.
*/
public String getMessage() {
@@ -45,6 +48,7 @@ public final class ChatBlock extends SynchronizationBlock {
/**
* Gets the text color.
+ *
* @return The text color.
*/
public int getTextColor() {
@@ -53,6 +57,7 @@ public final class ChatBlock extends SynchronizationBlock {
/**
* Gets the text effects.
+ *
* @return The text effects.
*/
public int getTextEffects() {
@@ -61,6 +66,7 @@ public final class ChatBlock extends SynchronizationBlock {
/**
* Gets the compressed message.
+ *
* @return The compressed message.
*/
public byte[] getCompressedMessage() {
diff --git a/src/org/apollo/game/sync/block/GraphicBlock.java b/src/org/apollo/game/sync/block/GraphicBlock.java
index 7de0f0d7..2f62c595 100644
--- a/src/org/apollo/game/sync/block/GraphicBlock.java
+++ b/src/org/apollo/game/sync/block/GraphicBlock.java
@@ -4,6 +4,7 @@ import org.apollo.game.model.Graphic;
/**
* The graphic {@link SynchronizationBlock}.
+ *
* @author Graham
*/
public final class GraphicBlock extends SynchronizationBlock {
@@ -15,6 +16,7 @@ public final class GraphicBlock extends SynchronizationBlock {
/**
* Creates the graphic block.
+ *
* @param graphic The graphic.
*/
GraphicBlock(Graphic graphic) {
@@ -23,6 +25,7 @@ public final class GraphicBlock extends SynchronizationBlock {
/**
* Gets the graphic.
+ *
* @return The graphic.
*/
public Graphic getGraphic() {
diff --git a/src/org/apollo/game/sync/block/SynchronizationBlock.java b/src/org/apollo/game/sync/block/SynchronizationBlock.java
index 2e5a2be3..7d8f7057 100644
--- a/src/org/apollo/game/sync/block/SynchronizationBlock.java
+++ b/src/org/apollo/game/sync/block/SynchronizationBlock.java
@@ -8,26 +8,28 @@ import org.apollo.game.model.Position;
import org.apollo.game.sync.seg.SynchronizationSegment;
/**
- * A synchronization block is part of a {@link SynchronizationSegment}. A
- * segment can have up to one block of each type.
+ * A synchronization block is part of a {@link SynchronizationSegment}. A segment can have up to one block of each type.
*
- * This class also has static factory methods for creating
- * {@link SynchronizationBlock}s.
+ * This class also has static factory methods for creating {@link SynchronizationBlock}s.
+ *
* @author Graham
*/
public abstract class SynchronizationBlock {
/**
* Creates an appearance block for the specified player.
+ *
* @param player The player.
* @return The appearance block.
*/
public static SynchronizationBlock createAppearanceBlock(Player player) {
- return new AppearanceBlock(player.getEncodedName(), player.getAppearance(), player.getSkillSet().getCombatLevel(), 0, player.getEquipment());
+ return new AppearanceBlock(player.getEncodedName(), player.getAppearance(), player.getSkillSet()
+ .getCombatLevel(), 0, player.getEquipment());
}
/**
* Creates a chat block for the specified player.
+ *
* @param player The player.
* @param chatEvent The chat event.
* @return The chat block.
@@ -38,6 +40,7 @@ public abstract class SynchronizationBlock {
/**
* Creates an animation block with the specified animation.
+ *
* @param animation The animation.
* @return The animation block.
*/
@@ -47,6 +50,7 @@ public abstract class SynchronizationBlock {
/**
* Creates a graphic block with the specified graphic.
+ *
* @param graphic The graphic.
* @return The graphic block.
*/
@@ -56,6 +60,7 @@ public abstract class SynchronizationBlock {
/**
* Creates a turn to position block with the specified position.
+ *
* @param position The position.
* @return The turn to position block.
*/
diff --git a/src/org/apollo/game/sync/block/SynchronizationBlockSet.java b/src/org/apollo/game/sync/block/SynchronizationBlockSet.java
index f8449b8f..e305a43a 100644
--- a/src/org/apollo/game/sync/block/SynchronizationBlockSet.java
+++ b/src/org/apollo/game/sync/block/SynchronizationBlockSet.java
@@ -5,6 +5,7 @@ import java.util.Map;
/**
* A specialized collection of {@link SynchronizationBlock}s.
+ *
* @author Graham
*/
public final class SynchronizationBlockSet implements Cloneable {
@@ -16,6 +17,7 @@ public final class SynchronizationBlockSet implements Cloneable {
/**
* Adds a {@link SynchronizationBlock}.
+ *
* @param block The block to add.
*/
public void add(SynchronizationBlock block) {
@@ -39,6 +41,7 @@ public final class SynchronizationBlockSet implements Cloneable {
/**
* Gets the size of the set.
+ *
* @return The size of the set.
*/
public int size() {
@@ -47,6 +50,7 @@ public final class SynchronizationBlockSet implements Cloneable {
/**
* Checks if this set contains the specified block.
+ *
* @param clazz The block's class.
* @return {@code true} if so, {@code false} if not.
*/
@@ -56,6 +60,7 @@ public final class SynchronizationBlockSet implements Cloneable {
/**
* Removes a block.
+ *
* @param clazz The block's class.
*/
public void remove(Class extends SynchronizationBlock> clazz) {
@@ -64,6 +69,7 @@ public final class SynchronizationBlockSet implements Cloneable {
/**
* Gets a block.
+ *
* @param The type of block.
* @param clazz The block's class.
* @return The block.
diff --git a/src/org/apollo/game/sync/block/TurnToPositionBlock.java b/src/org/apollo/game/sync/block/TurnToPositionBlock.java
index 2888e84d..5f504ef9 100644
--- a/src/org/apollo/game/sync/block/TurnToPositionBlock.java
+++ b/src/org/apollo/game/sync/block/TurnToPositionBlock.java
@@ -4,6 +4,7 @@ import org.apollo.game.model.Position;
/**
* The turn to position {@link SynchronizationBlock}.
+ *
* @author Graham
*/
public final class TurnToPositionBlock extends SynchronizationBlock {
@@ -15,6 +16,7 @@ public final class TurnToPositionBlock extends SynchronizationBlock {
/**
* Creates the turn to position block.
+ *
* @param position The position to turn to.
*/
public TurnToPositionBlock(Position position) {
@@ -23,6 +25,7 @@ public final class TurnToPositionBlock extends SynchronizationBlock {
/**
* Gets the position to turn to.
+ *
* @return The position to turn to.
*/
public Position getPosition() {
diff --git a/src/org/apollo/game/sync/block/package-info.java b/src/org/apollo/game/sync/block/package-info.java
index 6b1923ff..bce56141 100644
--- a/src/org/apollo/game/sync/block/package-info.java
+++ b/src/org/apollo/game/sync/block/package-info.java
@@ -2,3 +2,4 @@
* Contains classes related to synchronization 'blocks'.
*/
package org.apollo.game.sync.block;
+
diff --git a/src/org/apollo/game/sync/package-info.java b/src/org/apollo/game/sync/package-info.java
index 983126d4..a929edd6 100644
--- a/src/org/apollo/game/sync/package-info.java
+++ b/src/org/apollo/game/sync/package-info.java
@@ -3,3 +3,4 @@
* client's state is updated by the server so it matches the server's state.
*/
package org.apollo.game.sync;
+
diff --git a/src/org/apollo/game/sync/seg/AddCharacterSegment.java b/src/org/apollo/game/sync/seg/AddCharacterSegment.java
index a94ef5a9..f4d4b597 100644
--- a/src/org/apollo/game/sync/seg/AddCharacterSegment.java
+++ b/src/org/apollo/game/sync/seg/AddCharacterSegment.java
@@ -5,6 +5,7 @@ import org.apollo.game.sync.block.SynchronizationBlockSet;
/**
* A {@link SynchronizationSegment} which adds a character.
+ *
* @author Graham
*/
public final class AddCharacterSegment extends SynchronizationSegment {
@@ -21,6 +22,7 @@ public final class AddCharacterSegment extends SynchronizationSegment {
/**
* Creates the add character segment.
+ *
* @param blockSet The block set.
* @param index The characters's index.
* @param position The position.
@@ -33,6 +35,7 @@ public final class AddCharacterSegment extends SynchronizationSegment {
/**
* Gets the character's index.
+ *
* @return The index.
*/
public int getIndex() {
@@ -41,6 +44,7 @@ public final class AddCharacterSegment extends SynchronizationSegment {
/**
* Gets the position.
+ *
* @return The position.
*/
public Position getPosition() {
diff --git a/src/org/apollo/game/sync/seg/MovementSegment.java b/src/org/apollo/game/sync/seg/MovementSegment.java
index d791e298..6295440d 100644
--- a/src/org/apollo/game/sync/seg/MovementSegment.java
+++ b/src/org/apollo/game/sync/seg/MovementSegment.java
@@ -5,6 +5,7 @@ import org.apollo.game.sync.block.SynchronizationBlockSet;
/**
* A {@link SynchronizationSegment} where the character is moved (or doesn't move!).
+ *
* @author Graham
*/
public final class MovementSegment extends SynchronizationSegment {
@@ -16,6 +17,7 @@ public final class MovementSegment extends SynchronizationSegment {
/**
* Creates the movement segment.
+ *
* @param blockSet The block set.
* @param directions The directions array.
* @throws IllegalArgumentException if there are not 0, 1 or 2 directions.
@@ -30,6 +32,7 @@ public final class MovementSegment extends SynchronizationSegment {
/**
* Gets the directions.
+ *
* @return The directions.
*/
public Direction[] getDirections() {
diff --git a/src/org/apollo/game/sync/seg/RemoveCharacterSegment.java b/src/org/apollo/game/sync/seg/RemoveCharacterSegment.java
index 3dbdda4f..6a1f1f18 100644
--- a/src/org/apollo/game/sync/seg/RemoveCharacterSegment.java
+++ b/src/org/apollo/game/sync/seg/RemoveCharacterSegment.java
@@ -4,6 +4,7 @@ import org.apollo.game.sync.block.SynchronizationBlockSet;
/**
* A {@link SynchronizationSegment} which removes a character.
+ *
* @author Graham
*/
public final class RemoveCharacterSegment extends SynchronizationSegment {
diff --git a/src/org/apollo/game/sync/seg/SegmentType.java b/src/org/apollo/game/sync/seg/SegmentType.java
index 58fed7c9..5884074b 100644
--- a/src/org/apollo/game/sync/seg/SegmentType.java
+++ b/src/org/apollo/game/sync/seg/SegmentType.java
@@ -2,6 +2,7 @@ package org.apollo.game.sync.seg;
/**
* An enumeration which contains the types of segments.
+ *
* @author Graham
*/
public enum SegmentType {
diff --git a/src/org/apollo/game/sync/seg/SynchronizationSegment.java b/src/org/apollo/game/sync/seg/SynchronizationSegment.java
index 9b9516a7..83d4b8bc 100644
--- a/src/org/apollo/game/sync/seg/SynchronizationSegment.java
+++ b/src/org/apollo/game/sync/seg/SynchronizationSegment.java
@@ -6,9 +6,9 @@ import org.apollo.game.sync.block.SynchronizationBlock;
import org.apollo.game.sync.block.SynchronizationBlockSet;
/**
- * A segment contains a set of {@link SynchronizationBlock}s,
- * {@link Direction}s (or teleport {@link Position}s) and any other things
- * required for the update of a single player.
+ * A segment contains a set of {@link SynchronizationBlock}s, {@link Direction}s (or teleport {@link Position}s) and any
+ * other things required for the update of a single player.
+ *
* @author Graham
*/
public abstract class SynchronizationSegment {
@@ -20,6 +20,7 @@ public abstract class SynchronizationSegment {
/**
* Creates the segment.
+ *
* @param blockSet The block set.
*/
public SynchronizationSegment(SynchronizationBlockSet blockSet) {
@@ -28,6 +29,7 @@ public abstract class SynchronizationSegment {
/**
* Gets the block set.
+ *
* @return The block set.
*/
public final SynchronizationBlockSet getBlockSet() {
@@ -36,6 +38,7 @@ public abstract class SynchronizationSegment {
/**
* Gets the type of segment.
+ *
* @return The type of segment.
*/
public abstract SegmentType getType();
diff --git a/src/org/apollo/game/sync/seg/TeleportSegment.java b/src/org/apollo/game/sync/seg/TeleportSegment.java
index 2abe8cc8..b00c0487 100644
--- a/src/org/apollo/game/sync/seg/TeleportSegment.java
+++ b/src/org/apollo/game/sync/seg/TeleportSegment.java
@@ -4,8 +4,8 @@ import org.apollo.game.model.Position;
import org.apollo.game.sync.block.SynchronizationBlockSet;
/**
- * A {@link SynchronizationSegment} where the character is teleported to a new
- * location.
+ * A {@link SynchronizationSegment} where the character is teleported to a new location.
+ *
* @author Graham
*/
public final class TeleportSegment extends SynchronizationSegment {
@@ -17,6 +17,7 @@ public final class TeleportSegment extends SynchronizationSegment {
/**
* Creates the teleport segment.
+ *
* @param blockSet The block set.
* @param destination The destination.
*/
@@ -27,6 +28,7 @@ public final class TeleportSegment extends SynchronizationSegment {
/**
* Gets the destination.
+ *
* @return The destination.
*/
public Position getDestination() {
diff --git a/src/org/apollo/game/sync/seg/package-info.java b/src/org/apollo/game/sync/seg/package-info.java
index e85bdb7b..4b1bd83a 100644
--- a/src/org/apollo/game/sync/seg/package-info.java
+++ b/src/org/apollo/game/sync/seg/package-info.java
@@ -4,3 +4,4 @@
* character.
*/
package org.apollo.game.sync.seg;
+
diff --git a/src/org/apollo/game/sync/task/PhasedSynchronizationTask.java b/src/org/apollo/game/sync/task/PhasedSynchronizationTask.java
index 2dccc29c..7087bf30 100644
--- a/src/org/apollo/game/sync/task/PhasedSynchronizationTask.java
+++ b/src/org/apollo/game/sync/task/PhasedSynchronizationTask.java
@@ -3,12 +3,12 @@ package org.apollo.game.sync.task;
import java.util.concurrent.Phaser;
/**
- * A {@link SynchronizationTask} which wraps around another
- * {@link SynchronizationTask} and notifies the specified {@link Phaser} when
- * the task has completed by calling {@link Phaser#arriveAndDeregister()}.
+ * A {@link SynchronizationTask} which wraps around another {@link SynchronizationTask} and notifies the specified
+ * {@link Phaser} when the task has completed by calling {@link Phaser#arriveAndDeregister()}.
*
- * The phaser must have already registered this task. This can be done using
- * the {@link Phaser#register()} or {@link Phaser#bulkRegister(int)} methods.
+ * The phaser must have already registered this task. This can be done using the {@link Phaser#register()} or
+ * {@link Phaser#bulkRegister(int)} methods.
+ *
* @author Graham
*/
public final class PhasedSynchronizationTask extends SynchronizationTask {
@@ -25,6 +25,7 @@ public final class PhasedSynchronizationTask extends SynchronizationTask {
/**
* Creates the phased synchronization task.
+ *
* @param phaser The phaser.
* @param task The task.
*/
diff --git a/src/org/apollo/game/sync/task/PlayerSynchronizationTask.java b/src/org/apollo/game/sync/task/PlayerSynchronizationTask.java
index a918058c..af6de2e4 100644
--- a/src/org/apollo/game/sync/task/PlayerSynchronizationTask.java
+++ b/src/org/apollo/game/sync/task/PlayerSynchronizationTask.java
@@ -20,17 +20,15 @@ import org.apollo.game.sync.seg.TeleportSegment;
import org.apollo.util.CharacterRepository;
/**
- * A {@link SynchronizationTask} which synchronizes the specified {@link Player}
- * .
+ * A {@link SynchronizationTask} which synchronizes the specified {@link Player} .
*
* @author Graham
*/
public final class PlayerSynchronizationTask extends SynchronizationTask {
/**
- * The maximum number of players to load per cycle. This prevents the update
- * packet from becoming too large (the client uses a 5000 byte buffer) and
- * also stops old spec PCs from crashing when they login or teleport.
+ * The maximum number of players to load per cycle. This prevents the update packet from becoming too large (the
+ * client uses a 5000 byte buffer) and also stops old spec PCs from crashing when they login or teleport.
*/
private static final int NEW_PLAYERS_PER_CYCLE = 20;
@@ -42,8 +40,7 @@ public final class PlayerSynchronizationTask extends SynchronizationTask {
/**
* Creates the {@link PlayerSynchronizationTask} for the specified player.
*
- * @param player
- * The player.
+ * @param player The player.
*/
public PlayerSynchronizationTask(Player player) {
this.player = player;
@@ -73,22 +70,18 @@ public final class PlayerSynchronizationTask extends SynchronizationTask {
for (Iterator it = localPlayers.iterator(); it.hasNext();) {
Player p = it.next();
- if (!p.isActive()
- || p.isTeleporting()
- || p.getPosition().getLongestDelta(player.getPosition()) > player
- .getViewingDistance()) {
+ if (!p.isActive() || p.isTeleporting()
+ || p.getPosition().getLongestDelta(player.getPosition()) > player.getViewingDistance()) {
it.remove();
segments.add(new RemoveCharacterSegment());
} else {
- segments.add(new MovementSegment(p.getBlockSet(), p
- .getDirections()));
+ segments.add(new MovementSegment(p.getBlockSet(), p.getDirections()));
}
}
int added = 0;
- CharacterRepository repository = World.getWorld()
- .getPlayerRepository();
+ CharacterRepository repository = World.getWorld().getPlayerRepository();
for (Iterator it = repository.iterator(); it.hasNext();) {
Player p = it.next();
if (localPlayers.size() >= 255) {
@@ -99,9 +92,7 @@ public final class PlayerSynchronizationTask extends SynchronizationTask {
}
// we do not check p.isActive() here, since if they are active they
// must be in the repository
- if (p != player
- && p.getPosition().isWithinDistance(player.getPosition(),
- player.getViewingDistance())
+ if (p != player && p.getPosition().isWithinDistance(player.getPosition(), player.getViewingDistance())
&& !localPlayers.contains(p)) {
localPlayers.add(p);
added++;
@@ -113,14 +104,12 @@ public final class PlayerSynchronizationTask extends SynchronizationTask {
blockSet.add(SynchronizationBlock.createAppearanceBlock(p));
}
- segments.add(new AddCharacterSegment(blockSet, p.getIndex(), p
- .getPosition()));
+ segments.add(new AddCharacterSegment(blockSet, p.getIndex(), p.getPosition()));
}
}
- PlayerSynchronizationEvent event = new PlayerSynchronizationEvent(
- lastKnownRegion, player.getPosition(), regionChanged, segment,
- oldLocalPlayers, segments);
+ PlayerSynchronizationEvent event = new PlayerSynchronizationEvent(lastKnownRegion, player.getPosition(),
+ regionChanged, segment, oldLocalPlayers, segments);
player.send(event);
}
diff --git a/src/org/apollo/game/sync/task/PostPlayerSynchronizationTask.java b/src/org/apollo/game/sync/task/PostPlayerSynchronizationTask.java
index d7eaaa57..fa7acea9 100644
--- a/src/org/apollo/game/sync/task/PostPlayerSynchronizationTask.java
+++ b/src/org/apollo/game/sync/task/PostPlayerSynchronizationTask.java
@@ -3,8 +3,8 @@ package org.apollo.game.sync.task;
import org.apollo.game.model.Player;
/**
- * A {@link SynchronizationTask} which does post-synchronization work for the
- * specified {@link Player}.
+ * A {@link SynchronizationTask} which does post-synchronization work for the specified {@link Player}.
+ *
* @author Graham
*/
public final class PostPlayerSynchronizationTask extends SynchronizationTask {
@@ -15,8 +15,8 @@ public final class PostPlayerSynchronizationTask extends SynchronizationTask {
private final Player player;
/**
- * Creates the {@link PostPlayerSynchronizationTask} for the specified
- * player.
+ * Creates the {@link PostPlayerSynchronizationTask} for the specified player.
+ *
* @param player The player.
*/
public PostPlayerSynchronizationTask(Player player) {
diff --git a/src/org/apollo/game/sync/task/PrePlayerSynchronizationTask.java b/src/org/apollo/game/sync/task/PrePlayerSynchronizationTask.java
index 8f134cc5..0f7485ca 100644
--- a/src/org/apollo/game/sync/task/PrePlayerSynchronizationTask.java
+++ b/src/org/apollo/game/sync/task/PrePlayerSynchronizationTask.java
@@ -5,8 +5,8 @@ import org.apollo.game.model.Player;
import org.apollo.game.model.Position;
/**
- * A {@link SynchronizationTask} which does pre-synchronization work for the
- * specified {@link Player}.
+ * A {@link SynchronizationTask} which does pre-synchronization work for the specified {@link Player}.
+ *
* @author Graham
*/
public final class PrePlayerSynchronizationTask extends SynchronizationTask {
@@ -17,8 +17,8 @@ public final class PrePlayerSynchronizationTask extends SynchronizationTask {
private final Player player;
/**
- * Creates the {@link PrePlayerSynchronizationTask} for the specified
- * player.
+ * Creates the {@link PrePlayerSynchronizationTask} for the specified player.
+ *
* @param player The player.
*/
public PrePlayerSynchronizationTask(Player player) {
@@ -49,6 +49,7 @@ public final class PrePlayerSynchronizationTask extends SynchronizationTask {
/**
* Checks if a region update is required.
+ *
* @return {@code true} if so, {@code false} otherwise.
*/
private boolean isRegionUpdateRequired() {
diff --git a/src/org/apollo/game/sync/task/SynchronizationTask.java b/src/org/apollo/game/sync/task/SynchronizationTask.java
index e50c1901..6017f793 100644
--- a/src/org/apollo/game/sync/task/SynchronizationTask.java
+++ b/src/org/apollo/game/sync/task/SynchronizationTask.java
@@ -3,9 +3,9 @@ package org.apollo.game.sync.task;
import org.apollo.game.sync.ClientSynchronizer;
/**
- * Represents some task that must be completed during the client
- * synchronization process (see {@link ClientSynchronizer} for more
- * information).
+ * Represents some task that must be completed during the client synchronization process (see {@link ClientSynchronizer}
+ * for more information).
+ *
* @author Graham
*/
public abstract class SynchronizationTask implements Runnable {
diff --git a/src/org/apollo/game/sync/task/package-info.java b/src/org/apollo/game/sync/task/package-info.java
index e8f64318..1ad610da 100644
--- a/src/org/apollo/game/sync/task/package-info.java
+++ b/src/org/apollo/game/sync/task/package-info.java
@@ -4,3 +4,4 @@
* executed during the client synchronization process.
*/
package org.apollo.game.sync.task;
+
diff --git a/src/org/apollo/io/EquipmentDefinitionParser.java b/src/org/apollo/io/EquipmentDefinitionParser.java
index a086535a..68004e0d 100644
--- a/src/org/apollo/io/EquipmentDefinitionParser.java
+++ b/src/org/apollo/io/EquipmentDefinitionParser.java
@@ -7,8 +7,9 @@ import java.io.InputStream;
import org.apollo.game.model.def.EquipmentDefinition;
/**
- * A class which parses the {@code data/equipment-[release].dat} file to
- * create an array of {@link EquipmentDefinition}s.
+ * A class which parses the {@code data/equipment-[release].dat} file to create an array of {@link EquipmentDefinition}
+ * s.
+ *
* @author Graham
*/
public final class EquipmentDefinitionParser {
@@ -20,6 +21,7 @@ public final class EquipmentDefinitionParser {
/**
* Creates the equipment definition parser.
+ *
* @param is The input stream.
*/
public EquipmentDefinitionParser(InputStream is) {
@@ -28,6 +30,7 @@ public final class EquipmentDefinitionParser {
/**
* Parses the input stream.
+ *
* @return The equipment definition array.
* @throws IOException if an I/O error occurs.
*/
diff --git a/src/org/apollo/io/EventHandlerChainParser.java b/src/org/apollo/io/EventHandlerChainParser.java
index 80cba83a..6b896d97 100644
--- a/src/org/apollo/io/EventHandlerChainParser.java
+++ b/src/org/apollo/io/EventHandlerChainParser.java
@@ -16,8 +16,7 @@ import org.apollo.util.xml.XmlParser;
import org.xml.sax.SAXException;
/**
- * A class which parses the {@code events.xml} file to produce
- * {@link EventHandlerChainGroup}s.
+ * A class which parses the {@code events.xml} file to produce {@link EventHandlerChainGroup}s.
*
* @author Graham
*/
@@ -36,10 +35,8 @@ public final class EventHandlerChainParser {
/**
* Creates the event chain parser.
*
- * @param is
- * The source {@link InputStream}.
- * @throws SAXException
- * if a SAX error occurs.
+ * @param is The source {@link InputStream}.
+ * @throws SAXException if a SAX error occurs.
*/
public EventHandlerChainParser(InputStream is) throws SAXException {
this.parser = new XmlParser();
@@ -49,22 +46,16 @@ public final class EventHandlerChainParser {
/**
* Parses the XML and produces a group of {@link EventHandlerChain}s.
*
- * @throws IOException
- * if an I/O error occurs.
- * @throws SAXException
- * if a SAX error occurs.
- * @throws ClassNotFoundException
- * if a class was not found.
- * @throws IllegalAccessException
- * if a class was accessed illegally.
- * @throws InstantiationException
- * if a class could not be instantiated.
+ * @throws IOException if an I/O error occurs.
+ * @throws SAXException if a SAX error occurs.
+ * @throws ClassNotFoundException if a class was not found.
+ * @throws IllegalAccessException if a class was accessed illegally.
+ * @throws InstantiationException if a class could not be instantiated.
* @return An {@link EventHandlerChainGroup}.
*/
@SuppressWarnings("unchecked")
- public EventHandlerChainGroup parse() throws IOException, SAXException,
- ClassNotFoundException, InstantiationException,
- IllegalAccessException {
+ public EventHandlerChainGroup parse() throws IOException, SAXException, ClassNotFoundException,
+ InstantiationException, IllegalAccessException {
XmlNode rootNode = parser.parse(is);
if (!rootNode.getName().equals("events")) {
throw new IOException("root node name is not 'events'");
@@ -74,19 +65,16 @@ public final class EventHandlerChainParser {
for (XmlNode eventNode : rootNode) {
if (!eventNode.getName().equals("event")) {
- throw new IOException(
- "only expected nodes named 'event' beneath the root node");
+ throw new IOException("only expected nodes named 'event' beneath the root node");
}
XmlNode typeNode = eventNode.getChild("type");
if (typeNode == null) {
- throw new IOException(
- "no node named 'type' beneath current event node");
+ throw new IOException("no node named 'type' beneath current event node");
}
XmlNode chainNode = eventNode.getChild("chain");
if (chainNode == null) {
- throw new IOException(
- "no node named 'chain' beneath current event node");
+ throw new IOException("no node named 'chain' beneath current event node");
}
String eventClassName = typeNode.getValue();
@@ -94,14 +82,12 @@ public final class EventHandlerChainParser {
throw new IOException("type node must have a value");
}
- Class extends Event> eventClass = (Class extends Event>) Class
- .forName(eventClassName);
+ Class extends Event> eventClass = (Class extends Event>) Class.forName(eventClassName);
List> handlers = new ArrayList>();
for (XmlNode handlerNode : chainNode) {
if (!handlerNode.getName().equals("handler")) {
- throw new IOException(
- "only expected nodes named 'handler' beneath the root node");
+ throw new IOException("only expected nodes named 'handler' beneath the root node");
}
String handlerClassName = handlerNode.getValue();
@@ -115,8 +101,7 @@ public final class EventHandlerChainParser {
handlers.add(handler);
}
- EventHandler>[] handlersArray = handlers
- .toArray(new EventHandler>[handlers.size()]);
+ EventHandler>[] handlersArray = handlers.toArray(new EventHandler>[handlers.size()]);
@SuppressWarnings("rawtypes")
EventHandlerChain> chain = new EventHandlerChain(handlersArray);
diff --git a/src/org/apollo/io/PluginMetaDataParser.java b/src/org/apollo/io/PluginMetaDataParser.java
index 740a64c3..dec9bb6e 100644
--- a/src/org/apollo/io/PluginMetaDataParser.java
+++ b/src/org/apollo/io/PluginMetaDataParser.java
@@ -9,8 +9,8 @@ import org.apollo.util.xml.XmlParser;
import org.xml.sax.SAXException;
/**
- * A class which parses {@code plugin.xml} files into {@link PluginMetaData}
- * objects.
+ * A class which parses {@code plugin.xml} files into {@link PluginMetaData} objects.
+ *
* @author Graham
*/
public final class PluginMetaDataParser {
@@ -32,6 +32,7 @@ public final class PluginMetaDataParser {
/**
* Creates the plugin meta data parser.
+ *
* @param is The input stream.
* @throws SAXException if a SAX error occurs.
*/
@@ -42,6 +43,7 @@ public final class PluginMetaDataParser {
/**
* Parses the XML and creates a meta data object.
+ *
* @return The meta data object.
* @throws SAXException if a SAX error occurs.
* @throws IOException if an I/O error occurs.
@@ -103,6 +105,7 @@ public final class PluginMetaDataParser {
/**
* Gets the specified child element, if it exists.
+ *
* @param node The root node.
* @param name The element name.
* @return The node object.
diff --git a/src/org/apollo/io/package-info.java b/src/org/apollo/io/package-info.java
index bffc4b6e..b8106308 100644
--- a/src/org/apollo/io/package-info.java
+++ b/src/org/apollo/io/package-info.java
@@ -2,3 +2,4 @@
* Contains classes which deal with input/output.
*/
package org.apollo.io;
+
diff --git a/src/org/apollo/io/player/PlayerLoader.java b/src/org/apollo/io/player/PlayerLoader.java
index 7e95ff5c..cd5425ec 100644
--- a/src/org/apollo/io/player/PlayerLoader.java
+++ b/src/org/apollo/io/player/PlayerLoader.java
@@ -3,15 +3,16 @@ package org.apollo.io.player;
import org.apollo.security.PlayerCredentials;
/**
- * An interface which may be extended by others which are capable of loading
- * players. For example, implementations might include text-based, binary and
- * SQL loaders.
+ * An interface which may be extended by others which are capable of loading players. For example, implementations might
+ * include text-based, binary and SQL loaders.
+ *
* @author Graham
*/
public interface PlayerLoader {
/**
* Loads a player.
+ *
* @param credentials The player's credentials.
* @return The {@link PlayerLoaderResponse}.
* @throws Exception if an error occurs.
diff --git a/src/org/apollo/io/player/PlayerLoaderResponse.java b/src/org/apollo/io/player/PlayerLoaderResponse.java
index 0c67bfca..65d89680 100644
--- a/src/org/apollo/io/player/PlayerLoaderResponse.java
+++ b/src/org/apollo/io/player/PlayerLoaderResponse.java
@@ -4,8 +4,8 @@ import org.apollo.game.model.Player;
import org.apollo.net.codec.login.LoginConstants;
/**
- * A response for the
- * {@link PlayerLoader#loadPlayer(org.apollo.security.PlayerCredentials)} call.
+ * A response for the {@link PlayerLoader#loadPlayer(org.apollo.security.PlayerCredentials)} call.
+ *
* @author Graham
*/
public final class PlayerLoaderResponse {
@@ -22,9 +22,9 @@ public final class PlayerLoaderResponse {
/**
* Creates a {@link PlayerLoaderResponse} with only a status code.
+ *
* @param status The status code.
- * @throws IllegalArgumentException if the status code needs a
- * {@link Player}.
+ * @throws IllegalArgumentException if the status code needs a {@link Player}.
*/
public PlayerLoaderResponse(int status) {
if (status == LoginConstants.STATUS_OK || status == LoginConstants.STATUS_RECONNECTION_OK) {
@@ -36,10 +36,10 @@ public final class PlayerLoaderResponse {
/**
* Creates a {@link PlayerLoaderResponse} with a status code and player.
+ *
* @param status The status code.
* @param player The player.
- * @throws IllegalArgumentException if the status code does not need
- * {@link Player}.
+ * @throws IllegalArgumentException if the status code does not need {@link Player}.
*/
public PlayerLoaderResponse(int status, Player player) {
if (status != LoginConstants.STATUS_OK && status != LoginConstants.STATUS_RECONNECTION_OK) {
@@ -51,6 +51,7 @@ public final class PlayerLoaderResponse {
/**
* Gets the status code.
+ *
* @return The status code.
*/
public int getStatus() {
@@ -59,8 +60,8 @@ public final class PlayerLoaderResponse {
/**
* Gets the player.
- * @return The player, or {@code null} if there is no player in this
- * response.
+ *
+ * @return The player, or {@code null} if there is no player in this response.
*/
public Player getPlayer() {
return player;
diff --git a/src/org/apollo/io/player/PlayerSaver.java b/src/org/apollo/io/player/PlayerSaver.java
index 5e253364..fbe7e011 100644
--- a/src/org/apollo/io/player/PlayerSaver.java
+++ b/src/org/apollo/io/player/PlayerSaver.java
@@ -3,15 +3,16 @@ package org.apollo.io.player;
import org.apollo.game.model.Player;
/**
- * An interface which may be implemented by others which are capable of saving
- * players. For example, implementations might include text-based, binary and
- * SQL savers.
+ * An interface which may be implemented by others which are capable of saving players. For example, implementations
+ * might include text-based, binary and SQL savers.
+ *
* @author Graham
*/
public interface PlayerSaver {
/**
* Saves a player.
+ *
* @param player The player to save.
* @throws Exception if an error occurs.
*/
diff --git a/src/org/apollo/io/player/impl/BinaryPlayerLoader.java b/src/org/apollo/io/player/impl/BinaryPlayerLoader.java
index 0a76ea5d..68155f16 100644
--- a/src/org/apollo/io/player/impl/BinaryPlayerLoader.java
+++ b/src/org/apollo/io/player/impl/BinaryPlayerLoader.java
@@ -22,6 +22,7 @@ import org.apollo.util.StreamUtil;
/**
* A {@link PlayerLoader} implementation that loads data from a binary file.
+ *
* @author Graham
*/
public final class BinaryPlayerLoader implements PlayerLoader {
@@ -104,6 +105,7 @@ public final class BinaryPlayerLoader implements PlayerLoader {
/**
* Reads an inventory from the input stream.
+ *
* @param in The input stream.
* @param inventory The inventory.
* @throws IOException if an I/O error occurs.
diff --git a/src/org/apollo/io/player/impl/BinaryPlayerSaver.java b/src/org/apollo/io/player/impl/BinaryPlayerSaver.java
index 71f2110a..ee4fd8df 100644
--- a/src/org/apollo/io/player/impl/BinaryPlayerSaver.java
+++ b/src/org/apollo/io/player/impl/BinaryPlayerSaver.java
@@ -16,8 +16,8 @@ import org.apollo.io.player.PlayerSaver;
import org.apollo.util.StreamUtil;
/**
- * A {@link PlayerSaver} implementation that saves player data to a binary
- * file.
+ * A {@link PlayerSaver} implementation that saves player data to a binary file.
+ *
* @author Graham
*/
public final class BinaryPlayerSaver implements PlayerSaver {
@@ -73,6 +73,7 @@ public final class BinaryPlayerSaver implements PlayerSaver {
/**
* Writes an inventory to the specified output stream.
+ *
* @param out The output stream.
* @param inventory The inventory.
* @throws IOException if an I/O error occurs.
diff --git a/src/org/apollo/io/player/impl/BinaryPlayerUtil.java b/src/org/apollo/io/player/impl/BinaryPlayerUtil.java
index 215815bf..720f7233 100644
--- a/src/org/apollo/io/player/impl/BinaryPlayerUtil.java
+++ b/src/org/apollo/io/player/impl/BinaryPlayerUtil.java
@@ -5,8 +5,8 @@ import java.io.File;
import org.apollo.util.NameUtil;
/**
- * A utility class with common functionality used by the binary player loader/
- * savers.
+ * A utility class with common functionality used by the binary player loader/ savers.
+ *
* @author Graham
*/
public final class BinaryPlayerUtil {
@@ -27,6 +27,7 @@ public final class BinaryPlayerUtil {
/**
* Gets the file for the specified player.
+ *
* @param name The name of the player.
* @return The file.
*/
diff --git a/src/org/apollo/io/player/impl/DiscardPlayerSaver.java b/src/org/apollo/io/player/impl/DiscardPlayerSaver.java
index bd0a5202..03adc45b 100644
--- a/src/org/apollo/io/player/impl/DiscardPlayerSaver.java
+++ b/src/org/apollo/io/player/impl/DiscardPlayerSaver.java
@@ -5,6 +5,7 @@ import org.apollo.io.player.PlayerSaver;
/**
* A {@link PlayerSaver} implementation that discards player data.
+ *
* @author Graham
*/
public final class DiscardPlayerSaver implements PlayerSaver {
diff --git a/src/org/apollo/io/player/impl/DummyPlayerLoader.java b/src/org/apollo/io/player/impl/DummyPlayerLoader.java
index ab4781fc..6cbcb4e2 100644
--- a/src/org/apollo/io/player/impl/DummyPlayerLoader.java
+++ b/src/org/apollo/io/player/impl/DummyPlayerLoader.java
@@ -10,6 +10,7 @@ import org.apollo.security.PlayerCredentials;
/**
* A dummy {@link PlayerLoader} implementation used for testing purposes.
+ *
* @author Graham
*/
public final class DummyPlayerLoader implements PlayerLoader {
diff --git a/src/org/apollo/io/player/impl/package-info.java b/src/org/apollo/io/player/impl/package-info.java
index 4557451d..f4b8c099 100644
--- a/src/org/apollo/io/player/impl/package-info.java
+++ b/src/org/apollo/io/player/impl/package-info.java
@@ -2,3 +2,4 @@
* Contains various player loader/saver implementations.
*/
package org.apollo.io.player.impl;
+
diff --git a/src/org/apollo/io/player/package-info.java b/src/org/apollo/io/player/package-info.java
index c54e147d..ce4f331f 100644
--- a/src/org/apollo/io/player/package-info.java
+++ b/src/org/apollo/io/player/package-info.java
@@ -2,3 +2,4 @@
* Contains classes which deal with loading and saving player files.
*/
package org.apollo.io.player;
+
diff --git a/src/org/apollo/login/LoginService.java b/src/org/apollo/login/LoginService.java
index 80a6c486..6f0a39b7 100644
--- a/src/org/apollo/login/LoginService.java
+++ b/src/org/apollo/login/LoginService.java
@@ -21,6 +21,7 @@ import org.apollo.util.xml.XmlParser;
/**
* The {@link LoginService} manages {@link LoginRequest}s.
+ *
* @author Graham
*/
public final class LoginService extends Service {
@@ -42,6 +43,7 @@ public final class LoginService extends Service {
/**
* Creates the login service.
+ *
* @throws Exception if an error occurs.
*/
public LoginService() throws Exception {
@@ -50,6 +52,7 @@ public final class LoginService extends Service {
/**
* Initialises the login service.
+ *
* @throws Exception if an error occurs.
*/
private void init() throws Exception {
@@ -86,6 +89,7 @@ public final class LoginService extends Service {
/**
* Submits a login request.
+ *
* @param session The session submitting this request.
* @param request The login request.
*/
@@ -101,6 +105,7 @@ public final class LoginService extends Service {
/**
* Submits a save request.
+ *
* @param session The session submitting this request.
* @param player The player to save.
*/
diff --git a/src/org/apollo/login/PlayerLoaderWorker.java b/src/org/apollo/login/PlayerLoaderWorker.java
index 0412af7e..b09931f5 100644
--- a/src/org/apollo/login/PlayerLoaderWorker.java
+++ b/src/org/apollo/login/PlayerLoaderWorker.java
@@ -11,6 +11,7 @@ import org.apollo.net.session.LoginSession;
/**
* A class which processes a single login request.
+ *
* @author Graham
*/
public final class PlayerLoaderWorker implements Runnable {
@@ -36,8 +37,8 @@ public final class PlayerLoaderWorker implements Runnable {
private final LoginRequest request;
/**
- * Creates a {@link PlayerLoaderWorker} which will do the work for a single
- * player load request.
+ * Creates a {@link PlayerLoaderWorker} which will do the work for a single player load request.
+ *
* @param loader The current player loader.
* @param session The {@link LoginSession} which initiated the request.
* @param request The {@link LoginRequest} object.
@@ -55,7 +56,8 @@ public final class PlayerLoaderWorker implements Runnable {
session.handlePlayerLoaderResponse(request, response);
} catch (Exception e) {
logger.log(Level.SEVERE, "Unable to load player's game.", e);
- session.handlePlayerLoaderResponse(request, new PlayerLoaderResponse(LoginConstants.STATUS_COULD_NOT_COMPLETE));
+ session.handlePlayerLoaderResponse(request, new PlayerLoaderResponse(
+ LoginConstants.STATUS_COULD_NOT_COMPLETE));
}
}
diff --git a/src/org/apollo/login/PlayerSaverWorker.java b/src/org/apollo/login/PlayerSaverWorker.java
index 20d2ce06..cf30473b 100644
--- a/src/org/apollo/login/PlayerSaverWorker.java
+++ b/src/org/apollo/login/PlayerSaverWorker.java
@@ -9,6 +9,7 @@ import org.apollo.net.session.GameSession;
/**
* A class which processes a single save request.
+ *
* @author Graham
*/
public final class PlayerSaverWorker implements Runnable {
@@ -35,6 +36,7 @@ public final class PlayerSaverWorker implements Runnable {
/**
* Creates the player saver worker.
+ *
* @param saver The player saver.
* @param session The game session.
* @param player The player to save.
diff --git a/src/org/apollo/login/package-info.java b/src/org/apollo/login/package-info.java
index 1632fa8f..2825a57e 100644
--- a/src/org/apollo/login/package-info.java
+++ b/src/org/apollo/login/package-info.java
@@ -2,3 +2,4 @@
* Contains classes related to the login service.
*/
package org.apollo.login;
+
diff --git a/src/org/apollo/net/ApolloHandler.java b/src/org/apollo/net/ApolloHandler.java
index 373da45f..56ab00e5 100644
--- a/src/org/apollo/net/ApolloHandler.java
+++ b/src/org/apollo/net/ApolloHandler.java
@@ -21,8 +21,8 @@ import org.jboss.netty.handler.timeout.IdleStateAwareChannelUpstreamHandler;
import org.jboss.netty.handler.timeout.IdleStateEvent;
/**
- * An implementation of {@link SimpleChannelUpstreamHandler} which handles
- * incoming upstream events from Netty.
+ * An implementation of {@link SimpleChannelUpstreamHandler} which handles incoming upstream events from Netty.
+ *
* @author Graham
*/
public final class ApolloHandler extends IdleStateAwareChannelUpstreamHandler {
@@ -39,6 +39,7 @@ public final class ApolloHandler extends IdleStateAwareChannelUpstreamHandler {
/**
* Creates the Apollo event handler.
+ *
* @param context The server context.
*/
public ApolloHandler(ServerContext context) {
diff --git a/src/org/apollo/net/HttpPipelineFactory.java b/src/org/apollo/net/HttpPipelineFactory.java
index 24345333..9fbb90c3 100644
--- a/src/org/apollo/net/HttpPipelineFactory.java
+++ b/src/org/apollo/net/HttpPipelineFactory.java
@@ -11,6 +11,7 @@ import org.jboss.netty.util.Timer;
/**
* A {@link ChannelPipelineFactory} for the HTTP protocol.
+ *
* @author Graham
*/
public final class HttpPipelineFactory implements ChannelPipelineFactory {
@@ -32,6 +33,7 @@ public final class HttpPipelineFactory implements ChannelPipelineFactory {
/**
* Creates the HTTP pipeline factory.
+ *
* @param handler The file server event handler.
* @param timer The timer used for idle checking.
*/
diff --git a/src/org/apollo/net/JagGrabPipelineFactory.java b/src/org/apollo/net/JagGrabPipelineFactory.java
index e5ab6287..1ee715b6 100644
--- a/src/org/apollo/net/JagGrabPipelineFactory.java
+++ b/src/org/apollo/net/JagGrabPipelineFactory.java
@@ -16,6 +16,7 @@ import org.jboss.netty.util.Timer;
/**
* A {@link ChannelPipelineFactory} for the JAGGRAB protocol.
+ *
* @author Graham
*/
public final class JagGrabPipelineFactory implements ChannelPipelineFactory {
@@ -55,6 +56,7 @@ public final class JagGrabPipelineFactory implements ChannelPipelineFactory {
/**
* Creates a {@code JAGGRAB} pipeline factory.
+ *
* @param handler The file server event handler.
* @param timer The timer used for idle checking.
*/
diff --git a/src/org/apollo/net/NetworkConstants.java b/src/org/apollo/net/NetworkConstants.java
index 6e018ad0..81f9399e 100644
--- a/src/org/apollo/net/NetworkConstants.java
+++ b/src/org/apollo/net/NetworkConstants.java
@@ -2,6 +2,7 @@ package org.apollo.net;
/**
* Holds various network-related constants such as port numbers.
+ *
* @author Graham
*/
public final class NetworkConstants {
diff --git a/src/org/apollo/net/ServicePipelineFactory.java b/src/org/apollo/net/ServicePipelineFactory.java
index 12deb764..c2b12cae 100644
--- a/src/org/apollo/net/ServicePipelineFactory.java
+++ b/src/org/apollo/net/ServicePipelineFactory.java
@@ -8,8 +8,8 @@ import org.jboss.netty.handler.timeout.IdleStateHandler;
import org.jboss.netty.util.Timer;
/**
- * A {@link ChannelPipelineFactory} which creates {@link ChannelPipeline}s for
- * the service pipeline.
+ * A {@link ChannelPipelineFactory} which creates {@link ChannelPipeline}s for the service pipeline.
+ *
* @author Graham
*/
public final class ServicePipelineFactory implements ChannelPipelineFactory {
@@ -26,6 +26,7 @@ public final class ServicePipelineFactory implements ChannelPipelineFactory {
/**
* Creates the service pipeline factory.
+ *
* @param handler The networking event handler.
* @param timer The timer used for idle checking.
*/
diff --git a/src/org/apollo/net/codec/game/AccessMode.java b/src/org/apollo/net/codec/game/AccessMode.java
index 5277c05b..6ce74ddf 100644
--- a/src/org/apollo/net/codec/game/AccessMode.java
+++ b/src/org/apollo/net/codec/game/AccessMode.java
@@ -1,8 +1,8 @@
package org.apollo.net.codec.game;
/**
- * An enumeration which holds the mode a {@link GamePacketBuilder} or
- * {@link GamePacketReader} can be in.
+ * An enumeration which holds the mode a {@link GamePacketBuilder} or {@link GamePacketReader} can be in.
+ *
* @author Graham
*/
public enum AccessMode {
diff --git a/src/org/apollo/net/codec/game/DataConstants.java b/src/org/apollo/net/codec/game/DataConstants.java
index 11c74ccc..d0d25ea4 100644
--- a/src/org/apollo/net/codec/game/DataConstants.java
+++ b/src/org/apollo/net/codec/game/DataConstants.java
@@ -2,13 +2,13 @@ package org.apollo.net.codec.game;
/**
* A class holding data-related constants.
+ *
* @author Graham
*/
public final class DataConstants {
/**
- * An array of bit masks. The element {@code n} is equal to
- * {@code 2n - 1}.
+ * An array of bit masks. The element {@code n} is equal to {@code 2n - 1}.
*/
public static final int[] BIT_MASK = new int[32];
diff --git a/src/org/apollo/net/codec/game/DataOrder.java b/src/org/apollo/net/codec/game/DataOrder.java
index d1cd6be8..3bee8e7f 100644
--- a/src/org/apollo/net/codec/game/DataOrder.java
+++ b/src/org/apollo/net/codec/game/DataOrder.java
@@ -1,8 +1,8 @@
package org.apollo.net.codec.game;
/**
- * Represents the order of bytes in a {@link DataType} when
- * {@code {@link DataType#getBytes()} > 1}.
+ * Represents the order of bytes in a {@link DataType} when {@code {@link DataType#getBytes()} > 1}.
+ *
* @author Graham
*/
public enum DataOrder {
diff --git a/src/org/apollo/net/codec/game/DataTransformation.java b/src/org/apollo/net/codec/game/DataTransformation.java
index b4f0edb6..bcbaee0a 100644
--- a/src/org/apollo/net/codec/game/DataTransformation.java
+++ b/src/org/apollo/net/codec/game/DataTransformation.java
@@ -2,6 +2,7 @@ package org.apollo.net.codec.game;
/**
* Represents the different ways data values can be transformed.
+ *
* @author Graham
*/
public enum DataTransformation {
@@ -12,8 +13,7 @@ public enum DataTransformation {
NONE,
/**
- * Adds 128 to the value when it is written, takes 128 from the value when
- * it is read (also known as type-A).
+ * Adds 128 to the value when it is written, takes 128 from the value when it is read (also known as type-A).
*/
ADD,
diff --git a/src/org/apollo/net/codec/game/DataType.java b/src/org/apollo/net/codec/game/DataType.java
index 52b44203..d5a96102 100644
--- a/src/org/apollo/net/codec/game/DataType.java
+++ b/src/org/apollo/net/codec/game/DataType.java
@@ -2,6 +2,7 @@ package org.apollo.net.codec.game;
/**
* Represents the different simple data types.
+ *
* @author Graham
*/
public enum DataType {
@@ -38,6 +39,7 @@ public enum DataType {
/**
* Creates a data type.
+ *
* @param bytes The number of bytes it occupies.
*/
private DataType(int bytes) {
@@ -46,6 +48,7 @@ public enum DataType {
/**
* Gets the number of bytes the data type occupies.
+ *
* @return The number of bytes.
*/
public int getBytes() {
diff --git a/src/org/apollo/net/codec/game/GameDecoderState.java b/src/org/apollo/net/codec/game/GameDecoderState.java
index 1867a6c1..89b8912d 100644
--- a/src/org/apollo/net/codec/game/GameDecoderState.java
+++ b/src/org/apollo/net/codec/game/GameDecoderState.java
@@ -1,29 +1,27 @@
package org.apollo.net.codec.game;
/**
- * An enumeration with the different states the {@link GamePacketDecoder} can
- * be in.
+ * An enumeration with the different states the {@link GamePacketDecoder} can be in.
+ *
* @author Graham
*/
public enum GameDecoderState {
/**
- * The game opcode state waits for an encrypted opcode. It decrypts it, and
- * will either set the next state to the length (if the packet is variably-
- * sized) or the payload (if it is not variably-sized) state.
+ * The game opcode state waits for an encrypted opcode. It decrypts it, and will either set the next state to the
+ * length (if the packet is variably- sized) or the payload (if it is not variably-sized) state.
*/
GAME_OPCODE,
/**
- * The game length state waits for the packet length. Once it has been
- * received, it sets the state to the payload state.
+ * The game length state waits for the packet length. Once it has been received, it sets the state to the payload
+ * state.
*/
GAME_LENGTH,
/**
- * The payload state will wait for the whole packet to be received. Then,
- * it will pass a {@link GamePacket} object to Netty and reset the state
- * back to the game opcode state, ready for the next packet.
+ * The payload state will wait for the whole packet to be received. Then, it will pass a {@link GamePacket} object
+ * to Netty and reset the state back to the game opcode state, ready for the next packet.
*/
GAME_PAYLOAD;
diff --git a/src/org/apollo/net/codec/game/GameEventDecoder.java b/src/org/apollo/net/codec/game/GameEventDecoder.java
index da6fa292..a2b9d879 100644
--- a/src/org/apollo/net/codec/game/GameEventDecoder.java
+++ b/src/org/apollo/net/codec/game/GameEventDecoder.java
@@ -8,8 +8,8 @@ import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.handler.codec.oneone.OneToOneDecoder;
/**
- * A {@link OneToOneDecoder} that decodes {@link GamePacket}s into
- * {@link Event}s.
+ * A {@link OneToOneDecoder} that decodes {@link GamePacket}s into {@link Event}s.
+ *
* @author Graham
*/
public final class GameEventDecoder extends OneToOneDecoder {
@@ -21,6 +21,7 @@ public final class GameEventDecoder extends OneToOneDecoder {
/**
* Creates the game event decoder with the specified release.
+ *
* @param release The release.
*/
public GameEventDecoder(Release release) {
diff --git a/src/org/apollo/net/codec/game/GameEventEncoder.java b/src/org/apollo/net/codec/game/GameEventEncoder.java
index 4e99a29e..29066b8b 100644
--- a/src/org/apollo/net/codec/game/GameEventEncoder.java
+++ b/src/org/apollo/net/codec/game/GameEventEncoder.java
@@ -8,8 +8,8 @@ import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.handler.codec.oneone.OneToOneEncoder;
/**
- * A {@link OneToOneEncoder} which encodes {@link Event}s into
- * {@link GamePacket}s.
+ * A {@link OneToOneEncoder} which encodes {@link Event}s into {@link GamePacket}s.
+ *
* @author Graham
*/
public final class GameEventEncoder extends OneToOneEncoder {
@@ -21,6 +21,7 @@ public final class GameEventEncoder extends OneToOneEncoder {
/**
* Creates the game event encoder with the specified release.
+ *
* @param release The release.
*/
public GameEventEncoder(Release release) {
diff --git a/src/org/apollo/net/codec/game/GamePacket.java b/src/org/apollo/net/codec/game/GamePacket.java
index ada7d7e1..78f31e9b 100644
--- a/src/org/apollo/net/codec/game/GamePacket.java
+++ b/src/org/apollo/net/codec/game/GamePacket.java
@@ -5,6 +5,7 @@ import org.jboss.netty.buffer.ChannelBuffer;
/**
* Represents a single packet used in the in-game protocol.
+ *
* @author Graham
*/
public final class GamePacket {
@@ -31,6 +32,7 @@ public final class GamePacket {
/**
* Creates the game packet.
+ *
* @param opcode The opcode.
* @param type The packet type.
* @param payload The payload.
@@ -44,6 +46,7 @@ public final class GamePacket {
/**
* Gets the opcode.
+ *
* @return The opcode.
*/
public int getOpcode() {
@@ -52,6 +55,7 @@ public final class GamePacket {
/**
* Gets the payload length.
+ *
* @return The payload length.
*/
public int getLength() {
@@ -60,6 +64,7 @@ public final class GamePacket {
/**
* Gets the payload.
+ *
* @return The payload.
*/
public ChannelBuffer getPayload() {
@@ -68,6 +73,7 @@ public final class GamePacket {
/**
* Gets the packet type.
+ *
* @return The packet type.
*/
public PacketType getType() {
diff --git a/src/org/apollo/net/codec/game/GamePacketBuilder.java b/src/org/apollo/net/codec/game/GamePacketBuilder.java
index 996e8482..a00eceba 100644
--- a/src/org/apollo/net/codec/game/GamePacketBuilder.java
+++ b/src/org/apollo/net/codec/game/GamePacketBuilder.java
@@ -7,6 +7,7 @@ import org.jboss.netty.buffer.ChannelBuffers;
/**
* A class which assists in creating a {@link GamePacket}.
+ *
* @author Graham
*/
public final class GamePacketBuilder {
@@ -45,8 +46,8 @@ public final class GamePacketBuilder {
}
/**
- * Creates the {@link GamePacketBuilder} for a {@link PacketType#FIXED}
- * packet with the specified opcode.
+ * Creates the {@link GamePacketBuilder} for a {@link PacketType#FIXED} packet with the specified opcode.
+ *
* @param opcode The opcode.
*/
public GamePacketBuilder(int opcode) {
@@ -54,8 +55,8 @@ public final class GamePacketBuilder {
}
/**
- * Creates the {@link GamePacketBuilder} for the specified packet type and
- * opcode.
+ * Creates the {@link GamePacketBuilder} for the specified packet type and opcode.
+ *
* @param opcode The opcode.
* @param type The packet type.
*/
@@ -65,11 +66,10 @@ public final class GamePacketBuilder {
}
/**
- * Creates a {@link GamePacket} based on the current contents of this
- * builder.
+ * Creates a {@link GamePacket} based on the current contents of this builder.
+ *
* @return The {@link GamePacket}.
- * @throws IllegalStateException if the builder is not in byte access mode,
- * or if the packet is raw.
+ * @throws IllegalStateException if the builder is not in byte access mode, or if the packet is raw.
*/
public GamePacket toGamePacket() {
if (type == PacketType.RAW) {
@@ -83,9 +83,9 @@ public final class GamePacketBuilder {
/**
* Gets the current length of the builder's buffer.
+ *
* @return The length of the buffer.
- * @throws IllegalStateException if the builder is not in byte access
- * mode.
+ * @throws IllegalStateException if the builder is not in byte access mode.
*/
public int getLength() {
checkByteAccess();
@@ -94,8 +94,8 @@ public final class GamePacketBuilder {
/**
* Switches this builder's mode to the byte access mode.
- * @throws IllegalStateException if the builder is already in byte access
- * mode.
+ *
+ * @throws IllegalStateException if the builder is already in byte access mode.
*/
public void switchToByteAccess() {
if (mode == AccessMode.BYTE_ACCESS) {
@@ -107,8 +107,8 @@ public final class GamePacketBuilder {
/**
* Switches this builder's mode to the bit access mode.
- * @throws IllegalStateException if the builder is already in bit access
- * mode.
+ *
+ * @throws IllegalStateException if the builder is already in bit access mode.
*/
public void switchToBitAccess() {
if (mode == AccessMode.BIT_ACCESS) {
@@ -119,8 +119,8 @@ public final class GamePacketBuilder {
}
/**
- * Puts a raw builder. Both builders (this and parameter) must be in byte
- * access mode.
+ * Puts a raw builder. Both builders (this and parameter) must be in byte access mode.
+ *
* @param builder The builder.
*/
public void putRawBuilder(GamePacketBuilder builder) {
@@ -133,8 +133,8 @@ public final class GamePacketBuilder {
}
/**
- * Puts a raw builder in reverse. Both builders (this and parameter) must
- * be in byte access mode.
+ * Puts a raw builder in reverse. Both builders (this and parameter) must be in byte access mode.
+ *
* @param builder The builder.
*/
public void putRawBuilderReverse(GamePacketBuilder builder) {
@@ -148,6 +148,7 @@ public final class GamePacketBuilder {
/**
* Puts a standard data type with the specified value.
+ *
* @param type The data type.
* @param value The value.
* @throws IllegalStateException if this reader is not in byte access mode.
@@ -158,6 +159,7 @@ public final class GamePacketBuilder {
/**
* Puts a standard data type with the specified value and byte order.
+ *
* @param type The data type.
* @param order The byte order.
* @param value The value.
@@ -170,6 +172,7 @@ public final class GamePacketBuilder {
/**
* Puts a standard data type with the specified value and transformation.
+ *
* @param type The type.
* @param transformation The transformation.
* @param value The value.
@@ -181,8 +184,8 @@ public final class GamePacketBuilder {
}
/**
- * Puts a standard data type with the specified value, byte order and
- * transformation.
+ * Puts a standard data type with the specified value, byte order and transformation.
+ *
* @param type The data type.
* @param order The byte order.
* @param transformation The transformation.
@@ -255,6 +258,7 @@ public final class GamePacketBuilder {
/**
* Puts a string into the buffer.
+ *
* @param str The string.
*/
public void putString(String str) {
@@ -268,6 +272,7 @@ public final class GamePacketBuilder {
/**
* Puts a smart into the buffer.
+ *
* @param value The value.
*/
public void putSmart(int value) {
@@ -281,6 +286,7 @@ public final class GamePacketBuilder {
/**
* Puts the bytes from the specified buffer into this packet's buffer.
+ *
* @param buffer The source {@link ChannelBuffer}.
* @throws IllegalStateException if the builder is not in byte access mode.
*/
@@ -296,8 +302,8 @@ public final class GamePacketBuilder {
}
/**
- * Puts the bytes from the specified buffer into this packet's buffer, in
- * reverse.
+ * Puts the bytes from the specified buffer into this packet's buffer, in reverse.
+ *
* @param buffer The source {@link ChannelBuffer}.
* @throws IllegalStateException if the builder is not in byte access mode.
*/
@@ -314,6 +320,7 @@ public final class GamePacketBuilder {
/**
* Puts the specified byte array into the buffer.
+ *
* @param bytes The byte array.
* @throws IllegalStateException if the builder is not in bit access mode.
*/
@@ -323,9 +330,10 @@ public final class GamePacketBuilder {
/**
* Puts the bytes into the buffer with the specified transformation.
+ *
* @param transformation The transformation.
* @param bytes The byte array.
- *@throws IllegalStateException if the builder is not in byte access mode.
+ * @throws IllegalStateException if the builder is not in byte access mode.
*/
public void putBytes(DataTransformation transformation, byte[] bytes) {
if (transformation == DataTransformation.NONE) {
@@ -339,6 +347,7 @@ public final class GamePacketBuilder {
/**
* Puts the specified byte array into the buffer in reverse.
+ *
* @param bytes The byte array.
* @throws IllegalStateException if the builder is not in byte access mode.
*/
@@ -350,8 +359,8 @@ public final class GamePacketBuilder {
}
/**
- * Puts the specified byte array into the buffer in reverse with the
- * specified transformation.
+ * Puts the specified byte array into the buffer in reverse with the specified transformation.
+ *
* @param transformation The transformation.
* @param bytes The byte array.
* @throws IllegalStateException if the builder is not in byte access mode.
@@ -367,9 +376,9 @@ public final class GamePacketBuilder {
}
/**
- * Puts a single bit into the buffer. If {@code flag} is {@code true}, the
- * value of the bit is {@code 1}. If {@code flag} is {@code false}, the
- * value of the bit is {@code 0}.
+ * Puts a single bit into the buffer. If {@code flag} is {@code true}, the value of the bit is {@code 1}. If
+ * {@code flag} is {@code false}, the value of the bit is {@code 0}.
+ *
* @param flag The flag.
* @throws IllegalStateException if the builder is not in bit access mode.
*/
@@ -379,6 +388,7 @@ public final class GamePacketBuilder {
/**
* Puts a single bit into the buffer with the value {@code value}.
+ *
* @param value The value.
* @throws IllegalStateException if the builder is not in bit access mode.
*/
@@ -388,11 +398,11 @@ public final class GamePacketBuilder {
/**
* Puts {@code numBits} into the buffer with the value {@code value}.
+ *
* @param numBits The number of bits to put into the buffer.
* @param value The value.
* @throws IllegalStateException if the builder is not in bit access mode.
- * @throws IllegalArgumentException if the number of bits is not between 1
- * and 31 inclusive.
+ * @throws IllegalArgumentException if the number of bits is not between 1 and 31 inclusive.
*/
public void putBits(int numBits, int value) {
if (numBits < 0 || numBits > 32) {
@@ -412,7 +422,7 @@ public final class GamePacketBuilder {
for (; numBits > bitOffset; bitOffset = 8) {
int tmp = buffer.getByte(bytePos);
tmp &= ~DataConstants.BIT_MASK[bitOffset];
- tmp |= (value >> (numBits-bitOffset)) & DataConstants.BIT_MASK[bitOffset];
+ tmp |= (value >> (numBits - bitOffset)) & DataConstants.BIT_MASK[bitOffset];
buffer.setByte(bytePos++, tmp);
numBits -= bitOffset;
}
@@ -431,6 +441,7 @@ public final class GamePacketBuilder {
/**
* Checks that this builder is in the byte access mode.
+ *
* @throws IllegalStateException if the builder is not in byte access mode.
*/
private void checkByteAccess() {
@@ -441,6 +452,7 @@ public final class GamePacketBuilder {
/**
* Checks that this builder is in the bit access mode.
+ *
* @throws IllegalStateException if the builder is not in bit access mode.
*/
private void checkBitAccess() {
diff --git a/src/org/apollo/net/codec/game/GamePacketDecoder.java b/src/org/apollo/net/codec/game/GamePacketDecoder.java
index 078b7b78..2dc6bbb6 100644
--- a/src/org/apollo/net/codec/game/GamePacketDecoder.java
+++ b/src/org/apollo/net/codec/game/GamePacketDecoder.java
@@ -13,6 +13,7 @@ import org.jboss.netty.channel.ChannelHandlerContext;
/**
* A {@link StatefulFrameDecoder} which decodes game packets.
+ *
* @author Graham
*/
public final class GamePacketDecoder extends StatefulFrameDecoder {
@@ -44,6 +45,7 @@ public final class GamePacketDecoder extends StatefulFrameDecoder 32) {
@@ -393,7 +410,7 @@ public final class GamePacketReader {
int bytePos = bitIndex >> 3;
int bitOffset = 8 - (bitIndex & 7);
int value = 0;
- bitIndex +=numBits;
+ bitIndex += numBits;
for (; numBits > bitOffset; bitOffset = 8) {
value += (buffer.getByte(bytePos++) & DataConstants.BIT_MASK[bitOffset]) << numBits - bitOffset;
diff --git a/src/org/apollo/net/codec/game/package-info.java b/src/org/apollo/net/codec/game/package-info.java
index 0f1a7fef..430c229e 100644
--- a/src/org/apollo/net/codec/game/package-info.java
+++ b/src/org/apollo/net/codec/game/package-info.java
@@ -2,3 +2,4 @@
* Contains codecs for the game protocol.
*/
package org.apollo.net.codec.game;
+
diff --git a/src/org/apollo/net/codec/handshake/HandshakeConstants.java b/src/org/apollo/net/codec/handshake/HandshakeConstants.java
index 2dc23645..ea25c394 100644
--- a/src/org/apollo/net/codec/handshake/HandshakeConstants.java
+++ b/src/org/apollo/net/codec/handshake/HandshakeConstants.java
@@ -2,6 +2,7 @@ package org.apollo.net.codec.handshake;
/**
* Holds handshake-related constants.
+ *
* @author Graham
*/
public final class HandshakeConstants {
diff --git a/src/org/apollo/net/codec/handshake/HandshakeDecoder.java b/src/org/apollo/net/codec/handshake/HandshakeDecoder.java
index 20dd40f1..4300e02c 100644
--- a/src/org/apollo/net/codec/handshake/HandshakeDecoder.java
+++ b/src/org/apollo/net/codec/handshake/HandshakeDecoder.java
@@ -11,8 +11,9 @@ import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.handler.codec.frame.FrameDecoder;
/**
- * A {@link FrameDecoder} which decodes the handshake and makes changes to the
- * pipeline as appropriate for the selected service.
+ * A {@link FrameDecoder} which decodes the handshake and makes changes to the pipeline as appropriate for the selected
+ * service.
+ *
* @author Graham
*/
public final class HandshakeDecoder extends FrameDecoder {
@@ -25,8 +26,7 @@ public final class HandshakeDecoder extends FrameDecoder {
}
@Override
- protected Object decode(ChannelHandlerContext ctx, Channel channel,
- ChannelBuffer buffer) throws Exception {
+ protected Object decode(ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer) throws Exception {
if (buffer.readable()) {
int id = buffer.readUnsignedByte();
diff --git a/src/org/apollo/net/codec/handshake/HandshakeMessage.java b/src/org/apollo/net/codec/handshake/HandshakeMessage.java
index f299005a..32990818 100644
--- a/src/org/apollo/net/codec/handshake/HandshakeMessage.java
+++ b/src/org/apollo/net/codec/handshake/HandshakeMessage.java
@@ -2,6 +2,7 @@ package org.apollo.net.codec.handshake;
/**
* A handshake message in the service handshake protocol.
+ *
* @author Graham
*/
public final class HandshakeMessage {
@@ -13,6 +14,7 @@ public final class HandshakeMessage {
/**
* Creates the handshake message.
+ *
* @param serviceId The service id.
*/
public HandshakeMessage(int serviceId) {
@@ -21,6 +23,7 @@ public final class HandshakeMessage {
/**
* Gets the service id.
+ *
* @return The service id.
*/
public int getServiceId() {
diff --git a/src/org/apollo/net/codec/handshake/package-info.java b/src/org/apollo/net/codec/handshake/package-info.java
index 33e2f54c..439018f9 100644
--- a/src/org/apollo/net/codec/handshake/package-info.java
+++ b/src/org/apollo/net/codec/handshake/package-info.java
@@ -2,3 +2,4 @@
* Contains codecs for the handshake protocol.
*/
package org.apollo.net.codec.handshake;
+
diff --git a/src/org/apollo/net/codec/jaggrab/JagGrabRequest.java b/src/org/apollo/net/codec/jaggrab/JagGrabRequest.java
index 069f3cb3..354b1cca 100644
--- a/src/org/apollo/net/codec/jaggrab/JagGrabRequest.java
+++ b/src/org/apollo/net/codec/jaggrab/JagGrabRequest.java
@@ -2,6 +2,7 @@ package org.apollo.net.codec.jaggrab;
/**
* Represents the request for a single file using the JAGGRAB protocol.
+ *
* @author Graham
*/
public final class JagGrabRequest {
@@ -13,6 +14,7 @@ public final class JagGrabRequest {
/**
* Creates the request.
+ *
* @param filePath The file path.
*/
public JagGrabRequest(String filePath) {
@@ -21,6 +23,7 @@ public final class JagGrabRequest {
/**
* Gets the file path.
+ *
* @return The file path.
*/
public String getFilePath() {
diff --git a/src/org/apollo/net/codec/jaggrab/JagGrabRequestDecoder.java b/src/org/apollo/net/codec/jaggrab/JagGrabRequestDecoder.java
index ad574126..f7c1af3b 100644
--- a/src/org/apollo/net/codec/jaggrab/JagGrabRequestDecoder.java
+++ b/src/org/apollo/net/codec/jaggrab/JagGrabRequestDecoder.java
@@ -6,6 +6,7 @@ import org.jboss.netty.handler.codec.oneone.OneToOneDecoder;
/**
* A {@link OneToOneDecoder} for the JAGGRAB protocol.
+ *
* @author Graham
*/
public final class JagGrabRequestDecoder extends OneToOneDecoder {
diff --git a/src/org/apollo/net/codec/jaggrab/JagGrabResponse.java b/src/org/apollo/net/codec/jaggrab/JagGrabResponse.java
index 72560bbd..c1bdda43 100644
--- a/src/org/apollo/net/codec/jaggrab/JagGrabResponse.java
+++ b/src/org/apollo/net/codec/jaggrab/JagGrabResponse.java
@@ -4,6 +4,7 @@ import org.jboss.netty.buffer.ChannelBuffer;
/**
* Represents a single JAGGRAB reponse.
+ *
* @author Graham
*/
public final class JagGrabResponse {
@@ -15,6 +16,7 @@ public final class JagGrabResponse {
/**
* Creates the response.
+ *
* @param fileData The file data.
*/
public JagGrabResponse(ChannelBuffer fileData) {
@@ -23,6 +25,7 @@ public final class JagGrabResponse {
/**
* Gets the file data.
+ *
* @return The file data.
*/
public ChannelBuffer getFileData() {
diff --git a/src/org/apollo/net/codec/jaggrab/JagGrabResponseEncoder.java b/src/org/apollo/net/codec/jaggrab/JagGrabResponseEncoder.java
index 8850ed48..d65fc84d 100644
--- a/src/org/apollo/net/codec/jaggrab/JagGrabResponseEncoder.java
+++ b/src/org/apollo/net/codec/jaggrab/JagGrabResponseEncoder.java
@@ -6,6 +6,7 @@ import org.jboss.netty.handler.codec.oneone.OneToOneEncoder;
/**
* A {@link OneToOneEncoder} for the JAGGRAB protocol.
+ *
* @author Graham
*/
public final class JagGrabResponseEncoder extends OneToOneEncoder {
diff --git a/src/org/apollo/net/codec/jaggrab/package-info.java b/src/org/apollo/net/codec/jaggrab/package-info.java
index b97f667b..54b34246 100644
--- a/src/org/apollo/net/codec/jaggrab/package-info.java
+++ b/src/org/apollo/net/codec/jaggrab/package-info.java
@@ -2,3 +2,4 @@
* Contains codecs for the JAGGRAB protocol.
*/
package org.apollo.net.codec.jaggrab;
+
diff --git a/src/org/apollo/net/codec/login/LoginConstants.java b/src/org/apollo/net/codec/login/LoginConstants.java
index 0e86c166..049e0786 100644
--- a/src/org/apollo/net/codec/login/LoginConstants.java
+++ b/src/org/apollo/net/codec/login/LoginConstants.java
@@ -2,6 +2,7 @@ package org.apollo.net.codec.login;
/**
* Holds login-related constants.
+ *
* @author Graham
*/
public final class LoginConstants {
diff --git a/src/org/apollo/net/codec/login/LoginDecoder.java b/src/org/apollo/net/codec/login/LoginDecoder.java
index d538d697..682852c1 100644
--- a/src/org/apollo/net/codec/login/LoginDecoder.java
+++ b/src/org/apollo/net/codec/login/LoginDecoder.java
@@ -16,6 +16,7 @@ import org.jboss.netty.channel.ChannelHandlerContext;
/**
* A {@link StatefulFrameDecoder} which decodes the login request frames.
+ *
* @author Graham
*/
public final class LoginDecoder extends StatefulFrameDecoder {
@@ -53,8 +54,8 @@ public final class LoginDecoder extends StatefulFrameDecoder
}
@Override
- protected Object decode(ChannelHandlerContext ctx, Channel channel,
- ChannelBuffer buffer, LoginDecoderState state) throws Exception {
+ protected Object decode(ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer, LoginDecoderState state)
+ throws Exception {
switch (state) {
case LOGIN_HANDSHAKE:
return decodeHandshake(ctx, channel, buffer);
@@ -69,14 +70,14 @@ public final class LoginDecoder extends StatefulFrameDecoder
/**
* Decodes in the handshake state.
+ *
* @param ctx The channel handler context.
* @param channel The channel.
* @param buffer The buffer.
* @return The frame, or {@code null}.
* @throws Exception if an error occurs.
*/
- private Object decodeHandshake(ChannelHandlerContext ctx, Channel channel,
- ChannelBuffer buffer) throws Exception {
+ private Object decodeHandshake(ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer) throws Exception {
if (buffer.readable()) {
usernameHash = buffer.readUnsignedByte();
serverSeed = random.nextLong();
@@ -94,14 +95,14 @@ public final class LoginDecoder extends StatefulFrameDecoder
/**
* Decodes in the header state.
+ *
* @param ctx The channel handler context.
* @param channel The channel.
* @param buffer The buffer.
* @return The frame, or {@code null}.
* @throws Exception if an error occurs.
*/
- private Object decodeHeader(ChannelHandlerContext ctx, Channel channel,
- ChannelBuffer buffer) throws Exception {
+ private Object decodeHeader(ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer) throws Exception {
if (buffer.readableBytes() >= 2) {
int loginType = buffer.readUnsignedByte();
@@ -120,14 +121,14 @@ public final class LoginDecoder extends StatefulFrameDecoder
/**
* Decodes in the payload state.
+ *
* @param ctx The channel handler context.
* @param channel The channel.
* @param buffer The buffer.
* @return The frame, or {@code null}.
* @throws Exception if an error occurs.
*/
- private Object decodePayload(ChannelHandlerContext ctx, Channel channel,
- ChannelBuffer buffer) throws Exception {
+ private Object decodePayload(ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer) throws Exception {
if (buffer.readableBytes() >= loginLength) {
ChannelBuffer payload = buffer.readBytes(loginLength);
if (payload.readUnsignedByte() != 0xFF) {
@@ -190,7 +191,8 @@ public final class LoginDecoder extends StatefulFrameDecoder
PlayerCredentials credentials = new PlayerCredentials(username, password, usernameHash, uid);
IsaacRandomPair randomPair = new IsaacRandomPair(encodingRandom, decodingRandom);
- LoginRequest req = new LoginRequest(credentials, randomPair, reconnecting, lowMemory, releaseNumber, archiveCrcs);
+ LoginRequest req = new LoginRequest(credentials, randomPair, reconnecting, lowMemory, releaseNumber,
+ archiveCrcs);
if (buffer.readable()) {
return new Object[] { req, buffer.readBytes(buffer.readableBytes()) };
diff --git a/src/org/apollo/net/codec/login/LoginDecoderState.java b/src/org/apollo/net/codec/login/LoginDecoderState.java
index 77e3974b..83d70108 100644
--- a/src/org/apollo/net/codec/login/LoginDecoderState.java
+++ b/src/org/apollo/net/codec/login/LoginDecoderState.java
@@ -1,29 +1,27 @@
package org.apollo.net.codec.login;
/**
- * An enumeration with the different states the {@link LoginDecoder} can
- * be in.
+ * An enumeration with the different states the {@link LoginDecoder} can be in.
+ *
* @author Graham
*/
public enum LoginDecoderState {
/**
- * The login handshake state will wait for the username hash to be
- * received. Once it is, a server session key will be sent to the client
- * and the state will be set to the login header state.
+ * The login handshake state will wait for the username hash to be received. Once it is, a server session key will
+ * be sent to the client and the state will be set to the login header state.
*/
LOGIN_HANDSHAKE,
/**
- * The login header state will wait for the login type and payload length
- * to be received. These are saved, and then the state will be set to the
- * login payload state.
+ * The login header state will wait for the login type and payload length to be received. These are saved, and then
+ * the state will be set to the login payload state.
*/
LOGIN_HEADER,
/**
- * The login payload state will wait for all login information (such as
- * client release number, username and password).
+ * The login payload state will wait for all login information (such as client release number, username and
+ * password).
*/
LOGIN_PAYLOAD;
diff --git a/src/org/apollo/net/codec/login/LoginEncoder.java b/src/org/apollo/net/codec/login/LoginEncoder.java
index 54936c39..908ea5a8 100644
--- a/src/org/apollo/net/codec/login/LoginEncoder.java
+++ b/src/org/apollo/net/codec/login/LoginEncoder.java
@@ -8,13 +8,13 @@ import org.jboss.netty.handler.codec.oneone.OneToOneEncoder;
/**
* A class which encodes login response messsages.
+ *
* @author Graham
*/
public final class LoginEncoder extends OneToOneEncoder {
@Override
- protected Object encode(ChannelHandlerContext ctx, Channel channel,
- Object message) throws Exception {
+ protected Object encode(ChannelHandlerContext ctx, Channel channel, Object message) throws Exception {
if (!(message instanceof LoginResponse)) {
return message;
}
diff --git a/src/org/apollo/net/codec/login/LoginRequest.java b/src/org/apollo/net/codec/login/LoginRequest.java
index 61eb0dd1..669a00d5 100644
--- a/src/org/apollo/net/codec/login/LoginRequest.java
+++ b/src/org/apollo/net/codec/login/LoginRequest.java
@@ -5,6 +5,7 @@ import org.apollo.security.PlayerCredentials;
/**
* Represents a login request.
+ *
* @author Graham
*/
public final class LoginRequest {
@@ -41,6 +42,7 @@ public final class LoginRequest {
/**
* Creates a login request.
+ *
* @param credentials The player credentials.
* @param randomPair The pair of random number generators.
* @param lowMemory The low memory flag.
@@ -48,8 +50,8 @@ public final class LoginRequest {
* @param releaseNumber The release number.
* @param archiveCrcs The archive CRCs.
*/
- public LoginRequest(PlayerCredentials credentials,
- IsaacRandomPair randomPair, boolean lowMemory, boolean reconnecting, int releaseNumber, int[] archiveCrcs) {
+ public LoginRequest(PlayerCredentials credentials, IsaacRandomPair randomPair, boolean lowMemory,
+ boolean reconnecting, int releaseNumber, int[] archiveCrcs) {
this.credentials = credentials;
this.randomPair = randomPair;
this.lowMemory = lowMemory;
@@ -60,6 +62,7 @@ public final class LoginRequest {
/**
* Gets the player's credentials.
+ *
* @return The player's credentials.
*/
public PlayerCredentials getCredentials() {
@@ -68,6 +71,7 @@ public final class LoginRequest {
/**
* Gets the pair of random number generators.
+ *
* @return The pair of random number generators.
*/
public IsaacRandomPair getRandomPair() {
@@ -76,6 +80,7 @@ public final class LoginRequest {
/**
* Checks if this client is in low memory mode.
+ *
* @return {@code true} if so, {@code false} if not.
*/
public boolean isLowMemory() {
@@ -84,6 +89,7 @@ public final class LoginRequest {
/**
* Checks if this client is reconnecting.
+ *
* @return {@code true} if so, {@code false} if not.
*/
public boolean isReconnecting() {
@@ -92,6 +98,7 @@ public final class LoginRequest {
/**
* Gets the release number.
+ *
* @return The release number.
*/
public int getReleaseNumber() {
@@ -100,6 +107,7 @@ public final class LoginRequest {
/**
* Gets the archive CRCs.
+ *
* @return The array of archive CRCs.
*/
public int[] getArchiveCrcs() {
diff --git a/src/org/apollo/net/codec/login/LoginResponse.java b/src/org/apollo/net/codec/login/LoginResponse.java
index 80c7715a..4c9147d3 100644
--- a/src/org/apollo/net/codec/login/LoginResponse.java
+++ b/src/org/apollo/net/codec/login/LoginResponse.java
@@ -2,6 +2,7 @@ package org.apollo.net.codec.login;
/**
* Represents a login response.
+ *
* @author Graham
*/
public final class LoginResponse {
@@ -23,6 +24,7 @@ public final class LoginResponse {
/**
* Creates the login response.
+ *
* @param status The login status.
* @param rights The rights level.
* @param flagged The flagged flag.
@@ -35,6 +37,7 @@ public final class LoginResponse {
/**
* Gets the status.
+ *
* @return The status.
*/
public int getStatus() {
@@ -43,6 +46,7 @@ public final class LoginResponse {
/**
* Checks if the player should be flagged.
+ *
* @return The flagged flag.
*/
public boolean isFlagged() {
@@ -51,6 +55,7 @@ public final class LoginResponse {
/**
* Gets the rights level.
+ *
* @return The rights level.
*/
public int getRights() {
diff --git a/src/org/apollo/net/codec/login/package-info.java b/src/org/apollo/net/codec/login/package-info.java
index ff8f46db..06638c04 100644
--- a/src/org/apollo/net/codec/login/package-info.java
+++ b/src/org/apollo/net/codec/login/package-info.java
@@ -2,3 +2,4 @@
* Contains codecs for the login protocol.
*/
package org.apollo.net.codec.login;
+
diff --git a/src/org/apollo/net/codec/update/OnDemandRequest.java b/src/org/apollo/net/codec/update/OnDemandRequest.java
index 14064689..762c1098 100644
--- a/src/org/apollo/net/codec/update/OnDemandRequest.java
+++ b/src/org/apollo/net/codec/update/OnDemandRequest.java
@@ -4,41 +4,40 @@ import org.apollo.fs.FileDescriptor;
/**
* Represents a single 'on-demand' request.
+ *
* @author Graham
*/
public final class OnDemandRequest implements Comparable {
/**
* An enumeration containing the different request priorities.
+ *
* @author Graham
*/
public enum Priority {
/**
- * High priority - used in-game when data is required immediately but
- * has not yet been received.
+ * High priority - used in-game when data is required immediately but has not yet been received.
*/
HIGH(0),
/**
- * Medium priority - used while loading the 'bare minimum' required to
- * run the game.
+ * Medium priority - used while loading the 'bare minimum' required to run the game.
*/
MEDIUM(1),
/**
- * Low priority - used when a file is not required urgently. The client
- * login screen says "loading extra files.." when low priority loading
- * is being performed.
+ * Low priority - used when a file is not required urgently. The client login screen says
+ * "loading extra files.." when low priority loading is being performed.
*/
LOW(2);
/**
* Converts the integer value to a priority.
+ *
* @param v The integer value.
* @return The priority.
- * @throws IllegalArgumentException if the value is outside of the
- * range 1-3 inclusive.
+ * @throws IllegalArgumentException if the value is outside of the range 1-3 inclusive.
*/
public static Priority valueOf(int v) {
switch (v) {
@@ -60,6 +59,7 @@ public final class OnDemandRequest implements Comparable {
/**
* Creates a priority.
+ *
* @param intValue The integer value.
*/
private Priority(int intValue) {
@@ -68,6 +68,7 @@ public final class OnDemandRequest implements Comparable {
/**
* Converts the priority to an integer.
+ *
* @return The integer value.
*/
public int toInteger() {
@@ -88,6 +89,7 @@ public final class OnDemandRequest implements Comparable {
/**
* Creates the 'on-demand' request.
+ *
* @param fileDescriptor The file descriptor.
* @param priority The priority.
*/
@@ -98,6 +100,7 @@ public final class OnDemandRequest implements Comparable {
/**
* Gets the file descriptor.
+ *
* @return The file descriptor.
*/
public FileDescriptor getFileDescriptor() {
@@ -106,6 +109,7 @@ public final class OnDemandRequest implements Comparable {
/**
* Gets the priority.
+ *
* @return The priority.
*/
public Priority getPriority() {
diff --git a/src/org/apollo/net/codec/update/OnDemandResponse.java b/src/org/apollo/net/codec/update/OnDemandResponse.java
index 0f2fdc0b..ab28b8bb 100644
--- a/src/org/apollo/net/codec/update/OnDemandResponse.java
+++ b/src/org/apollo/net/codec/update/OnDemandResponse.java
@@ -5,6 +5,7 @@ import org.jboss.netty.buffer.ChannelBuffer;
/**
* Represents a single 'on-demand' response.
+ *
* @author Graham
*/
public final class OnDemandResponse {
@@ -31,6 +32,7 @@ public final class OnDemandResponse {
/**
* Creates the 'on-demand' response.
+ *
* @param fileDescriptor The file descriptor.
* @param fileSize The file size.
* @param chunkId The chunk id.
@@ -45,6 +47,7 @@ public final class OnDemandResponse {
/**
* Gets the file descriptor.
+ *
* @return The file descriptor.
*/
public FileDescriptor getFileDescriptor() {
@@ -53,6 +56,7 @@ public final class OnDemandResponse {
/**
* Gets the file size.
+ *
* @return The file size.
*/
public int getFileSize() {
@@ -61,6 +65,7 @@ public final class OnDemandResponse {
/**
* Gets the chunk id.
+ *
* @return The chunk id.
*/
public int getChunkId() {
@@ -69,6 +74,7 @@ public final class OnDemandResponse {
/**
* Gets the chunk data.
+ *
* @return The chunk data.
*/
public ChannelBuffer getChunkData() {
diff --git a/src/org/apollo/net/codec/update/UpdateDecoder.java b/src/org/apollo/net/codec/update/UpdateDecoder.java
index 7e22e5ea..3d285a40 100644
--- a/src/org/apollo/net/codec/update/UpdateDecoder.java
+++ b/src/org/apollo/net/codec/update/UpdateDecoder.java
@@ -9,6 +9,7 @@ import org.jboss.netty.handler.codec.frame.FrameDecoder;
/**
* A {@link FrameDecoder} for the 'on-demand' protocol.
+ *
* @author Graham
*/
public final class UpdateDecoder extends FrameDecoder {
diff --git a/src/org/apollo/net/codec/update/UpdateEncoder.java b/src/org/apollo/net/codec/update/UpdateEncoder.java
index 6d4261de..2486955d 100644
--- a/src/org/apollo/net/codec/update/UpdateEncoder.java
+++ b/src/org/apollo/net/codec/update/UpdateEncoder.java
@@ -9,6 +9,7 @@ import org.jboss.netty.handler.codec.oneone.OneToOneEncoder;
/**
* A {@link OneToOneEncoder} for the 'on-demand' protocol.
+ *
* @author Graham
*/
public final class UpdateEncoder extends OneToOneEncoder {
diff --git a/src/org/apollo/net/codec/update/package-info.java b/src/org/apollo/net/codec/update/package-info.java
index 354193ef..f352ecdd 100644
--- a/src/org/apollo/net/codec/update/package-info.java
+++ b/src/org/apollo/net/codec/update/package-info.java
@@ -2,3 +2,4 @@
* Contains codecs for the ondemand (update) protocol.
*/
package org.apollo.net.codec.update;
+
diff --git a/src/org/apollo/net/meta/PacketMetaData.java b/src/org/apollo/net/meta/PacketMetaData.java
index 38b14574..8568cf65 100644
--- a/src/org/apollo/net/meta/PacketMetaData.java
+++ b/src/org/apollo/net/meta/PacketMetaData.java
@@ -2,12 +2,14 @@ package org.apollo.net.meta;
/**
* A class which contains meta data for a single type of packet.
+ *
* @author Graham
*/
public final class PacketMetaData {
/**
* Creates a {@link PacketMetaData} object for a fixed-length packet.
+ *
* @param length The length of the packet.
* @return The {@link PacketMetaData} object.
* @throws IllegalArgumentException if length is less than 0.
@@ -20,8 +22,8 @@ public final class PacketMetaData {
}
/**
- * Creates a {@link PacketMetaData} object for a variable byte length
- * packet.
+ * Creates a {@link PacketMetaData} object for a variable byte length packet.
+ *
* @return The {@link PacketMetaData} object.
*/
public static PacketMetaData createVariableByte() {
@@ -29,8 +31,8 @@ public final class PacketMetaData {
}
/**
- * Creates a {@link PacketMetaData} object for a variable short length
- * packet.
+ * Creates a {@link PacketMetaData} object for a variable short length packet.
+ *
* @return The {@link PacketMetaData} object.
*/
public static PacketMetaData createVariableShort() {
@@ -48,9 +50,9 @@ public final class PacketMetaData {
private final int length;
/**
- * Creates the packet meta data object. This should not be called directy.
- * Use the {@link #createFixed(int)}, {@link #createVariableByte()} and
- * {@link #createVariableShort()} methods instead!
+ * Creates the packet meta data object. This should not be called directy. Use the {@link #createFixed(int)},
+ * {@link #createVariableByte()} and {@link #createVariableShort()} methods instead!
+ *
* @param type The type of packet.
* @param length The length of the packet.
*/
@@ -61,6 +63,7 @@ public final class PacketMetaData {
/**
* Gets the type of packet.
+ *
* @return The type of packet.
*/
public PacketType getType() {
@@ -69,6 +72,7 @@ public final class PacketMetaData {
/**
* Gets the length of this packet.
+ *
* @return The length of this packet.
* @throws IllegalStateException if the packet is not a fixed-size packet.
*/
diff --git a/src/org/apollo/net/meta/PacketMetaDataGroup.java b/src/org/apollo/net/meta/PacketMetaDataGroup.java
index 8a4a63a9..66a98d95 100644
--- a/src/org/apollo/net/meta/PacketMetaDataGroup.java
+++ b/src/org/apollo/net/meta/PacketMetaDataGroup.java
@@ -2,16 +2,18 @@ package org.apollo.net.meta;
/**
* A class which contains a group of {@link PacketMetaData} objects.
+ *
* @author Graham
*/
public final class PacketMetaDataGroup {
/**
* Creates a {@link PacketMetaDataGroup} from the packet length array.
+ *
* @param lengthArray The packet length array.
* @return The {@link PacketMetaDataGroup} object.
- * @throws IllegalArgumentException if the array length is not 256 or if
- * there is an element in the array with a value below -3.
+ * @throws IllegalArgumentException if the array length is not 256 or if there is an element in the array with a
+ * value below -3.
*/
public static PacketMetaDataGroup createFromArray(int[] lengthArray) {
if (lengthArray.length != 256) {
@@ -41,8 +43,7 @@ public final class PacketMetaDataGroup {
private final PacketMetaData[] packets = new PacketMetaData[256];
/**
- * This constructor should not be called directly. Use the
- * {@link #createFromArray(int[])} method instead.
+ * This constructor should not be called directly. Use the {@link #createFromArray(int[])} method instead.
*/
private PacketMetaDataGroup() {
@@ -50,11 +51,10 @@ public final class PacketMetaDataGroup {
/**
* Gets the meta data for the specified packet.
+ *
* @param opcode The opcode of the packet.
- * @return The {@link PacketMetaData}, or {@code null} if the packet does
- * not exist.
- * @throws IllegalArgumentException if the opcoe is not in the range 0 to
- * 255.
+ * @return The {@link PacketMetaData}, or {@code null} if the packet does not exist.
+ * @throws IllegalArgumentException if the opcoe is not in the range 0 to 255.
*/
public PacketMetaData getMetaData(int opcode) {
if (opcode < 0 || opcode >= packets.length) {
diff --git a/src/org/apollo/net/meta/PacketType.java b/src/org/apollo/net/meta/PacketType.java
index fc8b4267..539b2aaa 100644
--- a/src/org/apollo/net/meta/PacketType.java
+++ b/src/org/apollo/net/meta/PacketType.java
@@ -2,6 +2,7 @@ package org.apollo.net.meta;
/**
* An enumeration which contains the different types of packets.
+ *
* @author Graham
*/
public enum PacketType {
@@ -12,8 +13,7 @@ public enum PacketType {
RAW,
/**
- * A packet where the length is known by both the client and server
- * already.
+ * A packet where the length is known by both the client and server already.
*/
FIXED,
diff --git a/src/org/apollo/net/meta/package-info.java b/src/org/apollo/net/meta/package-info.java
index 2a356190..22ba04eb 100644
--- a/src/org/apollo/net/meta/package-info.java
+++ b/src/org/apollo/net/meta/package-info.java
@@ -2,3 +2,4 @@
* Contains classes which contain meta data about the protocol/various packets.
*/
package org.apollo.net.meta;
+
diff --git a/src/org/apollo/net/package-info.java b/src/org/apollo/net/package-info.java
index 3939c715..27a4463f 100644
--- a/src/org/apollo/net/package-info.java
+++ b/src/org/apollo/net/package-info.java
@@ -3,3 +3,4 @@
* classes - such as the pipeline factory, handler and codecs.
*/
package org.apollo.net;
+
diff --git a/src/org/apollo/net/release/EventDecoder.java b/src/org/apollo/net/release/EventDecoder.java
index a68f0d11..bf4bacb0 100644
--- a/src/org/apollo/net/release/EventDecoder.java
+++ b/src/org/apollo/net/release/EventDecoder.java
@@ -4,8 +4,9 @@ import org.apollo.game.event.Event;
import org.apollo.net.codec.game.GamePacket;
/**
- * An {@link EventDecoder} decodes a {@link GamePacket} into an {@link Event}
- * object which can be processed by the server.
+ * An {@link EventDecoder} decodes a {@link GamePacket} into an {@link Event} object which can be processed by the
+ * server.
+ *
* @author Graham
* @param The type of {@link Event}.
*/
@@ -13,6 +14,7 @@ public abstract class EventDecoder {
/**
* Decodes the specified packet into an event.
+ *
* @param packet The packet.
* @return The event.
*/
diff --git a/src/org/apollo/net/release/EventEncoder.java b/src/org/apollo/net/release/EventEncoder.java
index e8291b24..23e3a402 100644
--- a/src/org/apollo/net/release/EventEncoder.java
+++ b/src/org/apollo/net/release/EventEncoder.java
@@ -4,8 +4,8 @@ import org.apollo.game.event.Event;
import org.apollo.net.codec.game.GamePacket;
/**
- * An {@link EventEncoder} encodes {@link Event} objects into
- * {@link GamePacket}s which can be sent over the network.
+ * An {@link EventEncoder} encodes {@link Event} objects into {@link GamePacket}s which can be sent over the network.
+ *
* @author Graham
* @param The type of {@link Event}.
*/
@@ -13,6 +13,7 @@ public abstract class EventEncoder {
/**
* Encodes the specified event into a packet.
+ *
* @param event The event.
* @return The packet.
*/
diff --git a/src/org/apollo/net/release/Release.java b/src/org/apollo/net/release/Release.java
index 8a5b57e6..8796a092 100644
--- a/src/org/apollo/net/release/Release.java
+++ b/src/org/apollo/net/release/Release.java
@@ -8,8 +8,8 @@ import org.apollo.net.meta.PacketMetaData;
import org.apollo.net.meta.PacketMetaDataGroup;
/**
- * A {@link Release} is a distinct client version, for example 317 is a common
- * release used in server emulators.
+ * A {@link Release} is a distinct client version, for example 317 is a common release used in server emulators.
+ *
* @author Graham
*/
public abstract class Release {
@@ -36,6 +36,7 @@ public abstract class Release {
/**
* Creates the release.
+ *
* @param releaseNumber The release number.
* @param incomingPacketMetaData The incoming packet meta data.
*/
@@ -46,6 +47,7 @@ public abstract class Release {
/**
* Gets the release number.
+ *
* @return The release number.
*/
public final int getReleaseNumber() {
@@ -54,6 +56,7 @@ public abstract class Release {
/**
* Registers a {@link EventDecoder} for the specified opcode.
+ *
* @param opcode The opcode, between 0 and 255 inclusive.
* @param decoder The {@link EventDecoder}.
*/
@@ -66,6 +69,7 @@ public abstract class Release {
/**
* Registers a {@link EventEncoder} for the specified event type.
+ *
* @param type The event type.
* @param encoder The {@link EventEncoder}.
*/
@@ -75,6 +79,7 @@ public abstract class Release {
/**
* Gets meta data for the specified incoming packet.
+ *
* @param opcode The opcode of the incoming packet.
* @return The {@link PacketMetaData} object.
*/
@@ -84,6 +89,7 @@ public abstract class Release {
/**
* Gets the {@link EventDecoder} for the specified opcode.
+ *
* @param opcode The opcode.
* @return The {@link EventDecoder}.
*/
@@ -96,6 +102,7 @@ public abstract class Release {
/**
* Gets an {@link EventEncoder} for the specified event type.
+ *
* @param type The type of event.
* @return The {@link EventEncoder}.
*/
diff --git a/src/org/apollo/net/release/package-info.java b/src/org/apollo/net/release/package-info.java
index 1e34440c..2b7d85f0 100644
--- a/src/org/apollo/net/release/package-info.java
+++ b/src/org/apollo/net/release/package-info.java
@@ -3,3 +3,4 @@
* allowing for portability between various protocol and client releases.
*/
package org.apollo.net.release;
+
diff --git a/src/org/apollo/net/release/r317/ButtonEventDecoder.java b/src/org/apollo/net/release/r317/ButtonEventDecoder.java
index 8ab8a1e0..6001917b 100644
--- a/src/org/apollo/net/release/r317/ButtonEventDecoder.java
+++ b/src/org/apollo/net/release/r317/ButtonEventDecoder.java
@@ -8,6 +8,7 @@ import org.apollo.net.release.EventDecoder;
/**
* An {@link EventDecoder} for the {@link ButtonEvent}.
+ *
* @author Graham
*/
public final class ButtonEventDecoder extends EventDecoder {
diff --git a/src/org/apollo/net/release/r317/CharacterDesignEventDecoder.java b/src/org/apollo/net/release/r317/CharacterDesignEventDecoder.java
index ff9f70a9..79ee86d4 100644
--- a/src/org/apollo/net/release/r317/CharacterDesignEventDecoder.java
+++ b/src/org/apollo/net/release/r317/CharacterDesignEventDecoder.java
@@ -10,6 +10,7 @@ import org.apollo.net.release.EventDecoder;
/**
* An {@link EventDecoder} for the {@link CharacterDesignEvent}.
+ *
* @author Graham
*/
public final class CharacterDesignEventDecoder extends EventDecoder {
diff --git a/src/org/apollo/net/release/r317/ChatEventDecoder.java b/src/org/apollo/net/release/r317/ChatEventDecoder.java
index dcf764de..4a66464f 100644
--- a/src/org/apollo/net/release/r317/ChatEventDecoder.java
+++ b/src/org/apollo/net/release/r317/ChatEventDecoder.java
@@ -19,10 +19,8 @@ public final class ChatEventDecoder extends EventDecoder {
public ChatEvent decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
- int effects = (int) reader.getUnsigned(DataType.BYTE,
- DataTransformation.SUBTRACT);
- int color = (int) reader.getUnsigned(DataType.BYTE,
- DataTransformation.SUBTRACT);
+ int effects = (int) reader.getUnsigned(DataType.BYTE, DataTransformation.SUBTRACT);
+ int color = (int) reader.getUnsigned(DataType.BYTE, DataTransformation.SUBTRACT);
int length = packet.getLength() - 2;
byte[] originalCompressed = new byte[length];
diff --git a/src/org/apollo/net/release/r317/CloseInterfaceEventEncoder.java b/src/org/apollo/net/release/r317/CloseInterfaceEventEncoder.java
index 7b2c62a2..a7855f3e 100644
--- a/src/org/apollo/net/release/r317/CloseInterfaceEventEncoder.java
+++ b/src/org/apollo/net/release/r317/CloseInterfaceEventEncoder.java
@@ -7,6 +7,7 @@ import org.apollo.net.release.EventEncoder;
/**
* An {@link EventEncoder} for the {@link CloseInterfaceEvent}.
+ *
* @author Graham
*/
public final class CloseInterfaceEventEncoder extends EventEncoder {
diff --git a/src/org/apollo/net/release/r317/ClosedInterfaceEventDecoder.java b/src/org/apollo/net/release/r317/ClosedInterfaceEventDecoder.java
index 63374e28..5c4fb71d 100644
--- a/src/org/apollo/net/release/r317/ClosedInterfaceEventDecoder.java
+++ b/src/org/apollo/net/release/r317/ClosedInterfaceEventDecoder.java
@@ -6,6 +6,7 @@ import org.apollo.net.release.EventDecoder;
/**
* An {@link EventDecoder} for the {@link ClosedInterfaceEvent}.
+ *
* @author Graham
*/
public final class ClosedInterfaceEventDecoder extends EventDecoder {
diff --git a/src/org/apollo/net/release/r317/CommandEventDecoder.java b/src/org/apollo/net/release/r317/CommandEventDecoder.java
index 2b37bf07..1e710550 100644
--- a/src/org/apollo/net/release/r317/CommandEventDecoder.java
+++ b/src/org/apollo/net/release/r317/CommandEventDecoder.java
@@ -7,6 +7,7 @@ import org.apollo.net.release.EventDecoder;
/**
* An {@link EventDecoder} for the {@link CommandEvent}.
+ *
* @author Graham
*/
public final class CommandEventDecoder extends EventDecoder {
diff --git a/src/org/apollo/net/release/r317/EnterAmountEventEncoder.java b/src/org/apollo/net/release/r317/EnterAmountEventEncoder.java
index 94e5d974..8ec09f1d 100644
--- a/src/org/apollo/net/release/r317/EnterAmountEventEncoder.java
+++ b/src/org/apollo/net/release/r317/EnterAmountEventEncoder.java
@@ -8,6 +8,7 @@ import org.jboss.netty.buffer.ChannelBuffers;
/**
* An {@link EventEncoder} for the {@link EnterAmountEvent}.
+ *
* @author Graham
*/
public final class EnterAmountEventEncoder extends EventEncoder {
diff --git a/src/org/apollo/net/release/r317/EnteredAmountEventDecoder.java b/src/org/apollo/net/release/r317/EnteredAmountEventDecoder.java
index fcc7754c..2a8cde4d 100644
--- a/src/org/apollo/net/release/r317/EnteredAmountEventDecoder.java
+++ b/src/org/apollo/net/release/r317/EnteredAmountEventDecoder.java
@@ -8,6 +8,7 @@ import org.apollo.net.release.EventDecoder;
/**
* An {@link EventDecoder} for the {@link EnteredAmountEvent}.
+ *
* @author Graham
*/
public final class EnteredAmountEventDecoder extends EventDecoder {
diff --git a/src/org/apollo/net/release/r317/EquipEventDecoder.java b/src/org/apollo/net/release/r317/EquipEventDecoder.java
index 5bd78739..e890c009 100644
--- a/src/org/apollo/net/release/r317/EquipEventDecoder.java
+++ b/src/org/apollo/net/release/r317/EquipEventDecoder.java
@@ -9,6 +9,7 @@ import org.apollo.net.release.EventDecoder;
/**
* An {@link EventDecoder} for the {@link EquipEvent}.
+ *
* @author Graham
*/
public final class EquipEventDecoder extends EventDecoder {
diff --git a/src/org/apollo/net/release/r317/FifthItemActionEventDecoder.java b/src/org/apollo/net/release/r317/FifthItemActionEventDecoder.java
index 2f2cdbf9..d6109c1b 100644
--- a/src/org/apollo/net/release/r317/FifthItemActionEventDecoder.java
+++ b/src/org/apollo/net/release/r317/FifthItemActionEventDecoder.java
@@ -13,15 +13,13 @@ import org.apollo.net.release.EventDecoder;
*
* @author Graham
*/
-public final class FifthItemActionEventDecoder extends
- EventDecoder {
+public final class FifthItemActionEventDecoder extends EventDecoder {
@Override
public FifthItemActionEvent decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
int slot = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE);
- int interfaceId = (int) reader.getUnsigned(DataType.SHORT,
- DataTransformation.ADD);
+ int interfaceId = (int) reader.getUnsigned(DataType.SHORT, DataTransformation.ADD);
int id = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE);
return new FifthItemActionEvent(interfaceId, id, slot);
}
diff --git a/src/org/apollo/net/release/r317/FirstItemActionEventDecoder.java b/src/org/apollo/net/release/r317/FirstItemActionEventDecoder.java
index ffbe3154..c8a59924 100644
--- a/src/org/apollo/net/release/r317/FirstItemActionEventDecoder.java
+++ b/src/org/apollo/net/release/r317/FirstItemActionEventDecoder.java
@@ -9,6 +9,7 @@ import org.apollo.net.release.EventDecoder;
/**
* An {@link EventDecoder} for the {@link FirstItemActionEvent}.
+ *
* @author Graham
*/
public final class FirstItemActionEventDecoder extends EventDecoder {
diff --git a/src/org/apollo/net/release/r317/FirstObjectActionEventDecoder.java b/src/org/apollo/net/release/r317/FirstObjectActionEventDecoder.java
index 662ff364..408c391b 100644
--- a/src/org/apollo/net/release/r317/FirstObjectActionEventDecoder.java
+++ b/src/org/apollo/net/release/r317/FirstObjectActionEventDecoder.java
@@ -14,16 +14,13 @@ import org.apollo.net.release.EventDecoder;
*
* @author Graham
*/
-public final class FirstObjectActionEventDecoder extends
- EventDecoder {
+public final class FirstObjectActionEventDecoder extends EventDecoder {
public FirstObjectActionEvent decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
- int x = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE,
- DataTransformation.ADD);
+ int x = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE, DataTransformation.ADD);
int id = (int) reader.getUnsigned(DataType.SHORT);
- int y = (int) reader
- .getUnsigned(DataType.SHORT, DataTransformation.ADD);
+ int y = (int) reader.getUnsigned(DataType.SHORT, DataTransformation.ADD);
return new FirstObjectActionEvent(id, new Position(x, y));
}
diff --git a/src/org/apollo/net/release/r317/FourthItemActionEventDecoder.java b/src/org/apollo/net/release/r317/FourthItemActionEventDecoder.java
index 5b6b1594..9f37ec62 100644
--- a/src/org/apollo/net/release/r317/FourthItemActionEventDecoder.java
+++ b/src/org/apollo/net/release/r317/FourthItemActionEventDecoder.java
@@ -9,6 +9,7 @@ import org.apollo.net.release.EventDecoder;
/**
* An {@link EventDecoder} for the {@link FourthItemActionEvent}.
+ *
* @author Graham
*/
public final class FourthItemActionEventDecoder extends EventDecoder {
diff --git a/src/org/apollo/net/release/r317/IdAssignmentEventEncoder.java b/src/org/apollo/net/release/r317/IdAssignmentEventEncoder.java
index faf3bbdb..dc33a7f3 100644
--- a/src/org/apollo/net/release/r317/IdAssignmentEventEncoder.java
+++ b/src/org/apollo/net/release/r317/IdAssignmentEventEncoder.java
@@ -10,6 +10,7 @@ import org.apollo.net.release.EventEncoder;
/**
* An {@link EventEncoder} for the {@link IdAssignmentEvent}.
+ *
* @author Graham
*/
public final class IdAssignmentEventEncoder extends EventEncoder {
diff --git a/src/org/apollo/net/release/r317/KeepAliveEventDecoder.java b/src/org/apollo/net/release/r317/KeepAliveEventDecoder.java
index 29ee57d5..a2fe1b26 100644
--- a/src/org/apollo/net/release/r317/KeepAliveEventDecoder.java
+++ b/src/org/apollo/net/release/r317/KeepAliveEventDecoder.java
@@ -6,6 +6,7 @@ import org.apollo.net.release.EventDecoder;
/**
* A {@link EventDecoder} for the {@link KeepAliveEvent}.
+ *
* @author Graham
*/
public final class KeepAliveEventDecoder extends EventDecoder {
diff --git a/src/org/apollo/net/release/r317/LogoutEventEncoder.java b/src/org/apollo/net/release/r317/LogoutEventEncoder.java
index 370f9f1d..23874648 100644
--- a/src/org/apollo/net/release/r317/LogoutEventEncoder.java
+++ b/src/org/apollo/net/release/r317/LogoutEventEncoder.java
@@ -7,6 +7,7 @@ import org.apollo.net.release.EventEncoder;
/**
* An {@link EventEncoder} for the {@link LogoutEvent}.
+ *
* @author Graham
*/
public final class LogoutEventEncoder extends EventEncoder {
diff --git a/src/org/apollo/net/release/r317/OpenInterfaceEventEncoder.java b/src/org/apollo/net/release/r317/OpenInterfaceEventEncoder.java
index 8cf62503..99b62376 100644
--- a/src/org/apollo/net/release/r317/OpenInterfaceEventEncoder.java
+++ b/src/org/apollo/net/release/r317/OpenInterfaceEventEncoder.java
@@ -8,6 +8,7 @@ import org.apollo.net.release.EventEncoder;
/**
* An {@link EventEncoder} for the {@link OpenInterfaceEvent}.
+ *
* @author Graham
*/
public final class OpenInterfaceEventEncoder extends EventEncoder {
diff --git a/src/org/apollo/net/release/r317/OpenInterfaceSidebarEventEncoder.java b/src/org/apollo/net/release/r317/OpenInterfaceSidebarEventEncoder.java
index 08e022c3..56a40fe6 100644
--- a/src/org/apollo/net/release/r317/OpenInterfaceSidebarEventEncoder.java
+++ b/src/org/apollo/net/release/r317/OpenInterfaceSidebarEventEncoder.java
@@ -9,6 +9,7 @@ import org.apollo.net.release.EventEncoder;
/**
* An {@link EventEncoder} for the {@link OpenInterfaceSidebarEvent}.
+ *
* @author Graham
*/
public final class OpenInterfaceSidebarEventEncoder extends EventEncoder {
diff --git a/src/org/apollo/net/release/r317/PlayerSynchronizationEventEncoder.java b/src/org/apollo/net/release/r317/PlayerSynchronizationEventEncoder.java
index 4684c194..49d65017 100644
--- a/src/org/apollo/net/release/r317/PlayerSynchronizationEventEncoder.java
+++ b/src/org/apollo/net/release/r317/PlayerSynchronizationEventEncoder.java
@@ -35,13 +35,11 @@ import org.apollo.net.release.EventEncoder;
*
* @author Graham
*/
-public final class PlayerSynchronizationEventEncoder extends
- EventEncoder {
+public final class PlayerSynchronizationEventEncoder extends EventEncoder {
@Override
public GamePacket encode(PlayerSynchronizationEvent event) {
- GamePacketBuilder builder = new GamePacketBuilder(81,
- PacketType.VARIABLE_SHORT);
+ GamePacketBuilder builder = new GamePacketBuilder(81, PacketType.VARIABLE_SHORT);
builder.switchToBitAccess();
GamePacketBuilder blockBuilder = new GamePacketBuilder();
@@ -56,8 +54,7 @@ public final class PlayerSynchronizationEventEncoder extends
if (type == SegmentType.REMOVE_CHARACTER) {
putRemoveCharacterUpdate(builder);
} else if (type == SegmentType.ADD_CHARACTER) {
- putAddCharacterUpdate((AddCharacterSegment) segment, event,
- builder);
+ putAddCharacterUpdate((AddCharacterSegment) segment, event, builder);
putBlocks(segment, blockBuilder);
} else {
putMovementUpdate(segment, event, builder);
@@ -79,8 +76,7 @@ public final class PlayerSynchronizationEventEncoder extends
/**
* Puts a remove character update.
*
- * @param builder
- * The builder.
+ * @param builder The builder.
*/
private void putRemoveCharacterUpdate(GamePacketBuilder builder) {
builder.putBits(1, 1);
@@ -90,15 +86,12 @@ public final class PlayerSynchronizationEventEncoder extends
/**
* Puts an add character update.
*
- * @param seg
- * The segment.
- * @param event
- * The event.
- * @param builder
- * The builder.
+ * @param seg The segment.
+ * @param event The event.
+ * @param builder The builder.
*/
- private void putAddCharacterUpdate(AddCharacterSegment seg,
- PlayerSynchronizationEvent event, GamePacketBuilder builder) {
+ private void putAddCharacterUpdate(AddCharacterSegment seg, PlayerSynchronizationEvent event,
+ GamePacketBuilder builder) {
boolean updateRequired = seg.getBlockSet().size() > 0;
Position player = event.getPosition();
Position other = seg.getPosition();
@@ -112,15 +105,12 @@ public final class PlayerSynchronizationEventEncoder extends
/**
* Puts a movement update for the specified segment.
*
- * @param seg
- * The segment.
- * @param event
- * The event.
- * @param builder
- * The builder.
+ * @param seg The segment.
+ * @param event The event.
+ * @param builder The builder.
*/
- private void putMovementUpdate(SynchronizationSegment seg,
- PlayerSynchronizationEvent event, GamePacketBuilder builder) {
+ private void putMovementUpdate(SynchronizationSegment seg, PlayerSynchronizationEvent event,
+ GamePacketBuilder builder) {
boolean updateRequired = seg.getBlockSet().size() > 0;
if (seg.getType() == SegmentType.TELEPORT) {
Position pos = ((TeleportSegment) seg).getDestination();
@@ -157,13 +147,10 @@ public final class PlayerSynchronizationEventEncoder extends
/**
* Puts the blocks for the specified segment.
*
- * @param segment
- * The segment.
- * @param blockBuilder
- * The block builder.
+ * @param segment The segment.
+ * @param blockBuilder The block builder.
*/
- private void putBlocks(SynchronizationSegment segment,
- GamePacketBuilder blockBuilder) {
+ private void putBlocks(SynchronizationSegment segment, GamePacketBuilder blockBuilder) {
SynchronizationBlockSet blockSet = segment.getBlockSet();
if (blockSet.size() > 0) {
int mask = 0;
@@ -200,8 +187,7 @@ public final class PlayerSynchronizationEventEncoder extends
}
if (blockSet.contains(AnimationBlock.class)) {
- putAnimationBlock(blockSet.get(AnimationBlock.class),
- blockBuilder);
+ putAnimationBlock(blockSet.get(AnimationBlock.class), blockBuilder);
}
if (blockSet.contains(ChatBlock.class)) {
@@ -209,13 +195,11 @@ public final class PlayerSynchronizationEventEncoder extends
}
if (blockSet.contains(AppearanceBlock.class)) {
- putAppearanceBlock(blockSet.get(AppearanceBlock.class),
- blockBuilder);
+ putAppearanceBlock(blockSet.get(AppearanceBlock.class), blockBuilder);
}
if (blockSet.contains(TurnToPositionBlock.class)) {
- putTurnToPositionBlock(blockSet.get(TurnToPositionBlock.class),
- blockBuilder);
+ putTurnToPositionBlock(blockSet.get(TurnToPositionBlock.class), blockBuilder);
}
}
}
@@ -223,79 +207,60 @@ public final class PlayerSynchronizationEventEncoder extends
/**
* Puts a turn to position block into the specified builder.
*
- * @param block
- * The block.
- * @param blockBuilder
- * The builder.
+ * @param block The block.
+ * @param blockBuilder The builder.
*/
- private void putTurnToPositionBlock(TurnToPositionBlock block,
- GamePacketBuilder blockBuilder) {
+ private void putTurnToPositionBlock(TurnToPositionBlock block, GamePacketBuilder blockBuilder) {
Position pos = block.getPosition();
- blockBuilder.put(DataType.SHORT, DataOrder.LITTLE,
- DataTransformation.ADD, pos.getX() * 2 + 1);
+ blockBuilder.put(DataType.SHORT, DataOrder.LITTLE, DataTransformation.ADD, pos.getX() * 2 + 1);
blockBuilder.put(DataType.SHORT, DataOrder.LITTLE, pos.getY() * 2 + 1);
}
/**
* Puts a graphic block into the specified builder.
*
- * @param block
- * The block.
- * @param blockBuilder
- * The builder.
+ * @param block The block.
+ * @param blockBuilder The builder.
*/
- private void putGraphicBlock(GraphicBlock block,
- GamePacketBuilder blockBuilder) {
+ private void putGraphicBlock(GraphicBlock block, GamePacketBuilder blockBuilder) {
Graphic graphic = block.getGraphic();
blockBuilder.put(DataType.SHORT, DataOrder.LITTLE, graphic.getId());
- blockBuilder.put(DataType.INT,
- (graphic.getHeight() << 16) | (graphic.getDelay() & 0xFFFF));
+ blockBuilder.put(DataType.INT, (graphic.getHeight() << 16) | (graphic.getDelay() & 0xFFFF));
}
/**
* Puts an animation block into the specified builder.
*
- * @param block
- * The block.
- * @param blockBuilder
- * The builder.
+ * @param block The block.
+ * @param blockBuilder The builder.
*/
- private void putAnimationBlock(AnimationBlock block,
- GamePacketBuilder blockBuilder) {
+ private void putAnimationBlock(AnimationBlock block, GamePacketBuilder blockBuilder) {
Animation animation = block.getAnimation();
blockBuilder.put(DataType.SHORT, DataOrder.LITTLE, animation.getId());
- blockBuilder.put(DataType.BYTE, DataTransformation.NEGATE,
- animation.getDelay());
+ blockBuilder.put(DataType.BYTE, DataTransformation.NEGATE, animation.getDelay());
}
/**
* Puts a chat block into the specified builder.
*
- * @param block
- * The block.
- * @param blockBuilder
- * The builder.
+ * @param block The block.
+ * @param blockBuilder The builder.
*/
private void putChatBlock(ChatBlock block, GamePacketBuilder blockBuilder) {
byte[] bytes = block.getCompressedMessage();
- blockBuilder.put(DataType.SHORT, DataOrder.LITTLE,
- (block.getTextColor() << 8) | block.getTextEffects());
+ blockBuilder.put(DataType.SHORT, DataOrder.LITTLE, (block.getTextColor() << 8) | block.getTextEffects());
blockBuilder.put(DataType.BYTE, block.getPrivilegeLevel().toInteger());
- blockBuilder
- .put(DataType.BYTE, DataTransformation.NEGATE, bytes.length);
+ blockBuilder.put(DataType.BYTE, DataTransformation.NEGATE, bytes.length);
blockBuilder.putBytesReverse(bytes);
}
/**
* Puts an appearance block into the specified builder.
*
- * @param block
- * The block.
- * @param blockBuilder
- * The builder.
+ * @param block The block.
+ * @param blockBuilder The builder.
*/
- private void putAppearanceBlock(AppearanceBlock block,
- GamePacketBuilder blockBuilder) {
+ private void putAppearanceBlock(AppearanceBlock block, GamePacketBuilder blockBuilder) {
Appearance appearance = block.getAppearance();
GamePacketBuilder playerProperties = new GamePacketBuilder();
@@ -370,8 +335,7 @@ public final class PlayerSynchronizationEventEncoder extends
if (helm != null) {
def = EquipmentDefinition.forId(helm.getId());
}
- if ((def != null && (def.isFullHat() || def.isFullMask()))
- || appearance.getGender() == Gender.FEMALE) {
+ if ((def != null && (def.isFullHat() || def.isFullMask())) || appearance.getGender() == Gender.FEMALE) {
playerProperties.put(DataType.BYTE, 0);
} else {
playerProperties.put(DataType.SHORT, 0x100 + style[1]);
@@ -397,8 +361,7 @@ public final class PlayerSynchronizationEventEncoder extends
// skill
// level
- blockBuilder.put(DataType.BYTE, DataTransformation.NEGATE,
- playerProperties.getLength());
+ blockBuilder.put(DataType.BYTE, DataTransformation.NEGATE, playerProperties.getLength());
blockBuilder.putRawBuilder(playerProperties);
}
diff --git a/src/org/apollo/net/release/r317/RegionChangeEventEncoder.java b/src/org/apollo/net/release/r317/RegionChangeEventEncoder.java
index a28f9d94..d883d9b2 100644
--- a/src/org/apollo/net/release/r317/RegionChangeEventEncoder.java
+++ b/src/org/apollo/net/release/r317/RegionChangeEventEncoder.java
@@ -9,6 +9,7 @@ import org.apollo.net.release.EventEncoder;
/**
* An {@link EventEncoder} for the {@link RegionChangeEvent}.
+ *
* @author Graham
*/
public final class RegionChangeEventEncoder extends EventEncoder {
diff --git a/src/org/apollo/net/release/r317/Release317.java b/src/org/apollo/net/release/r317/Release317.java
index b5612d2b..8ae65b1d 100644
--- a/src/org/apollo/net/release/r317/Release317.java
+++ b/src/org/apollo/net/release/r317/Release317.java
@@ -19,6 +19,7 @@ import org.apollo.net.release.Release;
/**
* An implementation of {@link Release} for the 317 protocol.
+ *
* @author Graham
*/
public final class Release317 extends Release {
@@ -26,33 +27,32 @@ public final class Release317 extends Release {
/**
* The incoming packet lengths array.
*/
- public static final int[] PACKET_LENGTHS = {
- 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, // 0
- 0, 0, 0, 0, 8, 0, 6, 2, 2, 0, // 10
- 0, 2, 0, 6, 0, 12, 0, 0, 0, 0, // 20
- 0, 0, 0, 0, 0, 8, 4, 0, 0, 2, // 30
- 2, 6, 0, 6, 0, -1, 0, 0, 0, 0, // 40
- 0, 0, 0, 12, 0, 0, 0, 0, 8, 0, // 50
- 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, // 60
- 6, 0, 2, 2, 8, 6, 0, -1, 0, 6, // 70
- 0, 0, 0, 0, 0, 1, 4, 6, 0, 0, // 80
- 0, 0, 0, 0, 0, 3, 0, 0, -1, 0, // 90
- 0, 13, 0, -1, 0, 0, 0, 0, 0, 0, // 100
- 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, // 110
- 1, 0, 6, 0, 0, 0, -1, 0, 2, 6, // 120
- 0, 4, 6, 8, 0, 6, 0, 0, 0, 2, // 130
- 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, // 140
- 0, 0, 1, 2, 0, 2, 6, 0, 0, 0, // 150
- 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, // 160
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 170
- 0, 8, 0, 3, 0, 2, 0, 0, 8, 1, // 180
- 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, // 190
- 2, 0, 0, 0, 0, 0, 0, 0, 4, 0, // 200
- 4, 0, 0, 0, 7, 8, 0, 0, 10, 0, // 210
- 0, 0, 0, 0, 0, 0, -1, 0, 6, 0, // 220
- 1, 0, 0, 0, 6, 0, 6, 8, 1, 0, // 230
- 0, 4, 0, 0, 0, 0, -1, 0, -1, 4, // 240
- 0, 0, 6, 6, 0, 0, // 250
+ public static final int[] PACKET_LENGTHS = { 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, // 0
+ 0, 0, 0, 0, 8, 0, 6, 2, 2, 0, // 10
+ 0, 2, 0, 6, 0, 12, 0, 0, 0, 0, // 20
+ 0, 0, 0, 0, 0, 8, 4, 0, 0, 2, // 30
+ 2, 6, 0, 6, 0, -1, 0, 0, 0, 0, // 40
+ 0, 0, 0, 12, 0, 0, 0, 0, 8, 0, // 50
+ 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, // 60
+ 6, 0, 2, 2, 8, 6, 0, -1, 0, 6, // 70
+ 0, 0, 0, 0, 0, 1, 4, 6, 0, 0, // 80
+ 0, 0, 0, 0, 0, 3, 0, 0, -1, 0, // 90
+ 0, 13, 0, -1, 0, 0, 0, 0, 0, 0, // 100
+ 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, // 110
+ 1, 0, 6, 0, 0, 0, -1, 0, 2, 6, // 120
+ 0, 4, 6, 8, 0, 6, 0, 0, 0, 2, // 130
+ 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, // 140
+ 0, 0, 1, 2, 0, 2, 6, 0, 0, 0, // 150
+ 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, // 160
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 170
+ 0, 8, 0, 3, 0, 2, 0, 0, 8, 1, // 180
+ 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, // 190
+ 2, 0, 0, 0, 0, 0, 0, 0, 4, 0, // 200
+ 4, 0, 0, 0, 7, 8, 0, 0, 10, 0, // 210
+ 0, 0, 0, 0, 0, 0, -1, 0, 6, 0, // 220
+ 1, 0, 0, 0, 6, 0, 6, 8, 1, 0, // 230
+ 0, 4, 0, 0, 0, 0, -1, 0, -1, 4, // 240
+ 0, 0, 6, 6, 0, 0, // 250
};
/**
diff --git a/src/org/apollo/net/release/r317/SecondItemActionEventDecoder.java b/src/org/apollo/net/release/r317/SecondItemActionEventDecoder.java
index 94820c55..f93d0294 100644
--- a/src/org/apollo/net/release/r317/SecondItemActionEventDecoder.java
+++ b/src/org/apollo/net/release/r317/SecondItemActionEventDecoder.java
@@ -13,16 +13,13 @@ import org.apollo.net.release.EventDecoder;
*
* @author Graham
*/
-public final class SecondItemActionEventDecoder extends
- EventDecoder {
+public final class SecondItemActionEventDecoder extends EventDecoder {
@Override
public SecondItemActionEvent decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
- int interfaceId = (int) reader.getUnsigned(DataType.SHORT,
- DataOrder.LITTLE, DataTransformation.ADD);
- int id = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE,
- DataTransformation.ADD);
+ int interfaceId = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE, DataTransformation.ADD);
+ int id = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE, DataTransformation.ADD);
int slot = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE);
return new SecondItemActionEvent(interfaceId, id, slot);
}
diff --git a/src/org/apollo/net/release/r317/SecondObjectActionEventDecoder.java b/src/org/apollo/net/release/r317/SecondObjectActionEventDecoder.java
index bf9891fb..70f09885 100644
--- a/src/org/apollo/net/release/r317/SecondObjectActionEventDecoder.java
+++ b/src/org/apollo/net/release/r317/SecondObjectActionEventDecoder.java
@@ -11,6 +11,7 @@ import org.apollo.net.release.EventDecoder;
/**
* An {@link EventDecoder} for the {@link SecondObjectActionEvent}.
+ *
* @author Graham
*/
public final class SecondObjectActionEventDecoder extends EventDecoder {
diff --git a/src/org/apollo/net/release/r317/ServerMessageEventEncoder.java b/src/org/apollo/net/release/r317/ServerMessageEventEncoder.java
index 7875e0d6..4de791d3 100644
--- a/src/org/apollo/net/release/r317/ServerMessageEventEncoder.java
+++ b/src/org/apollo/net/release/r317/ServerMessageEventEncoder.java
@@ -8,6 +8,7 @@ import org.apollo.net.release.EventEncoder;
/**
* An {@link EventEncoder} for the {@link ServerMessageEvent}.
+ *
* @author Graham
*/
public final class ServerMessageEventEncoder extends EventEncoder {
diff --git a/src/org/apollo/net/release/r317/SetInterfaceTextEventEncoder.java b/src/org/apollo/net/release/r317/SetInterfaceTextEventEncoder.java
index 148035ae..70183c65 100644
--- a/src/org/apollo/net/release/r317/SetInterfaceTextEventEncoder.java
+++ b/src/org/apollo/net/release/r317/SetInterfaceTextEventEncoder.java
@@ -13,16 +13,13 @@ import org.apollo.net.release.EventEncoder;
*
* @author The Wanderer
*/
-public final class SetInterfaceTextEventEncoder extends
- EventEncoder {
+public final class SetInterfaceTextEventEncoder extends EventEncoder {
@Override
public GamePacket encode(SetInterfaceTextEvent event) {
- GamePacketBuilder builder = new GamePacketBuilder(126,
- PacketType.VARIABLE_SHORT);
+ GamePacketBuilder builder = new GamePacketBuilder(126, PacketType.VARIABLE_SHORT);
builder.putString(event.getText());
- builder.put(DataType.SHORT, DataTransformation.ADD,
- event.getInterfaceId());
+ builder.put(DataType.SHORT, DataTransformation.ADD, event.getInterfaceId());
return builder.toGamePacket();
}
diff --git a/src/org/apollo/net/release/r317/SwitchItemEventDecoder.java b/src/org/apollo/net/release/r317/SwitchItemEventDecoder.java
index ca9f5513..12c00f30 100644
--- a/src/org/apollo/net/release/r317/SwitchItemEventDecoder.java
+++ b/src/org/apollo/net/release/r317/SwitchItemEventDecoder.java
@@ -18,14 +18,10 @@ public final class SwitchItemEventDecoder extends EventDecoder
@Override
public SwitchItemEvent decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
- int interfaceId = (int) reader.getUnsigned(DataType.SHORT,
- DataOrder.LITTLE, DataTransformation.ADD);
- boolean inserting = reader.getUnsigned(DataType.BYTE,
- DataTransformation.NEGATE) == 1;
- int oldSlot = (int) reader.getUnsigned(DataType.SHORT,
- DataOrder.LITTLE, DataTransformation.ADD);
- int newSlot = (int) reader
- .getUnsigned(DataType.SHORT, DataOrder.LITTLE);
+ int interfaceId = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE, DataTransformation.ADD);
+ boolean inserting = reader.getUnsigned(DataType.BYTE, DataTransformation.NEGATE) == 1;
+ int oldSlot = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE, DataTransformation.ADD);
+ int newSlot = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE);
return new SwitchItemEvent(interfaceId, inserting, oldSlot, newSlot);
}
diff --git a/src/org/apollo/net/release/r317/SwitchTabInterfaceEventEncoder.java b/src/org/apollo/net/release/r317/SwitchTabInterfaceEventEncoder.java
index 0a52591b..4c20ad43 100644
--- a/src/org/apollo/net/release/r317/SwitchTabInterfaceEventEncoder.java
+++ b/src/org/apollo/net/release/r317/SwitchTabInterfaceEventEncoder.java
@@ -9,6 +9,7 @@ import org.apollo.net.release.EventEncoder;
/**
* An {@link EventEncoder} for the {@link SwitchTabInterfaceEvent}.
+ *
* @author Graham
*/
public final class SwitchTabInterfaceEventEncoder extends EventEncoder {
diff --git a/src/org/apollo/net/release/r317/ThirdItemActionEventDecoder.java b/src/org/apollo/net/release/r317/ThirdItemActionEventDecoder.java
index 72ad45ec..e2082abf 100644
--- a/src/org/apollo/net/release/r317/ThirdItemActionEventDecoder.java
+++ b/src/org/apollo/net/release/r317/ThirdItemActionEventDecoder.java
@@ -13,18 +13,14 @@ import org.apollo.net.release.EventDecoder;
*
* @author Graham
*/
-public final class ThirdItemActionEventDecoder extends
- EventDecoder {
+public final class ThirdItemActionEventDecoder extends EventDecoder {
@Override
public ThirdItemActionEvent decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
- int interfaceId = (int) reader.getUnsigned(DataType.SHORT,
- DataOrder.LITTLE);
- int id = (int) reader.getUnsigned(DataType.SHORT,
- DataTransformation.ADD);
- int slot = (int) reader.getUnsigned(DataType.SHORT,
- DataTransformation.ADD);
+ int interfaceId = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE);
+ int id = (int) reader.getUnsigned(DataType.SHORT, DataTransformation.ADD);
+ int slot = (int) reader.getUnsigned(DataType.SHORT, DataTransformation.ADD);
return new ThirdItemActionEvent(interfaceId, id, slot);
}
diff --git a/src/org/apollo/net/release/r317/ThirdObjectActionEventDecoder.java b/src/org/apollo/net/release/r317/ThirdObjectActionEventDecoder.java
index b42b76d8..47a8d4f4 100644
--- a/src/org/apollo/net/release/r317/ThirdObjectActionEventDecoder.java
+++ b/src/org/apollo/net/release/r317/ThirdObjectActionEventDecoder.java
@@ -11,6 +11,7 @@ import org.apollo.net.release.EventDecoder;
/**
* An {@link EventDecoder} for the {@link ThirdObjectActionEvent}.
+ *
* @author Graham
*/
public final class ThirdObjectActionEventDecoder extends EventDecoder {
diff --git a/src/org/apollo/net/release/r317/UpdateItemsEventEncoder.java b/src/org/apollo/net/release/r317/UpdateItemsEventEncoder.java
index 3e27a3e9..9cfb7c01 100644
--- a/src/org/apollo/net/release/r317/UpdateItemsEventEncoder.java
+++ b/src/org/apollo/net/release/r317/UpdateItemsEventEncoder.java
@@ -12,6 +12,7 @@ import org.apollo.net.release.EventEncoder;
/**
* An {@link EventEncoder} for the {@link UpdateItemsEvent}.
+ *
* @author Graham
*/
public final class UpdateItemsEventEncoder extends EventEncoder {
diff --git a/src/org/apollo/net/release/r317/UpdateSkillEventEncoder.java b/src/org/apollo/net/release/r317/UpdateSkillEventEncoder.java
index bf2893ef..f6710351 100644
--- a/src/org/apollo/net/release/r317/UpdateSkillEventEncoder.java
+++ b/src/org/apollo/net/release/r317/UpdateSkillEventEncoder.java
@@ -10,6 +10,7 @@ import org.apollo.net.release.EventEncoder;
/**
* An {@link EventEncoder} for the {@link UpdateSkillEvent}.
+ *
* @author Graham
*/
public final class UpdateSkillEventEncoder extends EventEncoder {
diff --git a/src/org/apollo/net/release/r317/UpdateSlottedItemsEventEncoder.java b/src/org/apollo/net/release/r317/UpdateSlottedItemsEventEncoder.java
index 919bd3e7..dab09a81 100644
--- a/src/org/apollo/net/release/r317/UpdateSlottedItemsEventEncoder.java
+++ b/src/org/apollo/net/release/r317/UpdateSlottedItemsEventEncoder.java
@@ -11,6 +11,7 @@ import org.apollo.net.release.EventEncoder;
/**
* An {@link EventEncoder} for the {@link UpdateSlottedItemsEvent}.
+ *
* @author Graham
*/
public final class UpdateSlottedItemsEventEncoder extends EventEncoder {
diff --git a/src/org/apollo/net/release/r317/WalkEventDecoder.java b/src/org/apollo/net/release/r317/WalkEventDecoder.java
index 1bf20d7e..caf554fa 100644
--- a/src/org/apollo/net/release/r317/WalkEventDecoder.java
+++ b/src/org/apollo/net/release/r317/WalkEventDecoder.java
@@ -11,6 +11,7 @@ import org.apollo.net.release.EventDecoder;
/**
* An {@link EventDecoder} for the {@link WalkEvent}.
+ *
* @author Graham
*/
public final class WalkEventDecoder extends EventDecoder {
diff --git a/src/org/apollo/net/release/r317/package-info.java b/src/org/apollo/net/release/r317/package-info.java
index eac8d8a6..cbb87f69 100644
--- a/src/org/apollo/net/release/r317/package-info.java
+++ b/src/org/apollo/net/release/r317/package-info.java
@@ -2,3 +2,4 @@
* Contains codecs for the 317 release.
*/
package org.apollo.net.release.r317;
+
diff --git a/src/org/apollo/net/release/r377/ButtonEventDecoder.java b/src/org/apollo/net/release/r377/ButtonEventDecoder.java
index aa967ae6..b9c70a75 100644
--- a/src/org/apollo/net/release/r377/ButtonEventDecoder.java
+++ b/src/org/apollo/net/release/r377/ButtonEventDecoder.java
@@ -8,6 +8,7 @@ import org.apollo.net.release.EventDecoder;
/**
* An {@link EventDecoder} for the {@link ButtonEvent}.
+ *
* @author Graham
*/
public final class ButtonEventDecoder extends EventDecoder {
diff --git a/src/org/apollo/net/release/r377/CharacterDesignEventDecoder.java b/src/org/apollo/net/release/r377/CharacterDesignEventDecoder.java
index 80585edd..2f632cb1 100644
--- a/src/org/apollo/net/release/r377/CharacterDesignEventDecoder.java
+++ b/src/org/apollo/net/release/r377/CharacterDesignEventDecoder.java
@@ -10,6 +10,7 @@ import org.apollo.net.release.EventDecoder;
/**
* An {@link EventDecoder} for the {@link CharacterDesignEvent}.
+ *
* @author Graham
*/
public final class CharacterDesignEventDecoder extends EventDecoder {
diff --git a/src/org/apollo/net/release/r377/ChatEventDecoder.java b/src/org/apollo/net/release/r377/ChatEventDecoder.java
index 252c433b..e6b09818 100644
--- a/src/org/apollo/net/release/r377/ChatEventDecoder.java
+++ b/src/org/apollo/net/release/r377/ChatEventDecoder.java
@@ -10,6 +10,7 @@ import org.apollo.util.TextUtil;
/**
* An {@link EventDecoder} for the {@link ChatEvent}.
+ *
* @author Graham
*/
public final class ChatEventDecoder extends EventDecoder {
diff --git a/src/org/apollo/net/release/r377/CloseInterfaceEventEncoder.java b/src/org/apollo/net/release/r377/CloseInterfaceEventEncoder.java
index 1bfd8529..89245df3 100644
--- a/src/org/apollo/net/release/r377/CloseInterfaceEventEncoder.java
+++ b/src/org/apollo/net/release/r377/CloseInterfaceEventEncoder.java
@@ -7,6 +7,7 @@ import org.apollo.net.release.EventEncoder;
/**
* An {@link EventEncoder} for the {@link CloseInterfaceEvent}.
+ *
* @author Graham
*/
public final class CloseInterfaceEventEncoder extends EventEncoder {
diff --git a/src/org/apollo/net/release/r377/ClosedInterfaceEventDecoder.java b/src/org/apollo/net/release/r377/ClosedInterfaceEventDecoder.java
index 20df1b63..bc4ae221 100644
--- a/src/org/apollo/net/release/r377/ClosedInterfaceEventDecoder.java
+++ b/src/org/apollo/net/release/r377/ClosedInterfaceEventDecoder.java
@@ -6,6 +6,7 @@ import org.apollo.net.release.EventDecoder;
/**
* An {@link EventDecoder} for the {@link ClosedInterfaceEvent}.
+ *
* @author Graham
*/
public final class ClosedInterfaceEventDecoder extends EventDecoder {
diff --git a/src/org/apollo/net/release/r377/CommandEventDecoder.java b/src/org/apollo/net/release/r377/CommandEventDecoder.java
index 151e397a..cb49beaf 100644
--- a/src/org/apollo/net/release/r377/CommandEventDecoder.java
+++ b/src/org/apollo/net/release/r377/CommandEventDecoder.java
@@ -7,6 +7,7 @@ import org.apollo.net.release.EventDecoder;
/**
* An {@link EventDecoder} for the {@link CommandEvent}.
+ *
* @author Graham
*/
public final class CommandEventDecoder extends EventDecoder {
diff --git a/src/org/apollo/net/release/r377/EnterAmountEventEncoder.java b/src/org/apollo/net/release/r377/EnterAmountEventEncoder.java
index c74cfa8e..796871f8 100644
--- a/src/org/apollo/net/release/r377/EnterAmountEventEncoder.java
+++ b/src/org/apollo/net/release/r377/EnterAmountEventEncoder.java
@@ -8,6 +8,7 @@ import org.jboss.netty.buffer.ChannelBuffers;
/**
* An {@link EventEncoder} for the {@link EnterAmountEvent}.
+ *
* @author Graham
*/
public final class EnterAmountEventEncoder extends EventEncoder {
diff --git a/src/org/apollo/net/release/r377/EnteredAmountEventDecoder.java b/src/org/apollo/net/release/r377/EnteredAmountEventDecoder.java
index 2a18a175..fa0d30a6 100644
--- a/src/org/apollo/net/release/r377/EnteredAmountEventDecoder.java
+++ b/src/org/apollo/net/release/r377/EnteredAmountEventDecoder.java
@@ -8,6 +8,7 @@ import org.apollo.net.release.EventDecoder;
/**
* An {@link EventDecoder} for the {@link EnteredAmountEvent}.
+ *
* @author Graham
*/
public final class EnteredAmountEventDecoder extends EventDecoder {
diff --git a/src/org/apollo/net/release/r377/EquipEventDecoder.java b/src/org/apollo/net/release/r377/EquipEventDecoder.java
index 3f0ecf57..6211a52d 100644
--- a/src/org/apollo/net/release/r377/EquipEventDecoder.java
+++ b/src/org/apollo/net/release/r377/EquipEventDecoder.java
@@ -10,6 +10,7 @@ import org.apollo.net.release.EventDecoder;
/**
* An {@link EventDecoder} for the {@link EquipEvent}.
+ *
* @author Graham
*/
public final class EquipEventDecoder extends EventDecoder {
diff --git a/src/org/apollo/net/release/r377/FifthItemActionEventDecoder.java b/src/org/apollo/net/release/r377/FifthItemActionEventDecoder.java
index ce9bc50d..4caa2ede 100644
--- a/src/org/apollo/net/release/r377/FifthItemActionEventDecoder.java
+++ b/src/org/apollo/net/release/r377/FifthItemActionEventDecoder.java
@@ -10,6 +10,7 @@ import org.apollo.net.release.EventDecoder;
/**
* An {@link EventDecoder} for the {@link FifthItemActionEvent}.
+ *
* @author Graham
*/
public final class FifthItemActionEventDecoder extends EventDecoder {
diff --git a/src/org/apollo/net/release/r377/FirstItemActionEventDecoder.java b/src/org/apollo/net/release/r377/FirstItemActionEventDecoder.java
index 2ec7997b..945af466 100644
--- a/src/org/apollo/net/release/r377/FirstItemActionEventDecoder.java
+++ b/src/org/apollo/net/release/r377/FirstItemActionEventDecoder.java
@@ -9,6 +9,7 @@ import org.apollo.net.release.EventDecoder;
/**
* An {@link EventDecoder} for the {@link FirstItemActionEvent}.
+ *
* @author Graham
*/
public final class FirstItemActionEventDecoder extends EventDecoder {
diff --git a/src/org/apollo/net/release/r377/FirstObjectActionEventDecoder.java b/src/org/apollo/net/release/r377/FirstObjectActionEventDecoder.java
index b7e8f086..b267fad6 100644
--- a/src/org/apollo/net/release/r377/FirstObjectActionEventDecoder.java
+++ b/src/org/apollo/net/release/r377/FirstObjectActionEventDecoder.java
@@ -11,6 +11,7 @@ import org.apollo.net.release.EventDecoder;
/**
* An {@link EventDecoder} for the {@link FirstObjectActionEvent}.
+ *
* @author Graham
*/
public final class FirstObjectActionEventDecoder extends EventDecoder {
diff --git a/src/org/apollo/net/release/r377/FourthItemActionEventDecoder.java b/src/org/apollo/net/release/r377/FourthItemActionEventDecoder.java
index 9edb1f63..78e6041c 100644
--- a/src/org/apollo/net/release/r377/FourthItemActionEventDecoder.java
+++ b/src/org/apollo/net/release/r377/FourthItemActionEventDecoder.java
@@ -10,6 +10,7 @@ import org.apollo.net.release.EventDecoder;
/**
* An {@link EventDecoder} for the {@link FourthItemActionEvent}.
+ *
* @author Graham
*/
public final class FourthItemActionEventDecoder extends EventDecoder {
diff --git a/src/org/apollo/net/release/r377/IdAssignmentEventEncoder.java b/src/org/apollo/net/release/r377/IdAssignmentEventEncoder.java
index 8e95fb14..48d6d873 100644
--- a/src/org/apollo/net/release/r377/IdAssignmentEventEncoder.java
+++ b/src/org/apollo/net/release/r377/IdAssignmentEventEncoder.java
@@ -9,6 +9,7 @@ import org.apollo.net.release.EventEncoder;
/**
* An {@link EventEncoder} for the {@link IdAssignmentEvent}.
+ *
* @author Graham
*/
public final class IdAssignmentEventEncoder extends EventEncoder {
diff --git a/src/org/apollo/net/release/r377/KeepAliveEventDecoder.java b/src/org/apollo/net/release/r377/KeepAliveEventDecoder.java
index 51191c4e..5f17e870 100644
--- a/src/org/apollo/net/release/r377/KeepAliveEventDecoder.java
+++ b/src/org/apollo/net/release/r377/KeepAliveEventDecoder.java
@@ -6,6 +6,7 @@ import org.apollo.net.release.EventDecoder;
/**
* A {@link EventDecoder} for the {@link KeepAliveEvent}.
+ *
* @author Graham
*/
public final class KeepAliveEventDecoder extends EventDecoder {
diff --git a/src/org/apollo/net/release/r377/LogoutEventEncoder.java b/src/org/apollo/net/release/r377/LogoutEventEncoder.java
index 7c13a46c..a3d5f8f4 100644
--- a/src/org/apollo/net/release/r377/LogoutEventEncoder.java
+++ b/src/org/apollo/net/release/r377/LogoutEventEncoder.java
@@ -7,6 +7,7 @@ import org.apollo.net.release.EventEncoder;
/**
* An {@link EventEncoder} for the {@link LogoutEvent}.
+ *
* @author Graham
*/
public final class LogoutEventEncoder extends EventEncoder {
diff --git a/src/org/apollo/net/release/r377/OpenInterfaceEventEncoder.java b/src/org/apollo/net/release/r377/OpenInterfaceEventEncoder.java
index d91340f7..25b27df1 100644
--- a/src/org/apollo/net/release/r377/OpenInterfaceEventEncoder.java
+++ b/src/org/apollo/net/release/r377/OpenInterfaceEventEncoder.java
@@ -10,6 +10,7 @@ import org.apollo.net.release.EventEncoder;
/**
* An {@link EventEncoder} for the {@link OpenInterfaceEvent}.
+ *
* @author Graham
*/
public final class OpenInterfaceEventEncoder extends EventEncoder {
diff --git a/src/org/apollo/net/release/r377/OpenInterfaceSidebarEventEncoder.java b/src/org/apollo/net/release/r377/OpenInterfaceSidebarEventEncoder.java
index 010bf185..ef33f8f2 100644
--- a/src/org/apollo/net/release/r377/OpenInterfaceSidebarEventEncoder.java
+++ b/src/org/apollo/net/release/r377/OpenInterfaceSidebarEventEncoder.java
@@ -10,6 +10,7 @@ import org.apollo.net.release.EventEncoder;
/**
* An {@link EventEncoder} for the {@link OpenInterfaceSidebarEvent}.
+ *
* @author Graham
*/
public final class OpenInterfaceSidebarEventEncoder extends EventEncoder {
diff --git a/src/org/apollo/net/release/r377/PlayerSynchronizationEventEncoder.java b/src/org/apollo/net/release/r377/PlayerSynchronizationEventEncoder.java
index ac0f581e..52b15871 100644
--- a/src/org/apollo/net/release/r377/PlayerSynchronizationEventEncoder.java
+++ b/src/org/apollo/net/release/r377/PlayerSynchronizationEventEncoder.java
@@ -32,6 +32,7 @@ import org.apollo.net.release.EventEncoder;
/**
* An {@link EventEncoder} for the {@link PlayerSynchronizationEvent}.
+ *
* @author Graham
*/
public final class PlayerSynchronizationEventEncoder extends EventEncoder {
@@ -74,6 +75,7 @@ public final class PlayerSynchronizationEventEncoder extends EventEncoder 0;
Position player = event.getPosition();
Position other = seg.getPosition();
@@ -100,11 +104,13 @@ public final class PlayerSynchronizationEventEncoder extends EventEncoder 0;
if (seg.getType() == SegmentType.TELEPORT) {
Position pos = ((TeleportSegment) seg).getDestination();
@@ -140,6 +146,7 @@ public final class PlayerSynchronizationEventEncoder extends EventEncoder {
diff --git a/src/org/apollo/net/release/r377/Release377.java b/src/org/apollo/net/release/r377/Release377.java
index 9998099c..425910ec 100644
--- a/src/org/apollo/net/release/r377/Release377.java
+++ b/src/org/apollo/net/release/r377/Release377.java
@@ -94,22 +94,17 @@ public final class Release377 extends Release {
register(IdAssignmentEvent.class, new IdAssignmentEventEncoder());
register(RegionChangeEvent.class, new RegionChangeEventEncoder());
register(ServerMessageEvent.class, new ServerMessageEventEncoder());
- register(PlayerSynchronizationEvent.class,
- new PlayerSynchronizationEventEncoder());
+ register(PlayerSynchronizationEvent.class, new PlayerSynchronizationEventEncoder());
register(OpenInterfaceEvent.class, new OpenInterfaceEventEncoder());
register(CloseInterfaceEvent.class, new CloseInterfaceEventEncoder());
- register(SwitchTabInterfaceEvent.class,
- new SwitchTabInterfaceEventEncoder());
+ register(SwitchTabInterfaceEvent.class, new SwitchTabInterfaceEventEncoder());
register(LogoutEvent.class, new LogoutEventEncoder());
register(UpdateItemsEvent.class, new UpdateItemsEventEncoder());
- register(UpdateSlottedItemsEvent.class,
- new UpdateSlottedItemsEventEncoder());
+ register(UpdateSlottedItemsEvent.class, new UpdateSlottedItemsEventEncoder());
register(UpdateSkillEvent.class, new UpdateSkillEventEncoder());
- register(OpenInterfaceSidebarEvent.class,
- new OpenInterfaceSidebarEventEncoder());
+ register(OpenInterfaceSidebarEvent.class, new OpenInterfaceSidebarEventEncoder());
register(EnterAmountEvent.class, new EnterAmountEventEncoder());
- register(SetInterfaceTextEvent.class,
- new SetInterfaceTextEventEncoder());
+ register(SetInterfaceTextEvent.class, new SetInterfaceTextEventEncoder());
}
}
diff --git a/src/org/apollo/net/release/r377/SecondItemActionEventDecoder.java b/src/org/apollo/net/release/r377/SecondItemActionEventDecoder.java
index e3bf7d2e..de2cda0e 100644
--- a/src/org/apollo/net/release/r377/SecondItemActionEventDecoder.java
+++ b/src/org/apollo/net/release/r377/SecondItemActionEventDecoder.java
@@ -10,6 +10,7 @@ import org.apollo.net.release.EventDecoder;
/**
* An {@link EventDecoder} for the {@link SecondItemActionEvent}.
+ *
* @author Graham
*/
public final class SecondItemActionEventDecoder extends EventDecoder {
diff --git a/src/org/apollo/net/release/r377/SecondObjectActionEventDecoder.java b/src/org/apollo/net/release/r377/SecondObjectActionEventDecoder.java
index 4e5309bf..86ba208c 100644
--- a/src/org/apollo/net/release/r377/SecondObjectActionEventDecoder.java
+++ b/src/org/apollo/net/release/r377/SecondObjectActionEventDecoder.java
@@ -10,6 +10,7 @@ import org.apollo.net.release.EventDecoder;
/**
* An {@link EventDecoder} for the {@link SecondObjectActionEvent}.
+ *
* @author Graham
*/
public final class SecondObjectActionEventDecoder extends EventDecoder {
diff --git a/src/org/apollo/net/release/r377/ServerMessageEventEncoder.java b/src/org/apollo/net/release/r377/ServerMessageEventEncoder.java
index 6c87728b..7608ead1 100644
--- a/src/org/apollo/net/release/r377/ServerMessageEventEncoder.java
+++ b/src/org/apollo/net/release/r377/ServerMessageEventEncoder.java
@@ -8,6 +8,7 @@ import org.apollo.net.release.EventEncoder;
/**
* An {@link EventEncoder} for the {@link ServerMessageEvent}.
+ *
* @author Graham
*/
public final class ServerMessageEventEncoder extends EventEncoder {
diff --git a/src/org/apollo/net/release/r377/SetInterfaceTextEventEncoder.java b/src/org/apollo/net/release/r377/SetInterfaceTextEventEncoder.java
index 5b2c267e..feab6a12 100644
--- a/src/org/apollo/net/release/r377/SetInterfaceTextEventEncoder.java
+++ b/src/org/apollo/net/release/r377/SetInterfaceTextEventEncoder.java
@@ -11,6 +11,7 @@ import org.apollo.net.release.EventEncoder;
/**
* An {@link EventEncoder} for the {@link SetInterfaceTextEvent}.
+ *
* @author Graham
*/
public final class SetInterfaceTextEventEncoder extends EventEncoder {
diff --git a/src/org/apollo/net/release/r377/SwitchItemEventDecoder.java b/src/org/apollo/net/release/r377/SwitchItemEventDecoder.java
index f56285ff..07fcc4cc 100644
--- a/src/org/apollo/net/release/r377/SwitchItemEventDecoder.java
+++ b/src/org/apollo/net/release/r377/SwitchItemEventDecoder.java
@@ -10,6 +10,7 @@ import org.apollo.net.release.EventDecoder;
/**
* An {@link EventDecoder} for the {@link SwitchItemEvent}.
+ *
* @author Graham
*/
public final class SwitchItemEventDecoder extends EventDecoder {
diff --git a/src/org/apollo/net/release/r377/SwitchTabInterfaceEventEncoder.java b/src/org/apollo/net/release/r377/SwitchTabInterfaceEventEncoder.java
index d6ab593d..a821dbe8 100644
--- a/src/org/apollo/net/release/r377/SwitchTabInterfaceEventEncoder.java
+++ b/src/org/apollo/net/release/r377/SwitchTabInterfaceEventEncoder.java
@@ -9,6 +9,7 @@ import org.apollo.net.release.EventEncoder;
/**
* An {@link EventEncoder} for the {@link SwitchTabInterfaceEvent}.
+ *
* @author Graham
*/
public final class SwitchTabInterfaceEventEncoder extends EventEncoder {
diff --git a/src/org/apollo/net/release/r377/ThirdItemActionEventDecoder.java b/src/org/apollo/net/release/r377/ThirdItemActionEventDecoder.java
index 5ba0c10f..80c7c4c6 100644
--- a/src/org/apollo/net/release/r377/ThirdItemActionEventDecoder.java
+++ b/src/org/apollo/net/release/r377/ThirdItemActionEventDecoder.java
@@ -10,6 +10,7 @@ import org.apollo.net.release.EventDecoder;
/**
* An {@link EventDecoder} for the {@link ThirdItemActionEvent}.
+ *
* @author Graham
*/
public final class ThirdItemActionEventDecoder extends EventDecoder {
diff --git a/src/org/apollo/net/release/r377/ThirdObjectActionEventDecoder.java b/src/org/apollo/net/release/r377/ThirdObjectActionEventDecoder.java
index 2e4cbe67..e6b74f2a 100644
--- a/src/org/apollo/net/release/r377/ThirdObjectActionEventDecoder.java
+++ b/src/org/apollo/net/release/r377/ThirdObjectActionEventDecoder.java
@@ -14,17 +14,14 @@ import org.apollo.net.release.EventDecoder;
*
* @author Graham
*/
-public final class ThirdObjectActionEventDecoder extends
- EventDecoder {
+public final class ThirdObjectActionEventDecoder extends EventDecoder {
@Override
public ThirdObjectActionEvent decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
- int y = (int) reader
- .getUnsigned(DataType.SHORT, DataTransformation.ADD);
+ int y = (int) reader.getUnsigned(DataType.SHORT, DataTransformation.ADD);
int id = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE);
- int x = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE,
- DataTransformation.ADD);
+ int x = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE, DataTransformation.ADD);
return new ThirdObjectActionEvent(id, new Position(x, y));
}
diff --git a/src/org/apollo/net/release/r377/UpdateItemsEventEncoder.java b/src/org/apollo/net/release/r377/UpdateItemsEventEncoder.java
index 21e24555..ffc06338 100644
--- a/src/org/apollo/net/release/r377/UpdateItemsEventEncoder.java
+++ b/src/org/apollo/net/release/r377/UpdateItemsEventEncoder.java
@@ -12,6 +12,7 @@ import org.apollo.net.release.EventEncoder;
/**
* An {@link EventEncoder} for the {@link UpdateItemsEvent}.
+ *
* @author Graham
*/
public final class UpdateItemsEventEncoder extends EventEncoder {
diff --git a/src/org/apollo/net/release/r377/UpdateSkillEventEncoder.java b/src/org/apollo/net/release/r377/UpdateSkillEventEncoder.java
index d039c80e..a633ed52 100644
--- a/src/org/apollo/net/release/r377/UpdateSkillEventEncoder.java
+++ b/src/org/apollo/net/release/r377/UpdateSkillEventEncoder.java
@@ -10,6 +10,7 @@ import org.apollo.net.release.EventEncoder;
/**
* An {@link EventEncoder} for the {@link UpdateSkillEvent}.
+ *
* @author Graham
*/
public final class UpdateSkillEventEncoder extends EventEncoder {
diff --git a/src/org/apollo/net/release/r377/UpdateSlottedItemsEventEncoder.java b/src/org/apollo/net/release/r377/UpdateSlottedItemsEventEncoder.java
index 2906e6d4..683e3a81 100644
--- a/src/org/apollo/net/release/r377/UpdateSlottedItemsEventEncoder.java
+++ b/src/org/apollo/net/release/r377/UpdateSlottedItemsEventEncoder.java
@@ -11,6 +11,7 @@ import org.apollo.net.release.EventEncoder;
/**
* An {@link EventEncoder} for the {@link UpdateSlottedItemsEvent}.
+ *
* @author Graham
*/
public final class UpdateSlottedItemsEventEncoder extends EventEncoder {
diff --git a/src/org/apollo/net/release/r377/WalkEventDecoder.java b/src/org/apollo/net/release/r377/WalkEventDecoder.java
index ea637fda..1b6f03f8 100644
--- a/src/org/apollo/net/release/r377/WalkEventDecoder.java
+++ b/src/org/apollo/net/release/r377/WalkEventDecoder.java
@@ -11,6 +11,7 @@ import org.apollo.net.release.EventDecoder;
/**
* An {@link EventDecoder} for the {@link WalkEvent}.
+ *
* @author Graham
*/
public final class WalkEventDecoder extends EventDecoder {
diff --git a/src/org/apollo/net/release/r377/package-info.java b/src/org/apollo/net/release/r377/package-info.java
index af4c5ef0..b611ce90 100644
--- a/src/org/apollo/net/release/r377/package-info.java
+++ b/src/org/apollo/net/release/r377/package-info.java
@@ -2,3 +2,4 @@
* Contains codecs for the 377 release.
*/
package org.apollo.net.release.r377;
+
diff --git a/src/org/apollo/net/session/GameSession.java b/src/org/apollo/net/session/GameSession.java
index 9d06b95d..117af223 100644
--- a/src/org/apollo/net/session/GameSession.java
+++ b/src/org/apollo/net/session/GameSession.java
@@ -19,6 +19,7 @@ import org.jboss.netty.channel.ChannelFutureListener;
/**
* A game session.
+ *
* @author Graham
*/
public final class GameSession extends Session {
@@ -45,6 +46,7 @@ public final class GameSession extends Session {
/**
* Creates a login session for the specified channel.
+ *
* @param channel The channel.
* @param context The server context.
* @param player The player.
@@ -67,6 +69,7 @@ public final class GameSession extends Session {
/**
* Encodes and dispatches the specified event.
+ *
* @param event The event.
*/
public void dispatchEvent(Event event) {
@@ -81,6 +84,7 @@ public final class GameSession extends Session {
/**
* Handles pending events for this session.
+ *
* @param chainGroup The event chain group.
*/
@SuppressWarnings("unchecked")
@@ -115,6 +119,7 @@ public final class GameSession extends Session {
/**
* Handles a player saver response.
+ *
* @param success A flag indicating if the save was successful.
*/
public void handlePlayerSaverResponse(boolean success) {
diff --git a/src/org/apollo/net/session/LoginSession.java b/src/org/apollo/net/session/LoginSession.java
index c5709723..478eaf37 100644
--- a/src/org/apollo/net/session/LoginSession.java
+++ b/src/org/apollo/net/session/LoginSession.java
@@ -23,6 +23,7 @@ import org.jboss.netty.channel.ChannelHandlerContext;
/**
* A login session.
+ *
* @author Graham
*/
public final class LoginSession extends Session {
@@ -39,6 +40,7 @@ public final class LoginSession extends Session {
/**
* Creates a login session for the specified channel.
+ *
* @param channel The channel.
* @param channelContext The context of the {@link ApolloHandler}.
* @param serverContext The server context.
@@ -58,6 +60,7 @@ public final class LoginSession extends Session {
/**
* Gets the release.
+ *
* @return The release.
*/
public Release getRelease() {
@@ -66,6 +69,7 @@ public final class LoginSession extends Session {
/**
* Handles a login request.
+ *
* @param request The login request.
*/
private void handleLoginRequest(LoginRequest request) {
@@ -75,6 +79,7 @@ public final class LoginSession extends Session {
/**
* Handles a response from the login service.
+ *
* @param request The request this response corresponds to.
* @param response The response.
*/
@@ -113,9 +118,11 @@ public final class LoginSession extends Session {
Release release = serverContext.getRelease();
channel.getPipeline().addFirst("eventEncoder", new GameEventEncoder(release));
- channel.getPipeline().addBefore("eventEncoder", "gameEncoder", new GamePacketEncoder(randomPair.getEncodingRandom()));
+ channel.getPipeline().addBefore("eventEncoder", "gameEncoder",
+ new GamePacketEncoder(randomPair.getEncodingRandom()));
- channel.getPipeline().addBefore("handler", "gameDecoder", new GamePacketDecoder(randomPair.getDecodingRandom(), serverContext.getRelease()));
+ channel.getPipeline().addBefore("handler", "gameDecoder",
+ new GamePacketDecoder(randomPair.getDecodingRandom(), serverContext.getRelease()));
channel.getPipeline().addAfter("gameDecoder", "eventDecoder", new GameEventDecoder(release));
channel.getPipeline().remove("loginDecoder");
diff --git a/src/org/apollo/net/session/Session.java b/src/org/apollo/net/session/Session.java
index fa6e9570..058073c7 100644
--- a/src/org/apollo/net/session/Session.java
+++ b/src/org/apollo/net/session/Session.java
@@ -4,8 +4,8 @@ import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandlerContext;
/**
- * A session which is used as the attachment of a {@link ChannelHandlerContext}
- * in Netty.
+ * A session which is used as the attachment of a {@link ChannelHandlerContext} in Netty.
+ *
* @author Graham
*/
public abstract class Session {
@@ -17,6 +17,7 @@ public abstract class Session {
/**
* Creates a session for the specified channel.
+ *
* @param channel The channel.
*/
public Session(Channel channel) {
@@ -25,6 +26,7 @@ public abstract class Session {
/**
* Gets the channel.
+ *
* @return The channel.
*/
protected final Channel getChannel() {
@@ -33,6 +35,7 @@ public abstract class Session {
/**
* Processes a message received from the channel.
+ *
* @param message The message.
* @throws Exception if an error occurs.
*/
@@ -40,6 +43,7 @@ public abstract class Session {
/**
* Destroys this session.
+ *
* @throws Exception if an error occurs.
*/
public abstract void destroy() throws Exception;
diff --git a/src/org/apollo/net/session/UpdateSession.java b/src/org/apollo/net/session/UpdateSession.java
index 53b662a1..fd475f0d 100644
--- a/src/org/apollo/net/session/UpdateSession.java
+++ b/src/org/apollo/net/session/UpdateSession.java
@@ -10,6 +10,7 @@ import org.jboss.netty.handler.codec.http.HttpRequest;
/**
* An update session.
+ *
* @author Graham
*/
public final class UpdateSession extends Session {
@@ -21,6 +22,7 @@ public final class UpdateSession extends Session {
/**
* Creates an update session for the specified channel.
+ *
* @param channel The channel.
* @param context The server context.
*/
diff --git a/src/org/apollo/net/session/package-info.java b/src/org/apollo/net/session/package-info.java
index a78c2eb6..078414ef 100644
--- a/src/org/apollo/net/session/package-info.java
+++ b/src/org/apollo/net/session/package-info.java
@@ -5,3 +5,4 @@
* designed for networking.
*/
package org.apollo.net.session;
+
diff --git a/src/org/apollo/package-info.java b/src/org/apollo/package-info.java
index 841fa95a..65f5c1f3 100644
--- a/src/org/apollo/package-info.java
+++ b/src/org/apollo/package-info.java
@@ -3,3 +3,4 @@
* server bootstrap class.
*/
package org.apollo;
+
diff --git a/src/org/apollo/security/IsaacRandomPair.java b/src/org/apollo/security/IsaacRandomPair.java
index e5fa4066..c2383418 100644
--- a/src/org/apollo/security/IsaacRandomPair.java
+++ b/src/org/apollo/security/IsaacRandomPair.java
@@ -3,9 +3,9 @@ package org.apollo.security;
import net.burtleburtle.bob.rand.IsaacRandom;
/**
- * A pair of two {@link IsaacRandom} random number generators used as a stream
- * cipher. One takes the role of an encoder for this endpoint, the other takes
- * the role of a decoder for this endpoint.
+ * A pair of two {@link IsaacRandom} random number generators used as a stream cipher. One takes the role of an encoder
+ * for this endpoint, the other takes the role of a decoder for this endpoint.
+ *
* @author Graham
*/
public final class IsaacRandomPair {
@@ -22,6 +22,7 @@ public final class IsaacRandomPair {
/**
* Creates the pair of random number generators.
+ *
* @param encodingRandom The random number generator used for encoding.
* @param decodingRandom The random number generator used for decoding.
*/
@@ -32,6 +33,7 @@ public final class IsaacRandomPair {
/**
* Gets the random number generator used for encoding.
+ *
* @return The random number generator used for encoding.
*/
public IsaacRandom getEncodingRandom() {
@@ -40,6 +42,7 @@ public final class IsaacRandomPair {
/**
* Gets the random number generator used for decoding.
+ *
* @return The random number generator used for decoding.
*/
public IsaacRandom getDecodingRandom() {
diff --git a/src/org/apollo/security/PlayerCredentials.java b/src/org/apollo/security/PlayerCredentials.java
index d2e224c3..9b848548 100644
--- a/src/org/apollo/security/PlayerCredentials.java
+++ b/src/org/apollo/security/PlayerCredentials.java
@@ -4,6 +4,7 @@ import org.apollo.util.NameUtil;
/**
* Holds the credentials for a player.
+ *
* @author Graham
*/
public final class PlayerCredentials {
@@ -34,8 +35,8 @@ public final class PlayerCredentials {
private final int uid;
/**
- * Creates a new {@link PlayerCredentials} object with the specified name,
- * password and uid.
+ * Creates a new {@link PlayerCredentials} object with the specified name, password and uid.
+ *
* @param username The player's username.
* @param password The player's password.
* @param usernameHash The hash of the player's username.
@@ -51,6 +52,7 @@ public final class PlayerCredentials {
/**
* Gets the player's username.
+ *
* @return The player's username.
*/
public String getUsername() {
@@ -59,6 +61,7 @@ public final class PlayerCredentials {
/**
* Gets the player's username encoded as a long.
+ *
* @return The username as encoded by {@link NameUtil#encodeBase37(String)}.
*/
public long getEncodedUsername() {
@@ -67,6 +70,7 @@ public final class PlayerCredentials {
/**
* Gets the player's password.
+ *
* @return The player's password.
*/
public String getPassword() {
@@ -75,6 +79,7 @@ public final class PlayerCredentials {
/**
* Gets the username hash.
+ *
* @return The username hash.
*/
public int getUsernameHash() {
@@ -83,6 +88,7 @@ public final class PlayerCredentials {
/**
* Gets the computer's uid.
+ *
* @return The computer's uid.
*/
public int getUid() {
diff --git a/src/org/apollo/security/package-info.java b/src/org/apollo/security/package-info.java
index 90f9c39b..47ae437f 100644
--- a/src/org/apollo/security/package-info.java
+++ b/src/org/apollo/security/package-info.java
@@ -2,3 +2,4 @@
* Contains classes related to security and cryptography.
*/
package org.apollo.security;
+
diff --git a/src/org/apollo/tools/EquipmentConstants.java b/src/org/apollo/tools/EquipmentConstants.java
index d457fdf1..7efba9ee 100644
--- a/src/org/apollo/tools/EquipmentConstants.java
+++ b/src/org/apollo/tools/EquipmentConstants.java
@@ -16,10 +16,8 @@ public final class EquipmentConstants {
/**
* Hats.
*/
- public static final String[] HATS = { "helm", "hood", "coif", "Coif",
- "hat", "partyhat", "Hat", "full helm (t)", "full helm (g)",
- "hat (t)", "hat (g)", "cav", "boater", "helmet", "mask",
- "Helm of neitiznot" };
+ public static final String[] HATS = { "helm", "hood", "coif", "Coif", "hat", "partyhat", "Hat", "full helm (t)",
+ "full helm (g)", "hat (t)", "hat (g)", "cav", "boater", "helmet", "mask", "Helm of neitiznot" };
/**
* Boots.
@@ -29,15 +27,13 @@ public final class EquipmentConstants {
/**
* Gloves.
*/
- public static final String[] GLOVES = { "gloves", "gauntlets", "Gloves",
- "vambraces", "vamb", "bracers" };
+ public static final String[] GLOVES = { "gloves", "gauntlets", "Gloves", "vambraces", "vamb", "bracers" };
/**
* Shields.
*/
- public static final String[] SHIELDS = { "kiteshield", "sq shield",
- "Toktz-ket", "books", "book", "kiteshield (t)", "kiteshield (g)",
- "kiteshield(h)", "defender", "shield" };
+ public static final String[] SHIELDS = { "kiteshield", "sq shield", "Toktz-ket", "books", "book", "kiteshield (t)",
+ "kiteshield (g)", "kiteshield(h)", "defender", "shield" };
/**
* Amulets.
@@ -47,9 +43,8 @@ public final class EquipmentConstants {
/**
* Arrows.
*/
- public static final String[] ARROWS = { "arrow", "arrows", "arrow(p)",
- "arrow(+)", "arrow(s)", "bolt", "Bolt rack", "Opal bolts",
- "Dragon bolts" };
+ public static final String[] ARROWS = { "arrow", "arrows", "arrow(p)", "arrow(+)", "arrow(s)", "bolt", "Bolt rack",
+ "Opal bolts", "Dragon bolts" };
/**
* Rings.
@@ -59,52 +54,43 @@ public final class EquipmentConstants {
/**
* Bodies.
*/
- public static final String[] BODY = { "platebody", "chainbody", "robetop",
- "leathertop", "platemail", "top", "brassard", "Robe top", "body",
- "platebody (t)", "platebody (g)", "body(g)", "body_(g)",
- "chestplate", "torso", "shirt" };
+ public static final String[] BODY = { "platebody", "chainbody", "robetop", "leathertop", "platemail", "top",
+ "brassard", "Robe top", "body", "platebody (t)", "platebody (g)", "body(g)", "body_(g)", "chestplate",
+ "torso", "shirt" };
/**
* Legs.
*/
- public static final String[] LEGS = { "platelegs", "plateskirt", "skirt",
- "bottoms", "chaps", "platelegs (t)", "platelegs (g)", "bottom",
- "skirt", "skirt (g)", "skirt (t)", "chaps (g)", "chaps (t)",
- "tassets", "legs", "Flared trousers" };
+ public static final String[] LEGS = { "platelegs", "plateskirt", "skirt", "bottoms", "chaps", "platelegs (t)",
+ "platelegs (g)", "bottom", "skirt", "skirt (g)", "skirt (t)", "chaps (g)", "chaps (t)", "tassets", "legs",
+ "Flared trousers" };
/**
* Weapons.
*/
- public static final String[] WEAPONS = { "scimitar", "longsword", "sword",
- "longbow", "shortbow", "dagger", "mace", "halberd", "spear",
- "Abyssal whip", "axe", "flail", "crossbow", "Torags hammers",
- "dagger(p)", "dagger(+)", "dagger(s)", "spear(p)", "spear(+)",
- "spear(s)", "spear(kp)", "maul", "dart", "dart(p)", "javelin",
- "javelin(p)", "knife", "knife(p)", "Longbow", "Shortbow",
- "Crossbow", "Toktz-xil", "Toktz-mej", "Tzhaar-ket", "staff",
- "Staff", "godsword", "c'bow", "Crystal bow", "Dark bow",
- "Magic butterfly net" };
+ public static final String[] WEAPONS = { "scimitar", "longsword", "sword", "longbow", "shortbow", "dagger", "mace",
+ "halberd", "spear", "Abyssal whip", "axe", "flail", "crossbow", "Torags hammers", "dagger(p)", "dagger(+)",
+ "dagger(s)", "spear(p)", "spear(+)", "spear(s)", "spear(kp)", "maul", "dart", "dart(p)", "javelin",
+ "javelin(p)", "knife", "knife(p)", "Longbow", "Shortbow", "Crossbow", "Toktz-xil", "Toktz-mej",
+ "Tzhaar-ket", "staff", "Staff", "godsword", "c'bow", "Crystal bow", "Dark bow", "Magic butterfly net" };
/**
* Full bodies.
*/
- public static final String[] FULL_BODIES = { "top", "shirt", "platebody",
- "Ahrims robetop", "Karils leathertop", "brassard", "Robe top",
- "robetop", "platebody (t)", "platebody (g)", "chestplate", "torso" };
+ public static final String[] FULL_BODIES = { "top", "shirt", "platebody", "Ahrims robetop", "Karils leathertop",
+ "brassard", "Robe top", "robetop", "platebody (t)", "platebody (g)", "chestplate", "torso" };
/**
* Full hats.
*/
- public static final String[] FULL_HATS = { "med helm", "coif",
- "Dharoks helm", "hood", "Initiate helm", "Coif",
+ public static final String[] FULL_HATS = { "med helm", "coif", "Dharoks helm", "hood", "Initiate helm", "Coif",
"Helm of neitiznot" };
/**
* Full masks.
*/
- public static final String[] FULL_MASKS = { "full helm", "mask",
- "Veracs helm", "Guthans helm", "Torags helm", "Karils coif",
- "full helm (t)", "full helm (g)", "mask" };
+ public static final String[] FULL_MASKS = { "full helm", "mask", "Veracs helm", "Guthans helm", "Torags helm",
+ "Karils coif", "full helm (t)", "full helm (g)", "mask" };
/**
* Default private construcotr to prevent instantiation.
diff --git a/src/org/apollo/tools/EquipmentUpdater.java b/src/org/apollo/tools/EquipmentUpdater.java
index e6b46eda..51568df6 100644
--- a/src/org/apollo/tools/EquipmentUpdater.java
+++ b/src/org/apollo/tools/EquipmentUpdater.java
@@ -11,6 +11,7 @@ import org.apollo.game.model.def.ItemDefinition;
/**
* A tool for updating the equipment data.
+ *
* @author Graham
* @author Palidino76
*/
@@ -18,6 +19,7 @@ public final class EquipmentUpdater {
/**
* The entry point of the application.
+ *
* @param args The command line arguments.
* @throws Exception if an error occurs.
*/
@@ -29,7 +31,8 @@ public final class EquipmentUpdater {
}
String release = args[0];
- DataOutputStream os = new DataOutputStream(new BufferedOutputStream(new FileOutputStream("data/equipment-" + release + ".dat")));
+ DataOutputStream os = new DataOutputStream(new BufferedOutputStream(new FileOutputStream("data/equipment-"
+ + release + ".dat")));
try {
IndexedFileSystem fs = new IndexedFileSystem(new File("data/fs/" + release), true);
try {
@@ -64,6 +67,7 @@ public final class EquipmentUpdater {
/**
* Checks if the item is two handed.
+ *
* @param def The item.
* @return {@code true} if so, {@code false} otherwise.
*/
@@ -116,6 +120,7 @@ public final class EquipmentUpdater {
/**
* Gets the ranged requirement.
+ *
* @param def The item.
* @return The required level.
*/
@@ -228,6 +233,7 @@ public final class EquipmentUpdater {
/**
* Gets the magic requirement.
+ *
* @param def The item.
* @return The required level.
*/
@@ -302,6 +308,7 @@ public final class EquipmentUpdater {
/**
* Gets the strength requirement.
+ *
* @param def The item.
* @return The required level.
*/
@@ -312,20 +319,21 @@ public final class EquipmentUpdater {
if (name.equals("Torags hammers"))
return 70;
if (name.equals("Dharoks greataxe"))
- return 70;
+ return 70;
if (name.equals("Granite maul"))
- return 50;
+ return 50;
if (name.equals("Granite legs"))
- return 99;
+ return 99;
if (name.equals("Tzhaar-ket-om"))
- return 60;
+ return 60;
if (name.equals("Granite shield"))
- return 50;
- return 1;
+ return 50;
+ return 1;
}
/**
* Gets the attack requirement.
+ *
* @param def The item.
* @return The required level.
*/
@@ -468,6 +476,7 @@ public final class EquipmentUpdater {
/**
* Gets the defence requirement.
+ *
* @param def The item.
* @return The required level.
*/
@@ -771,6 +780,7 @@ public final class EquipmentUpdater {
/**
* Gets the weapon type.
+ *
* @param def The item.
* @return The weapon type, or {@code -1} if it is not a weapon.
*/
@@ -827,6 +837,7 @@ public final class EquipmentUpdater {
/**
* Checks if the item is a full body item.
+ *
* @param def The item.
* @return {@code true} if so, {@code false} otherwise.
*/
@@ -844,6 +855,7 @@ public final class EquipmentUpdater {
/**
* Checks if the item is a full hat item.
+ *
* @param def The item.
* @return {@code true} if so, {@code false} otherwise.
*/
@@ -861,6 +873,7 @@ public final class EquipmentUpdater {
/**
* Checks if the item is a full mask item.
+ *
* @param def The item.
* @return {@code true} if so, {@code false} otherwise.
*/
diff --git a/src/org/apollo/tools/NoteUpdater.java b/src/org/apollo/tools/NoteUpdater.java
index 4a2e01b4..7ef76410 100644
--- a/src/org/apollo/tools/NoteUpdater.java
+++ b/src/org/apollo/tools/NoteUpdater.java
@@ -13,12 +13,14 @@ import org.apollo.game.model.def.ItemDefinition;
/**
* A tool for updating the note data.
+ *
* @author Graham
*/
public final class NoteUpdater {
/**
* The entry point of the application.
+ *
* @param args The command line arguments.
* @throws Exception if an error occurs.
*/
@@ -30,7 +32,8 @@ public final class NoteUpdater {
}
String release = args[0];
- DataOutputStream os = new DataOutputStream(new BufferedOutputStream(new FileOutputStream("data/note-" + release + ".dat")));
+ DataOutputStream os = new DataOutputStream(new BufferedOutputStream(new FileOutputStream("data/note-" + release
+ + ".dat")));
try {
IndexedFileSystem fs = new IndexedFileSystem(new File("data/fs/" + release), true);
try {
diff --git a/src/org/apollo/tools/package-info.java b/src/org/apollo/tools/package-info.java
index 63be4cea..1795a543 100644
--- a/src/org/apollo/tools/package-info.java
+++ b/src/org/apollo/tools/package-info.java
@@ -2,3 +2,4 @@
* Contains several stand-alone utilities.
*/
package org.apollo.tools;
+
diff --git a/src/org/apollo/update/ChannelRequest.java b/src/org/apollo/update/ChannelRequest.java
index f53c3443..0c686f66 100644
--- a/src/org/apollo/update/ChannelRequest.java
+++ b/src/org/apollo/update/ChannelRequest.java
@@ -3,8 +3,8 @@ package org.apollo.update;
import org.jboss.netty.channel.Channel;
/**
- * A specialised request which contains a channel as well as the request object
- * itself.
+ * A specialised request which contains a channel as well as the request object itself.
+ *
* @author Graham
* @param The type of request.
*/
@@ -22,6 +22,7 @@ public final class ChannelRequest implements Comparable> {
/**
* Creates a new channel request.
+ *
* @param channel The channel.
* @param request The request.
*/
@@ -32,6 +33,7 @@ public final class ChannelRequest implements Comparable> {
/**
* Gets the channel.
+ *
* @return The channel.
*/
public Channel getChannel() {
@@ -40,6 +42,7 @@ public final class ChannelRequest implements Comparable> {
/**
* Gets the request.
+ *
* @return The request.
*/
public T getRequest() {
diff --git a/src/org/apollo/update/HttpRequestWorker.java b/src/org/apollo/update/HttpRequestWorker.java
index 0a5bd851..8952bf50 100644
--- a/src/org/apollo/update/HttpRequestWorker.java
+++ b/src/org/apollo/update/HttpRequestWorker.java
@@ -22,6 +22,7 @@ import org.jboss.netty.handler.codec.http.HttpResponseStatus;
/**
* A worker which services HTTP requests.
+ *
* @author Graham
*/
public final class HttpRequestWorker extends RequestWorker {
@@ -43,11 +44,13 @@ public final class HttpRequestWorker extends RequestWorker {
/**
* Creates the JAGGRAB request worker.
+ *
* @param dispatcher The dispatcher.
* @param fs The file system.
*/
diff --git a/src/org/apollo/update/OnDemandRequestWorker.java b/src/org/apollo/update/OnDemandRequestWorker.java
index e3ed050c..6aeb6436 100644
--- a/src/org/apollo/update/OnDemandRequestWorker.java
+++ b/src/org/apollo/update/OnDemandRequestWorker.java
@@ -13,6 +13,7 @@ import org.jboss.netty.channel.Channel;
/**
* A worker which services 'on-demand' requests.
+ *
* @author Graham
*/
public final class OnDemandRequestWorker extends RequestWorker {
@@ -24,6 +25,7 @@ public final class OnDemandRequestWorker extends RequestWorker The type of request.
* @param The type of provider.
@@ -29,6 +30,7 @@ public abstract class RequestWorker implements Runnable {
/**
* Creates the request worker with the specified file system.
+ *
* @param dispatcher The update dispatcher.
* @param provider The resource provider.
*/
@@ -75,6 +77,7 @@ public abstract class RequestWorker implements Runnable {
/**
* Gets the next request.
+ *
* @param dispatcher The dispatcher.
* @return The next request.
* @throws InterruptedException if the thread is interrupted.
@@ -83,6 +86,7 @@ public abstract class RequestWorker implements Runnable {
/**
* Services a request.
+ *
* @param provider The resource provider.
* @param channel The channel.
* @param request The request to service.
diff --git a/src/org/apollo/update/UpdateConstants.java b/src/org/apollo/update/UpdateConstants.java
index c4c7bc34..84d86de2 100644
--- a/src/org/apollo/update/UpdateConstants.java
+++ b/src/org/apollo/update/UpdateConstants.java
@@ -2,6 +2,7 @@ package org.apollo.update;
/**
* Holds update-related constants.
+ *
* @author Graham
*/
public final class UpdateConstants {
diff --git a/src/org/apollo/update/UpdateDispatcher.java b/src/org/apollo/update/UpdateDispatcher.java
index 22ad7baf..45a32b08 100644
--- a/src/org/apollo/update/UpdateDispatcher.java
+++ b/src/org/apollo/update/UpdateDispatcher.java
@@ -11,6 +11,7 @@ import org.jboss.netty.handler.codec.http.HttpRequest;
/**
* A class which dispatches requests to worker threads.
+ *
* @author Graham
*/
public final class UpdateDispatcher {
@@ -36,8 +37,8 @@ public final class UpdateDispatcher {
private final BlockingQueue> httpQueue = new LinkedBlockingQueue>();
/**
- * Gets the next 'on-demand' request from the queue, blocking if none are
- * available.
+ * Gets the next 'on-demand' request from the queue, blocking if none are available.
+ *
* @return The 'on-demand' request.
* @throws InterruptedException if the thread is interrupted.
*/
@@ -46,8 +47,8 @@ public final class UpdateDispatcher {
}
/**
- * Gets the next JAGGRAB request from the queue, blocking if none are
- * available.
+ * Gets the next JAGGRAB request from the queue, blocking if none are available.
+ *
* @return The JAGGRAB request.
* @throws InterruptedException if the thread is interrupted.
*/
@@ -56,8 +57,8 @@ public final class UpdateDispatcher {
}
/**
- * Gets the next HTTP request from the queue, blocking if none are
- * available.
+ * Gets the next HTTP request from the queue, blocking if none are available.
+ *
* @return The HTTP request.
* @throws InterruptedException if the thread is interrupted.
*/
@@ -67,6 +68,7 @@ public final class UpdateDispatcher {
/**
* Dispatches an 'on-demand' request.
+ *
* @param channel The channel.
* @param request The request.
*/
@@ -79,6 +81,7 @@ public final class UpdateDispatcher {
/**
* Dispatches a JAGGRAB request.
+ *
* @param channel The channel.
* @param request The request.
*/
@@ -91,6 +94,7 @@ public final class UpdateDispatcher {
/**
* Dispatches a HTTP request.
+ *
* @param channel The channel.
* @param request The request.
*/
diff --git a/src/org/apollo/update/UpdateService.java b/src/org/apollo/update/UpdateService.java
index 56eb3c50..eb40a684 100644
--- a/src/org/apollo/update/UpdateService.java
+++ b/src/org/apollo/update/UpdateService.java
@@ -11,6 +11,7 @@ import org.apollo.fs.IndexedFileSystem;
/**
* A class which services file requests.
+ *
* @author Graham
*/
public final class UpdateService extends Service {
@@ -50,6 +51,7 @@ public final class UpdateService extends Service {
/**
* Gets the update dispatcher.
+ *
* @return The update dispatcher.
*/
public UpdateDispatcher getDispatcher() {
diff --git a/src/org/apollo/update/package-info.java b/src/org/apollo/update/package-info.java
index f87d93f9..9a4c73c4 100644
--- a/src/org/apollo/update/package-info.java
+++ b/src/org/apollo/update/package-info.java
@@ -2,3 +2,4 @@
* Contains classes related to the update server.
*/
package org.apollo.update;
+
diff --git a/src/org/apollo/update/resource/CombinedResourceProvider.java b/src/org/apollo/update/resource/CombinedResourceProvider.java
index 8dea9ecc..d1da593d 100644
--- a/src/org/apollo/update/resource/CombinedResourceProvider.java
+++ b/src/org/apollo/update/resource/CombinedResourceProvider.java
@@ -5,6 +5,7 @@ import java.nio.ByteBuffer;
/**
* A resource provider composed of multiple resource providers.
+ *
* @author Graham
*/
public final class CombinedResourceProvider extends ResourceProvider {
@@ -16,6 +17,7 @@ public final class CombinedResourceProvider extends ResourceProvider {
/**
* Creates the combined resource providers.
+ *
* @param providers The providers this provider delegates to.
*/
public CombinedResourceProvider(ResourceProvider... providers) {
diff --git a/src/org/apollo/update/resource/HypertextResourceProvider.java b/src/org/apollo/update/resource/HypertextResourceProvider.java
index 39757d89..cc36b34c 100644
--- a/src/org/apollo/update/resource/HypertextResourceProvider.java
+++ b/src/org/apollo/update/resource/HypertextResourceProvider.java
@@ -9,6 +9,7 @@ import java.nio.channels.FileChannel.MapMode;
/**
* A {@link ResourceProvider} which provides additional hypertext resources.
+ *
* @author Graham
*/
public final class HypertextResourceProvider extends ResourceProvider {
@@ -19,8 +20,8 @@ public final class HypertextResourceProvider extends ResourceProvider {
private final File base;
/**
- * Creates a new hypertext resource provider with the specified base
- * directory.
+ * Creates a new hypertext resource provider with the specified base directory.
+ *
* @param base The base directory.
*/
public HypertextResourceProvider(File base) {
diff --git a/src/org/apollo/update/resource/ResourceProvider.java b/src/org/apollo/update/resource/ResourceProvider.java
index ea62fbfc..1452f273 100644
--- a/src/org/apollo/update/resource/ResourceProvider.java
+++ b/src/org/apollo/update/resource/ResourceProvider.java
@@ -5,22 +5,23 @@ import java.nio.ByteBuffer;
/**
* A class which provides resources.
+ *
* @author Graham
*/
public abstract class ResourceProvider {
/**
- * Checks that this provider can fulfil a request to the specified
- * resource.
+ * Checks that this provider can fulfil a request to the specified resource.
+ *
* @param path The path to the resource, e.g. {@code /crc}.
- * @return {@code true} if the provider can fulfil a request to the
- * resource, {@code false} otherwise.
+ * @return {@code true} if the provider can fulfil a request to the resource, {@code false} otherwise.
* @throws IOException if an I/O error occurs.
*/
public abstract boolean accept(String path) throws IOException;
/**
* Gets a resource by its path.
+ *
* @param path The path.
* @return The resource, or {@code null} if it doesn't exist.
* @throws IOException if an I/O error occurs.
diff --git a/src/org/apollo/update/resource/VirtualResourceProvider.java b/src/org/apollo/update/resource/VirtualResourceProvider.java
index e1edc80b..ebe6fd36 100644
--- a/src/org/apollo/update/resource/VirtualResourceProvider.java
+++ b/src/org/apollo/update/resource/VirtualResourceProvider.java
@@ -6,8 +6,9 @@ import java.nio.ByteBuffer;
import org.apollo.fs.IndexedFileSystem;
/**
- * A {@link ResourceProvider} which maps virtual resources (such as
- * {@code /media}) to files in an {@link IndexedFileSystem}.
+ * A {@link ResourceProvider} which maps virtual resources (such as {@code /media}) to files in an
+ * {@link IndexedFileSystem}.
+ *
* @author Graham
*/
public final class VirtualResourceProvider extends ResourceProvider {
@@ -15,10 +16,8 @@ public final class VirtualResourceProvider extends ResourceProvider {
/**
* An array of valid prefixes.
*/
- private static final String[] VALID_PREFIXES = {
- "crc", "title", "config", "interface", "media", "versionlist",
- "textures", "wordenc", "sounds"
- };
+ private static final String[] VALID_PREFIXES = { "crc", "title", "config", "interface", "media", "versionlist",
+ "textures", "wordenc", "sounds" };
/**
* The file system.
@@ -27,6 +26,7 @@ public final class VirtualResourceProvider extends ResourceProvider {
/**
* Creates a new virtual resource provider with the specified file system.
+ *
* @param fs The file system.
*/
public VirtualResourceProvider(IndexedFileSystem fs) {
diff --git a/src/org/apollo/update/resource/package-info.java b/src/org/apollo/update/resource/package-info.java
index 3f2bf15f..7b78cf73 100644
--- a/src/org/apollo/update/resource/package-info.java
+++ b/src/org/apollo/update/resource/package-info.java
@@ -2,3 +2,4 @@
* Contains resource providers for the update server.
*/
package org.apollo.update.resource;
+
diff --git a/src/org/apollo/util/ByteBufferUtil.java b/src/org/apollo/util/ByteBufferUtil.java
index 14c4b95c..4df53189 100644
--- a/src/org/apollo/util/ByteBufferUtil.java
+++ b/src/org/apollo/util/ByteBufferUtil.java
@@ -6,12 +6,14 @@ import org.apollo.net.NetworkConstants;
/**
* A utility class which contains {@link ByteBuffer}-related methods.
+ *
* @author Graham
*/
public final class ByteBufferUtil {
/**
* Reads an unsigned tri byte from the specified buffer.
+ *
* @param buffer The buffer.
* @return The tri byte.
*/
@@ -21,6 +23,7 @@ public final class ByteBufferUtil {
/**
* Reads a string from the specified buffer.
+ *
* @param buffer The buffer.
* @return The string.
*/
diff --git a/src/org/apollo/util/ChannelBufferUtil.java b/src/org/apollo/util/ChannelBufferUtil.java
index c39379a4..eb564ebf 100644
--- a/src/org/apollo/util/ChannelBufferUtil.java
+++ b/src/org/apollo/util/ChannelBufferUtil.java
@@ -4,14 +4,16 @@ import org.apollo.net.NetworkConstants;
import org.jboss.netty.buffer.ChannelBuffer;
/**
- * A utility class which provides extra {@link ChannelBuffer}-related methods
- * which deal with data types used in the protocol.
+ * A utility class which provides extra {@link ChannelBuffer}-related methods which deal with data types used in the
+ * protocol.
+ *
* @author Graham
*/
public final class ChannelBufferUtil {
/**
* Reads a string from the specified buffer.
+ *
* @param buffer The buffer.
* @return The string.
*/
diff --git a/src/org/apollo/util/CharacterRepository.java b/src/org/apollo/util/CharacterRepository.java
index cb3a4dfb..6ba7930e 100644
--- a/src/org/apollo/util/CharacterRepository.java
+++ b/src/org/apollo/util/CharacterRepository.java
@@ -6,8 +6,8 @@ import java.util.NoSuchElementException;
import org.apollo.game.model.Character;
/**
- * A {@link CharacterRepository} is a repository of {@link Character}s that are
- * currently active in the game world.
+ * A {@link CharacterRepository} is a repository of {@link Character}s that are currently active in the game world.
+ *
* @author Graham
* @param The type of character.
*/
@@ -30,8 +30,8 @@ public final class CharacterRepository implements Iterable<
/**
* Creates a new character repository with the specified capacity.
- * @param capacity The maximum number of characters that can be present in
- * the repository.
+ *
+ * @param capacity The maximum number of characters that can be present in the repository.
*/
public CharacterRepository(int capacity) {
this.characters = new Character[capacity];
@@ -39,6 +39,7 @@ public final class CharacterRepository implements Iterable<
/**
* Gets the size of this repository.
+ *
* @return The number of characters in this repository.
*/
public int size() {
@@ -47,6 +48,7 @@ public final class CharacterRepository implements Iterable<
/**
* Gets the capacity of this repository.
+ *
* @return The maximum size of this repository.
*/
public int capacity() {
@@ -55,9 +57,10 @@ public final class CharacterRepository implements Iterable<
/**
* Adds a character to the repository.
+ *
* @param character The character to add.
- * @return {@code true} if the character was added, {@code false} if the
- * size has reached the capacity of this repository.
+ * @return {@code true} if the character was added, {@code false} if the size has reached the capacity of this
+ * repository.
*/
public boolean add(T character) {
if (size == characters.length) {
@@ -94,9 +97,10 @@ public final class CharacterRepository implements Iterable<
/**
* Removes a character from the repository.
+ *
* @param character The character to remove.
- * @return {@code true} if the character was removed, {@code false} if it
- * was not (e.g. if it was never added or has been removed already).
+ * @return {@code true} if the character was removed, {@code false} if it was not (e.g. if it was never added or has
+ * been removed already).
*/
public boolean remove(T character) {
int index = character.getIndex() - 1;
@@ -119,8 +123,8 @@ public final class CharacterRepository implements Iterable<
}
/**
- * The {@link Iterator} implementation for the {@link CharacterRepository}
- * class.
+ * The {@link Iterator} implementation for the {@link CharacterRepository} class.
+ *
* @author Graham
*/
private final class CharacterRepositoryIterator implements Iterator {
diff --git a/src/org/apollo/util/CompressionUtil.java b/src/org/apollo/util/CompressionUtil.java
index 55726740..3b773261 100644
--- a/src/org/apollo/util/CompressionUtil.java
+++ b/src/org/apollo/util/CompressionUtil.java
@@ -13,12 +13,14 @@ import org.apache.commons.compress.compressors.bzip2.BZip2CompressorOutputStream
/**
* A utility class for performing compression/uncompression.
+ *
* @author Graham
*/
public final class CompressionUtil {
/**
* Ungzips the compressed array and places the results into the uncompressed array.
+ *
* @param compressed The compressed array.
* @param uncompressed The uncompressed array.
* @throws IOException if an I/O error occurs.
@@ -34,6 +36,7 @@ public final class CompressionUtil {
/**
* Unbzip2s the compressed array and places the result into the uncompressed array.
+ *
* @param compressed The compressed array.
* @param uncompressed The uncompressed array.
* @throws IOException if an I/O error occurs.
@@ -46,7 +49,8 @@ public final class CompressionUtil {
newCompressed[3] = '1';
System.arraycopy(compressed, 0, newCompressed, 4, compressed.length);
- DataInputStream is = new DataInputStream(new BZip2CompressorInputStream(new ByteArrayInputStream(newCompressed)));
+ DataInputStream is = new DataInputStream(
+ new BZip2CompressorInputStream(new ByteArrayInputStream(newCompressed)));
try {
is.readFully(uncompressed);
} finally {
@@ -56,6 +60,7 @@ public final class CompressionUtil {
/**
* Gzips the specified array.
+ *
* @param bytes The uncompressed array.
* @return The compressed array.
* @throws IOException if an I/O error occurs.
@@ -74,6 +79,7 @@ public final class CompressionUtil {
/**
* Bzip2s the specified array.
+ *
* @param bytes The uncompressed array.
* @return The compressed array.
* @throws IOException if an I/O error occurs.
diff --git a/src/org/apollo/util/EnumerationUtil.java b/src/org/apollo/util/EnumerationUtil.java
index 5cdd4c79..d28704c5 100644
--- a/src/org/apollo/util/EnumerationUtil.java
+++ b/src/org/apollo/util/EnumerationUtil.java
@@ -4,15 +4,16 @@ import java.util.Enumeration;
import java.util.Iterator;
/**
- * A utility class for wrapping old {@link Enumeration} objects inside an
- * {@link Iterator} to allow for greater compatibility.
+ * A utility class for wrapping old {@link Enumeration} objects inside an {@link Iterator} to allow for greater
+ * compatibility.
+ *
* @author Graham
*/
public final class EnumerationUtil {
/**
- * Returns an {@link Iterator} which wraps around the specified
- * {@link Enumeration}.
+ * Returns an {@link Iterator} which wraps around the specified {@link Enumeration}.
+ *
* @param The type of object that is iterated over.
* @param enumeration The {@link Enumeration}.
* @return An {@link Iterator}.
diff --git a/src/org/apollo/util/LanguageUtil.java b/src/org/apollo/util/LanguageUtil.java
index f96999d9..35f4b3b8 100644
--- a/src/org/apollo/util/LanguageUtil.java
+++ b/src/org/apollo/util/LanguageUtil.java
@@ -2,12 +2,14 @@ package org.apollo.util;
/**
* A utility class which contains language-related methods.
+ *
* @author Graham
*/
public final class LanguageUtil {
/**
* Gets the indefinite article of a 'thing'.
+ *
* @param thing The thing.
* @return The indefinite article.
*/
diff --git a/src/org/apollo/util/NameUtil.java b/src/org/apollo/util/NameUtil.java
index 2aa79c26..af29dec6 100644
--- a/src/org/apollo/util/NameUtil.java
+++ b/src/org/apollo/util/NameUtil.java
@@ -2,6 +2,7 @@ package org.apollo.util;
/**
* A class which contains name-related utility methods.
+ *
* @author Graham
*/
public final class NameUtil {
@@ -9,16 +10,14 @@ public final class NameUtil {
/**
* An array of valid characters in a player name encoded as a long.
*/
- 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', '!', '@',
- '#', '$', '%', '^', '&', '*', '(', ')', '-', '+', '=', ':', ';',
- '.', '>', '<', ',', '"', '[', ']', '|', '?', '/', '`'
- };
+ 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 player name to a long.
+ *
* @param name The player name.
* @return The long.
*/
@@ -38,12 +37,14 @@ public final class NameUtil {
l += (27 + c) - 48;
}
}
- for (; l % 37L == 0L && l != 0L; l /= 37L);
+ for (; l % 37L == 0L && l != 0L; l /= 37L)
+ ;
return l;
}
/**
* Converts a long to a player name.
+ *
* @param l The long.
* @return The player name.
*/
diff --git a/src/org/apollo/util/NamedThreadFactory.java b/src/org/apollo/util/NamedThreadFactory.java
index e5d37a02..cf861deb 100644
--- a/src/org/apollo/util/NamedThreadFactory.java
+++ b/src/org/apollo/util/NamedThreadFactory.java
@@ -4,11 +4,12 @@ import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;
/**
- * A {@link ThreadFactory} which gives each thread a unique name made up of the
- * name supplied in the constructor and postfixed with an id.
+ * A {@link ThreadFactory} which gives each thread a unique name made up of the name supplied in the constructor and
+ * postfixed with an id.
*
- * For example, if the name {@code MyThread} was given and a third thread was
- * created by the factory, the resulting name would be {@code MyThread [id=2]}.
+ * For example, if the name {@code MyThread} was given and a third thread was created by the factory, the resulting name
+ * would be {@code MyThread [id=2]}.
+ *
* @author Graham
*/
public final class NamedThreadFactory implements ThreadFactory {
@@ -25,6 +26,7 @@ public final class NamedThreadFactory implements ThreadFactory {
/**
* Creates the named thread factory.
+ *
* @param name The unique name.
*/
public NamedThreadFactory(String name) {
diff --git a/src/org/apollo/util/StatefulFrameDecoder.java b/src/org/apollo/util/StatefulFrameDecoder.java
index f16bdba5..f80b2128 100644
--- a/src/org/apollo/util/StatefulFrameDecoder.java
+++ b/src/org/apollo/util/StatefulFrameDecoder.java
@@ -8,25 +8,20 @@ import org.jboss.netty.handler.codec.replay.ReplayingDecoder;
import org.jboss.netty.handler.codec.replay.VoidEnum;
/**
- * A stateful implementation of a {@link FrameDecoder} which may be
- * extended and used by other classes. The current state is tracked by this
- * class and is a user-specified enumeration.
- *
- * The state may be changed by calling the
- * {@link StatefulFrameDecoder#setState(Enum)} method.
- *
+ * A stateful implementation of a {@link FrameDecoder} which may be extended and used by other classes. The current
+ * state is tracked by this class and is a user-specified enumeration.
+ *
+ * The state may be changed by calling the {@link StatefulFrameDecoder#setState(Enum)} method.
+ *
* The current state is supplied as a parameter in the
- * {@link StatefulFrameDecoder#decode(ChannelHandlerContext, Channel, ChannelBuffer, Enum)}
- * and
- * {@link StatefulFrameDecoder#decodeLast(ChannelHandlerContext, Channel, ChannelBuffer, Enum)}
- * methods.
- *
- * This class is not thread safe: it is recommended that the state is only set
- * in the decode methods overriden.
- *
- * {@code null} states are not permitted. This means you cannot use
- * {@link VoidEnum} like used in a {@link ReplayingDecoder}. If you do not need
- * state management, the {@link FrameDecoder} class should be used instead.
+ * {@link StatefulFrameDecoder#decode(ChannelHandlerContext, Channel, ChannelBuffer, Enum)} and
+ * {@link StatefulFrameDecoder#decodeLast(ChannelHandlerContext, Channel, ChannelBuffer, Enum)} methods.
+ *
+ * This class is not thread safe: it is recommended that the state is only set in the decode methods overriden.
+ *
+ * {@code null} states are not permitted. This means you cannot use {@link VoidEnum} like used in a
+ * {@link ReplayingDecoder}. If you do not need state management, the {@link FrameDecoder} class should be used instead.
+ *
* @author Graham
* @param The state enumeration.
*/
@@ -39,6 +34,7 @@ public abstract class StatefulFrameDecoder> extends FrameDecod
/**
* Creates the stateful frame decoder with the specified initial state.
+ *
* @param state The initial state.
* @throws NullPointerException if the state is {@code null}.
*/
@@ -47,8 +43,8 @@ public abstract class StatefulFrameDecoder> extends FrameDecod
}
/**
- * Creates the stateful frame decoder with the specified initial state and
- * unwrap flag.
+ * Creates the stateful frame decoder with the specified initial state and unwrap flag.
+ *
* @param state The initial state.
* @param unwrap The unwrap flag.
* @throws NullPointerException if the state is {@code null}.
@@ -59,19 +55,19 @@ public abstract class StatefulFrameDecoder> extends FrameDecod
}
@Override
- protected final Object decode(ChannelHandlerContext ctx, Channel channel,
- ChannelBuffer buffer) throws Exception {
+ protected final Object decode(ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer) throws Exception {
return decode(ctx, channel, buffer, state);
}
@Override
- protected final Object decodeLast(ChannelHandlerContext ctx, Channel channel,
- ChannelBuffer buffer) throws Exception {
+ protected final Object decodeLast(ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer)
+ throws Exception {
return decodeLast(ctx, channel, buffer, state);
}
/**
* Sets a new state.
+ *
* @param state The new state.
* @throws NullPointerException if the state is {@code null}.
*/
@@ -84,34 +80,30 @@ public abstract class StatefulFrameDecoder> extends FrameDecod
/**
* Decodes the received packets into a frame.
+ *
* @param ctx The current context of this handler.
* @param channel The channel.
- * @param buffer The cumulative buffer, which may contain zero or more
- * bytes.
- * @param state The current state. The state may be changed by calling
- * {@link #setState(Enum)}.
- * @return The decoded frame, or {@code null} if not enough data was
- * received.
+ * @param buffer The cumulative buffer, which may contain zero or more bytes.
+ * @param state The current state. The state may be changed by calling {@link #setState(Enum)}.
+ * @return The decoded frame, or {@code null} if not enough data was received.
* @throws Exception if an error occurs during decoding.
*/
- protected abstract Object decode(ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer, T state) throws Exception;
+ protected abstract Object decode(ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer, T state)
+ throws Exception;
/**
- * Decodes remaining data before the channel is closed into a frame. You
- * may override this method, but it is not required. If you do not,
- * remaining data will be discarded!
+ * Decodes remaining data before the channel is closed into a frame. You may override this method, but it is not
+ * required. If you do not, remaining data will be discarded!
+ *
* @param ctx The current context of this handler.
* @param channel The channel.
- * @param buffer The cumulative buffer, which may contain zero or more
- * bytes.
- * @param state The current state. The state may be changed by calling
- * {@link #setState(Enum)}.
- * @return The decoded frame, or {@code null} if not enough data was
- * received.
+ * @param buffer The cumulative buffer, which may contain zero or more bytes.
+ * @param state The current state. The state may be changed by calling {@link #setState(Enum)}.
+ * @return The decoded frame, or {@code null} if not enough data was received.
* @throws Exception if an error occurs during decoding.
*/
- protected Object decodeLast(ChannelHandlerContext ctx, Channel channel,
- ChannelBuffer buffer, T state) throws Exception {
+ protected Object decodeLast(ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer, T state)
+ throws Exception {
return null;
}
diff --git a/src/org/apollo/util/StreamUtil.java b/src/org/apollo/util/StreamUtil.java
index 5de1a78a..0438b6e8 100644
--- a/src/org/apollo/util/StreamUtil.java
+++ b/src/org/apollo/util/StreamUtil.java
@@ -5,14 +5,15 @@ import java.io.InputStream;
import java.io.OutputStream;
/**
- * A class which contains {@link InputStream}- and {@link OutputStream}-related
- * utility methods.
+ * A class which contains {@link InputStream}- and {@link OutputStream}-related utility methods.
+ *
* @author Graham
*/
public final class StreamUtil {
/**
* Writes a string to the specified output stream.
+ *
* @param os The output stream.
* @param str The string.
* @throws IOException if an I/O error occurs.
@@ -26,6 +27,7 @@ public final class StreamUtil {
/**
* Reads a string from the specified input stream.
+ *
* @param is The input stream.
* @return The string.
* @throws IOException if an I/O error occurs.
diff --git a/src/org/apollo/util/TextUtil.java b/src/org/apollo/util/TextUtil.java
index 6d035e82..5554fb52 100644
--- a/src/org/apollo/util/TextUtil.java
+++ b/src/org/apollo/util/TextUtil.java
@@ -2,25 +2,24 @@ package org.apollo.util;
/**
* A class which contains text-related utility methods.
+ *
* @author Graham
*/
public final class TextUtil {
/**
- * An array of characters ordered by frequency - the elements with lower
- * indices (generally) appear more often in chat messages.
+ * 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', '$', '%', '"', '[', ']' };
/**
- * Uncompresses the compressed data ({@code in}) with the length
- * ({@code len}) and returns the uncompressed {@link String}.
+ * Uncompresses the compressed data ({@code in}) with the length ({@code len}) and returns the uncompressed
+ * {@link String}.
+ *
* @param in The compressed input data.
* @param len The length.
* @return The uncompressed {@link String}.
@@ -47,8 +46,8 @@ public final class TextUtil {
}
/**
- * Compresses the input text ({@code in}) and places the result in the
- * {@code out} array.
+ * Compresses the input text ({@code in}) and places the result in the {@code out} array.
+ *
* @param in The input text.
* @param out The output array.
* @return The number of bytes written to the output array.
@@ -95,6 +94,7 @@ public final class TextUtil {
/**
* Filters invalid characters from the specified string.
+ *
* @param str The input string.
* @return The filtered string.
*/
@@ -113,6 +113,7 @@ public final class TextUtil {
/**
* Capitalizes the string correctly.
+ *
* @param str The input string.
* @return The string with correct capitalization.
*/
diff --git a/src/org/apollo/util/package-info.java b/src/org/apollo/util/package-info.java
index 10d7f7b2..84028720 100644
--- a/src/org/apollo/util/package-info.java
+++ b/src/org/apollo/util/package-info.java
@@ -2,3 +2,4 @@
* Contains utility classes.
*/
package org.apollo.util;
+
diff --git a/src/org/apollo/util/plugin/DependencyException.java b/src/org/apollo/util/plugin/DependencyException.java
index 760783f8..38fcb31e 100644
--- a/src/org/apollo/util/plugin/DependencyException.java
+++ b/src/org/apollo/util/plugin/DependencyException.java
@@ -1,8 +1,8 @@
package org.apollo.util.plugin;
/**
- * An {@link Exception} which is thrown when a dependency cannot be resolved,
- * or when there is a circular dependency.
+ * An {@link Exception} which is thrown when a dependency cannot be resolved, or when there is a circular dependency.
+ *
* @author Graham
*/
@SuppressWarnings("serial")
@@ -10,6 +10,7 @@ public final class DependencyException extends Exception {
/**
* Creates the dependency exception.
+ *
* @param s The message describing what happened.
*/
public DependencyException(String s) {
diff --git a/src/org/apollo/util/plugin/PluginContext.java b/src/org/apollo/util/plugin/PluginContext.java
index 82ff5904..706b122c 100644
--- a/src/org/apollo/util/plugin/PluginContext.java
+++ b/src/org/apollo/util/plugin/PluginContext.java
@@ -13,9 +13,9 @@ import org.apollo.net.release.EventEncoder;
import org.apollo.net.release.Release;
/**
- * The {@link PluginContext} contains methods a plugin can use to interface
- * with the server, for example, by adding {@link EventHandler}s to
- * {@link EventHandlerChain}s.
+ * The {@link PluginContext} contains methods a plugin can use to interface with the server, for example, by adding
+ * {@link EventHandler}s to {@link EventHandlerChain}s.
+ *
* @author Graham
*/
public final class PluginContext {
@@ -27,6 +27,7 @@ public final class PluginContext {
/**
* Creates the plugin context.
+ *
* @param context The server context.
*/
public PluginContext(ServerContext context) {
@@ -35,6 +36,7 @@ public final class PluginContext {
/**
* Adds a command listener.
+ *
* @param name The name of the listener.
* @param listener The listener.
*/
@@ -44,6 +46,7 @@ public final class PluginContext {
/**
* Adds an event encoder.
+ *
* @param The type of encoder.
* @param releaseNo The release number.
* @param event The event.
@@ -60,6 +63,7 @@ public final class PluginContext {
/**
* Adds an event decoder.
+ *
* @param The type of decoder.
* @param releaseNo The release number.
* @param opcode The opcode.
@@ -76,6 +80,7 @@ public final class PluginContext {
/**
* Adds an event handler to the end of the chain.
+ *
* @param The type of event.
* @param event The event.
* @param handler The handler.
diff --git a/src/org/apollo/util/plugin/PluginEnvironment.java b/src/org/apollo/util/plugin/PluginEnvironment.java
index ebd677ad..9b01c4dc 100644
--- a/src/org/apollo/util/plugin/PluginEnvironment.java
+++ b/src/org/apollo/util/plugin/PluginEnvironment.java
@@ -3,14 +3,15 @@ package org.apollo.util.plugin;
import java.io.InputStream;
/**
- * Represents some sort of environment that plugins could be executed in, e.g.
- * {@code javax.script} or Jython.
+ * Represents some sort of environment that plugins could be executed in, e.g. {@code javax.script} or Jython.
+ *
* @author Graham
*/
public interface PluginEnvironment {
/**
* Parses the input stream.
+ *
* @param is The input stream.
* @param name The name of the file.
*/
@@ -18,6 +19,7 @@ public interface PluginEnvironment {
/**
* Sets the context for this environment.
+ *
* @param context The context.
*/
public void setContext(PluginContext context);
diff --git a/src/org/apollo/util/plugin/PluginManager.java b/src/org/apollo/util/plugin/PluginManager.java
index 456c45a1..dab739a5 100644
--- a/src/org/apollo/util/plugin/PluginManager.java
+++ b/src/org/apollo/util/plugin/PluginManager.java
@@ -20,6 +20,7 @@ import org.xml.sax.SAXException;
/**
* A class which manages plugins.
+ *
* @author Graham
*/
public final class PluginManager {
@@ -36,6 +37,7 @@ public final class PluginManager {
/**
* Creates the plugin manager.
+ *
* @param context The plugin context.
*/
public PluginManager(PluginContext context) {
@@ -63,6 +65,7 @@ public final class PluginManager {
/**
* Creates an iterator for the set of authors.
+ *
* @return The iterator.
*/
public Iterator createAuthorsIterator() {
@@ -71,6 +74,7 @@ public final class PluginManager {
/**
* Starts the plugin system by finding and loading all the plugins.
+ *
* @throws SAXException if a SAX error occurs.
* @throws IOException if an I/O error occurs.
* @throws DependencyException if a dependency could not be resolved.
@@ -89,6 +93,7 @@ public final class PluginManager {
/**
* Finds plugins and loads their meta data.
+ *
* @return A collection of plugin meta data objects.
* @throws IOException if an I/O error occurs.
* @throws SAXException if a SAX error occurs.
@@ -119,6 +124,7 @@ public final class PluginManager {
/**
* Starts a specific plugin.
+ *
* @param env The environment.
* @param plugin The plugin.
* @param plugins The plugin map.
@@ -126,7 +132,8 @@ 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;
@@ -153,6 +160,7 @@ public final class PluginManager {
/**
* Creates a plugin map from a collection.
+ *
* @param plugins The plugin collection.
* @return The plugin map.
*/
diff --git a/src/org/apollo/util/plugin/PluginMetaData.java b/src/org/apollo/util/plugin/PluginMetaData.java
index c6c4d018..a8944014 100644
--- a/src/org/apollo/util/plugin/PluginMetaData.java
+++ b/src/org/apollo/util/plugin/PluginMetaData.java
@@ -2,6 +2,7 @@ package org.apollo.util.plugin;
/**
* Contains attributes which describe a plugin.
+ *
* @author Graham
*/
public final class PluginMetaData {
@@ -43,6 +44,7 @@ public final class PluginMetaData {
/**
* Creates the plugin meta data.
+ *
* @param id The plugin's id.
* @param name The plugin's name.
* @param description The plugin's description.
@@ -51,7 +53,8 @@ public final class PluginMetaData {
* @param dependencies The plugin's dependencies.
* @param version The plugin's version.
*/
- public PluginMetaData(String id, String name, String description, String[] authors, String[] scripts, String[] dependencies, int version) {
+ public PluginMetaData(String id, String name, String description, String[] authors, String[] scripts,
+ String[] dependencies, int version) {
this.id = id;
this.name = name;
this.description = description;
@@ -63,6 +66,7 @@ public final class PluginMetaData {
/**
* Gets the plugin's id.
+ *
* @return The plugin's id.
*/
public String getId() {
@@ -71,6 +75,7 @@ public final class PluginMetaData {
/**
* Gets the plugin's name.
+ *
* @return The plugin's name.
*/
public String getName() {
@@ -79,6 +84,7 @@ public final class PluginMetaData {
/**
* Gets the plugin's description.
+ *
* @return The plugin's description.
*/
public String getDescription() {
@@ -87,6 +93,7 @@ public final class PluginMetaData {
/**
* Gets the plugin's authors.
+ *
* @return The plugin's authors.
*/
public String[] getAuthors() {
@@ -95,6 +102,7 @@ public final class PluginMetaData {
/**
* Gets the plugin's scripts.
+ *
* @return The plugin's scripts.
*/
public String[] getScripts() {
@@ -103,6 +111,7 @@ public final class PluginMetaData {
/**
* Gets the plugin's dependencies.
+ *
* @return The plugin's dependencies.
*/
public String[] getDependencies() {
@@ -111,6 +120,7 @@ public final class PluginMetaData {
/**
* Gets the plugin's version.
+ *
* @return The plugin's version.
*/
public int getVersion() {
diff --git a/src/org/apollo/util/plugin/RubyPluginEnvironment.java b/src/org/apollo/util/plugin/RubyPluginEnvironment.java
index 74095135..96d95058 100644
--- a/src/org/apollo/util/plugin/RubyPluginEnvironment.java
+++ b/src/org/apollo/util/plugin/RubyPluginEnvironment.java
@@ -9,6 +9,7 @@ import org.jruby.embed.ScriptingContainer;
/**
* A {@link PluginEnvironment} which uses Ruby.
+ *
* @author Graham
*/
public final class RubyPluginEnvironment implements PluginEnvironment {
@@ -20,6 +21,7 @@ public final class RubyPluginEnvironment implements PluginEnvironment {
/**
* Creates and bootstraps the Ruby plugin environment.
+ *
* @throws IOException if an I/O error occurs during bootstrapping.
*/
public RubyPluginEnvironment() throws IOException {
@@ -28,6 +30,7 @@ public final class RubyPluginEnvironment implements PluginEnvironment {
/**
* Parses the bootstrapper.
+ *
* @throws IOException if an I/O error occurs.
*/
private void parseBootstrapper() throws IOException {
diff --git a/src/org/apollo/util/plugin/package-info.java b/src/org/apollo/util/plugin/package-info.java
index 3b93bd8a..49fb70b1 100644
--- a/src/org/apollo/util/plugin/package-info.java
+++ b/src/org/apollo/util/plugin/package-info.java
@@ -2,3 +2,4 @@
* Contains classes related to plugins.
*/
package org.apollo.util.plugin;
+
diff --git a/src/org/apollo/util/xml/XmlNode.java b/src/org/apollo/util/xml/XmlNode.java
index 7caf3072..9cd38d17 100644
--- a/src/org/apollo/util/xml/XmlNode.java
+++ b/src/org/apollo/util/xml/XmlNode.java
@@ -10,8 +10,9 @@ import java.util.Map;
import java.util.Set;
/**
- * A class which represents a single node in the DOM tree, maintaining
- * information about its children, attributes, value and name.
+ * A class which represents a single node in the DOM tree, maintaining information about its children, attributes, value
+ * and name.
+ *
* @author Graham
*/
public final class XmlNode implements Iterable {
@@ -36,9 +37,9 @@ public final class XmlNode implements Iterable {
*/
private final List children = new ArrayList();
-
/**
* Creates a new {@link XmlNode} with the specified name.
+ *
* @param name The name of this node.
*/
public XmlNode(String name) {
@@ -47,6 +48,7 @@ public final class XmlNode implements Iterable {
/**
* Gets the name of this node.
+ *
* @return The name of this node.
*/
public String getName() {
@@ -55,6 +57,7 @@ public final class XmlNode implements Iterable {
/**
* Sets the name of this node.
+ *
* @param name The name of this node.
*/
public void setName(String name) {
@@ -63,6 +66,7 @@ public final class XmlNode implements Iterable {
/**
* Gets the value of this node.
+ *
* @return The value of this node, or {@code null} if it has no value.
*/
public String getValue() {
@@ -71,6 +75,7 @@ public final class XmlNode implements Iterable {
/**
* Sets the value of this node.
+ *
* @param value The value of this node.
*/
public void setValue(String value) {
@@ -86,6 +91,7 @@ public final class XmlNode implements Iterable {
/**
* Checks if this node has a value.
+ *
* @return {@code true} if so, {@code false} if not.
*/
public boolean hasValue() {
@@ -99,6 +105,7 @@ public final class XmlNode implements Iterable {
/**
* Gets a {@link Collection} of child {@link XmlNode}s.
+ *
* @return The collection.
*/
public Collection getChildren() {
@@ -107,9 +114,9 @@ public final class XmlNode implements Iterable {
/**
* Gets the first child with the specified name.
+ *
* @param name The name of the child.
- * @return The {@link XmlNode} if a child was found with a matching name,
- * {@code null} otherwise.
+ * @return The {@link XmlNode} if a child was found with a matching name, {@code null} otherwise.
*/
public XmlNode getChild(String name) {
for (XmlNode child : children) {
@@ -122,6 +129,7 @@ public final class XmlNode implements Iterable {
/**
* Gets a {@link Set} of attribute names.
+ *
* @return The set of names.
*/
public Set getAttributeNames() {
@@ -130,6 +138,7 @@ public final class XmlNode implements Iterable {
/**
* Gets a {@link Set} of attribute map entries.
+ *
* @return The set of entries.
*/
public Set> getAttributes() {
@@ -138,6 +147,7 @@ public final class XmlNode implements Iterable {
/**
* Gets an attribute by it's name.
+ *
* @param name The name of the attribute.
* @return The attribute's value, or {@code null} if it doesn't exist.
*/
@@ -147,9 +157,9 @@ public final class XmlNode implements Iterable {
/**
* Checks if an attribute with the specified name exists.
+ *
* @param name The attribute's name.
- * @return {@code true} if an attribute with that name exists,
- * {@code false} otherwise.
+ * @return {@code true} if an attribute with that name exists, {@code false} otherwise.
*/
public boolean containsAttribute(String name) {
return attributes.containsKey(name);
@@ -157,6 +167,7 @@ public final class XmlNode implements Iterable {
/**
* Adds an attribute. It will overwrite an existing attribute if it exists.
+ *
* @param name The name of the attribute.
* @param value The value of the attribute.
*/
@@ -166,6 +177,7 @@ public final class XmlNode implements Iterable {
/**
* Removes an attribute.
+ *
* @param name The name of the attribute.
*/
public void removeAttribute(String name) {
@@ -181,6 +193,7 @@ public final class XmlNode implements Iterable {
/**
* Adds a child {@link XmlNode}.
+ *
* @param child The child to add.
*/
public void addChild(XmlNode child) {
@@ -189,6 +202,7 @@ public final class XmlNode implements Iterable {
/**
* Removes a child {@link XmlNode}.
+ *
* @param child The child to remove.
*/
public void removeChild(XmlNode child) {
@@ -204,6 +218,7 @@ public final class XmlNode implements Iterable {
/**
* Gets the child count.
+ *
* @return The number of child {@link XmlNode}s.
*/
public int getChildCount() {
@@ -212,6 +227,7 @@ public final class XmlNode implements Iterable {
/**
* Gets the attribute count.
+ *
* @return The number of attributes.
*/
public int getAttributeCount() {
diff --git a/src/org/apollo/util/xml/XmlParser.java b/src/org/apollo/util/xml/XmlParser.java
index a0f20f32..b967d1a1 100644
--- a/src/org/apollo/util/xml/XmlParser.java
+++ b/src/org/apollo/util/xml/XmlParser.java
@@ -13,14 +13,15 @@ import org.xml.sax.helpers.DefaultHandler;
import org.xml.sax.helpers.XMLReaderFactory;
/**
- * A simple XML parser which uses the internal {@link org.xml.sax} API to
- * create a tree of {@link XmlNode} objects.
+ * A simple XML parser which uses the internal {@link org.xml.sax} API to create a tree of {@link XmlNode} objects.
+ *
* @author Graham
*/
public final class XmlParser {
/**
* A class which handles SAX events.
+ *
* @author Graham
*/
private final class XmlHandler extends DefaultHandler {
@@ -81,13 +82,13 @@ public final class XmlParser {
private XmlNode currentNode;
/**
- * The stack of nodes, which is used when traversing the document and going
- * through child nodes.
+ * The stack of nodes, which is used when traversing the document and going through child nodes.
*/
private Stack nodeStack = new Stack();
/**
* Creates a new xml parser.
+ *
* @throws SAXException if a SAX error occurs.
*/
public XmlParser() throws SAXException {
@@ -108,6 +109,7 @@ public final class XmlParser {
/**
* Parses XML data from the given {@link InputStream}.
+ *
* @param is The {@link InputStream}.
* @return The root {@link XmlNode}.
* @throws IOException if an I/O error occurs.
@@ -121,6 +123,7 @@ public final class XmlParser {
/**
* Parses XML data from the given {@link Reader}.
+ *
* @param reader The {@link Reader}.
* @return The root {@link XmlNode}.
* @throws IOException if an I/O error occurs.
@@ -134,6 +137,7 @@ public final class XmlParser {
/**
* Parses XML data from the {@link InputSource}.
+ *
* @param source The {@link InputSource}.
* @return The root {@link XmlNode}.
* @throws IOException if an I/O error occurs.
diff --git a/src/org/apollo/util/xml/package-info.java b/src/org/apollo/util/xml/package-info.java
index 875e5213..5d00c109 100644
--- a/src/org/apollo/util/xml/package-info.java
+++ b/src/org/apollo/util/xml/package-info.java
@@ -2,3 +2,4 @@
* Contains classes which parse XML data into an object tree.
*/
package org.apollo.util.xml;
+