RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
AxeData.java
1package com.osroyale.content.skill.impl.woodcutting;
2
3import com.google.common.collect.ImmutableSet;
4import com.google.common.collect.ImmutableSortedSet;
5import com.osroyale.game.world.entity.mob.player.Player;
6import com.osroyale.game.world.entity.skill.Skill;
7
8import java.util.Optional;
9
10
52
53public enum AxeData {
54 BRONZE(1351, 1, 879, 0.1),
55 IRON(1349, 1, 877, 0.2),
56 STEEL(1353, 6, 875, 0.3),
57 BLACK(1361, 6, 873, 0.4),
58 MITHRIL(1355, 21, 871, 0.5),
59 ADAMANT(1357, 31, 869, 0.6),
60 RUNE(1359, 41, 867, 0.75),
61 THIRD_AGE(20011, 90, 7264, 0.80),
62 DRAGON(6739, 61, 2846, 0.85),
63 INFERNAL(13241, 61, 2117, 0.85);
64
68 private static final ImmutableSet<AxeData> VALUES = ImmutableSortedSet.copyOf(values()).descendingSet();
69
73 public final int id;
74
78 public final int level;
79
83 public final int animation;
84
88 public final double speed;
89
98 AxeData(int id, int level, int animation, double speed) {
99 this.id = id;
100 this.level = level;
101 this.animation = animation;
102 this.speed = speed;
103 }
104
111 public static Optional<AxeData> getDefinition(Player player) {
112 if (player.equipment.hasWeapon()) {
113 Optional<AxeData> result = VALUES.stream().filter(it -> player.equipment.contains(it.id) && player.skills.getLevel(Skill.WOODCUTTING) >= it.level).findFirst();
114
115 if (result.isPresent()) {
116 return result;
117 }
118 }
119 return VALUES.stream().filter(def -> player.inventory.contains(def.id) && player.skills.getLevel(Skill.WOODCUTTING) >= def.level).findAny();
120 }
121
122
123}
static Optional< AxeData > getDefinition(Player player)
Definition AxeData.java:111
AxeData(int id, int level, int animation, double speed)
Definition AxeData.java:98