1package com.runehive.content.skill.impl.smithing;
3import com.runehive.Config;
4import com.runehive.content.skillcape.SkillCape;
5import com.runehive.content.activity.randomevent.RandomEventHandler;
6import com.runehive.game.Animation;
7import com.runehive.game.action.Action;
8import com.runehive.game.action.policy.WalkablePolicy;
9import com.runehive.game.world.entity.mob.player.Player;
10import com.runehive.game.world.entity.skill.Skill;
11import com.runehive.game.world.object.GameObject;
12import com.runehive.net.packet.out.SendChatBoxInterface;
13import com.runehive.net.packet.out.SendInputAmount;
14import com.runehive.net.packet.out.SendItemModelOnInterface;
16import java.util.Optional;
23 private static final int[]
SMELT_FRAME = {2405, 2406, 2407, 2409, 2410, 2411, 2412, 2413};
26 public static final int[]
SMELT_BARS = {2349, 2351, 2355, 2353, 2357, 2359, 2361, 2363};
49 if (!data.isPresent()) {
53 if (data.get().amount == -1) {
54 player.
send(
new SendInputAmount(
"How many you would like to melt?", 2, s ->
Smelting.smelt(player, data.get(), Integer.parseInt(s))));
58 smelt(player, data.get(), data.get().amount);
71 boolean accessible =
false;
74 if (
object.getId() ==
id) {
98 getMob().message(
"You need a smithing level of " +
definition.requirement +
" to smelt this bar.");
103 getMob().message(
"You don't have the required items to smelt this bar.");
113 getMob().playerAssistant.activateSkilling(1);
163 return "smelting-action";
The class that contains setting-related constants for the server.
static final double SMITHING_MODIFICATION
The experience modification for smithing.
static void trigger(Player player)
static boolean smelt(Player player, int buttonId)
Attempts to start smelting for the specified player.
boolean canSchedule()
A function executed on registration.
WalkablePolicy getWalkablePolicy()
Gets the WalkablePolicy of this action.
void execute()
A function representing the unit of work that will be carried out.
void onCancel(boolean logout)
A function executed on cancellation.
static final int[] FURNACE_IDS
The array which holds all the possible furnace ids a player can smelt his bars in.
String getName()
Gets the name of this action.
static boolean openInterface(Player player, GameObject object)
Opens the smelting itemcontainer for the player.
static final int[] SMELT_BARS
The bar identification to be drawn on each frame.
final boolean spell
Determines if we're smelting dependant on the superheat spell.
static void clearInterfaces(Player player)
Sends the items on the smelting itemcontainer.
boolean prioritized()
Determines if this action is prioritized.
int amount
The amount we're producing.
void onSchedule()
A function executed on registration.
boolean smelt()
Checks if the player has the requirements to smelt.
Smelting(Player player, SmeltingData definition, int amount, boolean spell)
Constructs a new Smelting.
static void smelt(Player player, SmeltingData data, int amount)
Smelts the data for the specified player and produces the exact amount the player inputed if he has t...
static final int[] SMELT_FRAME
The array which holds all the frames you can draw an item on.
final SmeltingData definition
The definition of the bar we're creating.
Class that models a single animation used by an entity.
T getMob()
Gets the player.
Action(T mob, int delay, boolean instant)
Creates a new Action randomevent.
public< A extends Action<?> > void execute(A action)
synchronized final void cancel()
Cancels all subsequent executions.
final SkillManager skills
void close(int interfaceId)
This class represents a character controlled by a player.
final InterfaceManager interfaceManager
void send(OutgoingPacket encoder)
Represents a trainable and usable skill.
static final int SMITHING
The smithing skill id.
void setDoingSkill(boolean doingSkill)
Skill get(int id)
Gets the skill for an id.
The enumerated type whose elements represent definitions for each smeltable bar.
static Optional< SmeltingData > getDefinition(int buttonId)
Searches for a match for the internal button identification.
static boolean isEquipped(Player player, SkillCape cape)
A queue policy determines whether the action can occur while walking.
NON_WALKABLE
This indicates actions cannot occur while walking.
Represents a game object.