RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
SendAddObject.java
1
package
com.osroyale.net.packet.out;
2
3
import
com.osroyale.net.codec.ByteOrder;
4
import
com.osroyale.net.codec.ByteModification;
5
import
com.osroyale.game.world.entity.mob.player.Player;
6
import
com.osroyale.game.world.object.GameObject;
7
import
com.osroyale.net.packet.OutgoingPacket;
8
29
30
public
class
SendAddObject
extends
OutgoingPacket {
31
32
private
final
GameObject
object;
33
34
public
SendAddObject(
GameObject
object
) {
35
super(151, 4);
36
this.object = object;
37
}
38
39
@Override
40
public
boolean
encode(
Player
player) {
41
if
(
object
.getInstancedHeight() != player.instance) {
42
return
false
;
43
}
44
player.send(
new
SendCoordinate
(
object
.getPosition()));
45
builder.writeByte(0,
ByteModification
.
ADD
);
46
builder.writeShort(
object
.getId(),
ByteOrder
.
LE
);
47
builder.writeByte((
object
.getObjectType().getId() << 2) + (
object
.getDirection().getId() & 3),
ByteModification
.
SUB
);
48
return
true
;
49
}
50
51
}
com.osroyale.game.world.entity.mob.player.Player
Definition
Player.java:162
com.osroyale.net.packet.out.SendCoordinate
Definition
SendCoordinate.java:29
com.osroyale.net.codec.ByteModification
Definition
ByteModification.java:33
com.osroyale.net.codec.ByteModification.SUB
SUB
Definition
ByteModification.java:53
com.osroyale.net.codec.ByteModification.ADD
ADD
Definition
ByteModification.java:43
com.osroyale.net.codec.ByteOrder
Definition
ByteOrder.java:33
com.osroyale.net.codec.ByteOrder.LE
LE
Definition
ByteOrder.java:38
com.osroyale.game.world.object.GameObject
Definition
GameObject.java:13