mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-02-07 12:11:22 +01:00
Made Unidentified Items unusable
This commit is contained in:
parent
1be8e8ca79
commit
31ca777678
@ -3,6 +3,7 @@ package net.Indyuce.mmoitems.api.player;
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import net.Indyuce.mmoitems.MMOItems;
|
||||
@ -54,7 +55,14 @@ public abstract class RPGPlayer {
|
||||
}
|
||||
|
||||
public boolean canUse(NBTItem item, boolean message) {
|
||||
|
||||
if (item.hasTag("MMOITEMS_UNIDENTIFIED_ITEM")) {
|
||||
if (message) {
|
||||
Message.UNIDENTIFIED_ITEM.format(ChatColor.RED).send(player.getPlayer(), "cant-use-item");
|
||||
player.getPlayer().playSound(player.getPlayer().getLocation(), Sound.ENTITY_VILLAGER_NO, 1, 1.5f);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
for (Conditional condition : MMOItems.plugin.getStats().getConditionals())
|
||||
if (!condition.canUse(this, item, message))
|
||||
return false;
|
||||
|
@ -27,6 +27,7 @@ public enum Message {
|
||||
WRONG_CLASS("You don't have the right class!"),
|
||||
NOT_ENOUGH_MANA("You don't have enough mana!"),
|
||||
NOT_ENOUGH_STAMINA("You don't have enough stamina!"),
|
||||
UNIDENTIFIED_ITEM("You can't use an unidentified item!"),
|
||||
|
||||
// custom durability
|
||||
ITEM_BROKE("Your #item#&c broke."),
|
||||
|
Loading…
Reference in New Issue
Block a user