1package com.runehive.content.skill.impl.crafting.impl;
3import com.runehive.Config;
4import com.runehive.net.packet.out.SendInputAmount;
5import com.runehive.net.packet.out.SendMessage;
6import com.runehive.game.action.Action;
7import com.runehive.game.action.policy.WalkablePolicy;
8import com.runehive.game.world.entity.mob.player.Player;
9import com.runehive.content.dialogue.ChatBoxItemDialogue;
10import com.runehive.game.world.entity.skill.Skill;
11import com.runehive.game.world.items.Item;
12import com.runehive.game.world.items.ItemDefinition;
13import com.runehive.util.Utility;
15import java.util.Arrays;
16import java.util.Optional;
74 return Arrays.stream(values()).filter(a -> a.ingredient ==
ingredient).findAny();
86 if (used.
getId() != 1759 && with.
getId() != 1759) {
90 Item wool = used.
getId() == 1759 ? used : with;
124 public void firstOption(
Player player) {
129 public void secondOption(
Player player) {
134 public void thirdOption(
Player player) {
139 public void fourthOption(
Player player) {
158 public void execute() {
171 if (++ticks == amount) {
178 public String getName() {
183 public boolean prioritized() {
The class that contains setting-related constants for the server.
static final double CRAFTING_MODIFICATION
The experience modification for crafting.
static void sendInterface(Player player, int interfaceId, Item item, int zoom)
final DialogueFactory execute()
Retrieves the next dialogue in the chain and executes it.
void clear()
Clears the current dialogue chain.
final DialogueFactory sendStatement(String... lines)
Appends a StatementDialogue to the current dialogue chain.
Handles stringing amulets.
static void craft(Player player, AmuletData amulet)
Handles crafting the amulet.
static Action< Player > string(Player player, AmuletData amulet, int amount)
The amulet stringing action.
static boolean useItem(Player player, Item used, Item with)
Handles using item.
Represents an action an entity can execute.
public< A extends Action<?> > void execute(A action)
final SkillManager skills
This class represents a character controlled by a player.
final Inventory inventory
DialogueFactory dialogueFactory
void send(OutgoingPacket encoder)
Represents a trainable and usable skill.
static final int CRAFTING
The crafting skill id.
void addExperience(int id, double experience)
Adds experience to a given skill.
int getMaxLevel(int id)
Gets the highest possible level of a skill.
Represents all of an in-game Item's attributes.
static ItemDefinition get(int id)
Gets an item definition.
String getName()
Gets the item name.
The container class that represents an item that can be interacted with.
final int getId()
Gets the identification of this item.
boolean remove(Item item)
Attempts to withdraw item from this container.
boolean add(Item item)
Attempts to deposit item into this container.
boolean contains(int id)
Determines if this container contains id.
The OutgoingPacket that sends a message to a Players chatbox in the client.
Handles miscellaneous methods.
static String getAOrAn(String nextWord)
A or an.
static Optional< AmuletData > forAmulet(int ingredient)
Grabs the amulet data.
AmuletData(int ingredient, int product, int level)
Constructs a new AmuletData.
final int product
The product item.
final int level
The level required.
final int ingredient
The amulet item.
A queue policy determines whether the action can occur while walking.
NON_WALKABLE
This indicates actions cannot occur while walking.