1package com.runehive.content.skill.impl.crafting.impl;
3import com.runehive.Config;
4import com.runehive.game.Animation;
5import com.runehive.game.action.Action;
6import com.runehive.game.action.policy.WalkablePolicy;
7import com.runehive.game.world.entity.mob.player.Player;
8import com.runehive.game.world.entity.skill.Skill;
9import com.runehive.game.world.items.Item;
10import com.runehive.game.world.items.ItemDefinition;
11import com.runehive.net.packet.out.SendInterfaceConfig;
12import com.runehive.net.packet.out.SendItemOnInterfaceSlot;
13import com.runehive.net.packet.out.SendMessage;
14import com.runehive.util.Utility;
16import java.util.Arrays;
17import java.util.Optional;
131 if (data.type ==
type) {
148 if (data.type ==
type) {
149 items[count] = data.product;
162 public static Optional<JewelleryData>
forItem(
int item) {
163 return Arrays.stream(values()).filter(i -> i.product == item).findAny();
174 for (
int i = 0; i < items.length; i++) {
179 for (
int i = 0; i < items.length; i++) {
184 for (
int i = 0; i < items.length; i++) {
214 boolean contains =
true;
243 public void execute() {
245 player.
send(
new SendMessage(
"You do not have the required items to craft this!"));
252 for (
int index = 0; index < jewellery.
materials.length; index++) {
262 if (++ticks == amount) {
269 public String getName() {
270 return "Jewellery crafting";
274 public boolean prioritized() {
The class that contains setting-related constants for the server.
static final double CRAFTING_MODIFICATION
The experience modification for crafting.
Handles crafting jewellery.
static Action< Player > craft(Player player, JewelleryData jewellery, int amount)
The jewellery crafting animation.
static void open(Player player)
Opens the jewellery creation itemcontainer.
static void click(Player player, int item, int amount)
Handles clicking on the itemcontainer.
Class that models a single animation used by an entity.
Represents an action an entity can execute.
public< A extends Action<?> > void execute(A action)
final SkillManager skills
void animate(int animation)
void close(int interfaceId)
void open(int identification)
Opens an interface for the player.
This class represents a character controlled by a player.
final Inventory inventory
final InterfaceManager interfaceManager
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.
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.
final boolean containsAll(int... identifiers)
Determines if this container contains all identifiers.
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 int[] getItems(JewelleryType type)
Gets the product items based on the jewellery type.
double experience
The experience rewarded.
int level
The level required.
JewelleryType type
The jewellery type.
JewelleryData(int product, int level, double experience, JewelleryType type, Item... materials)
Constructs a new JewelleryData.
Item[] materials
The materials required.
int product
The production item.
static int getSize(JewelleryType type)
Gets the size of all the jewellery types.
static Optional< JewelleryData > forItem(int item)
Gets the jewellery data based on the product item.
JewelleryType(int identification)
Constructs a new JewelleryType.
final int identification
The itemcontainer identification.
A queue policy determines whether the action can occur while walking.
NON_WALKABLE
This indicates actions cannot occur while walking.