RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.net.packet.out.SendAddObject Class Reference
Inheritance diagram for com.runehive.net.packet.out.SendAddObject:
Collaboration diagram for com.runehive.net.packet.out.SendAddObject:

Public Member Functions

boolean encode (Player player)
 SendAddObject (GameObject object)
Public Member Functions inherited from com.runehive.net.packet.OutgoingPacket
void execute (Player player)
 OutgoingPacket (int opcode, int capacity)
 OutgoingPacket (int opcode, PacketType type)
 OutgoingPacket (int opcode, PacketType type, int size)

Private Attributes

final GameObject object

Additional Inherited Members

Protected Attributes inherited from com.runehive.net.packet.OutgoingPacket
final PacketBuilder builder

Detailed Description

Definition at line 9 of file SendAddObject.java.

Constructor & Destructor Documentation

◆ SendAddObject()

com.runehive.net.packet.out.SendAddObject.SendAddObject ( GameObject object)

Definition at line 13 of file SendAddObject.java.

13 {
14 super(151, 4);
15 this.object = object;
16 }

References object.

Member Function Documentation

◆ encode()

boolean com.runehive.net.packet.out.SendAddObject.encode ( Player player)

Reimplemented from com.runehive.net.packet.OutgoingPacket.

Definition at line 19 of file SendAddObject.java.

19 {
20 if (object.getInstancedHeight() != player.instance) {
21 return false;
22 }
23 player.send(new SendCoordinate(object.getPosition()));
24 builder.writeByte(0, ByteModification.ADD);
25 builder.writeShort(object.getId(), ByteOrder.LE);
26 builder.writeByte((object.getObjectType().getId() << 2) + (object.getDirection().getId() & 3), ByteModification.SUB);
27 return true;
28 }

References com.runehive.net.codec.ByteModification.ADD, com.runehive.net.packet.OutgoingPacket.builder, com.runehive.game.world.entity.Entity.instance, com.runehive.net.codec.ByteOrder.LE, com.runehive.game.world.entity.mob.player.Player.send(), and com.runehive.net.codec.ByteModification.SUB.

Here is the call graph for this function:

Member Data Documentation

◆ object

final GameObject com.runehive.net.packet.out.SendAddObject.object
private

Definition at line 11 of file SendAddObject.java.

Referenced by SendAddObject().


The documentation for this class was generated from the following file: