Actually fix issue #2.

This commit is contained in:
Major-
2013-11-04 01:42:54 +00:00
parent 88c45c216f
commit ecb77ed748
10 changed files with 124 additions and 51 deletions
@@ -10,10 +10,10 @@ public class FirstNpcActionEvent extends NpcActionEvent {
/**
* Creates a new first npc action event.
*
* @param npcIndex The index of the npc.
* @param index The index of the npc.
*/
public FirstNpcActionEvent(int npcIndex) {
super(1, npcIndex);
public FirstNpcActionEvent(int index) {
super(1, index);
}
}
@@ -17,17 +17,17 @@ public class NpcActionEvent extends Event {
/**
* The npc index.
*/
private final int npcIndex;
private final int index;
/**
* Creates a new npc action event.
*
* @param action The action number.
* @param npcIndex The index of the npc.
* @param index The index of the npc.
*/
public NpcActionEvent(int action, int npcIndex) {
public NpcActionEvent(int action, int index) {
this.action = action;
this.npcIndex = npcIndex;
this.index = index;
}
/**
@@ -45,7 +45,7 @@ public class NpcActionEvent extends Event {
* @return The npc index.
*/
public int getNpcIndex() {
return npcIndex;
return index;
}
}
@@ -10,10 +10,10 @@ public class SecondNpcActionEvent extends NpcActionEvent {
/**
* Creates a new second npc action event.
*
* @param npcIndex The index of the npc.
* @param index The index of the npc.
*/
public SecondNpcActionEvent(int npcIndex) {
super(2, npcIndex);
public SecondNpcActionEvent(int index) {
super(2, index);
}
}
@@ -10,10 +10,10 @@ public class ThirdNpcActionEvent extends NpcActionEvent {
/**
* Creates a new third npc action event.
*
* @param npcIndex The index of the npc.
* @param index The index of the npc.
*/
public ThirdNpcActionEvent(int npcIndex) {
super(3, npcIndex);
public ThirdNpcActionEvent(int index) {
super(3, index);
}
}
@@ -31,11 +31,6 @@ public class InterfaceConstants {
*/
public static final int QUEST_SCROLL_PANE = 8143;
/**
* The quest title widget id.
*/
public static final int QUEST_TITLE = 8144;
/**
* The array of widgets that display the text.
*/
@@ -47,6 +42,11 @@ public class InterfaceConstants {
12201, 12202, 12203, 12204, 12205, 12206, 12207, 12208, 12209, 12210, 12211, 12212, 12213, 12214, 12215,
12216, 12217, 12218, 12219, 12220, 12221, 12222, 12223 };
/**
* The quest title widget id.
*/
public static final int QUEST_TITLE = 8144;
/**
* Prevent instantiation.
*/
+23 -23
View File
@@ -108,11 +108,6 @@ public final class Player extends Character {
*/
private boolean designedCharacter = false;
/**
* The player's run energy.
*/
private int runEnergy = 100;
/**
* A flag which indicates there are npcs that couldn't be added.
*/
@@ -163,6 +158,11 @@ public final class Player extends Character {
*/
private boolean regionChanged = false;
/**
* The player's run energy.
*/
private int runEnergy = 100;
/**
* A flag indicating if this player is running.
*/
@@ -299,6 +299,15 @@ public final class Player extends Character {
return privilegeLevel;
}
/**
* Gets the player's run energy.
*
* @return The run energy.
*/
public int getRunEnergy() {
return runEnergy;
}
/**
* Gets the game session.
*
@@ -619,6 +628,15 @@ public final class Player extends Character {
this.regionChanged = regionChanged;
}
/**
* Sets the player's run energy.
*
* @param runEnergy The energy.
*/
public void setRunEnergy(int runEnergy) {
this.runEnergy = runEnergy;
}
/**
* Sets the player's {@link GameSession}.
*
@@ -665,22 +683,4 @@ public final class Player extends Character {
+ privilegeLevel + "]";
}
/**
* Gets the player's run energy.
*
* @return The run energy.
*/
public int getRunEnergy() {
return runEnergy;
}
/**
* Sets the player's run energy.
*
* @param runEnergy The energy.
*/
public void setRunEnergy(int runEnergy) {
this.runEnergy = runEnergy;
}
}
@@ -0,0 +1,24 @@
package org.apollo.net.release.r317;
import org.apollo.game.event.impl.FirstNpcActionEvent;
import org.apollo.net.codec.game.DataTransformation;
import org.apollo.net.codec.game.DataType;
import org.apollo.net.codec.game.GamePacket;
import org.apollo.net.codec.game.GamePacketReader;
import org.apollo.net.release.EventDecoder;
/**
* The {@link EventDecoder} for the {@link FirstNpcActionEvent}.
*
* @author Major
*/
public class FirstNpcActionEventDecoder extends EventDecoder<FirstNpcActionEvent> {
@Override
public FirstNpcActionEvent decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
int index = (int) reader.getUnsigned(DataType.SHORT, DataTransformation.ADD);
return new FirstNpcActionEvent(index);
}
}
@@ -0,0 +1,24 @@
package org.apollo.net.release.r317;
import org.apollo.game.event.impl.SecondNpcActionEvent;
import org.apollo.net.codec.game.DataOrder;
import org.apollo.net.codec.game.DataType;
import org.apollo.net.codec.game.GamePacket;
import org.apollo.net.codec.game.GamePacketReader;
import org.apollo.net.release.EventDecoder;
/**
* The {@link EventDecoder} for the {@link SecondNpcActionEvent}.
*
* @author Major
*/
public class SecondNpcActionEventDecoder extends EventDecoder<SecondNpcActionEvent> {
@Override
public SecondNpcActionEvent decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
int index = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE);
return new SecondNpcActionEvent(index);
}
}
@@ -0,0 +1,25 @@
package org.apollo.net.release.r317;
import org.apollo.game.event.impl.ThirdNpcActionEvent;
import org.apollo.net.codec.game.DataOrder;
import org.apollo.net.codec.game.DataTransformation;
import org.apollo.net.codec.game.DataType;
import org.apollo.net.codec.game.GamePacket;
import org.apollo.net.codec.game.GamePacketReader;
import org.apollo.net.release.EventDecoder;
/**
* The {@link EventDecoder} for the {@link ThirdNpcActionEvent}.
*
* @author Major
*/
public class ThirdNpcActionEventDecoder extends EventDecoder<ThirdNpcActionEvent> {
@Override
public ThirdNpcActionEvent decode(GamePacket packet) {
GamePacketReader reader = new GamePacketReader(packet);
int index = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE, DataTransformation.ADD);
return new ThirdNpcActionEvent(index);
}
}
@@ -44,15 +44,6 @@ public final class PluginManager {
initAuthors();
}
/**
* Creates an unmodifiable {@link Set} containing the authors.
*
* @return The set.
*/
public Set<String> getAuthors() {
return Collections.unmodifiableSortedSet(authors);
}
/**
* Creates a plugin map from a collection.
*
@@ -98,6 +89,15 @@ public final class PluginManager {
return Collections.unmodifiableCollection(plugins);
}
/**
* Creates an unmodifiable {@link Set} containing the authors.
*
* @return The set.
*/
public Set<String> getAuthors() {
return Collections.unmodifiableSortedSet(authors);
}
/**
* Populates the list with the authors of the Apollo core.
*/