mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-07 16:49:12 +00:00
Actually fix issue #2.
This commit is contained in:
@@ -10,10 +10,10 @@ public class FirstNpcActionEvent extends NpcActionEvent {
|
|||||||
/**
|
/**
|
||||||
* Creates a new first npc action event.
|
* 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) {
|
public FirstNpcActionEvent(int index) {
|
||||||
super(1, npcIndex);
|
super(1, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -17,17 +17,17 @@ public class NpcActionEvent extends Event {
|
|||||||
/**
|
/**
|
||||||
* The npc index.
|
* The npc index.
|
||||||
*/
|
*/
|
||||||
private final int npcIndex;
|
private final int index;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new npc action event.
|
* Creates a new npc action event.
|
||||||
*
|
*
|
||||||
* @param action The action number.
|
* @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.action = action;
|
||||||
this.npcIndex = npcIndex;
|
this.index = index;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -45,7 +45,7 @@ public class NpcActionEvent extends Event {
|
|||||||
* @return The npc index.
|
* @return The npc index.
|
||||||
*/
|
*/
|
||||||
public int getNpcIndex() {
|
public int getNpcIndex() {
|
||||||
return npcIndex;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -10,10 +10,10 @@ public class SecondNpcActionEvent extends NpcActionEvent {
|
|||||||
/**
|
/**
|
||||||
* Creates a new second npc action event.
|
* 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) {
|
public SecondNpcActionEvent(int index) {
|
||||||
super(2, npcIndex);
|
super(2, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -10,10 +10,10 @@ public class ThirdNpcActionEvent extends NpcActionEvent {
|
|||||||
/**
|
/**
|
||||||
* Creates a new third npc action event.
|
* 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) {
|
public ThirdNpcActionEvent(int index) {
|
||||||
super(3, npcIndex);
|
super(3, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -31,11 +31,6 @@ public class InterfaceConstants {
|
|||||||
*/
|
*/
|
||||||
public static final int QUEST_SCROLL_PANE = 8143;
|
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.
|
* 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,
|
12201, 12202, 12203, 12204, 12205, 12206, 12207, 12208, 12209, 12210, 12211, 12212, 12213, 12214, 12215,
|
||||||
12216, 12217, 12218, 12219, 12220, 12221, 12222, 12223 };
|
12216, 12217, 12218, 12219, 12220, 12221, 12222, 12223 };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The quest title widget id.
|
||||||
|
*/
|
||||||
|
public static final int QUEST_TITLE = 8144;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prevent instantiation.
|
* Prevent instantiation.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -108,11 +108,6 @@ public final class Player extends Character {
|
|||||||
*/
|
*/
|
||||||
private boolean designedCharacter = false;
|
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.
|
* 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;
|
private boolean regionChanged = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The player's run energy.
|
||||||
|
*/
|
||||||
|
private int runEnergy = 100;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A flag indicating if this player is running.
|
* A flag indicating if this player is running.
|
||||||
*/
|
*/
|
||||||
@@ -299,6 +299,15 @@ public final class Player extends Character {
|
|||||||
return privilegeLevel;
|
return privilegeLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the player's run energy.
|
||||||
|
*
|
||||||
|
* @return The run energy.
|
||||||
|
*/
|
||||||
|
public int getRunEnergy() {
|
||||||
|
return runEnergy;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the game session.
|
* Gets the game session.
|
||||||
*
|
*
|
||||||
@@ -619,6 +628,15 @@ public final class Player extends Character {
|
|||||||
this.regionChanged = regionChanged;
|
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}.
|
* Sets the player's {@link GameSession}.
|
||||||
*
|
*
|
||||||
@@ -665,22 +683,4 @@ public final class Player extends Character {
|
|||||||
+ privilegeLevel + "]";
|
+ 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();
|
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.
|
* Creates a plugin map from a collection.
|
||||||
*
|
*
|
||||||
@@ -98,6 +89,15 @@ public final class PluginManager {
|
|||||||
return Collections.unmodifiableCollection(plugins);
|
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.
|
* Populates the list with the authors of the Apollo core.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user