diff --git a/.project b/.project index 6464f57b8..d561553c2 100644 --- a/.project +++ b/.project @@ -10,11 +10,6 @@ - - org.maven.ide.eclipse.maven2Builder - - - org.eclipse.m2e.core.maven2Builder diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index a2bf241bf..cf6ea6ad8 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -1,6 +1,13 @@ -#Tue Sep 13 16:51:09 BRT 2011 +#Tue Sep 13 17:32:00 BRT 2011 eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.source=1.7 diff --git a/pom.xml b/pom.xml index cb3c35810..e3c654f85 100644 --- a/pom.xml +++ b/pom.xml @@ -8,6 +8,45 @@ Lineage II server emulator 2011 + + GitHub + https://github.com/l2jserver2/l2jserver2-gs/issues + + + + GitHub + https://github.com/l2jserver2/l2jserver2-gs/wiki + + + + + rogiel + Rogiel + rogiel@rogiel.com + http://www.rogiel.com/ + -3 + + Creator + API Designer + + + + + + git://github.com/l2jserver2/l2jserver2-gs.git + ssh://git@github.com:l2jserver2/l2jserver2-gs.git + master + https://github.com/l2jserver2/l2jserver2-gs + + + + + GNU General Public License version 3 + http://www.gnu.org/licenses/gpl.txt + manual + + + package @@ -198,40 +237,11 @@ - - GitHub - https://github.com/Rogiel/l2jserver2-gs/issues - - - GitHub - https://github.com/Rogiel/l2jserver2-gs/wiki - - - - rogiel - Rogiel - rogiel@rogiel.com - http://www.rogiel.com - GMT - 3 - - Creator - API Designer - - - - - - - git://github.com/Rogiel/l2jserver2-gs.git - ssh://git@github.com:Rogiel/l2jserver2-gs.git - master - https://github.com/Rogiel/l2jserver2-gs - repository.jboss.org https://repository.jboss.org/nexus/content/repositories/releases/ - + false diff --git a/src/assembly/distribution-h2-bin.xml b/src/assembly/distribution-h2-bin.xml index 680a6fd9c..31b8dcfa2 100644 --- a/src/assembly/distribution-h2-bin.xml +++ b/src/assembly/distribution-h2-bin.xml @@ -31,12 +31,8 @@ ${project.build.directory} / - *.jar + ${project.artifactId}-${project.version}.jar - - *-sources.jar - *-javadoc.jar - diff --git a/src/assembly/distribution-mysql5-bin.xml b/src/assembly/distribution-mysql5-bin.xml index d1e43ff9b..40b697b55 100644 --- a/src/assembly/distribution-mysql5-bin.xml +++ b/src/assembly/distribution-mysql5-bin.xml @@ -31,12 +31,8 @@ ${project.build.directory} / - *.jar + ${project.artifactId}-${project.version}.jar - - *-sources.jar - *-javadoc.jar - diff --git a/src/main/java/com/l2jserver/L2JGameServerMain.java b/src/main/java/com/l2jserver/L2JGameServerMain.java index b929cc9b8..46e258f1b 100644 --- a/src/main/java/com/l2jserver/L2JGameServerMain.java +++ b/src/main/java/com/l2jserver/L2JGameServerMain.java @@ -30,8 +30,17 @@ import com.l2jserver.service.game.world.WorldIDService; import com.l2jserver.service.network.NetworkService; import com.l2jserver.service.network.keygen.BlowfishKeygenService; +/** + * Main class + * + * @author Rogiel + */ public class L2JGameServerMain { - public static void main(String[] args) throws InterruptedException { + /** + * Main method + * @param args no arguments are used + */ + public static void main(String[] args) { final L2JGameServer server = new L2JGameServer(); try { final ServiceManager serviceManager = server.getInjector() diff --git a/src/main/java/com/l2jserver/game/ai/AI.java b/src/main/java/com/l2jserver/game/ai/AI.java index fd3be3286..bba3eea52 100644 --- a/src/main/java/com/l2jserver/game/ai/AI.java +++ b/src/main/java/com/l2jserver/game/ai/AI.java @@ -20,6 +20,7 @@ import com.google.inject.Inject; import com.l2jserver.game.ai.desires.Desire; import com.l2jserver.game.ai.desires.DesireQueue; import com.l2jserver.model.world.Actor; +import com.l2jserver.service.game.world.WorldService; import com.l2jserver.service.game.world.event.WorldEventDispatcher; /** @@ -37,9 +38,18 @@ public abstract class AI { */ protected final T actor; + /** + * The {@link WorldService} event dispatcher + */ @Inject protected WorldEventDispatcher eventDispatcher; + /** + * Creates a new AI + * + * @param actor + * the actor controlled by this {@link AI} + */ protected AI(T actor) { this.actor = actor; } diff --git a/src/main/java/com/l2jserver/game/net/Lineage2Client.java b/src/main/java/com/l2jserver/game/net/Lineage2Client.java index 9fdcbb998..6834c1e8a 100644 --- a/src/main/java/com/l2jserver/game/net/Lineage2Client.java +++ b/src/main/java/com/l2jserver/game/net/Lineage2Client.java @@ -62,20 +62,6 @@ public class Lineage2Client { * The Lineage 2 session */ private Lineage2Session session; - /** - * The connection state - */ - private ConnectionState state = ConnectionState.CONNECTED; - - /** - * Each connection is represented by an state: connected, authenticated and - * in-game. - * - * @author Rogiel - */ - public enum ConnectionState { - CONNECTED, AUTHENTICATED, IN_GAME; - } /** * The client supported protocol version @@ -99,6 +85,8 @@ public class Lineage2Client { * * @param worldService * the world service + * @param networkService + * the network service * @param channel * the channel */ @@ -155,21 +143,6 @@ public class Lineage2Client { this.session = session; } - /** - * @return the state - */ - public ConnectionState getState() { - return state; - } - - /** - * @param state - * the state to set - */ - public void setState(ConnectionState state) { - this.state = state; - } - /** * @return the version */ @@ -190,6 +163,7 @@ public class Lineage2Client { * if the protocol is not known false will always be returned. * * @param version + * the protocol version to test for support * @return true if version is supported by the client * @see com.l2jserver.game.net.ProtocolVersion#supports(com.l2jserver.game.net.ProtocolVersion) */ diff --git a/src/main/java/com/l2jserver/game/net/Lineage2CryptographyKey.java b/src/main/java/com/l2jserver/game/net/Lineage2CryptographyKey.java index 20fb7cb34..2872c828a 100644 --- a/src/main/java/com/l2jserver/game/net/Lineage2CryptographyKey.java +++ b/src/main/java/com/l2jserver/game/net/Lineage2CryptographyKey.java @@ -78,6 +78,11 @@ public class Lineage2CryptographyKey { key[11] = (byte) (old >> 0x18 & 0xff); } + /** + * Creates a copy of this key + * + * @return the copied key + */ public Lineage2CryptographyKey copy() { return new Lineage2CryptographyKey(Arrays.copyOf(key, key.length)); } diff --git a/src/main/java/com/l2jserver/game/net/Lineage2PipelineFactory.java b/src/main/java/com/l2jserver/game/net/Lineage2PipelineFactory.java index 7915a245d..3605f6724 100644 --- a/src/main/java/com/l2jserver/game/net/Lineage2PipelineFactory.java +++ b/src/main/java/com/l2jserver/game/net/Lineage2PipelineFactory.java @@ -23,6 +23,7 @@ import org.jboss.netty.channel.ChannelPipelineFactory; import org.jboss.netty.handler.logging.LoggingHandler; import org.jboss.netty.logging.InternalLogLevel; +import com.google.inject.Guice; import com.google.inject.Inject; import com.google.inject.Injector; import com.l2jserver.game.net.codec.Lineage2Decrypter; @@ -56,6 +57,12 @@ public class Lineage2PipelineFactory implements ChannelPipelineFactory { */ private final WorldService worldService; + /** + * Creates a new instance of this pipeline + * @param injector the {@link Guice} {@link Injector} + * @param networkService the network service + * @param worldService the world service + */ @Inject public Lineage2PipelineFactory(Injector injector, NetworkService networkService, WorldService worldService) { diff --git a/src/main/java/com/l2jserver/game/net/ProtocolVersion.java b/src/main/java/com/l2jserver/game/net/ProtocolVersion.java index 586f49b67..db064b958 100644 --- a/src/main/java/com/l2jserver/game/net/ProtocolVersion.java +++ b/src/main/java/com/l2jserver/game/net/ProtocolVersion.java @@ -40,18 +40,45 @@ public enum ProtocolVersion { */ HIGH5(268, FREYA); + /** + * The parent version + */ public final ProtocolVersion parent; + /** + * This version numeric ID + */ public final int version; + /** + * Creates a new instance + * + * @param version + * the version integer id + */ ProtocolVersion(int version) { this(version, null); } + /** + * Creates a new instance with a parent version + * + * @param version + * the version integer id + * @param parent + * the parent version + */ ProtocolVersion(int version, ProtocolVersion parent) { this.version = version; this.parent = parent; } + /** + * Checks if an given version is compatible with this + * + * @param version + * the target version to be tested + * @return true if version is compatible + */ public boolean supports(ProtocolVersion version) { if (this == version) return true; @@ -60,6 +87,11 @@ public enum ProtocolVersion { return this.parent.supports(version); } + /** + * @param version + * the version integer id + * @return the detected version from the numeric id. Can be null + */ public static ProtocolVersion fromVersion(int version) { for (ProtocolVersion v : values()) { if (v.version == version) diff --git a/src/main/java/com/l2jserver/game/net/SystemMessage.java b/src/main/java/com/l2jserver/game/net/SystemMessage.java index db5778c0c..288179a58 100644 --- a/src/main/java/com/l2jserver/game/net/SystemMessage.java +++ b/src/main/java/com/l2jserver/game/net/SystemMessage.java @@ -15206,9 +15206,19 @@ public enum SystemMessage { */ THOMAS_D_TURKEY_DISAPPEARED(6505); + /** + * The system message integer id + */ public final int id; + /** + * The cached {@link SM_SYSTEM_MESSAGE} packet + */ public final SM_SYSTEM_MESSAGE packet; + /** + * @param id + * the integer id + */ SystemMessage(int id) { this.id = id; this.packet = new SM_SYSTEM_MESSAGE(this); diff --git a/src/main/java/com/l2jserver/game/net/codec/Lineage2Decrypter.java b/src/main/java/com/l2jserver/game/net/codec/Lineage2Decrypter.java index 01844a5c3..b52cee98a 100644 --- a/src/main/java/com/l2jserver/game/net/codec/Lineage2Decrypter.java +++ b/src/main/java/com/l2jserver/game/net/codec/Lineage2Decrypter.java @@ -70,7 +70,8 @@ public class Lineage2Decrypter extends OneToOneDecoder { /** * Creates a random key and enables descrypting * - * @return the generated key + * @param key + * the key */ public void enable(Lineage2CryptographyKey key) { this.setKey(key); @@ -89,10 +90,19 @@ public class Lineage2Decrypter extends OneToOneDecoder { this.key = key; } + /** + * @return true if decrypter is enabled + */ public boolean isEnabled() { return enabled; } + /** + * Sets the state of this decrypter + * + * @param enabled + * the new state + */ public void setEnabled(boolean enabled) { this.enabled = enabled; } diff --git a/src/main/java/com/l2jserver/game/net/codec/Lineage2Encrypter.java b/src/main/java/com/l2jserver/game/net/codec/Lineage2Encrypter.java index 0c3b260e7..7655b32c9 100644 --- a/src/main/java/com/l2jserver/game/net/codec/Lineage2Encrypter.java +++ b/src/main/java/com/l2jserver/game/net/codec/Lineage2Encrypter.java @@ -90,10 +90,19 @@ public class Lineage2Encrypter extends OneToOneEncoder { this.key = key; } + /** + * @return true if this encrypter is enabled + */ public boolean isEnabled() { return enabled; } + /** + * Sets the state of this encrypter + * + * @param enabled + * the new state + */ public void setEnabled(boolean enabled) { this.enabled = enabled; } diff --git a/src/main/java/com/l2jserver/game/net/codec/Lineage2FrameDecoder.java b/src/main/java/com/l2jserver/game/net/codec/Lineage2FrameDecoder.java index e7b53ae45..afbc38100 100644 --- a/src/main/java/com/l2jserver/game/net/codec/Lineage2FrameDecoder.java +++ b/src/main/java/com/l2jserver/game/net/codec/Lineage2FrameDecoder.java @@ -31,6 +31,9 @@ import org.jboss.netty.handler.codec.frame.FrameDecoder; * @author Rogiel */ public class Lineage2FrameDecoder extends FrameDecoder { + /** + * The message header size (in bytes) + */ private static final int HEADER_SIZE = 2; @Override diff --git a/src/main/java/com/l2jserver/game/net/handler/Lineage2PacketHandler.java b/src/main/java/com/l2jserver/game/net/handler/Lineage2PacketHandler.java index 781a7812c..801108e4c 100644 --- a/src/main/java/com/l2jserver/game/net/handler/Lineage2PacketHandler.java +++ b/src/main/java/com/l2jserver/game/net/handler/Lineage2PacketHandler.java @@ -53,6 +53,14 @@ public class Lineage2PacketHandler extends SimpleChannelHandler { */ private Lineage2Client connection; + /** + * Creates a new instance of the packet handler + * + * @param nettyNetworkService + * the netty network service + * @param worldService + * the world service + */ public Lineage2PacketHandler(NettyNetworkService nettyNetworkService, WorldService worldService) { this.nettyNetworkService = nettyNetworkService; diff --git a/src/main/java/com/l2jserver/game/net/packet/AbstractServerPacket.java b/src/main/java/com/l2jserver/game/net/packet/AbstractServerPacket.java index 0022bf6a6..3a22dd49c 100644 --- a/src/main/java/com/l2jserver/game/net/packet/AbstractServerPacket.java +++ b/src/main/java/com/l2jserver/game/net/packet/AbstractServerPacket.java @@ -23,8 +23,17 @@ package com.l2jserver.game.net.packet; * @see ServerPacket */ public abstract class AbstractServerPacket implements ServerPacket { + /** + * The packet OPCODE + */ private final int opcode; + /** + * Creates a new instance of the packet + * + * @param opcode + * the packet opcode + */ public AbstractServerPacket(int opcode) { this.opcode = opcode; } diff --git a/src/main/java/com/l2jserver/game/net/packet/client/CM_ACTION_USE.java b/src/main/java/com/l2jserver/game/net/packet/client/CM_ACTION_USE.java index 97006744b..d6e5aefe6 100644 --- a/src/main/java/com/l2jserver/game/net/packet/client/CM_ACTION_USE.java +++ b/src/main/java/com/l2jserver/game/net/packet/client/CM_ACTION_USE.java @@ -43,35 +43,108 @@ public class CM_ACTION_USE extends AbstractClientPacket { */ private final CharacterService charService; + /** + * The action to be performed + */ private Action action; + /** + * The enumeration of all possible actions + * + * @author Rogiel + */ public enum Action { - SIT_STAND(0), WALK_RUN(1), - - PRIVATE_STORE_SELL(10), PRIVATE_STORE_BUY(11), - - PET_FOLLOW_MOVE(15), PET_FOLLOW_MOVE2(21), - - PET_ATTACK(16), PET_ATTACK2(22), - - PET_STOP(17), PET_STOP2(23), + /** + * Toggles the character in SIT or STAND mode + */ + SIT_STAND(0), + /** + * Toggles the character in WALK or RUN mode + */ + WALK_RUN(1), + /** + * Stats a new private store sell + */ + PRIVATE_STORE_SELL(10), + /** + * Stats a new private store buy + */ + PRIVATE_STORE_BUY(11), + /** + * Sets the pet in follow mode + */ + PET_FOLLOW_MOVE(15), + /** + * Sets the pet in follow mode 2 + */ + PET_FOLLOW_MOVE2(21), + /** + * Orders the pet to attack + */ + PET_ATTACK(16), + /** + * Orders the pet to attack (second type) + */ + PET_ATTACK2(22), + /** + * Orders the pet to stop + */ + PET_STOP(17), + /** + * Orders the pet to stop (second type) + */ + PET_STOP2(23), + /** + * Unsummons the pet + */ PET_UNSUMMON(19), - + /** + * Mounts or dismount from pet + */ MOUNT_DISMOUNT(38), + /** + * Switch Wild Hog Cannon mode + */ + WILD_HOG_CANNON_SWITCH_MODE(32), + /** + * Stops Wild Hog Cannon + */ + WILD_HOG_CANNON_STOP(41), - WILD_HOG_CANNON_SWITCH_MODE(32), WILD_HOG_CANNON_STOP(41), - - SOULESS_TOXIC_SMOKE(36), SOULESS_PARASITE_BURST(39), - + /** + * Souless toxic smoke + */ + SOULESS_TOXIC_SMOKE(36), + /** + * Souless parasite burst + */ + SOULESS_PARASITE_BURST(39), + /** + * Creates a new darwven manufacture + */ DWARVEN_MANUFACTURE(37); + /** + * The numeric action id + */ public final int id; + /** + * @param id + * the numeric action id + */ Action(int id) { this.id = id; } + /** + * Resolves the numeric id into an Java type action + * + * @param id + * the numeric id + * @return the resolved action + */ public static Action fromID(int id) { for (final Action action : values()) if (action.id == id) @@ -80,11 +153,21 @@ public class CM_ACTION_USE extends AbstractClientPacket { } } + /** + * If CTRL key was pressed for this action + */ @SuppressWarnings("unused") private boolean ctrlPressed; + /** + * If SHIFT key was pressed for this action + */ @SuppressWarnings("unused") private boolean shiftPressed; + /** + * @param charService + * the character service + */ @Inject public CM_ACTION_USE(CharacterService charService) { this.charService = charService; diff --git a/src/main/java/com/l2jserver/game/net/packet/client/CM_ADMIN_COMMAND.java b/src/main/java/com/l2jserver/game/net/packet/client/CM_ADMIN_COMMAND.java index 0952746c9..c8fb1a9b1 100644 --- a/src/main/java/com/l2jserver/game/net/packet/client/CM_ADMIN_COMMAND.java +++ b/src/main/java/com/l2jserver/game/net/packet/client/CM_ADMIN_COMMAND.java @@ -46,6 +46,10 @@ public class CM_ADMIN_COMMAND extends AbstractClientPacket { @SuppressWarnings("unused") private String command; + /** + * @param adminService + * the administrator service + */ @Inject public CM_ADMIN_COMMAND(AdministratorService adminService) { this.adminService = adminService; diff --git a/src/main/java/com/l2jserver/game/net/packet/client/CM_ATTACK.java b/src/main/java/com/l2jserver/game/net/packet/client/CM_ATTACK.java index a1ba985c2..ae160c9c4 100644 --- a/src/main/java/com/l2jserver/game/net/packet/client/CM_ATTACK.java +++ b/src/main/java/com/l2jserver/game/net/packet/client/CM_ATTACK.java @@ -76,6 +76,11 @@ public class CM_ATTACK extends AbstractClientPacket { @SuppressWarnings("unused") private CharacterAttackAction action; + /** + * Enumeration of all possible attack actions + * + * @author Rogiel + */ public enum CharacterAttackAction { /** * Normal click @@ -86,12 +91,27 @@ public class CM_ATTACK extends AbstractClientPacket { */ SHIFT_CLICK(1); + /** + * The attack action numeric id + */ public final int id; + /** + * @param id + * the action numeric id + */ CharacterAttackAction(int id) { this.id = id; } + /** + * Resolves the numeric action id to an {@link CharacterAttackAction} + * type + * + * @param id + * the numeric id + * @return the resolved action + */ public static CharacterAttackAction fromID(int id) { for (final CharacterAttackAction action : values()) if (action.id == id) @@ -100,6 +120,12 @@ public class CM_ATTACK extends AbstractClientPacket { } } + /** + * @param charService + * the character service + * @param idResolver + * the object id resolver + */ @Inject public CM_ATTACK(CharacterService charService, ObjectIDResolver idResolver) { this.charService = charService; diff --git a/src/main/java/com/l2jserver/game/net/packet/client/CM_AUTH_LOGIN.java b/src/main/java/com/l2jserver/game/net/packet/client/CM_AUTH_LOGIN.java index 0ac748331..74c7ffac7 100644 --- a/src/main/java/com/l2jserver/game/net/packet/client/CM_AUTH_LOGIN.java +++ b/src/main/java/com/l2jserver/game/net/packet/client/CM_AUTH_LOGIN.java @@ -58,11 +58,29 @@ public class CM_AUTH_LOGIN extends AbstractClientPacket { * User account name */ private String loginName; + /** + * The play key 1 + */ private int playKey1; + /** + * The play key 2 + */ private int playKey2; + /** + * The login key 1 + */ private int loginKey1; + /** + * The login key 2 + */ private int loginKey2; + /** + * @param characterDao + * the character DAO + * @param accountIdFactory + * the account id factory + */ @Inject public CM_AUTH_LOGIN(CharacterDAO characterDao, AccountIDProvider accountIdFactory) { diff --git a/src/main/java/com/l2jserver/game/net/packet/client/CM_BYPASS.java b/src/main/java/com/l2jserver/game/net/packet/client/CM_BYPASS.java index a3fec8e3d..a56c4564d 100644 --- a/src/main/java/com/l2jserver/game/net/packet/client/CM_BYPASS.java +++ b/src/main/java/com/l2jserver/game/net/packet/client/CM_BYPASS.java @@ -40,6 +40,9 @@ import com.l2jserver.util.BufferUtils; * @author Rogiel */ public class CM_BYPASS extends AbstractClientPacket { + /** + * The logger + */ private final Logger log = LoggerFactory.getLogger(this.getClass()); /** @@ -61,6 +64,12 @@ public class CM_BYPASS extends AbstractClientPacket { */ private String command; + /** + * @param idResolver + * the object id resolver + * @param npcService + * the {@link NPC} service + */ @Inject public CM_BYPASS(ObjectIDResolver idResolver, NPCService npcService) { this.idResolver = idResolver; @@ -98,6 +107,11 @@ public class CM_BYPASS extends AbstractClientPacket { } } + /** + * @param tokenizer + * the tokenizer + * @return an array of strings with each parameter + */ private String[] createArgumentArray(StringTokenizer tokenizer) { if (!tokenizer.hasMoreTokens()) return new String[0]; diff --git a/src/main/java/com/l2jserver/game/net/packet/server/SM_SYSTEM_MESSAGE.java b/src/main/java/com/l2jserver/game/net/packet/server/SM_SYSTEM_MESSAGE.java index 9d6c808e9..2963bebdb 100644 --- a/src/main/java/com/l2jserver/game/net/packet/server/SM_SYSTEM_MESSAGE.java +++ b/src/main/java/com/l2jserver/game/net/packet/server/SM_SYSTEM_MESSAGE.java @@ -75,6 +75,9 @@ public class SM_SYSTEM_MESSAGE extends AbstractServerPacket { /** * Creates a new instance + * + * @param message + * the {@link SystemMessage} */ public SM_SYSTEM_MESSAGE(SystemMessage message) { super(OPCODE); @@ -108,8 +111,9 @@ public class SM_SYSTEM_MESSAGE extends AbstractServerPacket { * 81-89 Territory names
* 101-121 Fortress names
* - * @param number - * @return + * @param fort + * the fort + * @return the {@link SM_SYSTEM_MESSAGE} instance */ public final SM_SYSTEM_MESSAGE addFort(final Fort fort) { params.add(new SystemMessagePacketParameter() { @@ -206,7 +210,8 @@ public class SM_SYSTEM_MESSAGE extends AbstractServerPacket { * Elemental name - 0(Fire) ... * * @param type - * @return + * the type + * @return the {@link SM_SYSTEM_MESSAGE} instance */ public final SM_SYSTEM_MESSAGE addElemntal(final int type) { params.add(new SystemMessagePacketParameter() { @@ -223,7 +228,8 @@ public class SM_SYSTEM_MESSAGE extends AbstractServerPacket { * ID from sysstring-e.dat * * @param type - * @return + * the type + * @return the {@link SM_SYSTEM_MESSAGE} instance */ public final SM_SYSTEM_MESSAGE addSystemString(final int type) { params.add(new SystemMessagePacketParameter() { @@ -241,7 +247,7 @@ public class SM_SYSTEM_MESSAGE extends AbstractServerPacket { * * @param type * id of instance - * @return + * @return the {@link SM_SYSTEM_MESSAGE} instance */ public final SM_SYSTEM_MESSAGE addInstanceName(final int type) { params.add(new SystemMessagePacketParameter() { diff --git a/src/main/java/com/l2jserver/model/AbstractModel.java b/src/main/java/com/l2jserver/model/AbstractModel.java index bb33970fa..8a01afcdd 100644 --- a/src/main/java/com/l2jserver/model/AbstractModel.java +++ b/src/main/java/com/l2jserver/model/AbstractModel.java @@ -22,6 +22,9 @@ import com.l2jserver.model.id.ID; /** * Simple model interface implementing {@link ID} related methods * + * @param + * the ID type used to represent this {@link Model} + * * @author Rogiel */ public abstract class AbstractModel> implements Model { @@ -63,6 +66,7 @@ public abstract class AbstractModel> implements Model { * {@link ObjectDesire#INSERT} or {@link ObjectDesire#DELETE} the desire * will not be changed. */ + @SuppressWarnings("javadoc") protected void desireUpdate() { if (this.desire != ObjectDesire.INSERT && this.desire != ObjectDesire.DELETE) @@ -73,6 +77,7 @@ public abstract class AbstractModel> implements Model { * Set this object desire to {@link ObjectDesire#INSERT}. If the desire is * {@link ObjectDesire#DELETE} the desire will not be changed. */ + @SuppressWarnings("javadoc") protected void desireInsert() { if (this.desire != ObjectDesire.DELETE) this.desire = ObjectDesire.INSERT; diff --git a/src/main/java/com/l2jserver/model/Model.java b/src/main/java/com/l2jserver/model/Model.java index 64041c342..3a6a42399 100644 --- a/src/main/java/com/l2jserver/model/Model.java +++ b/src/main/java/com/l2jserver/model/Model.java @@ -20,8 +20,13 @@ import com.l2jserver.model.id.ID; import com.l2jserver.service.database.DatabaseService; /** - * @author Rogiel + * Base model. Each object model must implement this interface to be able to be + * inserted into the database. * + * @param + * the {@link ID} type used to represent this {@link Model} + * + * @author Rogiel */ public interface Model> { /** diff --git a/src/main/java/com/l2jserver/model/dao/NPCDAO.java b/src/main/java/com/l2jserver/model/dao/NPCDAO.java index 2245e966a..b0a6917a1 100644 --- a/src/main/java/com/l2jserver/model/dao/NPCDAO.java +++ b/src/main/java/com/l2jserver/model/dao/NPCDAO.java @@ -41,7 +41,7 @@ public interface NPCDAO extends DataAccessObject, Cacheable { /** * Select an {@link NPC} by its template. * - * @param name + * @param templateID * the npc template id * @return the found NPC. Null if does not exists. */ diff --git a/src/main/java/com/l2jserver/model/game/Castle.java b/src/main/java/com/l2jserver/model/game/Castle.java new file mode 100644 index 000000000..9fd921990 --- /dev/null +++ b/src/main/java/com/l2jserver/model/game/Castle.java @@ -0,0 +1,133 @@ +/* + * This file is part of l2jserver . + * + * l2jserver is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * l2jserver is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with l2jserver. If not, see . + */ +package com.l2jserver.model.game; + +import java.util.Date; + +import com.l2jserver.model.AbstractModel; +import com.l2jserver.model.id.CastleID; +import com.l2jserver.model.id.FortID; +import com.l2jserver.model.id.object.CharacterID; + +/** + * An fort in Lineage II game world + * + * @author Rogiel + */ +public class Castle extends AbstractModel { + /** + * The {@link Castle} of which this {@link Castle} belongs to + */ + private CastleID castleID; + /** + * The owner (clan leader) of which this {@link Castle} belongs to. + */ + private CharacterID ownerID; + + /** + * The castle name + */ + private String name; + /** + * The siege date + */ + private Date siegeDate; + /** + * The last time this fort was owned by someone + */ + private Date lastOwnedTime; + + /** + * @return the castleID + */ + public CastleID getCastleID() { + return castleID; + } + + /** + * @param castleID + * the castleID to set + */ + public void setCastleID(CastleID castleID) { + desireUpdate(); + this.castleID = castleID; + } + + /** + * @return the ownerID + */ + public CharacterID getOwnerID() { + return ownerID; + } + + /** + * @param ownerID + * the ownerID to set + */ + public void setOwnerID(CharacterID ownerID) { + desireUpdate(); + this.ownerID = ownerID; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name + * the name to set + */ + public void setName(String name) { + desireUpdate(); + this.name = name; + } + + /** + * @return the siegeDate + */ + public Date getSiegeDate() { + return siegeDate; + } + + /** + * @param siegeDate + * the siegeDate to set + */ + public void setSiegeDate(Date siegeDate) { + desireUpdate(); + this.siegeDate = siegeDate; + } + + /** + * @return the lastOwnedTime + */ + public Date getLastOwnedTime() { + return lastOwnedTime; + } + + /** + * @param lastOwnedTime + * the lastOwnedTime to set + */ + public void setLastOwnedTime(Date lastOwnedTime) { + desireUpdate(); + this.lastOwnedTime = lastOwnedTime; + } +} diff --git a/src/main/java/com/l2jserver/model/game/CharacterFriend.java b/src/main/java/com/l2jserver/model/game/CharacterFriend.java index 40a606a1c..7a10a9ab4 100644 --- a/src/main/java/com/l2jserver/model/game/CharacterFriend.java +++ b/src/main/java/com/l2jserver/model/game/CharacterFriend.java @@ -27,22 +27,38 @@ import com.l2jserver.model.world.L2Character; * @author Rogiel */ public class CharacterFriend extends AbstractModel { + /** + * @param id + * the friend id + */ public CharacterFriend(FriendID id) { this.setID(id); } + /** + * @return the character id + */ public CharacterID getCharacterID() { return id.getID1(); } + /** + * @return the character + */ public L2Character getCharacter() { return id.getID1().getObject(); } + /** + * @return the friend id + */ public CharacterID getFriendID() { return id.getID2(); } + /** + * @return the friend + */ public L2Character getFriend() { return id.getID2().getObject(); } diff --git a/src/main/java/com/l2jserver/model/game/Fort.java b/src/main/java/com/l2jserver/model/game/Fort.java index e3db9166c..1113a4ead 100644 --- a/src/main/java/com/l2jserver/model/game/Fort.java +++ b/src/main/java/com/l2jserver/model/game/Fort.java @@ -61,7 +61,14 @@ public class Fort extends AbstractModel { * @author Rogiel */ public enum FortType { - TYPE1, TYPE2; + /** + * Fort type 1 + */ + TYPE1, + /** + * Fort type 2 + */ + TYPE2; } /** diff --git a/src/main/java/com/l2jserver/model/game/Shortcut.java b/src/main/java/com/l2jserver/model/game/Shortcut.java index 0ebbc1143..950c2dd68 100644 --- a/src/main/java/com/l2jserver/model/game/Shortcut.java +++ b/src/main/java/com/l2jserver/model/game/Shortcut.java @@ -63,13 +63,39 @@ public class Shortcut extends AbstractModel { * @author Rogiel */ public enum ShortcutType { - ITEM(1), SKILL(2), ACTION(3), MACRO(4), RECIPE(5), TPBOOKMARK(6); + /** + * Item shortcut + */ + ITEM(1), + /** + * Skill shortcut + */ + SKILL(2), + /** + * Social action shortcut + */ + ACTION(3), + /** + * Macro shortcut + */ + MACRO(4), + /** + * Recipe shortcut + */ + RECIPE(5), + /** + * Bookmark shortcut + */ + TPBOOKMARK(6); /** * The shortcut type id */ public final int id; + /** + * @param id the numeric id + */ ShortcutType(int id) { this.id = id; } @@ -78,7 +104,7 @@ public class Shortcut extends AbstractModel { * * @param id * the type id - * @return + * @return the {@link ShortcutType} */ public static ShortcutType fromID(int id) { for (final ShortcutType shortcut : values()) { @@ -101,8 +127,8 @@ public class Shortcut extends AbstractModel { /** * Creates a new instance * - * @param character - * the character + * @param characterID + * the character id */ public Shortcut(CharacterID characterID) { this.characterID = characterID; diff --git a/src/main/java/com/l2jserver/model/game/Skill.java b/src/main/java/com/l2jserver/model/game/Skill.java index 01562f751..4218f49b7 100644 --- a/src/main/java/com/l2jserver/model/game/Skill.java +++ b/src/main/java/com/l2jserver/model/game/Skill.java @@ -29,6 +29,9 @@ import com.l2jserver.model.world.Actor; * @author Rogiel */ public class Skill extends AbstractModel { + /** + * The {@link Skill} template id + */ private final SkillTemplateID templateID; /** * The skill level learned @@ -38,6 +41,8 @@ public class Skill extends AbstractModel { /** * Creates a new instance in level one * + * @param templateID + * the {@link SkillTemplateID} instance * @param level * the level of this skill */ @@ -48,6 +53,9 @@ public class Skill extends AbstractModel { /** * Creates a new instance in level one + * + * @param templateID + * the {@link SkillTemplateID} instance */ public Skill(SkillTemplateID templateID) { this(templateID, 1); diff --git a/src/main/java/com/l2jserver/model/id/AbstractModelID.java b/src/main/java/com/l2jserver/model/id/AbstractModelID.java index d1389e897..83bfde5c5 100644 --- a/src/main/java/com/l2jserver/model/id/AbstractModelID.java +++ b/src/main/java/com/l2jserver/model/id/AbstractModelID.java @@ -22,6 +22,11 @@ import com.l2jserver.model.Model; * This is an abstract ID for most model objects that do not extend * {@link ObjectID}. * + * @param + * the raw id type + * @param + * the model this {@link ID} provides + * * @author Rogiel */ public abstract class AbstractModelID>> diff --git a/src/main/java/com/l2jserver/model/id/CastleID.java b/src/main/java/com/l2jserver/model/id/CastleID.java index 1b98bd7a8..5c871f49e 100644 --- a/src/main/java/com/l2jserver/model/id/CastleID.java +++ b/src/main/java/com/l2jserver/model/id/CastleID.java @@ -18,6 +18,7 @@ package com.l2jserver.model.id; import com.google.inject.Inject; import com.google.inject.assistedinject.Assisted; +import com.l2jserver.model.game.Castle; import com.l2jserver.model.id.provider.IDProvider; /** diff --git a/src/main/java/com/l2jserver/model/id/ID.java b/src/main/java/com/l2jserver/model/id/ID.java index 7a6f62c78..2721b843e 100644 --- a/src/main/java/com/l2jserver/model/id/ID.java +++ b/src/main/java/com/l2jserver/model/id/ID.java @@ -21,6 +21,9 @@ import com.google.inject.Inject; /** * The ID interface. Each object must be represented by an unique ID. * + * @param + * the raw id type + * * @author Rogiel */ public abstract class ID { @@ -29,6 +32,9 @@ public abstract class ID { */ protected final T id; + /** + * @param id the raw id + */ @Inject protected ID(T id) { this.id = id; diff --git a/src/main/java/com/l2jserver/model/id/TemplateID.java b/src/main/java/com/l2jserver/model/id/TemplateID.java index 920c54856..e42731edd 100644 --- a/src/main/java/com/l2jserver/model/id/TemplateID.java +++ b/src/main/java/com/l2jserver/model/id/TemplateID.java @@ -21,6 +21,7 @@ import java.lang.ref.SoftReference; import com.l2jserver.model.id.provider.IDProvider; import com.l2jserver.model.template.Template; +import com.l2jserver.service.game.template.TemplateService; /** * Templates IDs, different from {@link ObjectID}s, can be repeated and are @@ -29,9 +30,22 @@ import com.l2jserver.model.template.Template; * Please, do not directly instantiate this class, use an {@link IDProvider} * instead. * + * @param + * the template type provided by this {@link TemplateID} + * @param + * the raw ID type + * * @author Rogiel */ public abstract class TemplateID, I> extends ID { + /** + * The cached template {@link Reference} + *

+ * Please, avoid using it directly. Instead use {@link #getTemplate()} to + * retrieve the template object, since it will check if the reference is + * still valid and if not, will request the template with + * {@link TemplateService}. + */ private Reference cached; /** diff --git a/src/main/java/com/l2jserver/model/id/compound/AbstractCompoundID.java b/src/main/java/com/l2jserver/model/id/compound/AbstractCompoundID.java index ef55e5e87..72e51fa72 100644 --- a/src/main/java/com/l2jserver/model/id/compound/AbstractCompoundID.java +++ b/src/main/java/com/l2jserver/model/id/compound/AbstractCompoundID.java @@ -21,6 +21,11 @@ import com.l2jserver.model.id.ID; /** * The compound {@link ID} is composed of two IDs. * + * @param + * the first {@link ID} type + * @param + * the second {@link ID} type + * * @author Rogiel */ public class AbstractCompoundID extends ID> { diff --git a/src/main/java/com/l2jserver/model/id/object/ActorID.java b/src/main/java/com/l2jserver/model/id/object/ActorID.java index d9f136671..18e4f9edd 100644 --- a/src/main/java/com/l2jserver/model/id/object/ActorID.java +++ b/src/main/java/com/l2jserver/model/id/object/ActorID.java @@ -33,6 +33,9 @@ import com.l2jserver.model.world.Actor; * the actor subclass */ public abstract class ActorID extends ObjectID { + /** + * @param id the raw id + */ @Inject public ActorID(@Assisted int id) { super(id); diff --git a/src/main/java/com/l2jserver/model/id/object/CharacterID.java b/src/main/java/com/l2jserver/model/id/object/CharacterID.java index 0cf12c4a9..ce5bbec19 100644 --- a/src/main/java/com/l2jserver/model/id/object/CharacterID.java +++ b/src/main/java/com/l2jserver/model/id/object/CharacterID.java @@ -37,6 +37,10 @@ public final class CharacterID extends ActorID { */ private transient final CharacterDAO characterDao; + /** + * @param id the raw id + * @param characterDao the character DAO + */ @Inject public CharacterID(@Assisted int id, CharacterDAO characterDao) { super(id); diff --git a/src/main/java/com/l2jserver/model/id/object/ClanID.java b/src/main/java/com/l2jserver/model/id/object/ClanID.java index 427f1be7d..56e287674 100644 --- a/src/main/java/com/l2jserver/model/id/object/ClanID.java +++ b/src/main/java/com/l2jserver/model/id/object/ClanID.java @@ -37,6 +37,10 @@ public final class ClanID extends ObjectID { */ private final ClanDAO clanDao; + /** + * @param id the raw id + * @param clanDao the clan DAO + */ @Inject protected ClanID(@Assisted int id, ClanDAO clanDao) { super(id); diff --git a/src/main/java/com/l2jserver/model/id/object/ItemID.java b/src/main/java/com/l2jserver/model/id/object/ItemID.java index 95c8cfb3f..6168ca05b 100644 --- a/src/main/java/com/l2jserver/model/id/object/ItemID.java +++ b/src/main/java/com/l2jserver/model/id/object/ItemID.java @@ -37,6 +37,10 @@ public final class ItemID extends ObjectID { */ private final ItemDAO itemDao; + /** + * @param id the raw id + * @param itemDao the item DAO + */ @Inject protected ItemID(@Assisted int id, ItemDAO itemDao) { super(id); diff --git a/src/main/java/com/l2jserver/model/id/object/NPCID.java b/src/main/java/com/l2jserver/model/id/object/NPCID.java index 782835e7c..10bf5a4cd 100644 --- a/src/main/java/com/l2jserver/model/id/object/NPCID.java +++ b/src/main/java/com/l2jserver/model/id/object/NPCID.java @@ -40,6 +40,12 @@ public final class NPCID extends ActorID { */ private final WorldService worldService; + /** + * @param id + * the raw id + * @param worldService + * the world service + */ @Inject public NPCID(@Assisted int id, WorldService worldService) { super(id); diff --git a/src/main/java/com/l2jserver/model/id/object/PetID.java b/src/main/java/com/l2jserver/model/id/object/PetID.java index 5f46c8f23..9c6f8d5a5 100644 --- a/src/main/java/com/l2jserver/model/id/object/PetID.java +++ b/src/main/java/com/l2jserver/model/id/object/PetID.java @@ -36,6 +36,10 @@ public final class PetID extends ActorID { */ private final PetDAO petDao; + /** + * @param id the raw id + * @param petDao the pet DAO + */ @Inject protected PetID(int id, PetDAO petDao) { super(id); diff --git a/src/main/java/com/l2jserver/model/id/object/allocator/IDAllocatorException.java b/src/main/java/com/l2jserver/model/id/object/allocator/IDAllocatorException.java index 3c2e0633a..d3b85fee8 100644 --- a/src/main/java/com/l2jserver/model/id/object/allocator/IDAllocatorException.java +++ b/src/main/java/com/l2jserver/model/id/object/allocator/IDAllocatorException.java @@ -22,20 +22,40 @@ package com.l2jserver.model.id.object.allocator; * @author Rogiel */ public class IDAllocatorException extends RuntimeException { + /** + * The Java Serialization Serial + */ private static final long serialVersionUID = 111195059766878062L; + /** + * Creates an empty instance of this exception + */ public IDAllocatorException() { super(); } + /** + * @param message + * the message + * @param cause + * the root cause + */ public IDAllocatorException(String message, Throwable cause) { super(message, cause); } + /** + * @param message + * the message + */ public IDAllocatorException(String message) { super(message); } + /** + * @param cause + * the root cause + */ public IDAllocatorException(Throwable cause) { super(cause); } diff --git a/src/main/java/com/l2jserver/model/id/object/provider/CharacterIDProvider.java b/src/main/java/com/l2jserver/model/id/object/provider/CharacterIDProvider.java index 75ecd0ef3..264561606 100644 --- a/src/main/java/com/l2jserver/model/id/object/provider/CharacterIDProvider.java +++ b/src/main/java/com/l2jserver/model/id/object/provider/CharacterIDProvider.java @@ -42,6 +42,14 @@ public class CharacterIDProvider implements ObjectIDProvider { */ private final CharacterIDGuiceFactory factory; + /** + * @param allocator + * the id allocator + * @param idService + * the world id service + * @param factory + * the character id factory + */ @Inject public CharacterIDProvider(IDAllocator allocator, WorldIDService idService, CharacterIDGuiceFactory factory) { diff --git a/src/main/java/com/l2jserver/model/id/object/provider/ClanIDProvider.java b/src/main/java/com/l2jserver/model/id/object/provider/ClanIDProvider.java index e4b85f674..d279ce680 100644 --- a/src/main/java/com/l2jserver/model/id/object/provider/ClanIDProvider.java +++ b/src/main/java/com/l2jserver/model/id/object/provider/ClanIDProvider.java @@ -42,6 +42,14 @@ public class ClanIDProvider implements ObjectIDProvider { */ private final ClanIDGuiceFactory factory; + /** + * @param allocator + * the id allocator + * @param idService + * the world id service + * @param factory + * the clan id factory + */ @Inject public ClanIDProvider(IDAllocator allocator, WorldIDService idService, ClanIDGuiceFactory factory) { diff --git a/src/main/java/com/l2jserver/model/id/object/provider/ItemIDProvider.java b/src/main/java/com/l2jserver/model/id/object/provider/ItemIDProvider.java index 416445d11..2adf05e88 100644 --- a/src/main/java/com/l2jserver/model/id/object/provider/ItemIDProvider.java +++ b/src/main/java/com/l2jserver/model/id/object/provider/ItemIDProvider.java @@ -42,6 +42,14 @@ public class ItemIDProvider implements ObjectIDProvider { */ private final ItemIDGuiceFactory factory; + /** + * @param allocator + * the id allocator + * @param idService + * the world id service + * @param factory + * the item id factory + */ @Inject public ItemIDProvider(IDAllocator allocator, WorldIDService idService, ItemIDGuiceFactory factory) { diff --git a/src/main/java/com/l2jserver/model/id/object/provider/NPCIDProvider.java b/src/main/java/com/l2jserver/model/id/object/provider/NPCIDProvider.java index 0e32f3dc7..3c0829358 100644 --- a/src/main/java/com/l2jserver/model/id/object/provider/NPCIDProvider.java +++ b/src/main/java/com/l2jserver/model/id/object/provider/NPCIDProvider.java @@ -42,6 +42,14 @@ public class NPCIDProvider implements ObjectIDProvider { */ private final NPCIDGuiceFactory factory; + /** + * @param allocator + * the id allocator + * @param idService + * the world id service + * @param factory + * the npc id factory + */ @Inject public NPCIDProvider(IDAllocator allocator, WorldIDService idService, NPCIDGuiceFactory factory) { diff --git a/src/main/java/com/l2jserver/model/id/object/provider/ObjectIDProvider.java b/src/main/java/com/l2jserver/model/id/object/provider/ObjectIDProvider.java index 37321a2bf..d90aba6fa 100644 --- a/src/main/java/com/l2jserver/model/id/object/provider/ObjectIDProvider.java +++ b/src/main/java/com/l2jserver/model/id/object/provider/ObjectIDProvider.java @@ -19,6 +19,12 @@ package com.l2jserver.model.id.object.provider; import com.l2jserver.model.id.ObjectID; import com.l2jserver.model.id.provider.IDProvider; +/** + * @author Rogiel + * + * @param + * the ID type provided + */ public interface ObjectIDProvider> extends IDProvider { /** diff --git a/src/main/java/com/l2jserver/model/id/object/provider/ObjectIDResolver.java b/src/main/java/com/l2jserver/model/id/object/provider/ObjectIDResolver.java index c750ce548..5f7dcdd50 100644 --- a/src/main/java/com/l2jserver/model/id/object/provider/ObjectIDResolver.java +++ b/src/main/java/com/l2jserver/model/id/object/provider/ObjectIDResolver.java @@ -55,6 +55,10 @@ public class ObjectIDResolver implements ObjectIDProvider> { */ private final WorldIDService idService; + /** + * @param idService + * the world id service + */ @Inject public ObjectIDResolver(WorldIDService idService) { this.idService = idService; @@ -64,6 +68,7 @@ public class ObjectIDResolver implements ObjectIDProvider> { * Resolvers do not support creating new IDs * * @throws UnsupportedOperationException + * always */ @Override public ObjectID createID() { @@ -94,6 +99,7 @@ public class ObjectIDResolver implements ObjectIDProvider> { * Resolvers do not support destroying IDs * * @throws UnsupportedOperationException + * always */ @Override public void destroy(ObjectID id) { diff --git a/src/main/java/com/l2jserver/model/id/object/provider/PetIDProvider.java b/src/main/java/com/l2jserver/model/id/object/provider/PetIDProvider.java index 43eddd147..90787c8ee 100644 --- a/src/main/java/com/l2jserver/model/id/object/provider/PetIDProvider.java +++ b/src/main/java/com/l2jserver/model/id/object/provider/PetIDProvider.java @@ -42,6 +42,14 @@ public class PetIDProvider implements ObjectIDProvider { */ private final PetIDGuiceFactory factory; + /** + * @param allocator + * the id allocator + * @param idService + * the world id service + * @param factory + * the pet id factory + */ @Inject public PetIDProvider(IDAllocator allocator, WorldIDService idService, PetIDGuiceFactory factory) { diff --git a/src/main/java/com/l2jserver/model/id/provider/CompoundIDProvider.java b/src/main/java/com/l2jserver/model/id/provider/CompoundIDProvider.java index 5ff21b554..b02216822 100644 --- a/src/main/java/com/l2jserver/model/id/provider/CompoundIDProvider.java +++ b/src/main/java/com/l2jserver/model/id/provider/CompoundIDProvider.java @@ -24,6 +24,12 @@ import com.l2jserver.model.id.compound.AbstractCompoundID; * The ID factory is used to create instances of IDs. It will automatically make * sure the ID is free before allocating it. * + * @param + * the first compound {@link ID} type + * @param + * the second compound {@link ID} type + * @param + * the {@link CompoundIDProvider} type * @author Rogiel */ public interface CompoundIDProvider, I2 extends ID, T extends AbstractCompoundID> { diff --git a/src/main/java/com/l2jserver/model/id/provider/IDProvider.java b/src/main/java/com/l2jserver/model/id/provider/IDProvider.java index 6d0349da2..e7c1abdf8 100644 --- a/src/main/java/com/l2jserver/model/id/provider/IDProvider.java +++ b/src/main/java/com/l2jserver/model/id/provider/IDProvider.java @@ -31,6 +31,10 @@ import com.l2jserver.model.id.ID; * object will be created and following calls will always return the same * object. * + * @param + * the raw id type + * @param + * the {@link ID} implementation * @author Rogiel */ public interface IDProvider> { @@ -38,7 +42,8 @@ public interface IDProvider> { * Creates the ID object for an EXISTING ID. * * @param id - * @return + * the raw id value + * @return the resolved {@link ID} object */ T resolveID(I id); } diff --git a/src/main/java/com/l2jserver/model/id/template/ActorTemplateID.java b/src/main/java/com/l2jserver/model/id/template/ActorTemplateID.java index 078be5a71..f6df6c493 100644 --- a/src/main/java/com/l2jserver/model/id/template/ActorTemplateID.java +++ b/src/main/java/com/l2jserver/model/id/template/ActorTemplateID.java @@ -27,6 +27,8 @@ import com.l2jserver.service.game.template.TemplateService; /** * An {@link TemplateID} instance representing an {@link ActorTemplate} object * + * @param + * the type of {@link ActorTemplate} this {@link TemplateID} represents * @author Rogiel */ public class ActorTemplateID> extends @@ -36,6 +38,10 @@ public class ActorTemplateID> extends */ private transient final TemplateService templateService; + /** + * @param id the raw id + * @param templateService the template service + */ @Inject protected ActorTemplateID(@Assisted int id, TemplateService templateService) { super(id); diff --git a/src/main/java/com/l2jserver/model/id/template/CharacterTemplateID.java b/src/main/java/com/l2jserver/model/id/template/CharacterTemplateID.java index a0ce40f62..b084632e9 100644 --- a/src/main/java/com/l2jserver/model/id/template/CharacterTemplateID.java +++ b/src/main/java/com/l2jserver/model/id/template/CharacterTemplateID.java @@ -29,6 +29,10 @@ import com.l2jserver.service.game.template.TemplateService; * @author Rogiel */ public class CharacterTemplateID extends ActorTemplateID { + /** + * @param id the raw id + * @param templateService the template service + */ @Inject public CharacterTemplateID(@Assisted int id, TemplateService templateService) { super(id, templateService); diff --git a/src/main/java/com/l2jserver/model/id/template/ItemTemplateID.java b/src/main/java/com/l2jserver/model/id/template/ItemTemplateID.java index 598a59906..3ab158bf0 100644 --- a/src/main/java/com/l2jserver/model/id/template/ItemTemplateID.java +++ b/src/main/java/com/l2jserver/model/id/template/ItemTemplateID.java @@ -36,8 +36,11 @@ public class ItemTemplateID extends TemplateID { */ private final TemplateService templateService; + /** + * @param id the raw id + * @param templateService the template service + */ @Inject - // FIXME this should be protected public ItemTemplateID(@Assisted int id, TemplateService templateService) { super(id); this.templateService = templateService; diff --git a/src/main/java/com/l2jserver/model/id/template/NPCTemplateID.java b/src/main/java/com/l2jserver/model/id/template/NPCTemplateID.java index 0795ddb6c..d36da5b15 100644 --- a/src/main/java/com/l2jserver/model/id/template/NPCTemplateID.java +++ b/src/main/java/com/l2jserver/model/id/template/NPCTemplateID.java @@ -32,6 +32,10 @@ import com.l2jserver.util.jaxb.NPCTemplateIDAdapter; */ @XmlJavaTypeAdapter(value = NPCTemplateIDAdapter.class) public class NPCTemplateID extends ActorTemplateID { + /** + * @param id the raw id + * @param templateService the template service + */ @Inject public NPCTemplateID(@Assisted int id, TemplateService templateService) { super(id, templateService); diff --git a/src/main/java/com/l2jserver/model/id/template/SkillTemplateID.java b/src/main/java/com/l2jserver/model/id/template/SkillTemplateID.java index 550862d07..5ba8c6bdc 100644 --- a/src/main/java/com/l2jserver/model/id/template/SkillTemplateID.java +++ b/src/main/java/com/l2jserver/model/id/template/SkillTemplateID.java @@ -33,6 +33,10 @@ public class SkillTemplateID extends TemplateID { */ private final TemplateService templateService; + /** + * @param id the raw id + * @param templateService the template service + */ @Inject public SkillTemplateID(@Assisted int id, TemplateService templateService) { super(id); diff --git a/src/main/java/com/l2jserver/model/id/template/TeleportationTemplateID.java b/src/main/java/com/l2jserver/model/id/template/TeleportationTemplateID.java index 3e74e1c6e..b9dad0f7b 100644 --- a/src/main/java/com/l2jserver/model/id/template/TeleportationTemplateID.java +++ b/src/main/java/com/l2jserver/model/id/template/TeleportationTemplateID.java @@ -39,6 +39,10 @@ public class TeleportationTemplateID extends */ private final TemplateService templateService; + /** + * @param id the raw id + * @param templateService the template service + */ @Inject public TeleportationTemplateID(@Assisted int id, TemplateService templateService) { diff --git a/src/main/java/com/l2jserver/model/id/template/provider/TemplateIDProvider.java b/src/main/java/com/l2jserver/model/id/template/provider/TemplateIDProvider.java index b575d2875..133d9f1a2 100644 --- a/src/main/java/com/l2jserver/model/id/template/provider/TemplateIDProvider.java +++ b/src/main/java/com/l2jserver/model/id/template/provider/TemplateIDProvider.java @@ -22,10 +22,11 @@ import com.l2jserver.model.id.provider.IDProvider; /** * Creates a new {@link TemplateID} * - * @author Rogiel - * + * @param + * the raw id type * @param - * the subclass of {@link TemplateID} that will be createdF + * the subclass of {@link TemplateID} that will be created + * @author Rogiel */ public interface TemplateIDProvider> extends IDProvider { diff --git a/src/main/java/com/l2jserver/model/server/AttackHit.java b/src/main/java/com/l2jserver/model/server/AttackHit.java index 9f8dc0f66..48a598cd5 100644 --- a/src/main/java/com/l2jserver/model/server/AttackHit.java +++ b/src/main/java/com/l2jserver/model/server/AttackHit.java @@ -73,6 +73,10 @@ public class AttackHit { */ public final byte flag; + /** + * @param flag + * the bitset flag + */ AttackHitFlag(byte flag) { this.flag = flag; } diff --git a/src/main/java/com/l2jserver/model/server/attack/AttackCalculator.java b/src/main/java/com/l2jserver/model/server/attack/AttackCalculator.java index 6fdd53ffe..537dc19bb 100644 --- a/src/main/java/com/l2jserver/model/server/attack/AttackCalculator.java +++ b/src/main/java/com/l2jserver/model/server/attack/AttackCalculator.java @@ -24,11 +24,23 @@ import com.l2jserver.util.calculator.ComplexCalculator; */ public class AttackCalculator extends ComplexCalculator { + /** + * @param functions + * the functions + */ public AttackCalculator(AttackCalculatorFunction... functions) { super(AttackCalculatorType.class, functions); } + /** + * The calculator attributes + * + * @author Rogiel + */ public enum AttackCalculatorType { + /** + * Calculates the damage dealt by the attack + */ DAMAGE; } } diff --git a/src/main/java/com/l2jserver/model/server/attack/AttackCalculatorContext.java b/src/main/java/com/l2jserver/model/server/attack/AttackCalculatorContext.java index 3deb9e6b2..e7ce9c692 100644 --- a/src/main/java/com/l2jserver/model/server/attack/AttackCalculatorContext.java +++ b/src/main/java/com/l2jserver/model/server/attack/AttackCalculatorContext.java @@ -23,9 +23,21 @@ import com.l2jserver.util.calculator.CalculatorContext; * @author Rogiel */ public class AttackCalculatorContext extends CalculatorContext { + /** + * The attacker actor + */ public final Actor attacker; + /** + * The target actor + */ public final Actor target; + /** + * @param attacker + * the attacker + * @param target + * the target + */ public AttackCalculatorContext(Actor attacker, Actor target) { this.attacker = attacker; this.target = target; diff --git a/src/main/java/com/l2jserver/model/server/attack/AttackCalculatorFunction.java b/src/main/java/com/l2jserver/model/server/attack/AttackCalculatorFunction.java index 02713d541..6ec72e7be 100644 --- a/src/main/java/com/l2jserver/model/server/attack/AttackCalculatorFunction.java +++ b/src/main/java/com/l2jserver/model/server/attack/AttackCalculatorFunction.java @@ -25,6 +25,12 @@ import com.l2jserver.util.calculator.AbstractDoubleFunction; */ public abstract class AttackCalculatorFunction extends AbstractDoubleFunction { + /** + * @param order + * the calculation order + * @param type + * the function attribute + */ public AttackCalculatorFunction(int order, AttackCalculatorType type) { super(order, type); } @@ -34,5 +40,14 @@ public abstract class AttackCalculatorFunction extends return calculate(ctx.attacker, ctx.target, value); } + /** + * @param attacker + * the attacker + * @param target + * the target + * @param value + * the original value + * @return the calculated value + */ public abstract double calculate(Actor attacker, Actor target, double value); } diff --git a/src/main/java/com/l2jserver/model/server/attack/PhysicalAttackCalculator.java b/src/main/java/com/l2jserver/model/server/attack/PhysicalAttackCalculator.java index f6a6d0149..8947a29e6 100644 --- a/src/main/java/com/l2jserver/model/server/attack/PhysicalAttackCalculator.java +++ b/src/main/java/com/l2jserver/model/server/attack/PhysicalAttackCalculator.java @@ -24,6 +24,9 @@ import com.l2jserver.model.world.Actor; * @author Rogiel */ public class PhysicalAttackCalculator extends AttackCalculator { + /** + * Creates a new instance + */ public PhysicalAttackCalculator() { super(new AttackCalculatorFunction(0x000, AttackCalculatorType.DAMAGE) { @Override diff --git a/src/main/java/com/l2jserver/model/template/ActorTemplate.java b/src/main/java/com/l2jserver/model/template/ActorTemplate.java index e1cfbdef5..253b47925 100644 --- a/src/main/java/com/l2jserver/model/template/ActorTemplate.java +++ b/src/main/java/com/l2jserver/model/template/ActorTemplate.java @@ -24,6 +24,8 @@ import com.l2jserver.model.world.Actor; /** * Template for {@link Actor} * + * @param + * the {@link Actor} type this template is for * @author Rogiel */ public abstract class ActorTemplate extends @@ -42,5 +44,10 @@ public abstract class ActorTemplate extends return actor; } + /** + * Creates a new instance + * + * @return the created template instance + */ protected abstract T createInstance(); } \ No newline at end of file diff --git a/src/main/java/com/l2jserver/model/template/CharacterTemplate.java b/src/main/java/com/l2jserver/model/template/CharacterTemplate.java index cf5c10cec..82dfaabc6 100644 --- a/src/main/java/com/l2jserver/model/template/CharacterTemplate.java +++ b/src/main/java/com/l2jserver/model/template/CharacterTemplate.java @@ -207,6 +207,9 @@ public class CharacterTemplate extends ActorTemplate { return stats.crafter; } + /** + * @return the base HP + */ public double getBaseHP() { if (stats == null) return 0; @@ -215,6 +218,9 @@ public class CharacterTemplate extends ActorTemplate { return stats.hp.base; } + /** + * @return the base HP modifier + */ public double getBaseHPModifier() { if (stats == null) return 0; @@ -223,6 +229,9 @@ public class CharacterTemplate extends ActorTemplate { return stats.hp.modifier; } + /** + * @return the base HP add + */ public double getBaseHPAdd() { if (stats == null) return 0; @@ -231,7 +240,10 @@ public class CharacterTemplate extends ActorTemplate { return stats.hp.add; } - public double getBaseBaseMP() { + /** + * @return the base MP + */ + public double getBaseMP() { if (stats == null) return 0; if (stats.mp == null) @@ -239,6 +251,9 @@ public class CharacterTemplate extends ActorTemplate { return stats.mp.base; } + /** + * @return the base MP modifier + */ public double getBaseMPModifier() { if (stats == null) return 0; @@ -247,6 +262,9 @@ public class CharacterTemplate extends ActorTemplate { return stats.mp.modifier; } + /** + * @return the base MP add + */ public double getBaseMPAdd() { if (stats == null) return 0; @@ -255,6 +273,9 @@ public class CharacterTemplate extends ActorTemplate { return stats.mp.add; } + /** + * @return the base CP + */ public double getBaseCP() { if (stats == null) return 0; @@ -263,6 +284,9 @@ public class CharacterTemplate extends ActorTemplate { return stats.cp.base; } + /** + * @return the base CP modifier + */ public double getBaseCPModifier() { if (stats == null) return 0; @@ -271,6 +295,9 @@ public class CharacterTemplate extends ActorTemplate { return stats.cp.modifier; } + /** + * @return the base CP add + */ public double getBaseCPAdd() { if (stats == null) return 0; @@ -390,6 +417,9 @@ public class CharacterTemplate extends ActorTemplate { return stats.attack.magical.speed; } + /** + * @return the base run speed + */ public double getBaseRunSpeed() { if (stats == null) return 0; @@ -398,6 +428,9 @@ public class CharacterTemplate extends ActorTemplate { return stats.move.run; } + /** + * @return the base walk speed + */ public double getBaseWalkSpeed() { if (stats == null) return 0; @@ -481,6 +514,9 @@ public class CharacterTemplate extends ActorTemplate { return stats.maximumLoad; } + /** + * @return the male collision radius + */ public double getMaleCollisionRadius() { if (collision == null) return 0; @@ -489,6 +525,9 @@ public class CharacterTemplate extends ActorTemplate { return collision.male.radius; } + /** + * @return the male collision height + */ public double getMaleCollisionHeight() { if (collision == null) return 0; @@ -497,6 +536,9 @@ public class CharacterTemplate extends ActorTemplate { return collision.male.height; } + /** + * @return the female collision radius + */ public double getFemaleCollisionRadius() { if (collision == null) return 0; @@ -505,6 +547,9 @@ public class CharacterTemplate extends ActorTemplate { return collision.female.radius; } + /** + * @return the female collision height + */ public double getFemaleCollisionHeight() { if (collision == null) return 0; diff --git a/src/main/java/com/l2jserver/model/template/SkillTemplate.java b/src/main/java/com/l2jserver/model/template/SkillTemplate.java index 3e84ca28c..7dc0109a1 100644 --- a/src/main/java/com/l2jserver/model/template/SkillTemplate.java +++ b/src/main/java/com/l2jserver/model/template/SkillTemplate.java @@ -57,6 +57,14 @@ public class SkillTemplate extends AbstractTemplate { return create(null); } + /** + * Creates a new instance + * + * @param actorID + * the actor ID + * + * @return the created template instance + */ public Skill create(ActorID actorID) { final Skill skill = new Skill(id); if (actorID != null) diff --git a/src/main/java/com/l2jserver/model/template/actor/ActorSex.java b/src/main/java/com/l2jserver/model/template/actor/ActorSex.java index 28dc855c0..fed3fefe3 100644 --- a/src/main/java/com/l2jserver/model/template/actor/ActorSex.java +++ b/src/main/java/com/l2jserver/model/template/actor/ActorSex.java @@ -7,14 +7,33 @@ package com.l2jserver.model.template.actor; * @author Rogiel */ public enum ActorSex { - MALE(0x00), FEMALE(0x01); + /** + * Represents an male character + */ + MALE(0x00), + /** + * Represents an female character + */ + FEMALE(0x01); + /** + * The numeric sex option + */ public final int option; + /** + * @param option + * the numeric sex option + */ ActorSex(int option) { this.option = option; } + /** + * @param option + * the numeric sex option + * @return the resolved {@link ActorSex} + */ public static ActorSex fromOption(int option) { for (ActorSex sex : values()) { if (sex.option == option) diff --git a/src/main/java/com/l2jserver/model/template/calculator/ItemSetActorCalculator.java b/src/main/java/com/l2jserver/model/template/calculator/ItemSetActorCalculator.java index 3a5dcc185..3e5959b3b 100644 --- a/src/main/java/com/l2jserver/model/template/calculator/ItemSetActorCalculator.java +++ b/src/main/java/com/l2jserver/model/template/calculator/ItemSetActorCalculator.java @@ -27,8 +27,17 @@ import com.l2jserver.model.world.actor.stat.StatType; * */ public class ItemSetActorCalculator extends ActorFormula { + /** + * The stat set + */ private final StatSet set; + /** + * @param set + * the stat set + * @param type + * the stat type + */ public ItemSetActorCalculator(StatSet set, StatType type) { super(set.getOrder(), type); this.set = set; diff --git a/src/main/java/com/l2jserver/model/template/capability/Interactable.java b/src/main/java/com/l2jserver/model/template/capability/Interactable.java index 7ad780a8c..bf8a7713f 100644 --- a/src/main/java/com/l2jserver/model/template/capability/Interactable.java +++ b/src/main/java/com/l2jserver/model/template/capability/Interactable.java @@ -24,13 +24,16 @@ import com.l2jserver.util.exception.L2Exception; /** * Defines an {@link Template} which the player can interact with * + * @param + * the interable {@link WorldObject} type * @author Rogiel - * */ public interface Interactable extends TemplateCapability { /** * Performs an interaction with this template. * + * @param object + * the object to interact with * @param character * the interacting character * @param args diff --git a/src/main/java/com/l2jserver/model/template/character/CharacterRace.java b/src/main/java/com/l2jserver/model/template/character/CharacterRace.java index 334a09845..fc2f9eee2 100644 --- a/src/main/java/com/l2jserver/model/template/character/CharacterRace.java +++ b/src/main/java/com/l2jserver/model/template/character/CharacterRace.java @@ -13,6 +13,9 @@ public enum CharacterRace { */ public final int id; + /** + * @param id the race numeric id + */ CharacterRace(int id) { this.id = id; } diff --git a/src/main/java/com/l2jserver/model/template/item/ItemType.java b/src/main/java/com/l2jserver/model/template/item/ItemType.java index 7901f822d..b795fcc80 100644 --- a/src/main/java/com/l2jserver/model/template/item/ItemType.java +++ b/src/main/java/com/l2jserver/model/template/item/ItemType.java @@ -133,6 +133,10 @@ public enum ItemType { */ public final int id; + /** + * @param id + * the numeric id + */ ItemType(int id) { this.id = id; } diff --git a/src/main/java/com/l2jserver/model/template/item/WeaponType.java b/src/main/java/com/l2jserver/model/template/item/WeaponType.java index 395c1ef5b..25fcf732b 100644 --- a/src/main/java/com/l2jserver/model/template/item/WeaponType.java +++ b/src/main/java/com/l2jserver/model/template/item/WeaponType.java @@ -78,12 +78,12 @@ public enum WeaponType { DUALDAGGER(StatType.DUALDAGGER_WPN_VULN); /** - * This weapon type weaknesses + * This weapon type of weaknesses */ public final StatType weaknessesStat; /** - * @param weaknesses + * @param weaknessesStat * the weapon weaknesses */ WeaponType(StatType weaknessesStat) { diff --git a/src/main/java/com/l2jserver/model/world/Actor.java b/src/main/java/com/l2jserver/model/world/Actor.java index c7eaa3882..30615c792 100644 --- a/src/main/java/com/l2jserver/model/world/Actor.java +++ b/src/main/java/com/l2jserver/model/world/Actor.java @@ -16,6 +16,7 @@ */ package com.l2jserver.model.world; +import com.l2jserver.model.id.TemplateID; import com.l2jserver.model.id.object.ActorID; import com.l2jserver.model.id.template.ActorTemplateID; import com.l2jserver.model.template.ActorTemplate; @@ -30,6 +31,9 @@ import com.l2jserver.model.world.actor.stat.ActorStats; * @author Rogiel */ public abstract class Actor extends PositionableObject { + /** + * The {@link Actor} {@link TemplateID} + */ protected ActorTemplateID templateID; /** @@ -101,10 +105,17 @@ public abstract class Actor extends PositionableObject { */ protected final ActorSkillContainer skills = new ActorSkillContainer(this); + /** + * @param templateID + * the actor template id + */ protected Actor(ActorTemplateID templateID) { this.templateID = templateID; } + /** + * @return the actor stats + */ public abstract ActorStats getStats(); /** @@ -267,6 +278,9 @@ public abstract class Actor extends PositionableObject { return effects; } + /** + * @return the actor skills + */ public ActorSkillContainer getSkills() { return skills; } diff --git a/src/main/java/com/l2jserver/model/world/Item.java b/src/main/java/com/l2jserver/model/world/Item.java index 7f0daa224..f44e5c9fe 100644 --- a/src/main/java/com/l2jserver/model/world/Item.java +++ b/src/main/java/com/l2jserver/model/world/Item.java @@ -69,6 +69,9 @@ public class Item extends PositionableObject { */ private long count = 1; + /** + * @param templateID the item template id + */ public Item(ItemTemplateID templateID) { this.templateID = templateID; } diff --git a/src/main/java/com/l2jserver/model/world/L2Character.java b/src/main/java/com/l2jserver/model/world/L2Character.java index faef4ef2f..a5f4868a4 100644 --- a/src/main/java/com/l2jserver/model/world/L2Character.java +++ b/src/main/java/com/l2jserver/model/world/L2Character.java @@ -136,10 +136,25 @@ public class L2Character extends Player { * @author Rogiel */ public enum CharacterMoveType { - RUN(0x01), WALK(0x00); + /** + * Run mode + */ + RUN(0x01), + /** + * Walk mode + */ + WALK(0x00); + + /** + * The move mode numeric id + */ public final int id; + /** + * @param id + * the mode numeric id + */ CharacterMoveType(int id) { this.id = id; } @@ -158,8 +173,8 @@ public class L2Character extends Player { /** * Creates a new instance * - * @param baseAttributes - * the base attribute for this character + * @param templateID + * the {@link CharacterTemplateID} */ public L2Character(CharacterTemplateID templateID) { super(templateID); diff --git a/src/main/java/com/l2jserver/model/world/NPC.java b/src/main/java/com/l2jserver/model/world/NPC.java index af107d185..1a6dbc700 100644 --- a/src/main/java/com/l2jserver/model/world/NPC.java +++ b/src/main/java/com/l2jserver/model/world/NPC.java @@ -93,18 +93,32 @@ public class NPC extends Actor { throw new UnsupportedOperationException(); } + /** + * @return the maximum HP + */ public double getMaxHP() { return this.getTemplate().getMaximumHP(); } + /** + * @param maxHP the maximum HP + * @throws UnsupportedOperationException always + */ public void setMaxHP(double maxHP) { throw new UnsupportedOperationException(); } + /** + * @return the maximum MP + */ public double getMaxMP() { return this.getTemplate().getMaximumMP(); } + /** + * @param maxMP the maximum MP + * @throws UnsupportedOperationException always + */ public void setMaxMP(double maxMP) { throw new UnsupportedOperationException(); } diff --git a/src/main/java/com/l2jserver/model/world/Pet.java b/src/main/java/com/l2jserver/model/world/Pet.java index c10f60bf4..f13c4bdf9 100644 --- a/src/main/java/com/l2jserver/model/world/Pet.java +++ b/src/main/java/com/l2jserver/model/world/Pet.java @@ -36,6 +36,9 @@ public class Pet extends Player { */ private ItemID itemID; + /** + * @param templateID the pet template id + */ public Pet(ActorTemplateID templateID) { super(templateID); } diff --git a/src/main/java/com/l2jserver/model/world/Player.java b/src/main/java/com/l2jserver/model/world/Player.java index 7a9308d11..e01314aab 100644 --- a/src/main/java/com/l2jserver/model/world/Player.java +++ b/src/main/java/com/l2jserver/model/world/Player.java @@ -25,6 +25,9 @@ import com.l2jserver.model.id.template.ActorTemplateID; * @author Rogiel */ public abstract class Player extends Actor { + /** + * @param templateID the actor template id + */ public Player(ActorTemplateID templateID) { super(templateID); } diff --git a/src/main/java/com/l2jserver/model/world/PositionableObject.java b/src/main/java/com/l2jserver/model/world/PositionableObject.java index 6c60cda23..b585003c6 100644 --- a/src/main/java/com/l2jserver/model/world/PositionableObject.java +++ b/src/main/java/com/l2jserver/model/world/PositionableObject.java @@ -47,10 +47,16 @@ public abstract class PositionableObject extends AbstractObject { this.point = point; } + /** + * @return the position coodinate + */ public Coordinate getPosition() { return point.getCoordinate(); } + /** + * @param coord sets the current position + */ public void setPosition(Coordinate coord) { desireUpdate(); this.point = new Point3D(coord, (point != null ? point.getAngle() : 0)); diff --git a/src/main/java/com/l2jserver/model/world/actor/ActorExperience.java b/src/main/java/com/l2jserver/model/world/actor/ActorExperience.java index 1208d221c..85f99b1e0 100644 --- a/src/main/java/com/l2jserver/model/world/actor/ActorExperience.java +++ b/src/main/java/com/l2jserver/model/world/actor/ActorExperience.java @@ -78,6 +78,9 @@ public enum ActorExperience { */ public final int level; + /** + * @param experience the minimum experience for the level + */ ActorExperience(long experience) { this.experience = experience; this.level = this.ordinal(); diff --git a/src/main/java/com/l2jserver/model/world/actor/calculator/ActorCalculator.java b/src/main/java/com/l2jserver/model/world/actor/calculator/ActorCalculator.java index cf40c7544..f0abb8336 100644 --- a/src/main/java/com/l2jserver/model/world/actor/calculator/ActorCalculator.java +++ b/src/main/java/com/l2jserver/model/world/actor/calculator/ActorCalculator.java @@ -25,8 +25,12 @@ import com.l2jserver.util.calculator.ComplexCalculator; */ public class ActorCalculator extends ComplexCalculator { - public ActorCalculator(Class type, + /** + * @param calculators + * the calculators + */ + public ActorCalculator( Calculator... calculators) { - super(type, calculators); + super(StatType.class, calculators); } } diff --git a/src/main/java/com/l2jserver/model/world/actor/calculator/ActorCalculatorContext.java b/src/main/java/com/l2jserver/model/world/actor/calculator/ActorCalculatorContext.java index bd4807d5b..5b8f07c20 100644 --- a/src/main/java/com/l2jserver/model/world/actor/calculator/ActorCalculatorContext.java +++ b/src/main/java/com/l2jserver/model/world/actor/calculator/ActorCalculatorContext.java @@ -29,6 +29,10 @@ public class ActorCalculatorContext extends CalculatorContext { */ public final Actor actor; + /** + * @param actor + * the actor + */ public ActorCalculatorContext(Actor actor) { this.actor = actor; } diff --git a/src/main/java/com/l2jserver/model/world/actor/calculator/ActorCalculatorFunction.java b/src/main/java/com/l2jserver/model/world/actor/calculator/ActorCalculatorFunction.java index a120d01dc..63c764400 100644 --- a/src/main/java/com/l2jserver/model/world/actor/calculator/ActorCalculatorFunction.java +++ b/src/main/java/com/l2jserver/model/world/actor/calculator/ActorCalculatorFunction.java @@ -28,6 +28,12 @@ import com.l2jserver.util.calculator.AbstractDoubleFunction; */ public abstract class ActorCalculatorFunction extends AbstractDoubleFunction { + /** + * @param order + * the calculation order + * @param type + * the stat type + */ public ActorCalculatorFunction(int order, StatType type) { super(order, type); } @@ -37,6 +43,15 @@ public abstract class ActorCalculatorFunction extends return calculate(ctx.actor, ctx.actor.getTemplate(), value); } + /** + * @param a + * the actor + * @param t + * the actor template + * @param value + * the original value + * @return the calculated value + */ protected abstract double calculate(Actor a, ActorTemplate t, double value); } diff --git a/src/main/java/com/l2jserver/model/world/actor/calculator/ActorFormula.java b/src/main/java/com/l2jserver/model/world/actor/calculator/ActorFormula.java index 467c8e0b0..af69d09f2 100644 --- a/src/main/java/com/l2jserver/model/world/actor/calculator/ActorFormula.java +++ b/src/main/java/com/l2jserver/model/world/actor/calculator/ActorFormula.java @@ -22,6 +22,12 @@ import com.l2jserver.model.world.actor.stat.StatType; * @author Rogiel */ public abstract class ActorFormula extends ActorCalculatorFunction { + /** + * @param order + * the calculation order + * @param type + * the stat type + */ public ActorFormula(int order, StatType type) { super(order, type); } diff --git a/src/main/java/com/l2jserver/model/world/actor/calculator/AttackAccuracyBonusCalculator.java b/src/main/java/com/l2jserver/model/world/actor/calculator/AttackAccuracyBonusCalculator.java index 3205aaecb..57ec154a2 100644 --- a/src/main/java/com/l2jserver/model/world/actor/calculator/AttackAccuracyBonusCalculator.java +++ b/src/main/java/com/l2jserver/model/world/actor/calculator/AttackAccuracyBonusCalculator.java @@ -38,6 +38,9 @@ import com.l2jserver.model.world.actor.stat.StatType; * @author Rogiel */ public class AttackAccuracyBonusCalculator extends ActorFormula { + /** + * Creates a new instance + */ public AttackAccuracyBonusCalculator() { super(0x200, StatType.ACCURACY_COMBAT); } diff --git a/src/main/java/com/l2jserver/model/world/actor/calculator/AttackEvasionBonusCalculator.java b/src/main/java/com/l2jserver/model/world/actor/calculator/AttackEvasionBonusCalculator.java index f51864730..e05ae8fd4 100644 --- a/src/main/java/com/l2jserver/model/world/actor/calculator/AttackEvasionBonusCalculator.java +++ b/src/main/java/com/l2jserver/model/world/actor/calculator/AttackEvasionBonusCalculator.java @@ -38,6 +38,9 @@ import com.l2jserver.model.world.actor.stat.StatType; * @author Rogiel */ public class AttackEvasionBonusCalculator extends ActorFormula { + /** + * Creates a new instance + */ public AttackEvasionBonusCalculator() { super(0x200, StatType.EVASION_RATE); } diff --git a/src/main/java/com/l2jserver/model/world/actor/calculator/MagicalAttackBonusCalculator.java b/src/main/java/com/l2jserver/model/world/actor/calculator/MagicalAttackBonusCalculator.java index 87c83063a..cacc30fdb 100644 --- a/src/main/java/com/l2jserver/model/world/actor/calculator/MagicalAttackBonusCalculator.java +++ b/src/main/java/com/l2jserver/model/world/actor/calculator/MagicalAttackBonusCalculator.java @@ -32,6 +32,9 @@ import com.l2jserver.model.world.actor.stat.StatType; * @author Rogiel */ public class MagicalAttackBonusCalculator extends ActorFormula { + /** + * Creates a new instance + */ public MagicalAttackBonusCalculator() { super(0x200, StatType.MAGIC_ATTACK); } diff --git a/src/main/java/com/l2jserver/model/world/actor/calculator/MagicalAttackSpeedBonusCalculator.java b/src/main/java/com/l2jserver/model/world/actor/calculator/MagicalAttackSpeedBonusCalculator.java index 65203d5b7..2b563e44b 100644 --- a/src/main/java/com/l2jserver/model/world/actor/calculator/MagicalAttackSpeedBonusCalculator.java +++ b/src/main/java/com/l2jserver/model/world/actor/calculator/MagicalAttackSpeedBonusCalculator.java @@ -32,6 +32,9 @@ import com.l2jserver.model.world.actor.stat.StatType; * @author Rogiel */ public class MagicalAttackSpeedBonusCalculator extends ActorFormula { + /** + * Creates a new instance + */ public MagicalAttackSpeedBonusCalculator() { super(0x200, StatType.MAGIC_ATTACK_SPEED); } diff --git a/src/main/java/com/l2jserver/model/world/actor/calculator/MagicalCriticalRateBonusCalculator.java b/src/main/java/com/l2jserver/model/world/actor/calculator/MagicalCriticalRateBonusCalculator.java index ccd2cd0f1..e37e0cf60 100644 --- a/src/main/java/com/l2jserver/model/world/actor/calculator/MagicalCriticalRateBonusCalculator.java +++ b/src/main/java/com/l2jserver/model/world/actor/calculator/MagicalCriticalRateBonusCalculator.java @@ -32,6 +32,9 @@ import com.l2jserver.model.world.actor.stat.StatType; * @author Rogiel */ public class MagicalCriticalRateBonusCalculator extends ActorFormula { + /** + * Creates a new instance + */ public MagicalCriticalRateBonusCalculator() { super(0x300, StatType.MCRITICAL_RATE); } diff --git a/src/main/java/com/l2jserver/model/world/actor/calculator/MagicalDefenseBonusCalculator.java b/src/main/java/com/l2jserver/model/world/actor/calculator/MagicalDefenseBonusCalculator.java index 80cf57955..033d67c20 100644 --- a/src/main/java/com/l2jserver/model/world/actor/calculator/MagicalDefenseBonusCalculator.java +++ b/src/main/java/com/l2jserver/model/world/actor/calculator/MagicalDefenseBonusCalculator.java @@ -42,6 +42,9 @@ import com.l2jserver.model.world.actor.stat.StatType; * @author Rogiel */ public class MagicalDefenseBonusCalculator extends ActorFormula { + /** + * Creates a new instance + */ public MagicalDefenseBonusCalculator() { super(0x200, StatType.MAGIC_DEFENSE); } diff --git a/src/main/java/com/l2jserver/model/world/actor/calculator/MaximumHPBonusCalculator.java b/src/main/java/com/l2jserver/model/world/actor/calculator/MaximumHPBonusCalculator.java index c8de1efa2..04a4b2dac 100644 --- a/src/main/java/com/l2jserver/model/world/actor/calculator/MaximumHPBonusCalculator.java +++ b/src/main/java/com/l2jserver/model/world/actor/calculator/MaximumHPBonusCalculator.java @@ -31,6 +31,9 @@ import com.l2jserver.model.world.actor.stat.StatType; * @author Rogiel */ public class MaximumHPBonusCalculator extends ActorFormula { + /** + * Creates a new instance + */ public MaximumHPBonusCalculator() { super(0x200, StatType.MAX_HP); } diff --git a/src/main/java/com/l2jserver/model/world/actor/calculator/MaximumMPBonusCalculator.java b/src/main/java/com/l2jserver/model/world/actor/calculator/MaximumMPBonusCalculator.java index d78bc2f6e..bccb8fb93 100644 --- a/src/main/java/com/l2jserver/model/world/actor/calculator/MaximumMPBonusCalculator.java +++ b/src/main/java/com/l2jserver/model/world/actor/calculator/MaximumMPBonusCalculator.java @@ -31,6 +31,9 @@ import com.l2jserver.model.world.actor.stat.StatType; * @author Rogiel */ public class MaximumMPBonusCalculator extends ActorFormula { + /** + * Creates a new instance + */ public MaximumMPBonusCalculator() { super(0x200, StatType.MAX_MP); } diff --git a/src/main/java/com/l2jserver/model/world/actor/calculator/PhysicalAttackBonusCalculator.java b/src/main/java/com/l2jserver/model/world/actor/calculator/PhysicalAttackBonusCalculator.java index 34ef0ebac..975de8c67 100644 --- a/src/main/java/com/l2jserver/model/world/actor/calculator/PhysicalAttackBonusCalculator.java +++ b/src/main/java/com/l2jserver/model/world/actor/calculator/PhysicalAttackBonusCalculator.java @@ -33,6 +33,9 @@ import com.l2jserver.model.world.actor.stat.StatType; * @author Rogiel */ public class PhysicalAttackBonusCalculator extends ActorFormula { + /** + * Creates a new instance + */ public PhysicalAttackBonusCalculator() { super(0x100, StatType.POWER_ATTACK); } diff --git a/src/main/java/com/l2jserver/model/world/actor/calculator/PhysicalAttackSpeedBonusCalculator.java b/src/main/java/com/l2jserver/model/world/actor/calculator/PhysicalAttackSpeedBonusCalculator.java index 7ba286d39..99da83b3b 100644 --- a/src/main/java/com/l2jserver/model/world/actor/calculator/PhysicalAttackSpeedBonusCalculator.java +++ b/src/main/java/com/l2jserver/model/world/actor/calculator/PhysicalAttackSpeedBonusCalculator.java @@ -32,6 +32,9 @@ import com.l2jserver.model.world.actor.stat.StatType; * @author Rogiel */ public class PhysicalAttackSpeedBonusCalculator extends ActorFormula { + /** + * Creates a new instance + */ public PhysicalAttackSpeedBonusCalculator() { super(0x200, StatType.POWER_ATTACK_SPEED); } diff --git a/src/main/java/com/l2jserver/model/world/actor/calculator/PhysicalCriticalRateBonusCalculator.java b/src/main/java/com/l2jserver/model/world/actor/calculator/PhysicalCriticalRateBonusCalculator.java index 1d4f386ba..be7994f05 100644 --- a/src/main/java/com/l2jserver/model/world/actor/calculator/PhysicalCriticalRateBonusCalculator.java +++ b/src/main/java/com/l2jserver/model/world/actor/calculator/PhysicalCriticalRateBonusCalculator.java @@ -33,6 +33,9 @@ import com.l2jserver.model.world.actor.stat.StatType; * @author Rogiel */ public class PhysicalCriticalRateBonusCalculator extends ActorFormula { + /** + * Creates a new instance + */ public PhysicalCriticalRateBonusCalculator() { super(0x090, StatType.CRITICAL_RATE); } diff --git a/src/main/java/com/l2jserver/model/world/actor/calculator/PhysicalDefenseBonusCalculator.java b/src/main/java/com/l2jserver/model/world/actor/calculator/PhysicalDefenseBonusCalculator.java index e44984aff..5dd6ec0bf 100644 --- a/src/main/java/com/l2jserver/model/world/actor/calculator/PhysicalDefenseBonusCalculator.java +++ b/src/main/java/com/l2jserver/model/world/actor/calculator/PhysicalDefenseBonusCalculator.java @@ -43,6 +43,9 @@ import com.l2jserver.model.world.actor.stat.StatType; * @author Rogiel */ public class PhysicalDefenseBonusCalculator extends ActorFormula { + /** + * Creates a new instance + */ public PhysicalDefenseBonusCalculator() { super(0x200, StatType.POWER_DEFENSE); } diff --git a/src/main/java/com/l2jserver/model/world/actor/calculator/RunSpeedBonusCalculator.java b/src/main/java/com/l2jserver/model/world/actor/calculator/RunSpeedBonusCalculator.java index 8f2a8f7be..b2fb11a97 100644 --- a/src/main/java/com/l2jserver/model/world/actor/calculator/RunSpeedBonusCalculator.java +++ b/src/main/java/com/l2jserver/model/world/actor/calculator/RunSpeedBonusCalculator.java @@ -31,6 +31,9 @@ import com.l2jserver.model.world.actor.stat.StatType; * @author Rogiel */ public class RunSpeedBonusCalculator extends ActorFormula { + /** + * Creates a new instance + */ public RunSpeedBonusCalculator() { super(0x300, StatType.RUN_SPEED); } diff --git a/src/main/java/com/l2jserver/model/world/actor/calculator/WalkSpeedBonusCalculator.java b/src/main/java/com/l2jserver/model/world/actor/calculator/WalkSpeedBonusCalculator.java index 8dc42fb94..00b590a3d 100644 --- a/src/main/java/com/l2jserver/model/world/actor/calculator/WalkSpeedBonusCalculator.java +++ b/src/main/java/com/l2jserver/model/world/actor/calculator/WalkSpeedBonusCalculator.java @@ -31,6 +31,9 @@ import com.l2jserver.model.world.actor.stat.StatType; * @author Rogiel */ public class WalkSpeedBonusCalculator extends ActorFormula { + /** + * Creates a new instance + */ public WalkSpeedBonusCalculator() { super(0x300, StatType.WALK_SPEED); } diff --git a/src/main/java/com/l2jserver/model/world/actor/event/ActorEvent.java b/src/main/java/com/l2jserver/model/world/actor/event/ActorEvent.java index 7f8e1b516..30684ebc7 100644 --- a/src/main/java/com/l2jserver/model/world/actor/event/ActorEvent.java +++ b/src/main/java/com/l2jserver/model/world/actor/event/ActorEvent.java @@ -25,5 +25,8 @@ import com.l2jserver.service.game.world.event.WorldEvent; * @author Rogiel */ public interface ActorEvent extends WorldEvent { + /** + * @return the event actor + */ Actor getActor(); } diff --git a/src/main/java/com/l2jserver/model/world/actor/event/ActorListener.java b/src/main/java/com/l2jserver/model/world/actor/event/ActorListener.java index 5f3bd3b71..40252bf08 100644 --- a/src/main/java/com/l2jserver/model/world/actor/event/ActorListener.java +++ b/src/main/java/com/l2jserver/model/world/actor/event/ActorListener.java @@ -24,6 +24,9 @@ import com.l2jserver.service.game.world.event.TypedWorldListener; * @author Rogiel */ public abstract class ActorListener extends TypedWorldListener { + /** + * Creates a new instance + */ public ActorListener() { super(ActorEvent.class); } diff --git a/src/main/java/com/l2jserver/model/world/actor/stat/ActorStats.java b/src/main/java/com/l2jserver/model/world/actor/stat/ActorStats.java index 03ba59eeb..425037afc 100644 --- a/src/main/java/com/l2jserver/model/world/actor/stat/ActorStats.java +++ b/src/main/java/com/l2jserver/model/world/actor/stat/ActorStats.java @@ -36,7 +36,8 @@ import com.l2jserver.model.world.actor.calculator.WalkSpeedBonusCalculator; /** * @author Rogiel - * + * @param + * the {@link ActorCalculatorContext} type */ public abstract class ActorStats { // bonuses @@ -142,6 +143,12 @@ public abstract class ActorStats { */ private static final ActorFormula ATTACK_EVASION_BONUS_FORMULA = new AttackEvasionBonusCalculator(); + /** + * Adds default formulas to the calculator + * + * @param calculator + * the calculator + */ @SuppressWarnings("unchecked") protected void addTo(ActorCalculator calculator) { calculator.addNoSort(HP_BONUS_FORMULA, MP_BONUS_FORMULA, @@ -318,7 +325,13 @@ public abstract class ActorStats { return getCalculator().calculate(type, ctx); } + /** + * @return the calculator + */ protected abstract ActorCalculator getCalculator(); + /** + * @return the new context + */ protected abstract T createContext(); } diff --git a/src/main/java/com/l2jserver/model/world/character/CharacterStats.java b/src/main/java/com/l2jserver/model/world/character/CharacterStats.java index 4007f9889..34b57bb2c 100644 --- a/src/main/java/com/l2jserver/model/world/character/CharacterStats.java +++ b/src/main/java/com/l2jserver/model/world/character/CharacterStats.java @@ -50,17 +50,16 @@ import com.l2jserver.model.world.character.calculator.base.CharacterBaseRunSpeed import com.l2jserver.model.world.character.calculator.base.CharacterBaseStrengthCalculator; import com.l2jserver.model.world.character.calculator.base.CharacterBaseWalkSpeedCalculator; import com.l2jserver.model.world.character.calculator.base.CharacterBaseWitnessCalculator; -import com.l2jserver.util.calculator.SimpleCalculator; /** * This class is responsible for calculating the real character stats. The real * stats vary from the values from the templates, also, skills and items * equipped can change those values. Once an buff is applied, a new calculator - * is {@link SimpleCalculator#importFunctions(SimpleCalculator) imported} and - * their functions are added to this class calculator. Once the skill effect has - * past away, all the functions that were imported are now - * {@link SimpleCalculator#removeFunctions(SimpleCalculator) removed} and the - * calculator return to its original state. + * is {@link CharacterCalculator#add(com.l2jserver.util.calculator.Function...) + * imported} and their functions are added to this class calculator. Once the + * skill effect has past away, all the functions that were imported are now + * {@link CharacterCalculator#remove(com.l2jserver.util.calculator.Function) + * removed} and the calculator return to its original state. *

* Another important note is that calculators should perform calculations as * fast as possible. @@ -262,8 +261,7 @@ public class CharacterStats extends ActorStats { private final L2Character character; @SuppressWarnings("unchecked") - private static final CharacterCalculator calculator = new CharacterCalculator( - StatType.class); + private static final CharacterCalculator calculator = new CharacterCalculator(); /** * Creates a new {@link CharacterStats} and adds default calculators diff --git a/src/main/java/com/l2jserver/model/world/character/calculator/CharacterCalculator.java b/src/main/java/com/l2jserver/model/world/character/calculator/CharacterCalculator.java index 73712f634..67355c152 100644 --- a/src/main/java/com/l2jserver/model/world/character/calculator/CharacterCalculator.java +++ b/src/main/java/com/l2jserver/model/world/character/calculator/CharacterCalculator.java @@ -27,8 +27,8 @@ import com.l2jserver.util.calculator.Calculator; * @author Rogiel */ public class CharacterCalculator extends ActorCalculator { - public CharacterCalculator(Class type, + public CharacterCalculator( Calculator... calculators) { - super(type, calculators); + super(calculators); } } diff --git a/src/main/java/com/l2jserver/model/world/character/calculator/base/CharacterBaseMPCalculator.java b/src/main/java/com/l2jserver/model/world/character/calculator/base/CharacterBaseMPCalculator.java index cb2bdcb2b..8884ab404 100644 --- a/src/main/java/com/l2jserver/model/world/character/calculator/base/CharacterBaseMPCalculator.java +++ b/src/main/java/com/l2jserver/model/world/character/calculator/base/CharacterBaseMPCalculator.java @@ -37,6 +37,6 @@ public class CharacterBaseMPCalculator extends CharacterFormula { @Override public double calculate(L2Character c, CharacterTemplate t, double value) { - return t.getBaseBaseMP(); + return t.getBaseMP(); } } diff --git a/src/main/java/com/l2jserver/model/world/character/event/CharacterAttackEvent.java b/src/main/java/com/l2jserver/model/world/character/event/CharacterAttackEvent.java index 4debc6ad1..871814d7a 100644 --- a/src/main/java/com/l2jserver/model/world/character/event/CharacterAttackEvent.java +++ b/src/main/java/com/l2jserver/model/world/character/event/CharacterAttackEvent.java @@ -46,9 +46,11 @@ public class CharacterAttackEvent implements CharacterEvent { * Creates a new instance * * @param character - * the character - * @param point - * the character being attacked + * the character instance + * @param target + * the target character being attacked + * @param hit + * the {@link AttackHit} objects */ public CharacterAttackEvent(L2Character character, L2Character target, AttackHit hit) { diff --git a/src/main/java/com/l2jserver/model/world/character/event/CharacterTargetDeselectedEvent.java b/src/main/java/com/l2jserver/model/world/character/event/CharacterTargetDeselectedEvent.java index 7944702c7..57055c277 100644 --- a/src/main/java/com/l2jserver/model/world/character/event/CharacterTargetDeselectedEvent.java +++ b/src/main/java/com/l2jserver/model/world/character/event/CharacterTargetDeselectedEvent.java @@ -42,8 +42,8 @@ public class CharacterTargetDeselectedEvent implements CharacterEvent { * * @param character * the character - * @param target - * the character target + * @param oldTarget + * the character target before deselecting */ public CharacterTargetDeselectedEvent(L2Character character, Actor oldTarget) { this.character = character; diff --git a/src/main/java/com/l2jserver/model/world/npc/NPCStats.java b/src/main/java/com/l2jserver/model/world/npc/NPCStats.java index 19a501551..1d62873bf 100644 --- a/src/main/java/com/l2jserver/model/world/npc/NPCStats.java +++ b/src/main/java/com/l2jserver/model/world/npc/NPCStats.java @@ -19,7 +19,6 @@ package com.l2jserver.model.world.npc; import com.l2jserver.model.world.NPC; import com.l2jserver.model.world.actor.calculator.ActorCalculator; import com.l2jserver.model.world.actor.stat.ActorStats; -import com.l2jserver.model.world.actor.stat.StatType; import com.l2jserver.model.world.npc.calculator.NPCCalculator; import com.l2jserver.model.world.npc.calculator.NPCCalculatorContext; import com.l2jserver.model.world.npc.calculator.NPCFormula; @@ -42,17 +41,16 @@ import com.l2jserver.model.world.npc.calculator.base.NPCBaseRunSpeedCalculator; import com.l2jserver.model.world.npc.calculator.base.NPCBaseStrengthCalculator; import com.l2jserver.model.world.npc.calculator.base.NPCBaseWalkSpeedCalculator; import com.l2jserver.model.world.npc.calculator.base.NPCBaseWitnessCalculator; -import com.l2jserver.util.calculator.SimpleCalculator; /** * This class is responsible for calculating the real NPC stats. The real stats * vary from the values from the templates, also, skills and items equipped can * change those values. Once an buff is applied, a new calculator is - * {@link SimpleCalculator#importFunctions(SimpleCalculator) imported} and their - * functions are added to this class calculator. Once the skill effect has past - * away, all the functions that were imported are now - * {@link SimpleCalculator#removeFunctions(SimpleCalculator) removed} and the - * calculator return to its original state. + * {@link NPCCalculator#add(com.l2jserver.util.calculator.Function...) imported} + * and their functions are added to this class calculator. Once the skill effect + * has past away, all the functions that were imported are now + * {@link NPCCalculator#remove(com.l2jserver.util.calculator.Function) removed} + * and the calculator return to its original state. *

* Another important note is that calculators should perform calculations as * fast as possible. @@ -206,8 +204,7 @@ public class NPCStats extends ActorStats { */ private final NPC npc; - private static final NPCCalculator calculator = new NPCCalculator( - StatType.class); + private static final NPCCalculator calculator = new NPCCalculator(); /** * Creates a new {@link NPCStats} and adds default calculators diff --git a/src/main/java/com/l2jserver/model/world/npc/calculator/NPCCalculator.java b/src/main/java/com/l2jserver/model/world/npc/calculator/NPCCalculator.java index 71bb022b8..8e44f8d42 100644 --- a/src/main/java/com/l2jserver/model/world/npc/calculator/NPCCalculator.java +++ b/src/main/java/com/l2jserver/model/world/npc/calculator/NPCCalculator.java @@ -17,14 +17,13 @@ package com.l2jserver.model.world.npc.calculator; import com.l2jserver.model.world.actor.calculator.ActorCalculator; -import com.l2jserver.model.world.actor.stat.StatType; /** * @author Rogiel * */ public class NPCCalculator extends ActorCalculator { - public NPCCalculator(Class type, NPCCalculator... calculators) { - super(type, calculators); + public NPCCalculator(NPCCalculator... calculators) { + super(calculators); } } diff --git a/src/main/java/com/l2jserver/model/world/npc/controller/BaseNPCController.java b/src/main/java/com/l2jserver/model/world/npc/controller/BaseNPCController.java index ba5d5d22e..2f104fe2b 100644 --- a/src/main/java/com/l2jserver/model/world/npc/controller/BaseNPCController.java +++ b/src/main/java/com/l2jserver/model/world/npc/controller/BaseNPCController.java @@ -79,6 +79,7 @@ public class BaseNPCController implements NPCController { * the action arguments * @return true if chat message was sent * @throws L2Exception + * if the talk action could not be performed */ protected boolean talk(NPC npc, Lineage2Client conn, L2Character character, String... args) throws L2Exception { diff --git a/src/main/java/com/l2jserver/model/world/npc/event/NPCDieEvent.java b/src/main/java/com/l2jserver/model/world/npc/event/NPCDieEvent.java index f0a6fa532..16962e13f 100644 --- a/src/main/java/com/l2jserver/model/world/npc/event/NPCDieEvent.java +++ b/src/main/java/com/l2jserver/model/world/npc/event/NPCDieEvent.java @@ -29,8 +29,8 @@ public class NPCDieEvent extends ActorDieEvent implements NPCEvent { /** * @param npc * the died npc - * @param the - * actor who killed the npc + * @param killer + * the actor who killed the npc */ public NPCDieEvent(NPC npc, Actor killer) { super(npc, killer); diff --git a/src/main/java/com/l2jserver/model/world/player/event/PlayerSpawnEvent.java b/src/main/java/com/l2jserver/model/world/player/event/PlayerSpawnEvent.java index 2bc1978d5..bca7ebd66 100644 --- a/src/main/java/com/l2jserver/model/world/player/event/PlayerSpawnEvent.java +++ b/src/main/java/com/l2jserver/model/world/player/event/PlayerSpawnEvent.java @@ -27,7 +27,7 @@ import com.l2jserver.util.geometry.Point3D; */ public class PlayerSpawnEvent extends ActorSpawnEvent implements PlayerEvent { /** - * @param actor + * @param player * the player * @param point * the spawn point diff --git a/src/main/java/com/l2jserver/service/cache/Cache.java b/src/main/java/com/l2jserver/service/cache/Cache.java index fced38ad0..07c75c8e5 100644 --- a/src/main/java/com/l2jserver/service/cache/Cache.java +++ b/src/main/java/com/l2jserver/service/cache/Cache.java @@ -20,6 +20,8 @@ package com.l2jserver.service.cache; * This interface represents a Map structure for cache usage. * * @author Rogiel + * @param the key type + * @param the value type */ public interface Cache extends Iterable { /** @@ -30,7 +32,9 @@ public interface Cache extends Iterable { * given id in the map, {@link IllegalArgumentException} will be thrown. * * @param key + * the key name * @param value + * the cache content value */ void put(K key, V value); @@ -38,7 +42,8 @@ public interface Cache extends Iterable { * Returns cached value correlated to given key. * * @param key - * @return + * the key + * @return the cached value for this key */ V get(K key); @@ -46,7 +51,8 @@ public interface Cache extends Iterable { * Checks whether this map contains a value related to given key. * * @param key - * @return + * the key + * @return true if key has an value */ boolean contains(K key); @@ -54,6 +60,7 @@ public interface Cache extends Iterable { * Removes an entry from the map, that has given key. * * @param key + * the key */ void remove(K key); diff --git a/src/main/java/com/l2jserver/service/cache/CacheService.java b/src/main/java/com/l2jserver/service/cache/CacheService.java index ff63d188b..d7c8674e8 100644 --- a/src/main/java/com/l2jserver/service/cache/CacheService.java +++ b/src/main/java/com/l2jserver/service/cache/CacheService.java @@ -56,6 +56,7 @@ public interface CacheService extends Service { * the cache value type * @param name * the cache name + * @param size the maximum cache size * @size the maximum cache size * @return the created cache */ @@ -72,6 +73,7 @@ public interface CacheService extends Service { * the cache value type * @param name * the cache name + * @param size the maximum cache size * @size the maximum cache size * @return the created cache */ diff --git a/src/main/java/com/l2jserver/service/cache/SoftCacheService.java b/src/main/java/com/l2jserver/service/cache/SoftCacheService.java index db322bc68..879568621 100644 --- a/src/main/java/com/l2jserver/service/cache/SoftCacheService.java +++ b/src/main/java/com/l2jserver/service/cache/SoftCacheService.java @@ -130,6 +130,8 @@ public class SoftCacheService extends AbstractService implements CacheService { * value object) * * @author Rogiel + * @param the key type + * @param the value type */ private class SoftCache extends AbstractReferenceCache implements Cache { diff --git a/src/main/java/com/l2jserver/service/cache/WeakCacheService.java b/src/main/java/com/l2jserver/service/cache/WeakCacheService.java index 0b2089c96..2a5887b92 100644 --- a/src/main/java/com/l2jserver/service/cache/WeakCacheService.java +++ b/src/main/java/com/l2jserver/service/cache/WeakCacheService.java @@ -130,6 +130,8 @@ public class WeakCacheService extends AbstractService implements CacheService { * if there isn't any strong reference to the value object. * * @author Rogiel + * @param the key type + * @param the value type */ private class WeakCache extends AbstractReferenceCache implements Cache { diff --git a/src/main/java/com/l2jserver/service/core/threading/AsyncFuture.java b/src/main/java/com/l2jserver/service/core/threading/AsyncFuture.java index 717654f6f..11a323f65 100644 --- a/src/main/java/com/l2jserver/service/core/threading/AsyncFuture.java +++ b/src/main/java/com/l2jserver/service/core/threading/AsyncFuture.java @@ -26,6 +26,8 @@ import java.util.concurrent.TimeoutException; * features, such as waiting for an given task to finish. * * @author Rogiel + * @param + * the {@link Future} return type */ public interface AsyncFuture extends Future { /** diff --git a/src/main/java/com/l2jserver/service/core/threading/ThreadPool.java b/src/main/java/com/l2jserver/service/core/threading/ThreadPool.java index beaf17ab6..0224b080b 100644 --- a/src/main/java/com/l2jserver/service/core/threading/ThreadPool.java +++ b/src/main/java/com/l2jserver/service/core/threading/ThreadPool.java @@ -55,14 +55,14 @@ public interface ThreadPool { /** * Executes an asynchronous tasks at an scheduled time. * - * @param callable - * the callable instance * @param delay * the initial delay to wait before the task is executed - * @param repeat - * the repeating interval for this task * @param unit * the time unit of delay + * @param repeat + * the repeating interval for this task + * @param task + * the task to be executed * @return the {@link AsyncFuture} notified once the task has completed */ ScheduledAsyncFuture async(long delay, TimeUnit unit, long repeat, diff --git a/src/main/java/com/l2jserver/service/core/threading/ThreadService.java b/src/main/java/com/l2jserver/service/core/threading/ThreadService.java index 6c0ca6989..c013395df 100644 --- a/src/main/java/com/l2jserver/service/core/threading/ThreadService.java +++ b/src/main/java/com/l2jserver/service/core/threading/ThreadService.java @@ -67,14 +67,14 @@ public interface ThreadService extends Service { *

* Tasks scheduled here will go to an default shared thread pool. * - * @param callable - * the callable instance * @param delay * the initial delay to wait before the task is executed - * @param repeat - * the repeating interval for this task * @param unit * the time unit of delay + * @param repeat + * the repeating interval for this task + * @param task + * the task to be executed * @return the {@link AsyncFuture} notified once the task has completed */ ScheduledAsyncFuture async(long delay, TimeUnit unit, long repeat, diff --git a/src/main/java/com/l2jserver/service/core/vfs/VFSService.java b/src/main/java/com/l2jserver/service/core/vfs/VFSService.java index 339daa717..b29211abd 100644 --- a/src/main/java/com/l2jserver/service/core/vfs/VFSService.java +++ b/src/main/java/com/l2jserver/service/core/vfs/VFSService.java @@ -59,9 +59,9 @@ public interface VFSService extends Service { * Please note that event if the file DOES NOT exists a valid object will be * returned. * - * @param uri - * the file uri as an string + * @param path + * the file path as an string * @return the resolved file. Will return null if could not resolve. */ - Path resolve(String name); + Path resolve(String path); } diff --git a/src/main/java/com/l2jserver/service/database/DataAccessObject.java b/src/main/java/com/l2jserver/service/database/DataAccessObject.java index 08a68009b..3b47ddeab 100644 --- a/src/main/java/com/l2jserver/service/database/DataAccessObject.java +++ b/src/main/java/com/l2jserver/service/database/DataAccessObject.java @@ -38,7 +38,13 @@ import com.l2jserver.service.cache.IgnoreCaching; * could be a huge performance issue. DAO implementations are encouraged to * override the iterator implementation with a more specific implementation. * + * @param + * the {@link Model} supported by this DAO + * @param + * the ID used to represent the {@link Model} in this DAO + * * @author Rogiel + * */ public interface DataAccessObject, I extends ID> extends Iterable { @@ -47,6 +53,8 @@ public interface DataAccessObject, I extends ID> extends * * @param id * the id + * @return the selected object. null if could not be found in the + * database. */ O select(I id); diff --git a/src/main/java/com/l2jserver/service/database/JDBCDatabaseService.java b/src/main/java/com/l2jserver/service/database/JDBCDatabaseService.java index 987063937..7229a6cbf 100644 --- a/src/main/java/com/l2jserver/service/database/JDBCDatabaseService.java +++ b/src/main/java/com/l2jserver/service/database/JDBCDatabaseService.java @@ -406,6 +406,7 @@ public class JDBCDatabaseService extends AbstractService implements * the connection * @return the query return value * @throws SQLException + * if any SQL error occur */ R query(Connection conn) throws SQLException; } @@ -514,6 +515,7 @@ public class JDBCDatabaseService extends AbstractService implements * @param object * the object * @throws SQLException + * if any SQL error occur */ protected abstract void parametize(PreparedStatement st, T object) throws SQLException; @@ -522,8 +524,6 @@ public class JDBCDatabaseService extends AbstractService implements * Return the key mapper. Can be null if no generated keys are used or * are not important. * - * @param object - * the object * @return the key mapper */ protected Mapper> keyMapper() { @@ -593,9 +593,8 @@ public class JDBCDatabaseService extends AbstractService implements * * @param st * the prepared statement - * @param object - * the object * @throws SQLException + * if any SQL error occur */ protected void parametize(PreparedStatement st) throws SQLException { } @@ -670,9 +669,8 @@ public class JDBCDatabaseService extends AbstractService implements * * @param st * the prepared statement - * @param object - * the object * @throws SQLException + * if any SQL error occur */ protected void parametize(PreparedStatement st) throws SQLException { } @@ -706,6 +704,7 @@ public class JDBCDatabaseService extends AbstractService implements * the result set * @return the created instance * @throws SQLException + * if any SQL error occur */ T map(ResultSet rs) throws SQLException; } @@ -744,6 +743,8 @@ public class JDBCDatabaseService extends AbstractService implements * * @param database * the database service + * @param idMapper + * the {@link ID} {@link Mapper} */ public CachedMapper(JDBCDatabaseService database, Mapper idMapper) { this.database = database; @@ -781,6 +782,7 @@ public class JDBCDatabaseService extends AbstractService implements * the jdbc result set * @return the created object * @throws SQLException + * if any SQL error occur */ protected abstract T map(I id, ResultSet rs) throws SQLException; } diff --git a/src/main/java/com/l2jserver/service/game/castle/CastleService.java b/src/main/java/com/l2jserver/service/game/castle/CastleService.java index 8ec50506a..0abe04110 100644 --- a/src/main/java/com/l2jserver/service/game/castle/CastleService.java +++ b/src/main/java/com/l2jserver/service/game/castle/CastleService.java @@ -16,6 +16,7 @@ */ package com.l2jserver.service.game.castle; +import com.l2jserver.model.game.Castle; import com.l2jserver.service.Service; /** diff --git a/src/main/java/com/l2jserver/service/game/chat/ChatMessageType.java b/src/main/java/com/l2jserver/service/game/chat/ChatMessageType.java index d204be812..357ed56cb 100644 --- a/src/main/java/com/l2jserver/service/game/chat/ChatMessageType.java +++ b/src/main/java/com/l2jserver/service/game/chat/ChatMessageType.java @@ -39,7 +39,7 @@ public enum ChatMessageType { */ PARTY(3), /** - * @ + * \@ */ CLAN(4), GM(5), PETITION_PLAYER(6), PETITION_GM(7), /** diff --git a/src/main/java/com/l2jserver/service/game/chat/PublicChatChannel.java b/src/main/java/com/l2jserver/service/game/chat/PublicChatChannel.java index bd3fc18a8..f1fa510ec 100644 --- a/src/main/java/com/l2jserver/service/game/chat/PublicChatChannel.java +++ b/src/main/java/com/l2jserver/service/game/chat/PublicChatChannel.java @@ -16,7 +16,7 @@ */ package com.l2jserver.service.game.chat; -import com.l2jserver.model.id.object.CharacterID; +import com.l2jserver.model.server.ChatMessage; /** * An public {@link ChatChannel}. Please note that the concept of "public" does @@ -24,8 +24,8 @@ import com.l2jserver.model.id.object.CharacterID; * (i.e. clan, global, region, etc...). That mean that a single message can be * broadcasted to more than a single client. Note that even in a public channel * only a single event - * {@link ChatChannelListener#onMessage(ChatChannel, CharacterID, String)} will - * be dispatched per listener. + * {@link ChatChannelListener#onMessage(ChatChannel, ChatMessage)} will be + * dispatched per listener. * * @author Rogiel */ diff --git a/src/main/java/com/l2jserver/service/game/chat/SimpleChatService.java b/src/main/java/com/l2jserver/service/game/chat/SimpleChatService.java index 7939b7141..46af6ab0a 100644 --- a/src/main/java/com/l2jserver/service/game/chat/SimpleChatService.java +++ b/src/main/java/com/l2jserver/service/game/chat/SimpleChatService.java @@ -25,6 +25,7 @@ import org.slf4j.LoggerFactory; import com.google.common.base.Preconditions; import com.google.inject.Inject; import com.l2jserver.model.dao.CharacterDAO; +import com.l2jserver.model.id.ID; import com.l2jserver.model.id.object.CharacterID; import com.l2jserver.model.id.object.ClanID; import com.l2jserver.model.server.ChatMessage; @@ -34,6 +35,7 @@ import com.l2jserver.service.AbstractService; import com.l2jserver.service.AbstractService.Depends; import com.l2jserver.service.ServiceStartException; import com.l2jserver.service.ServiceStopException; +import com.l2jserver.service.database.DataAccessObject; import com.l2jserver.service.game.region.Region; import com.l2jserver.service.game.region.RegionService; import com.l2jserver.util.factory.CollectionFactory; @@ -93,8 +95,10 @@ public class SimpleChatService extends AbstractService implements ChatService { /** * Creates a new instance * - * @param regionService - * the region service + * @param chatLogService + * the chat log service + * @param charDao + * the character {@link DataAccessObject DAO} */ @Inject public SimpleChatService(ChatLoggingService chatLogService, @@ -420,6 +424,7 @@ public class SimpleChatService extends AbstractService implements ChatService { * Creates a new instance * * @param clanID + * the clan {@link ID} used in this channel */ public ClanChatChannelImpl(ClanID clanID) { Preconditions.checkNotNull(clanID, "clanID"); @@ -453,7 +458,8 @@ public class SimpleChatService extends AbstractService implements ChatService { /** * Creates a new instance * - * @param clanID + * @param region + * the region represented in this channel */ public RegionChatChannelImpl(Region region) { Preconditions.checkNotNull(region, "region"); diff --git a/src/main/java/com/l2jserver/service/game/npc/NPCService.java b/src/main/java/com/l2jserver/service/game/npc/NPCService.java index 154d9f45b..600afd563 100644 --- a/src/main/java/com/l2jserver/service/game/npc/NPCService.java +++ b/src/main/java/com/l2jserver/service/game/npc/NPCService.java @@ -44,6 +44,8 @@ public interface NPCService extends Service { * the character * @param action * the action type + * @throws ActionServiceException + * if the action thrown an exception * @throws CannotSetTargetServiceException * if was not possible to set the target */ @@ -60,6 +62,8 @@ public interface NPCService extends Service { * the character * @param args * the action arguments + * @throws ActionServiceException + * if the action thrown an exeption * @throws CannotSetTargetServiceException * if was not possible to set the target */ diff --git a/src/main/java/com/l2jserver/service/game/scripting/ScriptingService.java b/src/main/java/com/l2jserver/service/game/scripting/ScriptingService.java index 768912e4e..be619a99b 100644 --- a/src/main/java/com/l2jserver/service/game/scripting/ScriptingService.java +++ b/src/main/java/com/l2jserver/service/game/scripting/ScriptingService.java @@ -32,10 +32,11 @@ import com.l2jserver.service.Service; */ public interface ScriptingService extends Service { /** - * Loads script contexes from descriptor + * Loads script contexts from descriptor * * @param scriptDescriptor * xml file that describes contexes + * @return the {@link List} of {@link ScriptContext} loaded * @throws Exception * if can't load file */ diff --git a/src/main/java/com/l2jserver/service/game/scripting/impl/BinaryClass.java b/src/main/java/com/l2jserver/service/game/scripting/impl/BinaryClass.java index d882e893b..66ceb19e2 100644 --- a/src/main/java/com/l2jserver/service/game/scripting/impl/BinaryClass.java +++ b/src/main/java/com/l2jserver/service/game/scripting/impl/BinaryClass.java @@ -67,6 +67,8 @@ public class BinaryClass implements JavaFileObject { * * @param name * class name + * @param data + * the class contents */ public BinaryClass(String name, byte[] data) { this.name = name; diff --git a/src/main/java/com/l2jserver/service/game/scripting/impl/JavaSourceFromByteArray.java b/src/main/java/com/l2jserver/service/game/scripting/impl/JavaSourceFromByteArray.java index 033316a60..e79520e71 100644 --- a/src/main/java/com/l2jserver/service/game/scripting/impl/JavaSourceFromByteArray.java +++ b/src/main/java/com/l2jserver/service/game/scripting/impl/JavaSourceFromByteArray.java @@ -54,6 +54,8 @@ public class JavaSourceFromByteArray extends SimpleJavaFileObject { * class name of class * @param code * source code of class + * @param kind + * the class {@link javax.tools.JavaFileObject.Kind} */ public JavaSourceFromByteArray(String className, byte[] code, JavaFileObject.Kind kind) { diff --git a/src/main/java/com/l2jserver/service/game/scripting/impl/ScriptContextImpl.java b/src/main/java/com/l2jserver/service/game/scripting/impl/ScriptContextImpl.java index 76f5e2565..98ac899e1 100644 --- a/src/main/java/com/l2jserver/service/game/scripting/impl/ScriptContextImpl.java +++ b/src/main/java/com/l2jserver/service/game/scripting/impl/ScriptContextImpl.java @@ -86,6 +86,8 @@ public class ScriptContextImpl implements ScriptContext { /** * Creates new scriptcontext with given root file * + * @param injector + * the Guice {@link Injector} * @param root * file that represents root directory of this script context * @throws NullPointerException @@ -101,6 +103,8 @@ public class ScriptContextImpl implements ScriptContext { * Creates new ScriptContext with given file as root and another * ScriptContext as parent * + * @param injector + * the Guice {@link Injector} * @param root * file that represents root directory of this script context * @param parent diff --git a/src/main/java/com/l2jserver/service/game/scripting/impl/compiled/PrecompiledScriptClassLoader.java b/src/main/java/com/l2jserver/service/game/scripting/impl/compiled/PrecompiledScriptClassLoader.java index 13df5b5cd..24448e13a 100644 --- a/src/main/java/com/l2jserver/service/game/scripting/impl/compiled/PrecompiledScriptClassLoader.java +++ b/src/main/java/com/l2jserver/service/game/scripting/impl/compiled/PrecompiledScriptClassLoader.java @@ -44,6 +44,9 @@ public class PrecompiledScriptClassLoader extends ScriptClassLoader { /** * Creates new ScriptClassLoader with given ClassFileManger + * + * @param root + * the root file */ PrecompiledScriptClassLoader(final File root) { super(new URL[] {}); @@ -66,6 +69,7 @@ public class PrecompiledScriptClassLoader extends ScriptClassLoader { * @param file * jar file to add * @throws IOException + * if any I/O error occur */ @Override public void addLibrary(File file) throws IOException { @@ -74,14 +78,13 @@ public class PrecompiledScriptClassLoader extends ScriptClassLoader { /** * Loads class from library, parent or compiled * - * @param name - * class to load * @param file * the class file * @return loaded class * @throws ClassNotFoundException * if class not found * @throws IOException + * if any I/O error occur */ public Class loadClass(File file) throws ClassNotFoundException, IOException { diff --git a/src/main/java/com/l2jserver/service/game/scripting/impl/javacc/ScriptClassLoaderImpl.java b/src/main/java/com/l2jserver/service/game/scripting/impl/javacc/ScriptClassLoaderImpl.java index 93c382706..27fac361d 100644 --- a/src/main/java/com/l2jserver/service/game/scripting/impl/javacc/ScriptClassLoaderImpl.java +++ b/src/main/java/com/l2jserver/service/game/scripting/impl/javacc/ScriptClassLoaderImpl.java @@ -114,6 +114,7 @@ public class ScriptClassLoaderImpl extends ScriptClassLoader { * @param file * jar file to add * @throws IOException + * if any I/O error occur */ @Override public void addLibrary(File file) throws IOException { diff --git a/src/main/java/com/l2jserver/service/game/spawn/SpawnService.java b/src/main/java/com/l2jserver/service/game/spawn/SpawnService.java index ac77af1d9..16ab49c91 100644 --- a/src/main/java/com/l2jserver/service/game/spawn/SpawnService.java +++ b/src/main/java/com/l2jserver/service/game/spawn/SpawnService.java @@ -82,6 +82,9 @@ public interface SpawnService extends Service { * Schedules an {@link PositionableObject} object to be spawned in a certain * time. * + * @param + * the {@link PositionableObject} to be spawned + * * @param object * the PositionableObject object * @param point @@ -110,6 +113,9 @@ public interface SpawnService extends Service { * Schedules an {@link PositionableObject} object to be spawned in a certain * time. * + * @param + * the {@link PositionableObject} to be unspawned + * * @param object * the PositionableObject object * @param time diff --git a/src/main/java/com/l2jserver/service/game/world/CachedWorldIDService.java b/src/main/java/com/l2jserver/service/game/world/CachedWorldIDService.java index 130d0f123..b2eb4398d 100644 --- a/src/main/java/com/l2jserver/service/game/world/CachedWorldIDService.java +++ b/src/main/java/com/l2jserver/service/game/world/CachedWorldIDService.java @@ -38,8 +38,8 @@ import com.l2jserver.service.cache.CacheService; import com.l2jserver.service.database.DatabaseService; /** - * Implementation for {@link IDService} that caches all {@link ID} objects in - * memory. + * Implementation for {@link WorldIDService} that caches all {@link ID} objects + * in memory. * * @author Rogiel */ @@ -50,7 +50,7 @@ public class CachedWorldIDService extends AbstractService implements * The logger */ private final Logger log = LoggerFactory.getLogger(this.getClass()); - + /** * The cache service */ @@ -105,11 +105,11 @@ public class CachedWorldIDService extends AbstractService implements @Override public void load() { log.debug("Loading IDs from database"); - + load(characterDao.selectIDs()); load(itemDao.selectIDs()); load(npcDao.selectIDs()); - + log.debug("IDs loaded from database"); loaded = true; } diff --git a/src/main/java/com/l2jserver/service/game/world/WorldIDService.java b/src/main/java/com/l2jserver/service/game/world/WorldIDService.java index 5a69b1fbc..80eae567e 100644 --- a/src/main/java/com/l2jserver/service/game/world/WorldIDService.java +++ b/src/main/java/com/l2jserver/service/game/world/WorldIDService.java @@ -43,8 +43,6 @@ public interface WorldIDService extends Service { /** * Tries to resolve an ID based on its raw value * - * @param - * the raw ID type * @param * the ID type * @param id diff --git a/src/main/java/com/l2jserver/service/game/world/WorldService.java b/src/main/java/com/l2jserver/service/game/world/WorldService.java index 324dac9a3..de60f6f3b 100644 --- a/src/main/java/com/l2jserver/service/game/world/WorldService.java +++ b/src/main/java/com/l2jserver/service/game/world/WorldService.java @@ -154,7 +154,7 @@ public interface WorldService extends Service, Iterable { final WorldObjectFilter filter); /** - * Shortcut method for {@link Iterable#iterable()} with filters. The + * Shortcut method for {@link Iterable#iterator()} with filters. The * iterable instance returns the same {@link Iterator} as * {@link #iterator(WorldObjectFilter)}. * diff --git a/src/main/java/com/l2jserver/service/game/world/event/FilteredWorldListener.java b/src/main/java/com/l2jserver/service/game/world/event/FilteredWorldListener.java index 5ad256a45..2ae7b6423 100644 --- a/src/main/java/com/l2jserver/service/game/world/event/FilteredWorldListener.java +++ b/src/main/java/com/l2jserver/service/game/world/event/FilteredWorldListener.java @@ -24,6 +24,8 @@ import com.l2jserver.service.game.world.filter.WorldObjectFilter; * This listener will filter to only dispatch events on which the object matches * an given {@link WorldObjectFilter}. * + * @param + * the type of objects filtered in this filter * @author Rogiel */ public abstract class FilteredWorldListener implements @@ -44,6 +46,11 @@ public abstract class FilteredWorldListener implements } /** + * @param e + * the event + * @param object + * the object represented in the event + * @return true to keep listener alive * @see WorldListener#dispatch(WorldEvent) */ protected abstract boolean dispatch(WorldEvent e, T object); diff --git a/src/main/java/com/l2jserver/service/game/world/event/TypedWorldListener.java b/src/main/java/com/l2jserver/service/game/world/event/TypedWorldListener.java index b23ab02ae..6cd212845 100644 --- a/src/main/java/com/l2jserver/service/game/world/event/TypedWorldListener.java +++ b/src/main/java/com/l2jserver/service/game/world/event/TypedWorldListener.java @@ -21,6 +21,9 @@ import com.google.common.base.Preconditions; /** * This listener will filter to only dispatch an certain type events. * + * @param + * the type filtered by this {@link WorldListener} + * * @author Rogiel */ public abstract class TypedWorldListener implements WorldListener { @@ -40,6 +43,9 @@ public abstract class TypedWorldListener implements WorldListener { } /** + * @param e + * the event + * @return true to keep listener alive * @see WorldListener#dispatch(WorldEvent) */ protected abstract boolean dispatch(T e); diff --git a/src/main/java/com/l2jserver/service/game/world/event/WorldEventFuture.java b/src/main/java/com/l2jserver/service/game/world/event/WorldEventFuture.java index 4ab0541b8..dc642e746 100644 --- a/src/main/java/com/l2jserver/service/game/world/event/WorldEventFuture.java +++ b/src/main/java/com/l2jserver/service/game/world/event/WorldEventFuture.java @@ -25,6 +25,9 @@ import java.util.concurrent.TimeoutException; * used to receive notifications once an event has been dispatched to all * listeners. * + * @param + * the event type in this future + * * @author Rogiel */ public interface WorldEventFuture extends Future { diff --git a/src/main/java/com/l2jserver/service/game/world/event/WorldListener.java b/src/main/java/com/l2jserver/service/game/world/event/WorldListener.java index 4ad481c7e..3849d2cbf 100644 --- a/src/main/java/com/l2jserver/service/game/world/event/WorldListener.java +++ b/src/main/java/com/l2jserver/service/game/world/event/WorldListener.java @@ -20,9 +20,6 @@ package com.l2jserver.service.game.world.event; * This is the most abstract listener for the listening engine. * * @author Rogiel - * - * @param - * the received event type */ public interface WorldListener { /** diff --git a/src/main/java/com/l2jserver/service/game/world/filter/WorldFilters.java b/src/main/java/com/l2jserver/service/game/world/filter/WorldFilters.java index 5ff12b804..a2359f0ef 100644 --- a/src/main/java/com/l2jserver/service/game/world/filter/WorldFilters.java +++ b/src/main/java/com/l2jserver/service/game/world/filter/WorldFilters.java @@ -57,8 +57,8 @@ public final class WorldFilters { * * @param * the object type - * @param filters - * the filters + * @param filter + * the filter * @return the {@link NotFilter} */ public static final WorldObjectFilter not( diff --git a/src/main/java/com/l2jserver/service/game/world/filter/WorldObjectFilter.java b/src/main/java/com/l2jserver/service/game/world/filter/WorldObjectFilter.java index 45bfe92ec..b59074516 100644 --- a/src/main/java/com/l2jserver/service/game/world/filter/WorldObjectFilter.java +++ b/src/main/java/com/l2jserver/service/game/world/filter/WorldObjectFilter.java @@ -21,6 +21,9 @@ import com.l2jserver.model.world.WorldObject; /** * Filter an object in a world * + * @param + * the {@link WorldObject} filtered by this filter + * * @author Rogiel */ public interface WorldObjectFilter { diff --git a/src/main/java/com/l2jserver/service/game/world/filter/impl/RangeFilter.java b/src/main/java/com/l2jserver/service/game/world/filter/impl/RangeFilter.java index 1a6b5b096..087afe7eb 100644 --- a/src/main/java/com/l2jserver/service/game/world/filter/impl/RangeFilter.java +++ b/src/main/java/com/l2jserver/service/game/world/filter/impl/RangeFilter.java @@ -40,7 +40,7 @@ public class RangeFilter implements WorldObjectFilter { /** * Creates a new instance * - * @param objcect + * @param object * the positionable object as center point for range search * @param range * the desired maximum distance of the object diff --git a/src/main/java/com/l2jserver/service/game/world/filter/impl/RangePointFilter.java b/src/main/java/com/l2jserver/service/game/world/filter/impl/RangePointFilter.java index b0f3aef37..824d1e98e 100644 --- a/src/main/java/com/l2jserver/service/game/world/filter/impl/RangePointFilter.java +++ b/src/main/java/com/l2jserver/service/game/world/filter/impl/RangePointFilter.java @@ -41,8 +41,8 @@ public class RangePointFilter implements WorldObjectFilter { /** * Creates a new instance * - * @param objcect - * the positionable object as center point for range search + * @param point + * the point to start the range search * @param range * the desired maximum distance of the object */ diff --git a/src/main/java/com/l2jserver/service/network/broadcast/BroadcastServiceImpl.java b/src/main/java/com/l2jserver/service/network/broadcast/BroadcastServiceImpl.java index cc8fb0702..b464abd97 100644 --- a/src/main/java/com/l2jserver/service/network/broadcast/BroadcastServiceImpl.java +++ b/src/main/java/com/l2jserver/service/network/broadcast/BroadcastServiceImpl.java @@ -85,7 +85,7 @@ public class BroadcastServiceImpl extends AbstractService implements final L2Character character = conn.getCharacter(); Preconditions.checkNotNull(character, "character"); final CharacterID id = character.getID(); - + log.debug("Starting character broadcast"); // broadcast everything nearby @@ -197,8 +197,8 @@ public class BroadcastServiceImpl extends AbstractService implements * * @param conn * the connection - * @param character - * the character + * @param o + * the object to be broadcasted */ private void broadcast(Lineage2Client conn, WorldObject o) { log.debug("Broadcasting {} to {}", o, conn); diff --git a/src/main/java/com/l2jserver/util/calculator/AbstractDoubleFunction.java b/src/main/java/com/l2jserver/util/calculator/AbstractDoubleFunction.java index d6d6843e8..c5cfeb3c9 100644 --- a/src/main/java/com/l2jserver/util/calculator/AbstractDoubleFunction.java +++ b/src/main/java/com/l2jserver/util/calculator/AbstractDoubleFunction.java @@ -17,6 +17,10 @@ package com.l2jserver.util.calculator; /** + * @param + * the context type + * @param + * the attribute calculated * @author Rogiel */ public abstract class AbstractDoubleFunction> diff --git a/src/main/java/com/l2jserver/util/calculator/Calculator.java b/src/main/java/com/l2jserver/util/calculator/Calculator.java index 8a1246bb1..ed1cbccc7 100644 --- a/src/main/java/com/l2jserver/util/calculator/Calculator.java +++ b/src/main/java/com/l2jserver/util/calculator/Calculator.java @@ -17,8 +17,11 @@ package com.l2jserver.util.calculator; /** + * @param + * the context used in this calculator + * @param + * the attribute calculated by this calculator * @author Rogiel - * */ public interface Calculator> extends Function { diff --git a/src/main/java/com/l2jserver/util/calculator/ComplexCalculator.java b/src/main/java/com/l2jserver/util/calculator/ComplexCalculator.java index c5d27f61f..405c59978 100644 --- a/src/main/java/com/l2jserver/util/calculator/ComplexCalculator.java +++ b/src/main/java/com/l2jserver/util/calculator/ComplexCalculator.java @@ -29,6 +29,11 @@ import com.l2jserver.util.factory.CollectionFactory; * An calculator is used to compute data and outputs its result. Note also, that * an calculator is also an function, that way you can nest calculators. * + * @param + * the calculator context type + * @param + * the calculator attribute set + * * @author Rogiel */ public class ComplexCalculator> @@ -40,7 +45,10 @@ public class ComplexCalculator> /** * Creates a new empty calculator. Functions can be add using - * {@link #add(V, Function)}. + * {@link #add(Function)} or {@link #add(Function...)} + * + * @param type + * the {@link Class} for attribute set */ public ComplexCalculator(Class type) { super(0x00, null); @@ -51,8 +59,10 @@ public class ComplexCalculator> * Creates a new calculator with functions in the declaration * order. * - * @param functions - * the calculator functions + * @param type + * the {@link Class} for attribute set + * @param calculators + * the calculators which functions will be imported */ @SuppressWarnings("unchecked") public ComplexCalculator(Class type, Calculator... calculators) { @@ -66,6 +76,8 @@ public class ComplexCalculator> * Creates a new calculator with functions in the declaration * order. * + * @param value + * the attribute type * @param functions * the calculator functions */ @@ -80,6 +92,8 @@ public class ComplexCalculator> * Creates a new calculator with functions in the declaration * order. * + * @param type + * the {@link Class} for attribute set * @param functions * the calculator functions */ @@ -100,8 +114,6 @@ public class ComplexCalculator> *

* Once a new function is added, sorting will be performed automatically. * - * @param order - * the operation order, starting at 0. * @param function * the operation */ @@ -118,10 +130,8 @@ public class ComplexCalculator> *

* Once a new function is added, sorting will be performed automatically. * - * @param order - * the operation order, starting at 0. - * @param function - * the operation + * @param functions + * the functions to be added */ public void add(Function... functions) { for (final Function func : functions) { @@ -136,10 +146,8 @@ public class ComplexCalculator> *

* Once a new function is added, sorting will be performed automatically. * - * @param order - * the operation order, starting at 0. - * @param function - * the operation + * @param functions + * the functions to be added */ public void addNoSort(Function... functions) { for (final Function func : functions) { @@ -150,8 +158,6 @@ public class ComplexCalculator> /** * Removes an fuction from this calculator. * - * @param order - * the operation order, starting at 0. * @param function * the operation */ @@ -166,8 +172,8 @@ public class ComplexCalculator> *

* This method will heuristically search for nested calculators. * - * @param calculator - * the calculator + * @param calculators + * the calculators to be imported */ @SuppressWarnings("unchecked") public void importFunctions(Calculator... calculators) { @@ -200,8 +206,8 @@ public class ComplexCalculator> *

* This method will heuristically search for nested calculators. * - * @param calculator - * the calculator + * @param calculators + * the calculators */ @SuppressWarnings("unchecked") public void removeFunctions(Calculator... calculators) { diff --git a/src/main/java/com/l2jserver/util/calculator/Function.java b/src/main/java/com/l2jserver/util/calculator/Function.java index 94cd61a4a..11890fb31 100644 --- a/src/main/java/com/l2jserver/util/calculator/Function.java +++ b/src/main/java/com/l2jserver/util/calculator/Function.java @@ -19,6 +19,11 @@ package com.l2jserver.util.calculator; /** * An function is nothing more than a mathematical operation. * + * @param + * the calculator context type + * @param + * the attribute set type + * * @author Rogiel */ public interface Function> { @@ -26,9 +31,10 @@ public interface Function> { * Performs the operation in the calculation process. *

* The value in the argument is normally used for calculation, but - * an {@link Function} can ignore the value if required to (i.e. - * {@link SetFunction}) + * an {@link Function} can ignore the value if required to. * + * @param ctx + * the calculator context * @param value * the input value * @return the output value diff --git a/src/main/java/com/l2jserver/util/calculator/SimpleCalculator.java b/src/main/java/com/l2jserver/util/calculator/SimpleCalculator.java index 58651c07e..91134a44e 100644 --- a/src/main/java/com/l2jserver/util/calculator/SimpleCalculator.java +++ b/src/main/java/com/l2jserver/util/calculator/SimpleCalculator.java @@ -24,6 +24,11 @@ import java.util.Comparator; * An calculator is used to compute data and outputs its result. Note also, that * an calculator is also an function, that way you can nest calculators. * + * @param + * the calculator context type + * @param + * the attribute set type + * * @author Rogiel */ public class SimpleCalculator> @@ -38,6 +43,8 @@ public class SimpleCalculator> * Creates a new calculator with functions in the declaration * order. * + * @param value + * the attribute * @param functions * the calculator functions */ diff --git a/src/main/java/com/l2jserver/util/factory/CollectionFactory.java b/src/main/java/com/l2jserver/util/factory/CollectionFactory.java index 17dc10669..77886d0cd 100644 --- a/src/main/java/com/l2jserver/util/factory/CollectionFactory.java +++ b/src/main/java/com/l2jserver/util/factory/CollectionFactory.java @@ -52,8 +52,6 @@ public class CollectionFactory { * * @param * the type - * @param type - * the type * @return the created set */ public static final Set newSet() { @@ -85,6 +83,9 @@ public class CollectionFactory { /** * Creates a new reference queue of type T * + * @param + * the type of the {@link ReferenceQueue} + * * @return the created queue */ public static final ReferenceQueue newReferenceQueue() { diff --git a/src/main/java/com/l2jserver/util/html/markup/HtmlTemplate.java b/src/main/java/com/l2jserver/util/html/markup/HtmlTemplate.java index 17ffffd8d..a785dd023 100644 --- a/src/main/java/com/l2jserver/util/html/markup/HtmlTemplate.java +++ b/src/main/java/com/l2jserver/util/html/markup/HtmlTemplate.java @@ -112,6 +112,7 @@ public abstract class HtmlTemplate { * the name * @param value * the value + * @return the {@link HtmlTemplate} object. Used for chain calls. */ public HtmlTemplate register(String name, String value) { variables.put(name, value); diff --git a/src/main/java/com/l2jserver/util/html/markup/MarkupTag.java b/src/main/java/com/l2jserver/util/html/markup/MarkupTag.java index b2d2369c5..1fb15761b 100644 --- a/src/main/java/com/l2jserver/util/html/markup/MarkupTag.java +++ b/src/main/java/com/l2jserver/util/html/markup/MarkupTag.java @@ -94,8 +94,8 @@ public class MarkupTag { /** * Adds an internal text from an code * - * @param text - * the text + * @param code + * the text code * @return this {@link MarkupTag} */ public MarkupTag textcode(int code) { @@ -190,7 +190,7 @@ public class MarkupTag { * the link text * @param action * the link action (will automatically append "bypass -h") - * @return + * @return the MarkupTag for chained calls */ public MarkupTag addLink(String text, String action) { final Tag tag = new L2LinkTag(); diff --git a/src/main/java/com/l2jserver/util/transformer/Transformer.java b/src/main/java/com/l2jserver/util/transformer/Transformer.java index 506ad879b..2e8244be9 100644 --- a/src/main/java/com/l2jserver/util/transformer/Transformer.java +++ b/src/main/java/com/l2jserver/util/transformer/Transformer.java @@ -20,6 +20,9 @@ package com.l2jserver.util.transformer; * An transformer can transform an {@link Object} into an {@link String} and the * {@link String} back to an equivalent object. * + * @param + * the transformed type + * * @author Rogiel */ public interface Transformer {