1package com.runehive.content.skill.impl;
3import com.runehive.net.packet.out.SendMessage;
4import com.runehive.game.world.entity.mob.player.Player;
5import com.runehive.content.skill.SkillAction;
6import com.runehive.game.world.items.Item;
7import com.runehive.game.world.items.containers.ItemContainer;
8import com.runehive.game.world.position.Position;
9import com.runehive.util.StringUtils;
11import java.util.Optional;
66 if(!
getMob().getPlayer().inventory.contains(item)) {
67 String anyOrEnough = item.getAmount() == 1 ?
"any" :
"enough";
114 return Optional.empty();
SkillAction(Mob mob, Optional< Position > position, int delay, boolean instant)
Creates a new Action randomevent.
final Optional< Position > position
The position we should face.
abstract double experience()
The experience given from this action.
abstract int skill()
The skill we should hand to experience to.
abstract Optional< Item[]> produceItem()
The item that will be added upon production.
ProducingSkillAction(Player player, Optional< Position > position, boolean instant)
Creates a new ProducingSkillAction.
Optional< String > message()
The message that will be sent when the player doesn't have the items required.
final void onExecute()
The method which is called on intervals of the specified #delay;.
final boolean canRun()
Determines if the task can be ran.
void onProduce(boolean success)
The method executed upon production of an item.
ProducingSkillAction(Player player, Optional< Position > position, int delay, boolean instant)
Creates a new ProducingSkillAction.
abstract Optional< Item[]> removeItem()
The item that will be removed upon production.
T getMob()
Gets the player.
final boolean instant
If execution happens instantly upon being scheduled.
int delay
The cyclic delay.
This class represents a character controlled by a player.
The container class that represents an item that can be interacted with.
An abstraction game representing a group of Items.
final boolean hasCapacityFor(Item... item)
Determines if this container has the capacity for item.
final void fireCapacityExceededEvent()
Fires the ItemContainerListener.capacityExceeded(ItemContainer) event.
boolean removeAll(Collection<? extends Item > items)
Attempts to withdraw items in bulk from this container.
final ItemContainer copy()
Creates a copy of the underlying item container.
The OutgoingPacket that sends a message to a Players chatbox in the client.
static String appendPluralCheck(String thing)
Appends the determined plural check to thing.