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