mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-09 16:45:44 -07:00
Fletching now checks for inventory space before fletching darts, headless arrows, and arrows
This commit is contained in:
parent
9ca9f01ca3
commit
866372ad54
3 changed files with 18 additions and 0 deletions
|
|
@ -7,6 +7,8 @@ import content.global.skill.fletching.Fletching;
|
|||
import core.game.node.entity.player.Player;
|
||||
import core.game.node.item.Item;
|
||||
|
||||
import static core.api.ContentAPIKt.*;
|
||||
|
||||
/**
|
||||
* Represents the arrow head pulse to complete the headless arrow.
|
||||
* @author 'Vexia
|
||||
|
|
@ -53,6 +55,10 @@ public class ArrowHeadPulse extends SkillPulse<Item> {
|
|||
player.getDialogueInterpreter().sendDialogue("You need a fletching level of " + arrow.level + " to do this.");
|
||||
return false;
|
||||
}
|
||||
if (!hasSpaceFor(player, arrow.getFinished())) {
|
||||
sendDialogue(player, "You do not have enough inventory space.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ import core.game.node.entity.skill.Skills;
|
|||
import core.game.node.entity.player.Player;
|
||||
import core.game.node.item.Item;
|
||||
|
||||
import static core.api.ContentAPIKt.*;
|
||||
|
||||
/**
|
||||
* Represents the arrow pulse for creating unfinished arrows.
|
||||
* @author 'Vexia
|
||||
|
|
@ -75,6 +77,10 @@ public final class HeadlessArrowPulse extends SkillPulse<Item> {
|
|||
} else {
|
||||
useSets = false;
|
||||
}
|
||||
if (!hasSpaceFor(player, HEADLESS_ARROW.asItem())) {
|
||||
sendDialogue(player, "You do not have enough inventory space.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ import content.global.skill.fletching.Fletching;
|
|||
import core.game.node.entity.player.Player;
|
||||
import core.game.node.item.Item;
|
||||
|
||||
import static core.api.ContentAPIKt.*;
|
||||
|
||||
/**
|
||||
* Represents the dart pulse.
|
||||
* @author ceikry
|
||||
|
|
@ -48,6 +50,10 @@ public final class DartPulse extends SkillPulse<Item> {
|
|||
player.getDialogueInterpreter().sendDialogue("You need to have completed Tourist Trap to fletch darts.");
|
||||
return false;
|
||||
}
|
||||
if (!hasSpaceFor(player, dart.getFinished())) {
|
||||
sendDialogue(player, "You do not have enough inventory space.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue