RuneHive-Game
Loading...
Searching...
No Matches
SendGraphic.java
Go to the documentation of this file.
1package com.runehive.net.packet.out;
2
3import com.runehive.game.Graphic;
4import com.runehive.game.world.entity.mob.player.Player;
5import com.runehive.game.world.position.Position;
6import com.runehive.net.packet.OutgoingPacket;
7
8public class SendGraphic extends OutgoingPacket {
9
10 private final Graphic graphic;
11 private final Position position;
12
14 super(4, 6);
15 this.graphic = graphic;
16 this.position = position;
17 }
18
19 @Override
20 public boolean encode(Player player) {
21 player.send(new SendCoordinate(position));
22 builder.writeByte(0)
23 .writeShort(graphic.getId())
24 .writeByte(position.getHeight())
25 .writeShort(graphic.getDelay());
26 return true;
27 }
28}
Represents a single graphic that can be used by entities.
Definition Graphic.java:10
This class represents a character controlled by a player.
Definition Player.java:125
Represents a single tile on the game world.
Definition Position.java:14
OutgoingPacket(int opcode, int capacity)
SendGraphic(Graphic graphic, Position position)