mirror of
https://github.com/ProjectSWGCore/Holocore.git
synced 2026-10-18 08:02:56 -04:00
Refactored Encodable interface to include decode(ByteBuffer) method
This commit is contained in:
@@ -27,8 +27,6 @@
|
||||
***********************************************************************************/
|
||||
package resources.objects.waypoint;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import network.packets.Packet;
|
||||
import network.packets.swg.zone.baselines.Baseline.BaselineType;
|
||||
import resources.Location;
|
||||
@@ -38,6 +36,8 @@ import resources.encodables.OutOfBandPackage;
|
||||
import resources.objects.intangible.IntangibleObject;
|
||||
import resources.player.Player;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
public class WaypointObject extends IntangibleObject implements OutOfBandData {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -105,17 +105,15 @@ public class WaypointObject extends IntangibleObject implements OutOfBandData {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int decodeOutOfBandData(ByteBuffer data) {
|
||||
public void decode(ByteBuffer data) {
|
||||
data.getInt();
|
||||
setLocation(data.getFloat(), data.getFloat(), data.getFloat());
|
||||
cellId = data.getLong();
|
||||
cellId = Packet.getLong(data);
|
||||
getLocation().setTerrain(Terrain.getTerrainFromCrc(data.getInt()));
|
||||
System.out.println(getLocation());
|
||||
name = Packet.getUnicode(data);
|
||||
Packet.getLong(data); // objectId
|
||||
color = WaypointColor.valueOf(data.get());
|
||||
active = Packet.getBoolean(data);
|
||||
return 42 + name.length() * 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user