Fixed an exploit related to herb cleaning
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
package core.game.node.entity.skill.herblore;
|
package core.game.node.entity.skill.herblore;
|
||||||
|
|
||||||
|
import api.Container;
|
||||||
|
import api.ContentAPI;
|
||||||
import core.cache.def.impl.ItemDefinition;
|
import core.cache.def.impl.ItemDefinition;
|
||||||
import core.game.node.entity.skill.Skills;
|
import core.game.node.entity.skill.Skills;
|
||||||
import core.game.interaction.OptionHandler;
|
import core.game.interaction.OptionHandler;
|
||||||
@@ -35,9 +37,10 @@ public final class HerbCleanPlugin extends OptionHandler {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
double exp = herb.getExperience();
|
double exp = herb.getExperience();
|
||||||
if (player.getInventory().replace(herb.getProduct(), ((Item) node).getSlot()) != null) {
|
if (ContentAPI.removeItem(player, node.asItem(), Container.INVENTORY)){
|
||||||
player.getSkills().addExperience(Skills.HERBLORE, exp, true);
|
player.getSkills().addExperience(Skills.HERBLORE, exp, true);
|
||||||
player.getPacketDispatch().sendMessage("You clean the dirt from the " + herb.getProduct().getName().toLowerCase().replace("clean", "").trim() + " leaf.");
|
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);
|
player.lock(1);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user