woodcutting: Add axe animation matching helper method
This commit is contained in:
@@ -50,6 +50,7 @@ import static net.runelite.api.ItemID.MITHRIL_AXE;
|
||||
import static net.runelite.api.ItemID.RUNE_AXE;
|
||||
import static net.runelite.api.ItemID.STEEL_AXE;
|
||||
import static net.runelite.api.ItemID._3RD_AGE_AXE;
|
||||
import net.runelite.api.Player;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
@@ -84,6 +85,11 @@ enum Axe
|
||||
AXE_ANIM_IDS = builder.build();
|
||||
}
|
||||
|
||||
boolean matchesChoppingAnimation(final Player player)
|
||||
{
|
||||
return player != null && animId == player.getAnimation();
|
||||
}
|
||||
|
||||
static Axe findAxeByAnimId(int animId)
|
||||
{
|
||||
return AXE_ANIM_IDS.get(animId);
|
||||
|
||||
@@ -81,7 +81,7 @@ class WoodcuttingOverlay extends Overlay
|
||||
panelComponent.getChildren().clear();
|
||||
|
||||
Axe axe = plugin.getAxe();
|
||||
if (axe != null && axe.getAnimId() == client.getLocalPlayer().getAnimation())
|
||||
if (axe != null && axe.matchesChoppingAnimation(client.getLocalPlayer()))
|
||||
{
|
||||
panelComponent.getChildren().add(TitleComponent.builder()
|
||||
.text("Woodcutting")
|
||||
|
||||
Reference in New Issue
Block a user