Elements nbt tag

This commit is contained in:
Roch Blonndiaux 2023-05-30 14:15:59 +02:00
parent bec55fdacc
commit 1e642ff513
4 changed files with 6 additions and 4 deletions

View File

@ -151,7 +151,6 @@ public class ItemStats {
PICKAXE_POWER = new PickaxePower(), PICKAXE_POWER = new PickaxePower(),
CUSTOM_SOUNDS = new CustomSounds(), CUSTOM_SOUNDS = new CustomSounds(),
ELEMENTS_CATEGORY = new ItemStatCategory(StatsCategory.ELEMENTS, Material.SLIME_BALL, "The elements of your item."), ELEMENTS_CATEGORY = new ItemStatCategory(StatsCategory.ELEMENTS, Material.SLIME_BALL, "The elements of your item."),
//ELEMENTS = new Elements(),
COMMANDS = new Commands(), COMMANDS = new Commands(),
STAFF_SPIRIT = new StaffSpiritStat(), STAFF_SPIRIT = new StaffSpiritStat(),
LUTE_ATTACK_SOUND = new LuteAttackSoundStat(), LUTE_ATTACK_SOUND = new LuteAttackSoundStat(),

View File

@ -65,7 +65,6 @@ public class MMOItemTemplate extends PostLoadObject implements ItemReference {
@Override @Override
protected void whenPostLoaded(ConfigurationSection config) { protected void whenPostLoaded(ConfigurationSection config) {
FriendlyFeedbackProvider ffp = new FriendlyFeedbackProvider(FFPMMOItems.get()); FriendlyFeedbackProvider ffp = new FriendlyFeedbackProvider(FFPMMOItems.get());
ffp.activatePrefix(true, getType().getId() + " " + getId()); ffp.activatePrefix(true, getType().getId() + " " + getId());

View File

@ -1,9 +1,11 @@
package net.Indyuce.mmoitems.stat; package net.Indyuce.mmoitems.stat;
import io.lumine.mythic.lib.element.Element; import io.lumine.mythic.lib.element.Element;
import net.Indyuce.mmoitems.api.util.NumericStatFormula;
import net.Indyuce.mmoitems.stat.type.DoubleStat; import net.Indyuce.mmoitems.stat.type.DoubleStat;
import net.Indyuce.mmoitems.util.ElementStatType; import net.Indyuce.mmoitems.util.ElementStatType;
import net.Indyuce.mmoitems.util.PluginUtils; import net.Indyuce.mmoitems.util.PluginUtils;
import org.bukkit.configuration.ConfigurationSection;
/** /**
* mmoitems * mmoitems
@ -17,17 +19,19 @@ public class ElementStat extends DoubleStat {
private final ElementStatType type; private final ElementStatType type;
public ElementStat(ElementStatType type, Element element) { public ElementStat(ElementStatType type, Element element) {
super(String.format("ELEMENTS_%s_%s", type.name(), element.getName()), super(type.getConcatenatedTagPath(element),
StatsCategory.ELEMENTS, StatsCategory.ELEMENTS,
element.getIcon(), element.getIcon(),
PluginUtils.capitalizeAllWorlds(String.format("%s %s", element.getName(), type.getName())), PluginUtils.capitalizeAllWorlds(String.format("%s %s", element.getName(), type.getName())),
new String[]{}, new String[]{},
new String[]{"slashing", "piercing", "blunt", "catalyst", "range", "tool", "armor", "gem_stone"} new String[]{"slashing", "piercing", "blunt", "catalyst", "range", "tool", "armor", "gem_stone"}
); );
this.element = element; this.element = element;
this.type = type; this.type = type;
} }
public Element getElement() { public Element getElement() {
return element; return element;
} }

View File

@ -255,7 +255,7 @@ public class DoubleStat extends ItemStat<NumericStatFormula, DoubleData> impleme
// Create Fresh // Create Fresh
ArrayList<ItemTag> ret = new ArrayList<>(); ArrayList<ItemTag> ret = new ArrayList<>();
// Add sole tag // Add sole taggetNBT
ret.add(new ItemTag(getNBTPath(), data.getValue())); ret.add(new ItemTag(getNBTPath(), data.getValue()));
// Add category tag // Add category tag