1package com.runehive.game.world.items.ground;
3import com.runehive.game.event.impl.PickupItemEvent;
4import com.runehive.game.event.impl.log.DropItemLogEvent;
5import com.runehive.game.plugin.PluginManager;
6import com.runehive.game.world.World;
7import com.runehive.game.world.entity.Entity;
8import com.runehive.game.world.entity.EntityType;
9import com.runehive.game.world.entity.mob.player.Player;
10import com.runehive.game.world.entity.mob.player.PlayerRight;
11import com.runehive.game.world.items.Item;
12import com.runehive.game.world.position.Position;
13import com.runehive.game.world.region.Region;
14import com.runehive.net.packet.out.SendGroundItem;
15import com.runehive.net.packet.out.SendMessage;
16import com.runehive.net.packet.out.SendRemoveGroundItem;
18import java.util.Objects;
48 groundItem.instance =
player.instance;
57 groundItem.instance =
player.instance;
65 groundItem.instance =
player.instance;
75 groundItem.instance =
player.instance;
85 this.instance =
player.instance;
140 if (
item.getId() == 11283) {
142 player.dragonfireCharges = 0;
153 for (
Region reg : regions) {
161 region.addGroundItem(
this);
168 for (
Region reg : regions) {
175 region.removeGroundItem(
this);
180 return item.getName();
190 if (obj ==
this)
return true;
207 return "GroundItem[owner=" +
player.getUsername() +
", position=" +
getPosition() +
", index=" +
getIndex() +
", item=" +
item.getName() +
"]";
void publish(Event event)
Sends an Event to all subscribed listeners.
boolean publish(Player player, Event event)
This class handles how plugins are loaded/unloaded and accessed.
static PlayerDataBus getDataBus()
synchronized final void cancel()
Cancels all subsequent executions.
Represents the game world.
static void schedule(Task task)
Submits a new event.
static DataBus getDataBus()
static RegionManager getRegions()
void setRegistered(boolean registered)
Entity(Position position)
final boolean isRegistered()
void setPosition(Position position)
This class represents a character controlled by a player.
The container class that represents an item that can be interacted with.
final int getAmount()
Gets the quantity of this item.
boolean equals(Object obj)
EntityType getType()
Gets the EntityType.
GroundItemPolicy policy
The policy for this ground item.
final GroundItemEvent event
The randomevent for ground item.
static GroundItem create(Player player, Item item)
Creates a new GroundItem object for a player and an item.
static void createGlobal(Player player, Item item)
Creates a new GroundItem object for a player and an item.
void addToRegion(Region region)
Adds this entity to the specified region.
String getName()
Gets the name of this entity.
static void pickup(Player player, Item item, Position position)
Attempts to pick the specified item up.
final Player player
The optional player whom owns this item.
void unregister()
Unregisters an entity from the World.
static void createGlobal(Player player, Item item, Position position)
Creates a new GroundItem object for a player and an item.
boolean canSee(Player other)
GroundItem(Player player, Item item, Position position)
Constructs a new GroundItem object for a player, an item, and a position.
boolean canIronMenPickThisItemUp
static GroundItem create(Player player, Item item, Position position)
Creates a new GroundItem object for a player, an item and position.
void removeFromRegion(Region region)
Removes this entity from the specified region.
void register()
Registers an entity to the World.
boolean equals(Object obj)
final Item item
The item that represents this ground item.
Represents a single tile on the game world.
boolean equals(Object obj)
Represents a single region.
Region[] getSurroundingRegions(Position position)
Gets the regions surrounding a position.
The OutgoingPacket that sends a message to a Players chatbox in the client.
Holds all the player right data.
static boolean isIronman(Player player)
Checks if the player is an ironman.