mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-01-20 09:11:21 +01:00
Bug fix with the 'Workbench only' upgrade option
This commit is contained in:
parent
e791926ddb
commit
317bd675e3
@ -1,16 +1,33 @@
|
|||||||
package net.Indyuce.mmoitems.comp.rpg;
|
package net.Indyuce.mmoitems.comp.rpg;
|
||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
|
||||||
import java.util.logging.Level;
|
|
||||||
|
|
||||||
import net.Indyuce.mmoitems.MMOItems;
|
import net.Indyuce.mmoitems.MMOItems;
|
||||||
import net.Indyuce.mmoitems.api.player.PlayerData;
|
import net.Indyuce.mmoitems.api.player.PlayerData;
|
||||||
import net.Indyuce.mmoitems.api.player.RPGPlayer;
|
import net.Indyuce.mmoitems.api.player.RPGPlayer;
|
||||||
import net.Indyuce.mmoitems.comp.mmocore.MMOCoreHook;
|
import net.Indyuce.mmoitems.comp.mmocore.MMOCoreHook;
|
||||||
|
|
||||||
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
|
||||||
public interface RPGHandler {
|
public interface RPGHandler {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A RPGPlayer is a class used to retrieve all the rpg
|
||||||
|
* information of a player, like its class, level, mana
|
||||||
|
* stamina. It's also used to give or take mana/stamina
|
||||||
|
* to handle ability costs.
|
||||||
|
*
|
||||||
|
* @param data Player to retrieve rpg info from
|
||||||
|
* @return A new RPGPlayer for the given player
|
||||||
|
*/
|
||||||
RPGPlayer getInfo(PlayerData data);
|
RPGPlayer getInfo(PlayerData data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called everytime the player's inventory updates. This
|
||||||
|
* method should update the rpg stats like Max Mana which
|
||||||
|
* are normally given by items.
|
||||||
|
*
|
||||||
|
* @param data Player to update
|
||||||
|
*/
|
||||||
void refreshStats(PlayerData data);
|
void refreshStats(PlayerData data);
|
||||||
|
|
||||||
enum PluginEnum {
|
enum PluginEnum {
|
||||||
|
@ -178,6 +178,9 @@ public class UpgradeStat extends ItemStat implements ConsumableItemInteraction {
|
|||||||
|
|
||||||
MMOItem targetMMO = new LiveMMOItem(target);
|
MMOItem targetMMO = new LiveMMOItem(target);
|
||||||
UpgradeData targetSharpening = (UpgradeData) targetMMO.getData(ItemStats.UPGRADE);
|
UpgradeData targetSharpening = (UpgradeData) targetMMO.getData(ItemStats.UPGRADE);
|
||||||
|
if (targetSharpening.isWorkbench())
|
||||||
|
return false;
|
||||||
|
|
||||||
if (!targetSharpening.canLevelUp()) {
|
if (!targetSharpening.canLevelUp()) {
|
||||||
Message.MAX_UPGRADES_HIT.format(ChatColor.RED).send(player);
|
Message.MAX_UPGRADES_HIT.format(ChatColor.RED).send(player);
|
||||||
player.playSound(player.getLocation(), Sound.ENTITY_VILLAGER_NO, 1, 2);
|
player.playSound(player.getLocation(), Sound.ENTITY_VILLAGER_NO, 1, 2);
|
||||||
|
Loading…
Reference in New Issue
Block a user