mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-21 09:02:07 -07:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
9e2c12f841
1 changed files with 6 additions and 3 deletions
|
|
@ -1,5 +1,7 @@
|
|||
package core.game.node.entity.skill.herblore;
|
||||
|
||||
import api.Container;
|
||||
import api.ContentAPI;
|
||||
import core.cache.def.impl.ItemDefinition;
|
||||
import core.game.node.entity.skill.Skills;
|
||||
import core.game.interaction.OptionHandler;
|
||||
|
|
@ -35,9 +37,10 @@ public final class HerbCleanPlugin extends OptionHandler {
|
|||
return true;
|
||||
}
|
||||
double exp = herb.getExperience();
|
||||
if (player.getInventory().replace(herb.getProduct(), ((Item) node).getSlot()) != null) {
|
||||
player.getSkills().addExperience(Skills.HERBLORE, exp, true);
|
||||
player.getPacketDispatch().sendMessage("You clean the dirt from the " + herb.getProduct().getName().toLowerCase().replace("clean", "").trim() + " leaf.");
|
||||
if (ContentAPI.removeItem(player, node.asItem(), Container.INVENTORY)){
|
||||
player.getSkills().addExperience(Skills.HERBLORE, exp, true);
|
||||
ContentAPI.addItem(player, herb.getProduct().getId(), 1);
|
||||
player.getPacketDispatch().sendMessage("You clean the dirt from the " + herb.getProduct().getName().toLowerCase().replace("clean", "").trim() + " leaf.");
|
||||
}
|
||||
player.lock(1);
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue