36public class SendGroundItem
extends OutgoingPacket {
39 private GroundItemType type;
41 private SendGroundItem(
GroundItem groundItem, GroundItemType type) {
43 this.groundItem = groundItem;
48 this(groundItem, GroundItemType.NORMAL);
52 public boolean encode(
Player player) {
53 if (groundItem.instance != player.instance) {
57 if (!groundItem.isRegistered()) {
61 if (!groundItem.item.isTradeable()) {
62 this.type = GroundItemType.UNTRADEABLE;
63 }
else if (groundItem.item.getValue() > 1_000_000) {
64 this.type = GroundItemType.RARE;
66 this.type = GroundItemType.NORMAL;
71 .writeLong(groundItem.item.getAmount())
72 .writeByte(type.ordinal())
77public enum GroundItemType {