RuneHive-Game
Loading...
Searching...
No Matches
UnfinishedPotion.java
Go to the documentation of this file.
1package com.runehive.content.skill.impl.herblore;
2
3import com.runehive.game.world.items.Item;
4
5import java.util.Arrays;
6
7public enum UnfinishedPotion implements Potion {
8 GUAM_POTION(91, 249, 1),
9 MARRENTILL_POTION(93, 251, 5),
10 TARROMIN_POTION(95, 253, 12),
11 HARRALANDER_POTION(97, 255, 22),
12 RANARR_POTION(99, 257, 30),
13 TOADFLAX_POTION(3002, 2998, 34),
14 SPIRIT_WEED_POTION(12181, 12172, 40),
15 IRIT_POTION(101, 259, 45),
16 WERGALI_POTION(14856, 14854, 1),
17 AVANTOE_POTION(103, 261, 50),
18 KWUARM_POTION(105, 263, 55),
19 SNAPDRAGON_POTION(3004, 3000, 63),
20 CADANTINE_POTION(107, 265, 66),
21 LANTADYME(2483, 2481, 69),
22 DWARF_WEED_POTION(109, 267, 72),
23 TORSTOL_POTION(111, 269, 78);
24
25 private final int product;
26 private final Item[] ingredients;
27 private final int level;
28
29 UnfinishedPotion(int product, int ingredient, int level) {
30 this.product = product;
31 this.ingredients = new Item[] { new Item(227), new Item(ingredient) };
32 this.level = level;
33 }
34
35 public static UnfinishedPotion get(Item use, Item with) {
36 for (final UnfinishedPotion potion : values()) {
37 if (potion.ingredients[0].equals(use) && potion.ingredients[1].equals(with) || potion.ingredients[1].equals(use) && potion.ingredients[0].equals(with)) {
38 return potion;
39 }
40 }
41 return null;
42 }
43
44 @Override
45 public int getAnimation() {
46 return -1;
47 }
48
49 @Override
50 public double getExperience() {
51 return 0;
52 }
53
54 @Override
55 public Item[] getIngredients() {
56 return Arrays.copyOf(ingredients, ingredients.length);
57 }
58
59 @Override
60 public int getLevel() {
61 return level;
62 }
63
64 @Override
65 public Item getProduct() {
66 return new Item(product);
67 }
68
69 @Override
70 public String toString() {
71 return "UnfinishedPotion[product: " + getProduct() + ", level: " + level + ", ingredients: " + Arrays.toString(ingredients) + "]";
72 }
73}
The container class that represents an item that can be interacted with.
Definition Item.java:21
Item[] getIngredients()
Gets the ingredients required for the potion.
int getLevel()
Gets the level required for making the potion.
UnfinishedPotion(int product, int ingredient, int level)
The potion making itemcontainer.
Definition Potion.java:10