mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-10 10:20:41 -07:00
2 second function overload fix
This commit is contained in:
parent
67cb61b871
commit
b0c231459b
4 changed files with 3 additions and 14 deletions
|
|
@ -54,7 +54,7 @@ public abstract class Consumable implements Plugin<Object> {
|
|||
} else removeItem(player, item, Container.INVENTORY);
|
||||
|
||||
if (nextItemId != -1) {
|
||||
addItem(player, nextItemId, 1);
|
||||
addItem(player, nextItemId, 1, Container.INVENTORY);
|
||||
}
|
||||
final int initialLifePoints = player.getSkills().getLifepoints();
|
||||
Consumables.getConsumableById(item.getId()).effect.activate(player);
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import core.game.content.quest.tutorials.tutorialisland.TutorialSession;
|
|||
import core.game.content.quest.tutorials.tutorialisland.TutorialStage;
|
||||
import core.game.node.entity.player.Player;
|
||||
import core.plugin.Plugin;
|
||||
import org.rs09.consts.Items;
|
||||
|
||||
/**
|
||||
* @author 'Vexia
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public final class HerbCleanPlugin extends OptionHandler {
|
|||
double exp = herb.getExperience();
|
||||
if (removeItem(player, node.asItem(), Container.INVENTORY)){
|
||||
player.getSkills().addExperience(Skills.HERBLORE, exp, true);
|
||||
addItem(player, herb.getProduct().getId(), 1);
|
||||
addItem(player, herb.getProduct().getId(), 1, Container.INVENTORY);
|
||||
player.getAudioManager().send(SFX_IDS[RandomFunction.random(SFX_IDS.length)], 1);
|
||||
player.getPacketDispatch().sendMessage("You clean the dirt from the " + herb.getProduct().getName().toLowerCase().replace("clean", "").trim() + " leaf.");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -145,18 +145,6 @@ fun <T> removeItem(player: Player, item: T, container: Container = Container.INV
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an item to a player's inventory
|
||||
* @param player the player whose inventory to add an item to
|
||||
* @param id the ID of the item to add
|
||||
* @param amount the amount of the item to add, defaults to 1
|
||||
* @return true if the item exists in the given amount in the player's inventory
|
||||
*/
|
||||
|
||||
fun addItem(player: Player, id: Int, amount: Int = 1): Boolean{
|
||||
return addItem(player, id, amount)
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an item to the given player's given container
|
||||
* @param player the player whose container to modify
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue