mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-02-25 15:11:20 +01:00
!Merged getPath() and getId(), changed Stat constructor
This commit is contained in:
parent
fef22559a4
commit
5a007c2c1a
@ -4,6 +4,7 @@ import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
@ -61,6 +62,16 @@ public class MMOItemsCommand implements CommandExecutor {
|
||||
|
||||
// ==================================================================================================================================
|
||||
if (args.length < 1) {
|
||||
|
||||
for (ItemStat stat : MMOItems.plugin.getStats().getAll()) {
|
||||
|
||||
String id = stat.getId();
|
||||
String path = stat.getPath().replace("-", "_").toUpperCase();
|
||||
|
||||
if (!id.equals(path))
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING, stat.getName()+": " + path + " -> " + id);
|
||||
}
|
||||
|
||||
new PluginHelp(sender).open(1);
|
||||
return true;
|
||||
}
|
||||
|
@ -21,14 +21,13 @@ import net.mmogroup.mmolib.version.VersionMaterial;
|
||||
|
||||
public class MMOCoreHook implements RPGHandler, Listener {
|
||||
|
||||
private static final ItemStat MANA_REGENERATION = new DoubleStat(VersionMaterial.LAPIS_LAZULI.toItem(), "Mana Regeneration", new String[] { "Increases mana regen." }, "mana-regeneration");
|
||||
private static final ItemStat MAX_STAMINA = new DoubleStat(VersionMaterial.LIGHT_BLUE_DYE.toItem(), "Max Stamina", new String[] { "Adds stamina to your max stamina bar." }, "max-stamina");
|
||||
private static final ItemStat STAMINA_REGENERATION = new DoubleStat(VersionMaterial.LIGHT_BLUE_DYE.toItem(), "Stamina Regeneration", new String[] { "Increases stamina regen." }, "stamina-regeneration");
|
||||
private static final ItemStat SKILL_COOLDOWN_REDUCTION = new DoubleStat(new ItemStack(Material.BOOK), "Skill Cooldown Reduction", new String[] { "Reduces cooldowns of MMOCore skills (%)." }, "skill-cooldown-reduction");
|
||||
private static final ItemStat ADDITIONAL_EXPERIENCE = new DoubleStat(VersionMaterial.EXPERIENCE_BOTTLE.toItem(), "Additional Experience", new String[] { "Additional MMOCore main class experience in %." }, "additional-experience");
|
||||
private static final ItemStat HEALTH_REGENERATION = new DoubleStat(new ItemStack(Material.BREAD), "Health Regeneration", new String[] { "Increases MMOCore health regen.", "In %." }, "health-regeneration");
|
||||
|
||||
|
||||
private static final ItemStat MANA_REGENERATION = new DoubleStat("MANA_REGENERATION", VersionMaterial.LAPIS_LAZULI.toItem(), "Mana Regeneration", new String[] { "Increases mana regen." });
|
||||
private static final ItemStat MAX_STAMINA = new DoubleStat("MAX_STAMINA", VersionMaterial.LIGHT_BLUE_DYE.toItem(), "Max Stamina", new String[] { "Adds stamina to your max stamina bar." });
|
||||
private static final ItemStat STAMINA_REGENERATION = new DoubleStat("STAMINA_REGENERATION", VersionMaterial.LIGHT_BLUE_DYE.toItem(), "Stamina Regeneration", new String[] { "Increases stamina regen." });
|
||||
private static final ItemStat SKILL_COOLDOWN_REDUCTION = new DoubleStat("SKILL_COOLDOWN_REDUCTION", new ItemStack(Material.BOOK), "Skill Cooldown Reduction", new String[] { "Reduces cooldowns of MMOCore skills (%)." });
|
||||
private static final ItemStat ADDITIONAL_EXPERIENCE = new DoubleStat("ADDITIONAL_EXPERIENCE", VersionMaterial.EXPERIENCE_BOTTLE.toItem(), "Additional Experience", new String[] { "Additional MMOCore main class experience in %." });
|
||||
private static final ItemStat HEALTH_REGENERATION = new DoubleStat("HEALTH_REGENERATION", new ItemStack(Material.BREAD), "Health Regeneration", new String[] { "Increases MMOCore health regen.", "In %." });
|
||||
|
||||
/*
|
||||
* called when MMOItems enables
|
||||
*/
|
||||
|
@ -16,7 +16,7 @@ public class Required_Attribute extends DoubleStat implements Conditional {
|
||||
private final PlayerAttribute attribute;
|
||||
|
||||
public Required_Attribute(PlayerAttribute attribute) {
|
||||
super(VersionMaterial.GRAY_DYE.toItem(), attribute.getName() + " Requirement (MMOCore)", new String[] { "Amount of " + attribute.getName() + " points the", "player needs to use the item." }, "required-" + attribute.getId());
|
||||
super("REQUIRED_" + attribute.getId().toUpperCase().replace("-", "_"), VersionMaterial.GRAY_DYE.toItem(), attribute.getName() + " Requirement (MMOCore)", new String[] { "Amount of " + attribute.getName() + " points the", "player needs to use the item." });
|
||||
|
||||
this.attribute = attribute;
|
||||
}
|
||||
|
@ -10,13 +10,12 @@ import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||
import net.Indyuce.mmoitems.MMOItems;
|
||||
import net.Indyuce.mmoitems.api.player.PlayerData;
|
||||
import net.Indyuce.mmoitems.api.util.AltChar;
|
||||
import net.Indyuce.mmoitems.api.util.StatFormat;
|
||||
import net.Indyuce.mmoitems.stat.type.ItemStat;
|
||||
import net.mmogroup.mmolib.MMOLib;
|
||||
import net.mmogroup.mmolib.api.item.NBTItem;
|
||||
|
||||
public class MMOItemsPlaceholders extends PlaceholderExpansion {
|
||||
private DecimalFormat oneDigit = new DecimalFormat("0.#");
|
||||
private DecimalFormat oneDigit = new DecimalFormat("0.#"), twoDigits = new DecimalFormat("0.##");
|
||||
|
||||
@Override
|
||||
public String getAuthor() {
|
||||
@ -37,7 +36,7 @@ public class MMOItemsPlaceholders extends PlaceholderExpansion {
|
||||
if (identifier.startsWith("stat_")) {
|
||||
ItemStat stat = MMOItems.plugin.getStats().get(identifier.substring(5).toUpperCase());
|
||||
if (stat != null)
|
||||
return new StatFormat("##").format(PlayerData.get(player).getStats().getStat(stat));
|
||||
return twoDigits.format(PlayerData.get(player).getStats().getStat(stat));
|
||||
}
|
||||
|
||||
if (identifier.startsWith("ability_cd_"))
|
||||
|
@ -19,28 +19,28 @@ import net.Indyuce.mmoitems.stat.type.ItemStat;
|
||||
import net.mmogroup.mmolib.api.item.NBTItem;
|
||||
|
||||
public class McMMOHook implements RPGHandler, Listener {
|
||||
private final ItemStat disableMcMMORepair = new DisableStat(Material.IRON_BLOCK, "mcmmo-repair", "Disable McMMO Repair", "Players can't repair this with McMMO.");
|
||||
|
||||
private final ItemStat disableMcMMORepair = new DisableStat("MCMMO_REPAIR", Material.IRON_BLOCK, "Disable McMMO Repair", "Players can't repair this with McMMO.");
|
||||
|
||||
public McMMOHook() {
|
||||
Bukkit.getPluginManager().registerEvents(this, MMOItems.plugin);
|
||||
|
||||
|
||||
MMOItems.plugin.getStats().register("DISABLE_MCMMO_REPAIR", disableMcMMORepair);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
public void a(McMMOPlayerLevelUpEvent event) {
|
||||
PlayerData.get(event.getPlayer()).scheduleDelayedInventoryUpdate();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
public void b(McMMOPlayerLevelDownEvent event) {
|
||||
PlayerData.get(event.getPlayer()).scheduleDelayedInventoryUpdate();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
public void c(McMMOPlayerRepairCheckEvent event) {
|
||||
NBTItem nbt = NBTItem.get(event.getRepairedObject());
|
||||
if(nbt.hasType() && nbt.getBoolean("MMOITEMS_DISABLE_MCMMO_REPAIR"))
|
||||
if (nbt.hasType() && nbt.getBoolean("MMOITEMS_DISABLE_MCMMO_REPAIR"))
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
|
@ -28,12 +28,6 @@ import net.Indyuce.mmoitems.stat.Staff_Spirit.StaffSpirit;
|
||||
|
||||
public class ConfigManager {
|
||||
|
||||
// must be updated each time a new language file is needed
|
||||
private String[] fileNames = { "abilities", "messages", "potion-effects", "stats", "items", "attack-effects" };
|
||||
|
||||
// must be updated each time a new language is added
|
||||
private String[] languages = { "french", "chinese", "spanish", "russian", "polish" };
|
||||
|
||||
// cached config files
|
||||
private ConfigFile abilities, items, loreFormat, messages, potionEffects, stats, attackEffects, namePlaceholders;
|
||||
|
||||
@ -45,6 +39,8 @@ public class ConfigManager {
|
||||
public double dodgeKnockbackForce, soulboundBaseDamage, soulboundPerLvlDamage;
|
||||
|
||||
private static final Random random = new Random();
|
||||
private static final String[] fileNames = { "abilities", "messages", "potion-effects", "stats", "items", "attack-effects" };
|
||||
private static final String[] languages = { "french", "chinese", "spanish", "russian", "polish" };
|
||||
|
||||
// try to setup non existing languages
|
||||
public ConfigManager() {
|
||||
|
@ -15,9 +15,15 @@ import net.Indyuce.mmoitems.stat.type.AttributeStat;
|
||||
import net.Indyuce.mmoitems.stat.type.Conditional;
|
||||
import net.Indyuce.mmoitems.stat.type.DoubleStat;
|
||||
import net.Indyuce.mmoitems.stat.type.ItemStat;
|
||||
import net.Indyuce.mmoitems.stat.type.ProperStat;
|
||||
|
||||
public class StatManager {
|
||||
private final Map<String, ItemStat> stats = new LinkedHashMap<>();
|
||||
|
||||
/*
|
||||
* numeric statistics which can be mecanically updated when applying a gem
|
||||
* stone
|
||||
*/
|
||||
private final Set<DoubleStat> gem = new HashSet<>();
|
||||
private final Set<AttributeStat> attribute = new HashSet<>();
|
||||
private final Set<Conditional> conditionals = new HashSet<>();
|
||||
@ -50,7 +56,7 @@ public class StatManager {
|
||||
public Set<DoubleStat> getDoubleStats() {
|
||||
return gem;
|
||||
}
|
||||
|
||||
|
||||
public Set<Conditional> getConditionals() {
|
||||
return conditionals;
|
||||
}
|
||||
@ -63,10 +69,9 @@ public class StatManager {
|
||||
if (!stat.isEnabled())
|
||||
return;
|
||||
|
||||
stat.setId(id);
|
||||
stats.put(stat.getId(), stat);
|
||||
|
||||
if (isGemStoneStat(stat))
|
||||
if (!(stat instanceof ProperStat) && stat instanceof DoubleStat && Type.GEM_STONE.canHave(stat))
|
||||
gem.add((DoubleStat) stat);
|
||||
|
||||
if (stat instanceof AttributeStat)
|
||||
@ -88,8 +93,4 @@ public class StatManager {
|
||||
public ItemStat get(String str) {
|
||||
return stats.containsKey(str) ? stats.get(str) : null;
|
||||
}
|
||||
|
||||
private boolean isGemStoneStat(ItemStat stat) {
|
||||
return Type.GEM_STONE.canHave(stat) && stat != ItemStat.REQUIRED_LEVEL && stat != ItemStat.CUSTOM_MODEL_DATA && stat != ItemStat.DURABILITY && stat != ItemStat.MAX_CUSTOM_DURABILITY && stat != ItemStat.SUCCESS_RATE && stat instanceof DoubleStat;
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ public class Abilities extends ItemStat {
|
||||
private final DecimalFormat modifierFormat = new DecimalFormat("0.###");
|
||||
|
||||
public Abilities() {
|
||||
super(new ItemStack(Material.BLAZE_POWDER), "Item Abilities", new String[] { "Make your item cast amazing abilities", "to kill monsters or buff yourself." }, "ability", new String[] { "all" });
|
||||
super("ABILITY", new ItemStack(Material.BLAZE_POWDER), "Item Abilities", new String[] { "Make your item cast amazing abilities", "to kill monsters or buff yourself." }, new String[] { "all" });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -12,7 +12,7 @@ import net.mmogroup.mmolib.version.VersionMaterial;
|
||||
|
||||
public class Armor extends AttributeStat {
|
||||
public Armor() {
|
||||
super(new ItemStack(VersionMaterial.GOLDEN_CHESTPLATE.toMaterial()), "Armor", new String[] { "The armor given to the holder." }, "armor", Attribute.GENERIC_ARMOR);
|
||||
super("ARMOR", new ItemStack(VersionMaterial.GOLDEN_CHESTPLATE.toMaterial()), "Armor", new String[] { "The armor given to the holder." }, Attribute.GENERIC_ARMOR);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -12,7 +12,7 @@ import net.mmogroup.mmolib.api.item.ItemTag;
|
||||
|
||||
public class Armor_Toughness extends AttributeStat {
|
||||
public Armor_Toughness() {
|
||||
super(new ItemStack(Material.DIAMOND_CHESTPLATE), "Armor Toughness", new String[] { "Armor toughness reduces damage taken." }, "armor-toughness", Attribute.GENERIC_ARMOR_TOUGHNESS);
|
||||
super("ARMOR_TOUGHNESS", new ItemStack(Material.DIAMOND_CHESTPLATE), "Armor Toughness", new String[] { "Armor toughness reduces damage taken." }, Attribute.GENERIC_ARMOR_TOUGHNESS);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -31,7 +31,7 @@ import net.mmogroup.mmolib.version.VersionMaterial;
|
||||
|
||||
public class Arrow_Particles extends StringStat {
|
||||
public Arrow_Particles() {
|
||||
super(VersionMaterial.LIME_STAINED_GLASS.toItem(), "Arrow Particles", new String[] { "Particles that display around", "the arrows your bow fires." }, "arrow-particles", new String[] { "bow", "crossbow" });
|
||||
super("ARROW_PARTICLES", VersionMaterial.LIME_STAINED_GLASS.toItem(), "Arrow Particles", new String[] { "Particles that display around", "the arrows your bow fires." }, new String[] { "bow", "crossbow" });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -12,7 +12,7 @@ import net.mmogroup.mmolib.api.item.ItemTag;
|
||||
|
||||
public class Attack_Damage extends AttributeStat {
|
||||
public Attack_Damage() {
|
||||
super(new ItemStack(Material.IRON_SWORD), "Attack Damage", new String[] { "The amount of damage", "your weapon deals." }, "attack-damage", Attribute.GENERIC_ATTACK_DAMAGE, 1);
|
||||
super("ATTACK_DAMAGE", new ItemStack(Material.IRON_SWORD), "Attack Damage", new String[] { "The amount of damage", "your weapon deals." }, Attribute.GENERIC_ATTACK_DAMAGE, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -12,7 +12,7 @@ import net.mmogroup.mmolib.version.VersionMaterial;
|
||||
|
||||
public class Attack_Speed extends AttributeStat {
|
||||
public Attack_Speed() {
|
||||
super(VersionMaterial.LIGHT_GRAY_DYE.toItem(), "Attack Speed", new String[] { "The speed at which your weapon strikes.", "In attacks/sec." }, "attack-speed", Attribute.GENERIC_ATTACK_SPEED, MMOLib.plugin.getVersion().isBelowOrEqual(1, 12) ? 1.6 : 4);
|
||||
super("ATTACK_SPEED", VersionMaterial.LIGHT_GRAY_DYE.toItem(), "Attack Speed", new String[] { "The speed at which your weapon strikes.", "In attacks/sec." }, Attribute.GENERIC_ATTACK_SPEED, MMOLib.plugin.getVersion().isBelowOrEqual(1, 12) ? 1.6 : 4);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -35,7 +35,7 @@ public class Commands extends ItemStat {
|
||||
private static final int max = 15;
|
||||
|
||||
public Commands() {
|
||||
super(new ItemStack(VersionMaterial.COMMAND_BLOCK_MINECART.toMaterial()), "Commands", new String[] { "The commands your item", "performs when right clicked." }, "commands", new String[] { "!armor", "!gem_stone", "all" });
|
||||
super("COMMANDS", new ItemStack(VersionMaterial.COMMAND_BLOCK_MINECART.toMaterial()), "Commands", new String[] { "The commands your item", "performs when right clicked." }, new String[] { "!armor", "!gem_stone", "all" });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -30,7 +30,7 @@ import net.mmogroup.mmolib.version.VersionMaterial;
|
||||
|
||||
public class Compatible_Types extends StringStat {
|
||||
public Compatible_Types() {
|
||||
super(new ItemStack(VersionMaterial.COMMAND_BLOCK.toMaterial()), "Compatible Types", new String[] { "The item types this skin is", "compatible with." }, "compatible-types", new String[] { "skin" });
|
||||
super("COMPATIBLE_TYPES", new ItemStack(VersionMaterial.COMMAND_BLOCK.toMaterial()), "Compatible Types", new String[] { "The item types this skin is", "compatible with." }, new String[] { "skin" });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -12,7 +12,9 @@ import net.mmogroup.mmolib.version.VersionMaterial;
|
||||
|
||||
public class Craft_Permission extends StringStat {
|
||||
public Craft_Permission() {
|
||||
super(new ItemStack(VersionMaterial.OAK_SIGN.toMaterial()), "Crafting Recipe Permission", new String[] { "The permission needed to craft this item.", "Changing this value requires &o/mi reload recipes&7.", "", "NOT YET IMPLEMENTED" }, "craft-permission", new String[] { "all" });
|
||||
super("CRAFT_PERMISSION", new ItemStack(VersionMaterial.OAK_SIGN.toMaterial()), "Crafting Recipe Permission", new String[] { "The permission needed to craft this item.", "Changing this value requires &o/mi reload recipes&7." }, new String[] { "all" });
|
||||
|
||||
disable();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -26,7 +26,7 @@ import net.mmogroup.mmolib.version.VersionMaterial;
|
||||
|
||||
public class Crafting extends ItemStat {
|
||||
public Crafting() {
|
||||
super(new ItemStack(VersionMaterial.CRAFTING_TABLE.toMaterial()), "Crafting", new String[] { "The crafting recipes of your item.", "Changing a recipe requires &o/mi reload recipes&7." }, "crafting", new String[] { "all" });
|
||||
super("CRAFTING", new ItemStack(VersionMaterial.CRAFTING_TABLE.toMaterial()), "Crafting", new String[] { "The crafting recipes of your item.", "Changing a recipe requires &o/mi reload recipes&7." }, new String[] { "all" });
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -79,8 +79,9 @@ public class Crafting extends ItemStat {
|
||||
inv.getPlayer().sendMessage(MMOItems.plugin.getPrefix() + "Invalid format.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!validate(inv.getPlayer(), args[0])) return false;
|
||||
|
||||
if (!validate(inv.getPlayer(), args[0]))
|
||||
return false;
|
||||
int time;
|
||||
try {
|
||||
time = Integer.parseInt(args[1]);
|
||||
|
@ -29,7 +29,7 @@ import net.mmogroup.mmolib.api.item.NBTItem;
|
||||
|
||||
public class CustomSounds extends ItemStat {
|
||||
public CustomSounds() {
|
||||
super(new ItemStack(Material.JUKEBOX), "Custom Sounds", new String[] { "The custom sounds your item will use." }, "sounds", new String[] { "all" });
|
||||
super("SOUNDS", new ItemStack(Material.JUKEBOX), "Custom Sounds", new String[] { "The custom sounds your item will use." }, new String[] { "all" });
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -126,11 +126,11 @@ public class CustomSounds extends ItemStat {
|
||||
@Override
|
||||
public boolean whenApplied(MMOItemBuilder item, StatData data) {
|
||||
SoundListData sounds = (SoundListData) data;
|
||||
|
||||
|
||||
sounds.getCustomSounds().forEach(sound -> {
|
||||
SoundData value = sounds.get(sound);
|
||||
String s = sound.getName().replace(" ", "_").toUpperCase();
|
||||
|
||||
|
||||
item.addItemTag(new ItemTag("MMOITEMS_SOUND_" + s, value.getSound()));
|
||||
item.addItemTag(new ItemTag("MMOITEMS_SOUND_" + s + "_VOL", value.getVolume()));
|
||||
item.addItemTag(new ItemTag("MMOITEMS_SOUND_" + s + "_PIT", value.getPitch()));
|
||||
@ -143,8 +143,7 @@ public class CustomSounds extends ItemStat {
|
||||
public void whenLoaded(MMOItem mmoitem, NBTItem item) {
|
||||
SoundListData sounds = new SoundListData();
|
||||
|
||||
for (CustomSound sound : CustomSound.values())
|
||||
{
|
||||
for (CustomSound sound : CustomSound.values()) {
|
||||
String soundName = item.getString("MMOITEMS_SOUND_" + sound.name());
|
||||
if (soundName != null && !soundName.isEmpty())
|
||||
sounds.set(sound, soundName, item.getDouble("MMOITEMS_SOUND_" + sound.name() + "_VOL"), item.getDouble("MMOITEMS_SOUND_" + sound.name() + "_PIT"));
|
||||
@ -171,25 +170,47 @@ public class CustomSounds extends ItemStat {
|
||||
public void set(CustomSound sound, String s, double v, double p) {
|
||||
this.stats.put(sound, new SoundData(s, v, p));
|
||||
}
|
||||
|
||||
public int total()
|
||||
{ return stats.size(); }
|
||||
|
||||
public int total() {
|
||||
return stats.size();
|
||||
}
|
||||
}
|
||||
|
||||
public class SoundData
|
||||
{
|
||||
|
||||
public class SoundData {
|
||||
private String sound;
|
||||
private double volume, pitch;
|
||||
|
||||
public SoundData() {}
|
||||
public SoundData(String s, double v, double p)
|
||||
{ this.sound = s; this.volume = v; this.pitch = p; }
|
||||
|
||||
public void setSound(String value) { this.sound = value; }
|
||||
public void setVolume(double value) { this.volume = value; }
|
||||
public void setPitch(double value) { this.pitch = value; }
|
||||
public String getSound() { return this.sound; }
|
||||
public double getVolume() { return this.volume; }
|
||||
public double getPitch() { return this.pitch; }
|
||||
|
||||
public SoundData() {
|
||||
}
|
||||
|
||||
public SoundData(String s, double v, double p) {
|
||||
this.sound = s;
|
||||
this.volume = v;
|
||||
this.pitch = p;
|
||||
}
|
||||
|
||||
public void setSound(String value) {
|
||||
this.sound = value;
|
||||
}
|
||||
|
||||
public void setVolume(double value) {
|
||||
this.volume = value;
|
||||
}
|
||||
|
||||
public void setPitch(double value) {
|
||||
this.pitch = value;
|
||||
}
|
||||
|
||||
public String getSound() {
|
||||
return this.sound;
|
||||
}
|
||||
|
||||
public double getVolume() {
|
||||
return this.volume;
|
||||
}
|
||||
|
||||
public double getPitch() {
|
||||
return this.pitch;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,14 +7,17 @@ import net.Indyuce.mmoitems.api.item.MMOItem;
|
||||
import net.Indyuce.mmoitems.api.item.build.MMOItemBuilder;
|
||||
import net.Indyuce.mmoitems.stat.data.StatData;
|
||||
import net.Indyuce.mmoitems.stat.type.DoubleStat;
|
||||
import net.Indyuce.mmoitems.stat.type.ProperStat;
|
||||
import net.mmogroup.mmolib.MMOLib;
|
||||
import net.mmogroup.mmolib.api.item.ItemTag;
|
||||
import net.mmogroup.mmolib.api.item.NBTItem;
|
||||
|
||||
public class Custom_Model_Data extends DoubleStat {
|
||||
public class Custom_Model_Data extends DoubleStat implements ProperStat {
|
||||
public Custom_Model_Data() {
|
||||
super(new ItemStack(Material.PAINTING), "Custom Model Data", new String[] { "Your 1.14+ model data.", "(Only works on 1.14+)" }, "custom-model-data", new String[] { "all" });
|
||||
super("CUSTOM_MODEL_DATA", new ItemStack(Material.PAINTING), "Custom Model Data", new String[] { "Your 1.14+ model data." }, new String[] { "all" });
|
||||
|
||||
//if (MMOLib.plugin.getVersion().isBelowOrEqual(1, 13)) disable();
|
||||
if (MMOLib.plugin.getVersion().isBelowOrEqual(1, 13))
|
||||
disable();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -29,4 +32,3 @@ public class Custom_Model_Data extends DoubleStat {
|
||||
mmoitem.setData(this, new DoubleData(item.getDouble("CustomModelData")));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9,11 +9,12 @@ import net.Indyuce.mmoitems.api.item.build.MMOItemBuilder;
|
||||
import net.Indyuce.mmoitems.stat.data.StatData;
|
||||
import net.Indyuce.mmoitems.stat.type.DoubleStat;
|
||||
import net.Indyuce.mmoitems.stat.type.ItemStat;
|
||||
import net.Indyuce.mmoitems.stat.type.ProperStat;
|
||||
import net.mmogroup.mmolib.api.item.NBTItem;
|
||||
|
||||
public class DefaultDurability extends DoubleStat {
|
||||
public class DefaultDurability extends DoubleStat implements ProperStat {
|
||||
public DefaultDurability() {
|
||||
super(new ItemStack(Material.FISHING_ROD), "Item Damage", new String[] { "Default item damage. This does &cNOT", "impact the item's max durability." }, "durability", new String[] { "all" });
|
||||
super("DURABILITY", new ItemStack(Material.FISHING_ROD), "Item Damage", new String[] { "Default item damage. This does &cNOT", "impact the item's max durability." }, new String[] { "all" });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -7,7 +7,7 @@ import net.Indyuce.mmoitems.stat.type.DisableStat;
|
||||
|
||||
public class Disable_AdvancedEnchantments extends DisableStat {
|
||||
public Disable_AdvancedEnchantments() {
|
||||
super(Material.ENCHANTED_BOOK, "advanced-enchants", "Disable Advanced Enchants", new String[] { "all" }, "When toggled on, prevents players", "from applying AE onto this item.");
|
||||
super("ADVANCED_ENCHANTS", Material.ENCHANTED_BOOK, "Disable Advanced Enchants", new String[] { "all" }, "When toggled on, prevents players", "from applying AE onto this item.");
|
||||
|
||||
if (Bukkit.getPluginManager().getPlugin("AdvancedEnchantments") == null)
|
||||
disable();
|
||||
|
@ -14,7 +14,7 @@ import net.mmogroup.mmolib.version.VersionMaterial;
|
||||
|
||||
public class Display_Name extends StringStat {
|
||||
public Display_Name() {
|
||||
super(new ItemStack(VersionMaterial.OAK_SIGN.toMaterial()), "Display Name", new String[] { "The item display name." }, "name", new String[] { "all" });
|
||||
super("NAME", new ItemStack(VersionMaterial.OAK_SIGN.toMaterial()), "Display Name", new String[] { "The item display name." }, new String[] { "all" });
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -38,7 +38,7 @@ public class Display_Name extends StringStat {
|
||||
private String fix(String str) {
|
||||
return str.startsWith(ChatColor.WHITE + "") ? "" + ChatColor.GREEN + ChatColor.WHITE + str : str;
|
||||
}
|
||||
|
||||
|
||||
public String getDisplayName(StatData data) {
|
||||
String display = data.toString();
|
||||
|
||||
|
@ -27,7 +27,7 @@ import net.mmogroup.mmolib.version.VersionMaterial;
|
||||
|
||||
public class Dye_Color extends StringStat {
|
||||
public Dye_Color() {
|
||||
super(VersionMaterial.RED_DYE.toItem(), "Dye Color", new String[] { "The color of your item", "(for leather armor sets).", "In RGB." }, "dye-color", new String[] { "all" }, Material.LEATHER_HELMET, Material.LEATHER_CHESTPLATE, Material.LEATHER_LEGGINGS, Material.LEATHER_BOOTS);
|
||||
super("DYE_COLOR", VersionMaterial.RED_DYE.toItem(), "Dye Color", new String[] { "The color of your item", "(for leather armor sets).", "In RGB." }, new String[] { "all" }, Material.LEATHER_HELMET, Material.LEATHER_CHESTPLATE, Material.LEATHER_LEGGINGS, Material.LEATHER_BOOTS);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -37,10 +37,10 @@ import net.mmogroup.mmolib.api.item.ItemTag;
|
||||
import net.mmogroup.mmolib.api.item.NBTItem;
|
||||
|
||||
public class Effects extends ItemStat {
|
||||
private DecimalFormat durationFormat = new DecimalFormat("0.#");
|
||||
private final DecimalFormat durationFormat = new DecimalFormat("0.#");
|
||||
|
||||
public Effects() {
|
||||
super(new ItemStack(Material.POTION), "Effects", new String[] { "The potion effects your", "consumable item grants." }, "effects", new String[] { "consumable" });
|
||||
super("EFFECTS", new ItemStack(Material.POTION), "Effects", new String[] { "The potion effects your", "consumable item grants." }, new String[] { "consumable" });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -31,7 +31,7 @@ import net.mmogroup.mmolib.api.item.NBTItem;
|
||||
|
||||
public class Elements extends ItemStat {
|
||||
public Elements() {
|
||||
super(new ItemStack(Material.SLIME_BALL), "Elements", new String[] { "The elements of your item." }, "element", new String[] { "slashing", "piercing", "blunt", "offhand", "range", "tool", "armor" });
|
||||
super("ELEMENT", new ItemStack(Material.SLIME_BALL), "Elements", new String[] { "The elements of your item." }, new String[] { "slashing", "piercing", "blunt", "offhand", "range", "tool", "armor" });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -31,7 +31,7 @@ import net.mmogroup.mmolib.api.item.NBTItem;
|
||||
|
||||
public class Enchants extends ItemStat {
|
||||
public Enchants() {
|
||||
super(new ItemStack(Material.ENCHANTED_BOOK), "Enchantments", new String[] { "The item enchants." }, "enchants", new String[] { "all" });
|
||||
super("ENCHANTS", new ItemStack(Material.ENCHANTED_BOOK), "Enchantments", new String[] { "The item enchants." }, new String[] { "all" });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -8,7 +8,7 @@ import net.mmogroup.mmolib.version.VersionMaterial;
|
||||
|
||||
public class Gem_Color extends StringStat {
|
||||
public Gem_Color() {
|
||||
super(VersionMaterial.LIGHT_BLUE_DYE.toItem(), "Gem Color", new String[] { "Defines the color of the socket in", "which the gem can be applied." }, "gem-color", new String[] { "gem_stone" });
|
||||
super("GEM_COLOR", VersionMaterial.LIGHT_BLUE_DYE.toItem(), "Gem Color", new String[] { "Defines the color of the socket in", "which the gem can be applied." }, new String[] { "gem_stone" });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -32,7 +32,7 @@ import net.mmogroup.mmolib.api.item.NBTItem;
|
||||
|
||||
public class Gem_Sockets extends ItemStat {
|
||||
public Gem_Sockets() {
|
||||
super(new ItemStack(Material.EMERALD), "Gem Sockets", new String[] { "The amount of gem", "sockets your weapon has." }, "gem-sockets", new String[] { "piercing", "slashing", "blunt", "offhand", "range", "tool", "armor", "accessory" });
|
||||
super("GEM_SOCKETS", new ItemStack(Material.EMERALD), "Gem Sockets", new String[] { "The amount of gem", "sockets your weapon has." }, new String[] { "piercing", "slashing", "blunt", "offhand", "range", "tool", "armor", "accessory" });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -13,7 +13,7 @@ import net.mmogroup.mmolib.api.item.NBTItem;
|
||||
|
||||
public class Hide_Enchants extends BooleanStat {
|
||||
public Hide_Enchants() {
|
||||
super(new ItemStack(Material.BOOK), "Hide Enchantments", new String[] { "Enable to completely hide your item", "enchants. You can still see the glowing effect." }, "hide-enchants", new String[] { "all" });
|
||||
super("HIDE_ENCHANTS", new ItemStack(Material.BOOK), "Hide Enchantments", new String[] { "Enable to completely hide your item", "enchants. You can still see the glowing effect." }, new String[] { "all" });
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -22,10 +22,10 @@ public class Hide_Enchants extends BooleanStat {
|
||||
item.getMeta().addItemFlags(ItemFlag.HIDE_ENCHANTS);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void whenLoaded(MMOItem mmoitem, NBTItem item) {
|
||||
if(item.getItem().getItemMeta().hasItemFlag(ItemFlag.HIDE_ENCHANTS))
|
||||
if (item.getItem().getItemMeta().hasItemFlag(ItemFlag.HIDE_ENCHANTS))
|
||||
mmoitem.setData(ItemStat.HIDE_ENCHANTS, new BooleanData(true));
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ import net.mmogroup.mmolib.api.item.NBTItem;
|
||||
|
||||
public class Hide_Potion_Effects extends BooleanStat {
|
||||
public Hide_Potion_Effects() {
|
||||
super(new ItemStack(Material.POTION), "Hide Potion Effects", new String[] { "Hides potion effects & 'No Effects'", "from your item lore." }, "hide-potion-effects", new String[] { "all" }, Material.POTION, Material.SPLASH_POTION, Material.LINGERING_POTION, Material.TIPPED_ARROW);
|
||||
super("HIDE_POTION_EFFECTS", new ItemStack(Material.POTION), "Hide Potion Effects", new String[] { "Hides potion effects & 'No Effects'", "from your item lore." }, new String[] { "all" }, Material.POTION, Material.SPLASH_POTION, Material.LINGERING_POTION, Material.TIPPED_ARROW);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -22,10 +22,10 @@ public class Hide_Potion_Effects extends BooleanStat {
|
||||
item.getMeta().addItemFlags(ItemFlag.HIDE_POTION_EFFECTS);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void whenLoaded(MMOItem mmoitem, NBTItem item) {
|
||||
if(item.getItem().getItemMeta().hasItemFlag(ItemFlag.HIDE_POTION_EFFECTS))
|
||||
if (item.getItem().getItemMeta().hasItemFlag(ItemFlag.HIDE_POTION_EFFECTS))
|
||||
mmoitem.setData(ItemStat.HIDE_POTION_EFFECTS, new BooleanData(true));
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ import net.mmogroup.mmolib.api.item.ItemTag;
|
||||
|
||||
public class Inedible extends BooleanStat {
|
||||
public Inedible() {
|
||||
super(new ItemStack(Material.POISONOUS_POTATO), "Inedible", new String[] { "Players won't be able to", "right-click this consumable." }, "inedible", new String[] { "consumable" });
|
||||
super("INEDIBLE", new ItemStack(Material.POISONOUS_POTATO), "Inedible", new String[] { "Players won't be able to", "right-click this consumable." }, new String[] { "consumable" });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -30,7 +30,7 @@ import net.mmogroup.mmolib.version.VersionMaterial;
|
||||
|
||||
public class Item_Particles extends ItemStat {
|
||||
public Item_Particles() {
|
||||
super(VersionMaterial.PINK_STAINED_GLASS.toItem(), "Item Particles", new String[] { "The particles displayed when", "holding/wearing your item.", "", ChatColor.BLUE + "A tutorial is available on the wiki." }, "item-particles", new String[] { "all" });
|
||||
super("ITEM_PARTICLES", VersionMaterial.PINK_STAINED_GLASS.toItem(), "Item Particles", new String[] { "The particles displayed when", "holding/wearing your item.", "", ChatColor.BLUE + "A tutorial is available on the wiki." }, new String[] { "all" });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -25,7 +25,7 @@ import net.mmogroup.mmolib.api.item.NBTItem;
|
||||
|
||||
public class Item_Set extends StringStat {
|
||||
public Item_Set() {
|
||||
super(new ItemStack(Material.LEATHER_CHESTPLATE), "Item Set", new String[] { "Item sets can give to the player extra", "bonuses that depend on how many items", "from the same set your wear." }, "set", new String[] { "!gem_stone", "!consumable", "!material", "!miscellaneous", "all" });
|
||||
super("SET", new ItemStack(Material.LEATHER_CHESTPLATE), "Item Set", new String[] { "Item sets can give to the player extra", "bonuses that depend on how many items", "from the same set your wear." }, new String[] { "!gem_stone", "!consumable", "!material", "!miscellaneous", "all" });
|
||||
}
|
||||
|
||||
public boolean whenClicked(EditionInventory inv, InventoryClickEvent event, Player player, Type type, String path) {
|
||||
|
@ -15,7 +15,7 @@ import net.mmogroup.mmolib.api.item.ItemTag;
|
||||
|
||||
public class Item_Tier extends StringStat {
|
||||
public Item_Tier() {
|
||||
super(new ItemStack(Material.DIAMOND), "Item Tier", new String[] { "The tier defines how rare your item is", "and what item is dropped when your", "item is deconstructed.", "&9Tiers can be configured in the tiers.yml file" }, "tier", new String[] { "all" });
|
||||
super("TIER", new ItemStack(Material.DIAMOND), "Item Tier", new String[] { "The tier defines how rare your item is", "and what item is dropped when your", "item is deconstructed.", "&9Tiers can be configured in the tiers.yml file" }, new String[] { "all" });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -28,7 +28,7 @@ import net.mmogroup.mmolib.api.item.ItemTag;
|
||||
|
||||
public class Item_Type_Restriction extends StringStat {
|
||||
public Item_Type_Restriction() {
|
||||
super(new ItemStack(Material.EMERALD), "Item Type Restriction", new String[] { "This option defines the item types", "on which your gem can be applied." }, "item-type-restriction", new String[] { "gem_stone" });
|
||||
super("ITEM_TYPE_RESTRICTION", new ItemStack(Material.EMERALD), "Item Type Restriction", new String[] { "This option defines the item types", "on which your gem can be applied." }, new String[] { "gem_stone" });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -12,7 +12,7 @@ import net.mmogroup.mmolib.api.item.ItemTag;
|
||||
|
||||
public class Knockback_Resistance extends AttributeStat {
|
||||
public Knockback_Resistance() {
|
||||
super(new ItemStack(Material.CHAINMAIL_CHESTPLATE), "Knockback Resistance", new String[] { "The chance of your item to block the", "knockback from explosions, creepers...", "1.0 corresponds to 100%, 0.7 to 70%..." }, "knockback-resistance", Attribute.GENERIC_KNOCKBACK_RESISTANCE);
|
||||
super("KNOCKBACK_RESISTANCE", new ItemStack(Material.CHAINMAIL_CHESTPLATE), "Knockback Resistance", new String[] { "The chance of your item to block the", "knockback from explosions, creepers...", "1.0 corresponds to 100%, 0.7 to 70%..." }, Attribute.GENERIC_KNOCKBACK_RESISTANCE);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -8,18 +8,18 @@ import net.Indyuce.mmoitems.api.item.build.MMOItemBuilder;
|
||||
import net.Indyuce.mmoitems.stat.data.StatData;
|
||||
import net.Indyuce.mmoitems.stat.type.DoubleStat;
|
||||
import net.Indyuce.mmoitems.stat.type.ItemStat;
|
||||
import net.Indyuce.mmoitems.stat.type.ProperStat;
|
||||
import net.mmogroup.mmolib.api.item.NBTItem;
|
||||
|
||||
public class LegacyDurability extends DoubleStat {
|
||||
public class LegacyDurability extends DoubleStat implements ProperStat {
|
||||
public LegacyDurability() {
|
||||
super(new ItemStack(Material.FISHING_ROD), "Item Damage/ID", new String[] { "The durability/ID of your item. This", "does &cNOT&7 impact the item max durability." }, "durability", new String[] { "all" });
|
||||
super("DURABILITY", new ItemStack(Material.FISHING_ROD), "Item Damage/ID", new String[] { "The durability/ID of your item. This", "does &cNOT&7 impact the item max durability." }, new String[] { "all" });
|
||||
}
|
||||
|
||||
@Override
|
||||
// @SuppressWarnings("deprecation")
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean whenApplied(MMOItemBuilder item, StatData data) {
|
||||
// item.getItemStack().setDurability((short) ((DoubleData)
|
||||
// data).generateNewValue());
|
||||
item.getItemStack().setDurability((short) ((DoubleData) data).generateNewValue());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ import net.mmogroup.mmolib.version.VersionMaterial;
|
||||
|
||||
public class Lore extends StringStat {
|
||||
public Lore() {
|
||||
super(new ItemStack(VersionMaterial.WRITABLE_BOOK.toMaterial()), "Lore", new String[] { "The item lore." }, "lore", new String[] { "all" });
|
||||
super("LORE", new ItemStack(VersionMaterial.WRITABLE_BOOK.toMaterial()), "Lore", new String[] { "The item lore." }, new String[] { "all" });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -10,7 +10,7 @@ import net.mmogroup.mmolib.api.item.ItemTag;
|
||||
|
||||
public class Lost_when_Broken extends BooleanStat {
|
||||
public Lost_when_Broken() {
|
||||
super(new ItemStack(Material.SHEARS), "Lost when Broken?", new String[] { "If set to true, the item will be lost", "once it reaches 0 durability." }, "will-break", new String[] { "all" });
|
||||
super("WILL_BREAK", new ItemStack(Material.SHEARS), "Lost when Broken?", new String[] { "If set to true, the item will be lost", "once it reaches 0 durability." }, new String[] { "all" });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -26,7 +26,7 @@ import net.mmogroup.mmolib.version.VersionMaterial;
|
||||
|
||||
public class Lute_Attack_Effect extends StringStat {
|
||||
public Lute_Attack_Effect() {
|
||||
super(new ItemStack(VersionMaterial.DIAMOND_HORSE_ARMOR.toMaterial()), "Lute Attack Effect", new String[] { "Changes how your lute behaves", "when right clicked.", "&9Tip: /mi list lute" }, "lute-attack-effect", new String[] { "lute" });
|
||||
super("LUTE_ATTACK_EFFECT", new ItemStack(VersionMaterial.DIAMOND_HORSE_ARMOR.toMaterial()), "Lute Attack Effect", new String[] { "Changes how your lute behaves", "when right clicked.", "&9Tip: /mi list lute" }, new String[] { "lute" });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -10,7 +10,7 @@ import net.mmogroup.mmolib.version.VersionMaterial;
|
||||
|
||||
public class Lute_Attack_Sound extends StringStat {
|
||||
public Lute_Attack_Sound() {
|
||||
super(new ItemStack(VersionMaterial.GOLDEN_HORSE_ARMOR.toMaterial()), "Lute Attack Sound", new String[] { "The sound played when", "basic attacking with this lute." }, "lute-attack-sound", new String[] { "lute" });
|
||||
super("LUTE_ATTACK_SOUND", new ItemStack(VersionMaterial.GOLDEN_HORSE_ARMOR.toMaterial()), "Lute Attack Sound", new String[] { "The sound played when", "basic attacking with this lute." }, new String[] { "lute" });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -21,7 +21,7 @@ import net.mmogroup.mmolib.version.VersionMaterial;
|
||||
|
||||
public class MaterialStat extends StringStat {
|
||||
public MaterialStat() {
|
||||
super(new ItemStack(VersionMaterial.GRASS_BLOCK.toMaterial()), "Material", new String[] { "Your item material." }, "material", new String[] { "all" });
|
||||
super("MATERIAL", new ItemStack(VersionMaterial.GRASS_BLOCK.toMaterial()), "Material", new String[] { "Your item material." }, new String[] { "all" });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -12,7 +12,7 @@ import net.mmogroup.mmolib.api.item.ItemTag;
|
||||
|
||||
public class Max_Health extends AttributeStat {
|
||||
public Max_Health() {
|
||||
super(new ItemStack(Material.GOLDEN_APPLE), "Max Health", new String[] { "The amount of health your", "item gives to the holder." }, "max-health", Attribute.GENERIC_MAX_HEALTH);
|
||||
super("MAX_HEALTH", new ItemStack(Material.GOLDEN_APPLE), "Max Health", new String[] { "The amount of health your", "item gives to the holder." }, Attribute.GENERIC_MAX_HEALTH);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -11,12 +11,13 @@ import net.Indyuce.mmoitems.api.util.message.Message;
|
||||
import net.Indyuce.mmoitems.stat.data.StatData;
|
||||
import net.Indyuce.mmoitems.stat.type.Conditional;
|
||||
import net.Indyuce.mmoitems.stat.type.DoubleStat;
|
||||
import net.Indyuce.mmoitems.stat.type.ProperStat;
|
||||
import net.mmogroup.mmolib.api.item.ItemTag;
|
||||
import net.mmogroup.mmolib.api.item.NBTItem;
|
||||
|
||||
public class Maximum_Durability extends DoubleStat implements Conditional {
|
||||
public class Maximum_Durability extends DoubleStat implements Conditional, ProperStat {
|
||||
public Maximum_Durability() {
|
||||
super(new ItemStack(Material.SHEARS), "Maximum Durability", new String[] { "The amount of uses before your", "item becomes unusable/breaks." }, "max-durability", new String[] { "all" });
|
||||
super("MAX_DURABILITY", new ItemStack(Material.SHEARS), "Maximum Durability", new String[] { "The amount of uses before your", "item becomes unusable/breaks." }, new String[] { "all" });
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -12,7 +12,7 @@ import net.mmogroup.mmolib.api.item.ItemTag;
|
||||
|
||||
public class Movement_Speed extends AttributeStat {
|
||||
public Movement_Speed() {
|
||||
super(new ItemStack(Material.LEATHER_BOOTS), "Movement Speed", new String[] { "Movement Speed increase walk speed.", "Default MC walk speed: 0.1" }, "movement-speed", Attribute.GENERIC_MOVEMENT_SPEED);
|
||||
super("MOVEMENT_SPEED", new ItemStack(Material.LEATHER_BOOTS), "Movement Speed", new String[] { "Movement Speed increase walk speed.", "Default MC walk speed: 0.1" }, Attribute.GENERIC_MOVEMENT_SPEED);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -30,7 +30,7 @@ import net.mmogroup.mmolib.api.item.NBTItem;
|
||||
|
||||
public class NBT_Tags extends StringStat {
|
||||
public NBT_Tags() {
|
||||
super(new ItemStack(Material.NAME_TAG), "NBT Tags", new String[] { "Custom NBT Tags." }, "custom-nbt", new String[] { "all" });
|
||||
super("CUSTOM_NBT", new ItemStack(Material.NAME_TAG), "NBT Tags", new String[] { "Custom NBT Tags." }, new String[] { "all" });
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -58,13 +58,12 @@ public class NBT_Tags extends StringStat {
|
||||
|
||||
@Override
|
||||
public boolean whenInput(EditionInventory inv, ConfigFile config, String message, Object... info) {
|
||||
if(message.split("\\ ").length < 2) {
|
||||
if (message.split("\\ ").length < 2) {
|
||||
inv.getPlayer().sendMessage(ChatColor.RED + "Invalid format");
|
||||
return false;
|
||||
}
|
||||
|
||||
List<String> customNbt = config.getConfig().getConfigurationSection(inv.getItemId()).contains("custom-nbt")
|
||||
? config.getConfig().getStringList(inv.getItemId() + ".custom-nbt") : new ArrayList<>();
|
||||
|
||||
List<String> customNbt = config.getConfig().getConfigurationSection(inv.getItemId()).contains("custom-nbt") ? config.getConfig().getStringList(inv.getItemId() + ".custom-nbt") : new ArrayList<>();
|
||||
customNbt.add(message);
|
||||
config.getConfig().set(inv.getItemId() + ".custom-nbt", customNbt);
|
||||
inv.registerItemEdition(config);
|
||||
@ -98,7 +97,7 @@ public class NBT_Tags extends StringStat {
|
||||
JsonArray array = new JsonArray();
|
||||
((StringListData) data).getList().forEach(tag -> {
|
||||
array.add(tag);
|
||||
|
||||
|
||||
item.addItemTag(new ItemTag(tag.substring(0, tag.indexOf(' ')), tag.substring(tag.indexOf(' ') + 1)));
|
||||
});
|
||||
item.addItemTag(new ItemTag("MMOITEMS_NBTTAGS", array.toString()));
|
||||
|
@ -35,7 +35,7 @@ import net.mmogroup.mmolib.api.item.NBTItem;
|
||||
|
||||
public class Perm_Effects extends ItemStat {
|
||||
public Perm_Effects() {
|
||||
super(new ItemStack(Material.POTION), "Permanent Effects", new String[] { "The potion effects your", "item grants to the holder." }, "perm-effects", new String[] { "!miscellaneous", "all" });
|
||||
super("PERM_EFFECTS", new ItemStack(Material.POTION), "Permanent Effects", new String[] { "The potion effects your", "item grants to the holder." }, new String[] { "!miscellaneous", "all" });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -31,7 +31,7 @@ import net.mmogroup.mmolib.version.VersionMaterial;
|
||||
|
||||
public class Permission extends ItemStat implements Conditional {
|
||||
public Permission() {
|
||||
super(new ItemStack(VersionMaterial.OAK_SIGN.toMaterial()), "Permission", new String[] { "The permission needed to use this item." }, "permission", new String[] { "all" });
|
||||
super("PERMISSION", new ItemStack(VersionMaterial.OAK_SIGN.toMaterial()), "Permission", new String[] { "The permission needed to use this item." }, new String[] { "all" });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -10,7 +10,7 @@ import net.mmogroup.mmolib.api.item.ItemTag;
|
||||
|
||||
public class Pickaxe_Power extends DoubleStat {
|
||||
public Pickaxe_Power() {
|
||||
super(new ItemStack(Material.IRON_PICKAXE), "Pickaxe Power", new String[] { "The breaking strength of the", "item when mining custom blocks." }, "pickaxe-power", new String[] { "tool" });
|
||||
super("PICKAXE_POWER", new ItemStack(Material.IRON_PICKAXE), "Pickaxe Power", new String[] { "The breaking strength of the", "item when mining custom blocks." }, new String[] { "tool" });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -26,7 +26,7 @@ import net.Indyuce.mmoitems.stat.type.StringStat;
|
||||
|
||||
public class Potion_Color extends StringStat {
|
||||
public Potion_Color() {
|
||||
super(new ItemStack(Material.POTION), "Potion Color", new String[] { "The color of your potion.", "(Doesn't impact the effects)." }, "potion-color", new String[] { "all" }, Material.POTION, Material.SPLASH_POTION, Material.LINGERING_POTION, Material.TIPPED_ARROW);
|
||||
super("POTION_COLOR", new ItemStack(Material.POTION), "Potion Color", new String[] { "The color of your potion.", "(Doesn't impact the effects)." }, new String[] { "all" }, Material.POTION, Material.SPLASH_POTION, Material.LINGERING_POTION, Material.TIPPED_ARROW);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -31,7 +31,7 @@ import net.Indyuce.mmoitems.stat.type.StringStat;
|
||||
|
||||
public class Potion_Effects extends StringStat {
|
||||
public Potion_Effects() {
|
||||
super(new ItemStack(Material.POTION), "Potion Effects", new String[] { "The effects of your potion.", "(May have an impact on color)." }, "potion-effect", new String[] { "all" }, Material.POTION, Material.SPLASH_POTION, Material.LINGERING_POTION, Material.TIPPED_ARROW);
|
||||
super("POTION_EFFECT", new ItemStack(Material.POTION), "Potion Effects", new String[] { "The effects of your potion.", "(May have an impact on color)." }, new String[] { "all" }, Material.POTION, Material.SPLASH_POTION, Material.LINGERING_POTION, Material.TIPPED_ARROW);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -17,7 +17,7 @@ import net.mmogroup.mmolib.api.item.ItemTag;
|
||||
|
||||
public class Repair_Material extends StringStat {
|
||||
public Repair_Material() {
|
||||
super(new ItemStack(Material.ANVIL), "Repair Material", new String[] { "The material to be used when", "repairing this item in an anvil.", "", "Currently servers no purpose!" }, "repair-material", new String[] { "all" });
|
||||
super("REPAIR_MATERIAL", new ItemStack(Material.ANVIL), "Repair Material", new String[] { "The material to be used when", "repairing this item in an anvil.", "", "Currently servers no purpose!" }, new String[] { "all" });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -32,7 +32,7 @@ import net.mmogroup.mmolib.version.VersionMaterial;
|
||||
|
||||
public class Required_Class extends StringStat implements Conditional {
|
||||
public Required_Class() {
|
||||
super(new ItemStack(VersionMaterial.WRITABLE_BOOK.toMaterial()), "Required Class", new String[] { "The class you need to", "profress to use your item." }, "required-class", new String[] { "all" });
|
||||
super("REQUIRED_CLASS", new ItemStack(VersionMaterial.WRITABLE_BOOK.toMaterial()), "Required Class", new String[] { "The class you need to", "profress to use your item." }, new String[] { "all" });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -10,13 +10,14 @@ import net.Indyuce.mmoitems.api.util.message.Message;
|
||||
import net.Indyuce.mmoitems.stat.data.StatData;
|
||||
import net.Indyuce.mmoitems.stat.type.Conditional;
|
||||
import net.Indyuce.mmoitems.stat.type.DoubleStat;
|
||||
import net.Indyuce.mmoitems.stat.type.ProperStat;
|
||||
import net.mmogroup.mmolib.api.item.ItemTag;
|
||||
import net.mmogroup.mmolib.api.item.NBTItem;
|
||||
import net.mmogroup.mmolib.version.VersionMaterial;
|
||||
|
||||
public class Required_Level extends DoubleStat implements Conditional {
|
||||
public class Required_Level extends DoubleStat implements Conditional, ProperStat {
|
||||
public Required_Level() {
|
||||
super(new ItemStack(VersionMaterial.EXPERIENCE_BOTTLE.toMaterial()), "Required Level", new String[] { "The level your item needs", "in order to be used." }, "required-level", new String[] { "all" });
|
||||
super("REQUIRED_LEVEL", new ItemStack(VersionMaterial.EXPERIENCE_BOTTLE.toMaterial()), "Required Level", new String[] { "The level your item needs", "in order to be used." }, new String[] { "all" });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -23,7 +23,7 @@ import net.mmogroup.mmolib.version.VersionMaterial;
|
||||
|
||||
public class Restore extends StringStat {
|
||||
public Restore() {
|
||||
super(VersionMaterial.RED_DYE.toItem(), "Restore", new String[] { "The amount of health/food/saturation", "your consumable item restores." }, "restore", new String[] { "consumable" });
|
||||
super("RESTORE", VersionMaterial.RED_DYE.toItem(), "Restore", new String[] { "The amount of health/food/saturation", "your consumable item restores." }, new String[] { "consumable" });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -34,7 +34,7 @@ import net.mmogroup.mmolib.api.item.NBTItem;
|
||||
|
||||
public class Shield_Pattern extends StringStat {
|
||||
public Shield_Pattern() {
|
||||
super(new ItemStack(Material.SHIELD), "Shield Pattern", new String[] { "The color & patterns", "of your shield." }, "shield-pattern", new String[] { "all" }, Material.SHIELD);
|
||||
super("SHIELD_PATTERN", new ItemStack(Material.SHIELD), "Shield Pattern", new String[] { "The color & patterns", "of your shield." }, new String[] { "all" }, Material.SHIELD);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -25,7 +25,7 @@ import net.mmogroup.mmolib.version.VersionMaterial;
|
||||
|
||||
public class Skull_Texture extends StringStat {
|
||||
public Skull_Texture() {
|
||||
super(VersionMaterial.PLAYER_HEAD.toItem(), "Skull Texture", new String[] { "The head texture &nvalue&7.", "Can be found on heads databases." }, "skull-texture", new String[] { "all" }, VersionMaterial.PLAYER_HEAD.toMaterial());
|
||||
super("SKULL_TEXTURE", VersionMaterial.PLAYER_HEAD.toItem(), "Skull Texture", new String[] { "The head texture &nvalue&7.", "Can be found on heads databases." }, new String[] { "all" }, VersionMaterial.PLAYER_HEAD.toMaterial());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -27,7 +27,7 @@ import net.mmogroup.mmolib.version.VersionMaterial;
|
||||
|
||||
public class Soulbound extends InternalStat implements Conditional {
|
||||
public Soulbound() {
|
||||
super(new ItemStack(VersionMaterial.ENDER_EYE.toMaterial()), "Soulbound", new String[0], "soulbound", new String[] { "all" });
|
||||
super("SOULBOUND", new ItemStack(VersionMaterial.ENDER_EYE.toMaterial()), "Soulbound", new String[0], new String[] { "all" });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -11,7 +11,7 @@ import net.mmogroup.mmolib.version.VersionMaterial;
|
||||
|
||||
public class Soulbound_Level extends DoubleStat {
|
||||
public Soulbound_Level() {
|
||||
super(new ItemStack(VersionMaterial.ENDER_EYE.toMaterial()), "Soulbinding Level", new String[] { "The soulbound level defines how much", "damage players will take when trying", "to use a soulbound item. It also determines", "how hard it is to break the binding." }, "soulbound-level", new String[] { "consumable" });
|
||||
super("SOULBOUND_LEVEL", new ItemStack(VersionMaterial.ENDER_EYE.toMaterial()), "Soulbinding Level", new String[] { "The soulbound level defines how much", "damage players will take when trying", "to use a soulbound item. It also determines", "how hard it is to break the binding." }, new String[] { "consumable" });
|
||||
}
|
||||
|
||||
// writes soulbound level with roman writing in lore
|
||||
|
@ -24,7 +24,7 @@ import net.mmogroup.mmolib.version.VersionMaterial;
|
||||
|
||||
public class Staff_Spirit extends StringStat {
|
||||
public Staff_Spirit() {
|
||||
super(VersionMaterial.BONE_MEAL.toItem(), "Staff Spirit", new String[] { "Spirit changes the texture", "of the magic attack.", "&9Tip: /mi list spirit" }, "staff-spirit", new String[] { "staff", "wand" });
|
||||
super("STAFF_SPIRIT", VersionMaterial.BONE_MEAL.toItem(), "Staff Spirit", new String[] { "Spirit changes the texture", "of the magic attack.", "&9Tip: /mi list spirit" }, new String[] { "staff", "wand" });
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -66,12 +66,13 @@ public class Staff_Spirit extends StringStat {
|
||||
XRAY_SPIRIT("X-Ray Spirit", "Fires piercing & powerful X-rays.", new XRaySpirit()),
|
||||
THUNDER_SPIRIT("Thunder Spirit", "Fires AoE damaging thunder strikes.", new ThunderSpirit()),
|
||||
SUNFIRE_SPIRIT("Sunfire Spirit", "Fires AoE damaging fire comets.", new SunfireSpirit()),
|
||||
// CURSED_SPIRIT(ChatColor.DARK_PURPLE, "Cursed Spirit", "Fires a targeted cursed projectile."), new CursedSpirit()),
|
||||
// CURSED_SPIRIT(ChatColor.DARK_PURPLE, "Cursed Spirit", "Fires a
|
||||
// targeted cursed projectile."), new CursedSpirit()),
|
||||
;
|
||||
|
||||
private final String lore;
|
||||
private final StaffAttackHandler handler;
|
||||
|
||||
|
||||
private String name;
|
||||
|
||||
private StaffSpirit(String name, String lore, StaffAttackHandler handler) {
|
||||
@ -112,4 +113,3 @@ public class Staff_Spirit extends StringStat {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ public class StoredTags extends InternalStat {
|
||||
private static final List<String> ignoreList = Arrays.asList("Unbreakable", "BlockEntityTag", "display", "Enchantments", "HideFlags", "Damage", "AttributeModifiers", "SkullOwner", "CanDestroy", "PickupDelay", "Age");
|
||||
|
||||
public StoredTags() {
|
||||
super(VersionMaterial.OAK_SIGN.toItem(), "Stored Tags", new String[0], "stored-tags", new String[] { "all" });
|
||||
super("STORED_TAGS", VersionMaterial.OAK_SIGN.toItem(), "Stored Tags", new String[] { "You found a secret dev easter egg", "introduced during the 2020 epidemic!" }, new String[] { "all" });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -13,7 +13,7 @@ import net.mmogroup.mmolib.api.item.NBTItem;
|
||||
|
||||
public class Unbreakable extends BooleanStat {
|
||||
public Unbreakable() {
|
||||
super(new ItemStack(Material.ANVIL), "Unbreakable", new String[] { "Infinite durability if set to true." }, "unbreakable", new String[] { "all" });
|
||||
super("UNBREAKABLE", new ItemStack(Material.ANVIL), "Unbreakable", new String[] { "Infinite durability if set to true." }, new String[] { "all" });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -30,7 +30,7 @@ import net.mmogroup.mmolib.api.item.NBTItem;
|
||||
|
||||
public class Upgrade_Stat extends ItemStat {
|
||||
public Upgrade_Stat() {
|
||||
super(new ItemStack(Material.FLINT), "Item Upgrading", new String[] { "Upgrading your item improves its", "current stats. It requires either a", "consumable or a specific crafting ", "station. Upgrading may sometimes &cfail&7..." }, "upgrade", new String[] { "piercing", "slashing", "blunt", "offhand", "range", "tool", "armor", "consumable", "accessory" });
|
||||
super("UPGRADE", new ItemStack(Material.FLINT), "Item Upgrading", new String[] { "Upgrading your item improves its", "current stats. It requires either a", "consumable or a specific crafting ", "station. Upgrading may sometimes &cfail&7..." }, new String[] { "piercing", "slashing", "blunt", "offhand", "range", "tool", "armor", "consumable", "accessory" });
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -192,20 +192,19 @@ public class Upgrade_Stat extends ItemStat {
|
||||
public void upgrade(MMOItem mmoitem) {
|
||||
// change display name
|
||||
String suffix = ChatColor.translateAlternateColorCodes('&', MMOItems.plugin.getConfig().getString("item-upgrading.name-suffix"));
|
||||
if(MMOItems.plugin.getConfig().getBoolean("item-upgrading.display-in-name"))
|
||||
if (MMOItems.plugin.getConfig().getBoolean("item-upgrading.display-in-name"))
|
||||
if (mmoitem.hasData(ItemStat.NAME)) {
|
||||
StringData nameData = (StringData) mmoitem.getData(ItemStat.NAME);
|
||||
nameData.setString(level == 0 ? nameData.toString() + suffix.replace("#lvl#", "" + (level + 1)) : nameData.toString().replace(suffix.replace("#lvl#", "" + level), suffix.replace("#lvl#", "" + (level + 1))));
|
||||
} else if (mmoitem.hasData(ItemStat.LORE)) {
|
||||
StringListData loreData = (StringListData) mmoitem.getData(ItemStat.LORE);
|
||||
loreData.getList().forEach(line -> {
|
||||
if (line.contains("%upgrade_level%") || line.contains(suffix.replace("#lvl#", "" + level))) {
|
||||
line.replace("%upgrade_level%", suffix.replace("#lvl#", "" + level + 1));
|
||||
line.replace(suffix.replace("#lvl#", "" + level), suffix.replace("#lvl#", "" + level + 1));
|
||||
}
|
||||
});
|
||||
}
|
||||
else if (mmoitem.hasData(ItemStat.LORE)) {
|
||||
StringListData loreData = (StringListData) mmoitem.getData(ItemStat.LORE);
|
||||
loreData.getList().forEach(line -> {
|
||||
if(line.contains("%upgrade_level%") || line.contains(suffix.replace("#lvl#", "" + level))) {
|
||||
line.replace("%upgrade_level%", suffix.replace("#lvl#", "" + level + 1));
|
||||
line.replace(suffix.replace("#lvl#", "" + level), suffix.replace("#lvl#", "" + level + 1));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// apply stat updates
|
||||
getTemplate().upgrade(mmoitem);
|
||||
|
@ -10,7 +10,7 @@ import net.mmogroup.mmolib.api.item.ItemTag;
|
||||
|
||||
public class Vanilla_Eating_Animation extends BooleanStat {
|
||||
public Vanilla_Eating_Animation() {
|
||||
super(new ItemStack(Material.COOKED_BEEF), "Vanilla Eating Animation", new String[] { "When enabled, players have to wait", "for the vanilla eating animation", "in order to eat the consumable." }, "vanilla-eating", new String[] { "consumable" });
|
||||
super("VANILLA_EATING", new ItemStack(Material.COOKED_BEEF), "Vanilla Eating Animation", new String[] { "When enabled, players have to wait", "for the vanilla eating animation", "in order to eat the consumable." }, new String[] { "consumable" });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -12,12 +12,12 @@ public abstract class AttributeStat extends DoubleStat {
|
||||
private final double offset;
|
||||
private final Attribute attribute;
|
||||
|
||||
public AttributeStat(ItemStack item, String name, String[] lore, String path, Attribute attribute) {
|
||||
this(item, name, lore, path, attribute, 0);
|
||||
public AttributeStat(String id, ItemStack item, String name, String[] lore, Attribute attribute) {
|
||||
this(id, item, name, lore, attribute, 0);
|
||||
}
|
||||
|
||||
public AttributeStat(ItemStack item, String name, String[] lore, String path, Attribute attribute, double offset) {
|
||||
super(item, name, lore, path, new String[] { "!consumable", "!miscellaneous", "all" });
|
||||
public AttributeStat(String id, ItemStack item, String name, String[] lore, Attribute attribute, double offset) {
|
||||
super(id, item, name, lore, new String[] { "!consumable", "!miscellaneous", "all" });
|
||||
|
||||
this.offset = offset;
|
||||
this.attribute = attribute;
|
||||
|
@ -19,8 +19,8 @@ import net.mmogroup.mmolib.api.item.ItemTag;
|
||||
import net.mmogroup.mmolib.api.item.NBTItem;
|
||||
|
||||
public class BooleanStat extends ItemStat {
|
||||
public BooleanStat(ItemStack item, String name, String[] lore, String path, String[] types, Material... materials) {
|
||||
super(item, name, lore, path, types, materials);
|
||||
public BooleanStat(String id, ItemStack item, String name, String[] lore, String[] types, Material... materials) {
|
||||
super(id, item, name, lore, types, materials);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -10,32 +10,27 @@ import net.Indyuce.mmoitems.stat.data.StatData;
|
||||
import net.mmogroup.mmolib.api.item.ItemTag;
|
||||
|
||||
public class DisableStat extends BooleanStat {
|
||||
private String tag;
|
||||
|
||||
public DisableStat(Material material, String path, String name, String... lore) {
|
||||
super(new ItemStack(material), name, lore, "disable-" + path, new String[] { "all" });
|
||||
this.tag = path.toUpperCase().replace("-", "_");
|
||||
public DisableStat(String id, Material material, String name, String... lore) {
|
||||
super("DISABLE_" + id, new ItemStack(material), name, lore, new String[] { "all" });
|
||||
}
|
||||
|
||||
public DisableStat(Material material, String path, String name, Material[] materials, String... lore) {
|
||||
super(new ItemStack(material), name, lore, "disable-" + path, new String[] { "all" }, materials);
|
||||
this.tag = path.toUpperCase().replace("-", "_");
|
||||
public DisableStat(String id, Material material, String name, Material[] materials, String... lore) {
|
||||
super("DISABLE_" + id, new ItemStack(material), name, lore, new String[] { "all" }, materials);
|
||||
}
|
||||
|
||||
public DisableStat(Material material, String path, String name, String[] types, String... lore) {
|
||||
super(new ItemStack(material), name, lore, "disable-" + path, types);
|
||||
this.tag = path.toUpperCase().replace("-", "_");
|
||||
public DisableStat(String id, Material material, String name, String[] types, String... lore) {
|
||||
super("DISABLE_" + id, new ItemStack(material), name, lore, types);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void whenLoaded(MMOItem item, ConfigurationSection config) {
|
||||
item.setData(this, new BooleanData(config.getBoolean("disable-" + tag.toLowerCase().replace("_", "-"))));
|
||||
item.setData(this, new BooleanData(config.getBoolean(getPath())));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean whenApplied(MMOItemBuilder item, StatData data) {
|
||||
if (((BooleanData) data).isEnabled())
|
||||
item.addItemTag(new ItemTag("MMOITEMS_DISABLE_" + tag, true));
|
||||
item.addItemTag(new ItemTag("MMOITEMS_" + getId(), true));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -25,12 +25,12 @@ import net.mmogroup.mmolib.api.item.ItemTag;
|
||||
import net.mmogroup.mmolib.api.item.NBTItem;
|
||||
|
||||
public class DoubleStat extends ItemStat implements Upgradable {
|
||||
public DoubleStat(ItemStack item, String name, String[] lore, String path) {
|
||||
super(item, name, lore, path, new String[] { "!miscellaneous", "all" });
|
||||
public DoubleStat(String id, ItemStack item, String name, String[] lore) {
|
||||
super(id, item, name, lore, new String[] { "!miscellaneous", "all" });
|
||||
}
|
||||
|
||||
public DoubleStat(ItemStack item, String name, String[] lore, String path, String[] types, Material... materials) {
|
||||
super(item, name, lore, path, types, materials);
|
||||
public DoubleStat(String id, ItemStack item, String name, String[] lore, String[] types, Material... materials) {
|
||||
super(id, item, name, lore, types, materials);
|
||||
}
|
||||
|
||||
public void whenLoaded(MMOItem item, ConfigurationSection config) {
|
||||
|
@ -19,8 +19,8 @@ public abstract class InternalStat extends ItemStat {
|
||||
* edited in the item edition GUI since they only exist once the item is
|
||||
* physically generated.
|
||||
*/
|
||||
public InternalStat(ItemStack item, String name, String[] lore, String path, String[] types, Material... materials) {
|
||||
super(item, name, lore, path, types, materials);
|
||||
public InternalStat(String id, ItemStack item, String name, String[] lore, String[] types, Material... materials) {
|
||||
super(id, item, name, lore, types, materials);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -77,89 +77,89 @@ import net.mmogroup.mmolib.api.item.NBTItem;
|
||||
import net.mmogroup.mmolib.version.VersionMaterial;
|
||||
|
||||
public abstract class ItemStat {
|
||||
public static final ItemStat MATERIAL = new MaterialStat(), DURABILITY = MMOLib.plugin.getVersion().isBelowOrEqual(1, 12) ? new LegacyDurability() : new DefaultDurability(), CUSTOM_MODEL_DATA = new Custom_Model_Data(), MAX_CUSTOM_DURABILITY = new Maximum_Durability(), WILL_BREAK = new Lost_when_Broken();
|
||||
public static final ItemStat MATERIAL = new MaterialStat(), DURABILITY = MMOLib.plugin.getVersion().isBelowOrEqual(1, 12) ? new LegacyDurability() : new DefaultDurability(), CUSTOM_MODEL_DATA = new Custom_Model_Data(), MAX_DURABILITY = new Maximum_Durability(), WILL_BREAK = new Lost_when_Broken();
|
||||
public static final ItemStat NAME = new Display_Name(), LORE = new Lore(), NBT_TAGS = new NBT_Tags();
|
||||
|
||||
public static final ItemStat DISPLAYED_TYPE = new StringStat(new ItemStack(VersionMaterial.OAK_SIGN.toMaterial()), "Displayed Type", new String[] { "This option will only affect the", "type displayed on the item lore." }, "displayed-type", new String[] { "all" });
|
||||
public static final ItemStat DISPLAYED_TYPE = new StringStat("DISPLAYED_TYPE", VersionMaterial.OAK_SIGN.toItem(), "Displayed Type", new String[] { "This option will only affect the", "type displayed on the item lore." }, new String[] { "all" });
|
||||
public static final ItemStat ENCHANTS = new Enchants(), HIDE_ENCHANTS = new Hide_Enchants(), PERMISSION = new Permission(), ITEM_PARTICLES = new Item_Particles(), ARROW_PARTICLES = new Arrow_Particles();
|
||||
public static final ItemStat DISABLE_INTERACTION = new DisableStat(VersionMaterial.GRASS_BLOCK.toMaterial(), "interaction", "Disable Interaction", "Disable any unwanted interaction:", "block placement, item use...");
|
||||
public static final ItemStat DISABLE_CRAFTING = new DisableStat(VersionMaterial.CRAFTING_TABLE.toMaterial(), "crafting", "Disable Crafting", "Players can't use this item while crafting.");
|
||||
public static final ItemStat DISABLE_SMELTING = new DisableStat(Material.FURNACE, "smelting", "Disable Smelting", "Players can't use this item in furnaces.");
|
||||
public static final ItemStat DISABLE_ENCHANTING = new DisableStat(VersionMaterial.ENCHANTING_TABLE.toMaterial(), "enchanting", "Disable Enchanting", "Players can't enchant this item."), DISABLE_ADVANCED_ENCHANTS = new Disable_AdvancedEnchantments();
|
||||
public static final ItemStat DISABLE_REPAIRING = new DisableStat(Material.ANVIL, "repairing", "Disable Repairing", "Players can't use this item in anvils.");
|
||||
public static final ItemStat DISABLE_ARROW_SHOOTING = new DisableStat(Material.ARROW, "arrow-shooting", "Disable Arrow Shooting", new Material[] { Material.ARROW }, "Players can't shoot this", "item using a bow.");
|
||||
public static final ItemStat DISABLE_ATTACK_PASSIVE = new DisableStat(Material.BARRIER, "attack-passive", "Disable Attack Passive", new String[] { "piercing", "slashing", "blunt" }, "Disables the blunt/slashing/piercing", "passive effects on attacks.");
|
||||
public static final ItemStat DISABLE_INTERACTION = new DisableStat("INTERACTION", VersionMaterial.GRASS_BLOCK.toMaterial(), "Disable Interaction", "Disable any unwanted interaction:", "block placement, item use...");
|
||||
public static final ItemStat DISABLE_CRAFTING = new DisableStat("CRAFTING", VersionMaterial.CRAFTING_TABLE.toMaterial(), "Disable Crafting", "Players can't use this item while crafting.");
|
||||
public static final ItemStat DISABLE_SMELTING = new DisableStat("SMELTING", Material.FURNACE, "Disable Smelting", "Players can't use this item in furnaces.");
|
||||
public static final ItemStat DISABLE_ENCHANTING = new DisableStat("ENCHANTING", VersionMaterial.ENCHANTING_TABLE.toMaterial(), "Disable Enchanting", "Players can't enchant this item."), DISABLE_ADVANCED_ENCHANTS = new Disable_AdvancedEnchantments();
|
||||
public static final ItemStat DISABLE_REPAIRING = new DisableStat("REPAIRING", Material.ANVIL, "Disable Repairing", "Players can't use this item in anvils.");
|
||||
public static final ItemStat DISABLE_ARROW_SHOOTING = new DisableStat("ARROW_SHOOTING", Material.ARROW, "Disable Arrow Shooting", new Material[] { Material.ARROW }, "Players can't shoot this", "item using a bow.");
|
||||
public static final ItemStat DISABLE_ATTACK_PASSIVE = new DisableStat("ATTACK_PASSIVE", Material.BARRIER, "Disable Attack Passive", new String[] { "piercing", "slashing", "blunt" }, "Disables the blunt/slashing/piercing", "passive effects on attacks.");
|
||||
public static final ItemStat DISABLE_RIGHT_CLICK_CONSUME = new DisableStat("RIGHT_CLICK_CONSUME", Material.BARRIER, "Disable Right Click Consume", new String[] { "consumable" }, "This item will not be consumed", "when eaten by players.");
|
||||
|
||||
public static final ItemStat REQUIRED_LEVEL = new Required_Level(), REQUIRED_CLASS = new Required_Class(), ATTACK_DAMAGE = new Attack_Damage(), ATTACK_SPEED = new Attack_Speed();
|
||||
public static final ItemStat CRITICAL_STRIKE_CHANCE = new DoubleStat(new ItemStack(Material.NETHER_STAR), "Critical Strike Chance", new String[] { "Critical Strikes deal more damage.", "In % chance." }, "critical-strike-chance", new String[] { "!miscellaneous", "all" });
|
||||
public static final ItemStat CRITICAL_STRIKE_POWER = new DoubleStat(new ItemStack(Material.NETHER_STAR), "Critical Strike Power", new String[] { "The extra damage weapon crits deals.", "(Stacks with default value)", "In %." }, "critical-strike-power", new String[] { "!miscellaneous", "all" });
|
||||
public static final ItemStat BLOCK_POWER = new DoubleStat(new ItemStack(Material.IRON_HELMET), "Block Power", new String[] { "The % of the damage your", "armor/shield can block.", "Default: 25%" }, "block-power", new String[] { "!miscellaneous", "all" });
|
||||
public static final ItemStat BLOCK_RATING = new DoubleStat(new ItemStack(Material.IRON_HELMET), "Block Rating", new String[] { "The chance your piece of armor", "has to block any entity attack." }, "block-rating", new String[] { "!miscellaneous", "all" });
|
||||
public static final ItemStat BLOCK_COOLDOWN_REDUCTION = new DoubleStat(new ItemStack(Material.IRON_HELMET), "Block Cooldown Reduction", new String[] { "Reduces the blocking cooldown (%)." }, "block-cooldown-reduction", new String[] { "!miscellaneous", "all" });
|
||||
public static final ItemStat DODGE_RATING = new DoubleStat(new ItemStack(Material.FEATHER), "Dodge Rating", new String[] { "The chance to dodge an attack.", "Dodging completely negates", "the attack damage." }, "dodge-rating", new String[] { "!miscellaneous", "all" });
|
||||
public static final ItemStat DODGE_COOLDOWN_REDUCTION = new DoubleStat(new ItemStack(Material.FEATHER), "Dodge Cooldown Reduction", new String[] { "Reduces the dodging cooldown (%)." }, "dodge-cooldown-reduction", new String[] { "!miscellaneous", "all" });
|
||||
public static final ItemStat PARRY_RATING = new DoubleStat(new ItemStack(Material.BUCKET), "Parry Rating", new String[] { "The chance to parry an attack.", "Parrying negates the damage", "and knocks the attacker back." }, "parry-rating", new String[] { "!miscellaneous", "all" });
|
||||
public static final ItemStat PARRY_COOLDOWN_REDUCTION = new DoubleStat(new ItemStack(Material.BUCKET), "Parry Cooldown Reduction", new String[] { "Reduces the parrying cooldown (%)." }, "parry-cooldown-reduction", new String[] { "!miscellaneous", "all" });
|
||||
public static final ItemStat RANGE = new DoubleStat(new ItemStack(Material.STICK), "Range", new String[] { "The range of your item attacks." }, "range", new String[] { "staff", "whip", "wand", "musket" });
|
||||
public static final ItemStat MANA_COST = new DoubleStat(VersionMaterial.LAPIS_LAZULI.toItem(), "Mana Cost", new String[] { "Mana spent by your weapon to be used." }, "mana-cost", new String[] { "piercing", "slashing", "blunt", "range" });
|
||||
public static final ItemStat STAMINA_COST = new DoubleStat(VersionMaterial.LIGHT_GRAY_DYE.toItem(), "Stamina Cost", new String[] { "Stamina spent by your weapon to be used." }, "stamina-cost", new String[] { "piercing", "slashing", "blunt", "range" });
|
||||
public static final ItemStat ARROW_VELOCITY = new DoubleStat(new ItemStack(Material.ARROW), "Arrow Velocity", new String[] { "Determins how far your", "crossbow can shoot.", "Default: 1.0" }, "arrow-velocity", new String[] { "bow", "crossbow" });
|
||||
public static final ItemStat PVE_DAMAGE = new DoubleStat(new ItemStack(VersionMaterial.PORKCHOP.toMaterial()), "PvE Damage", new String[] { "Additional damage against", "non human entities in %." }, "pve-damage", new String[] { "piercing", "slashing", "blunt", "offhand", "range", "tool", "armor", "gem_stone", "accessory" });
|
||||
public static final ItemStat PVP_DAMAGE = new DoubleStat(new ItemStack(VersionMaterial.SKELETON_SKULL.toMaterial()), "PvP Damage", new String[] { "Additional damage", "against players in %." }, "pvp-damage", new String[] { "piercing", "slashing", "blunt", "offhand", "range", "tool", "armor", "gem_stone", "accessory" });
|
||||
public static final ItemStat BLUNT_POWER = new DoubleStat(new ItemStack(Material.IRON_AXE), "Blunt Power", new String[] { "The radius of the AoE attack.", "If set to 2.0, enemies within 2 blocks", "around your target will take damage." }, "blunt-power", new String[] { "blunt", "gem_stone" });
|
||||
public static final ItemStat BLUNT_RATING = new DoubleStat(new ItemStack(Material.BRICK), "Blunt Rating", new String[] { "The force of the blunt attack.", "If set to 50%, enemies hit by the attack", "will take 50% of the initial damage." }, "blunt-rating", new String[] { "blunt", "gem_stone" });
|
||||
public static final ItemStat WEAPON_DAMAGE = new DoubleStat(new ItemStack(Material.IRON_SWORD), "Weapon Damage", new String[] { "Additional on-hit weapon damage in %." }, "weapon-damage");
|
||||
public static final ItemStat SKILL_DAMAGE = new DoubleStat(new ItemStack(Material.BOOK), "Skill Damage", new String[] { "Additional ability damage in %." }, "skill-damage");
|
||||
public static final ItemStat PROJECTILE_DAMAGE = new DoubleStat(new ItemStack(Material.ARROW), "Projectile Damage", new String[] { "Additional skill/weapon projectile damage." }, "projectile-damage");
|
||||
public static final ItemStat MAGIC_DAMAGE = new DoubleStat(new ItemStack(Material.BOOK), "Magic Damage", new String[] { "Additional magic skill damage in %." }, "magic-damage");
|
||||
public static final ItemStat PHYSICAL_DAMAGE = new DoubleStat(new ItemStack(Material.IRON_AXE), "Physical Damage", new String[] { "Additional skill/weapon physical damage." }, "physical-damage");
|
||||
public static final ItemStat DAMAGE_REDUCTION = new DoubleStat(new ItemStack(Material.IRON_CHESTPLATE), "Damage Reduction", new String[] { "Reduces damage from any source.", "In %." }, "damage-reduction");
|
||||
public static final ItemStat FALL_DAMAGE_REDUCTION = new DoubleStat(new ItemStack(Material.FEATHER), "Fall Damage Reduction", new String[] { "Reduces fall damage.", "In %." }, "fall-damage-reduction");
|
||||
public static final ItemStat PROJECTILE_DAMAGE_REDUCTION = new DoubleStat(new ItemStack(Material.IRON_CHESTPLATE), "Projectile Damage Reduction", new String[] { "Reduces projectile damage.", "In %." }, "projectile-damage-reduction");
|
||||
public static final ItemStat PHYSICAL_DAMAGE_REDUCTION = new DoubleStat(new ItemStack(Material.LEATHER_CHESTPLATE), "Physical Damage Reduction", new String[] { "Reduces physical damage.", "In %." }, "physical-damage-reduction");
|
||||
public static final ItemStat FIRE_DAMAGE_REDUCTION = new DoubleStat(new ItemStack(Material.BLAZE_POWDER), "Fire Damage Reduction", new String[] { "Reduces fire damage.", "In %." }, "fire-damage-reduction");
|
||||
public static final ItemStat MAGIC_DAMAGE_REDUCTION = new DoubleStat(new ItemStack(Material.POTION), "Magic Damage Reduction", new String[] { "Reduce magic damage dealt by potions.", "In %." }, "magic-damage-reduction");
|
||||
public static final ItemStat PVE_DAMAGE_REDUCTION = new DoubleStat(new ItemStack(VersionMaterial.PORKCHOP.toMaterial()), "PvE Damage Reduction", new String[] { "Reduces damage dealt by mobs.", "In %." }, "pve-damage-reduction");
|
||||
public static final ItemStat PVP_DAMAGE_REDUCTION = new DoubleStat(new ItemStack(VersionMaterial.SKELETON_SKULL.toMaterial()), "PvP Damage Reduction", new String[] { "Reduces damage dealt by players", "In %." }, "pvp-damage-reduction");
|
||||
public static final ItemStat UNDEAD_DAMAGE = new DoubleStat(new ItemStack(VersionMaterial.SKELETON_SKULL.toMaterial()), "Undead Damage", new String[] { "Deals additional damage to undead.", "In %." }, "undead-damage");
|
||||
public static final ItemStat CRITICAL_STRIKE_CHANCE = new DoubleStat("CRITICAL_STRIKE_CHANCE", new ItemStack(Material.NETHER_STAR), "Critical Strike Chance", new String[] { "Critical Strikes deal more damage.", "In % chance." }, new String[] { "!miscellaneous", "all" });
|
||||
public static final ItemStat CRITICAL_STRIKE_POWER = new DoubleStat("CRITICAL_STRIKE_POWER", new ItemStack(Material.NETHER_STAR), "Critical Strike Power", new String[] { "The extra damage weapon crits deals.", "(Stacks with default value)", "In %." }, new String[] { "!miscellaneous", "all" });
|
||||
public static final ItemStat BLOCK_POWER = new DoubleStat("BLOCK_POWER", new ItemStack(Material.IRON_HELMET), "Block Power", new String[] { "The % of the damage your", "armor/shield can block.", "Default: 25%" }, new String[] { "!miscellaneous", "all" });
|
||||
public static final ItemStat BLOCK_RATING = new DoubleStat("BLOCK_RATING", new ItemStack(Material.IRON_HELMET), "Block Rating", new String[] { "The chance your piece of armor", "has to block any entity attack." }, new String[] { "!miscellaneous", "all" });
|
||||
public static final ItemStat BLOCK_COOLDOWN_REDUCTION = new DoubleStat("BLOCK_COOLDOWN_REDUCTION", new ItemStack(Material.IRON_HELMET), "Block Cooldown Reduction", new String[] { "Reduces the blocking cooldown (%)." }, new String[] { "!miscellaneous", "all" });
|
||||
public static final ItemStat DODGE_RATING = new DoubleStat("DODGE_RATING", new ItemStack(Material.FEATHER), "Dodge Rating", new String[] { "The chance to dodge an attack.", "Dodging completely negates", "the attack damage." }, new String[] { "!miscellaneous", "all" });
|
||||
public static final ItemStat DODGE_COOLDOWN_REDUCTION = new DoubleStat("DODGE_COOLDOWN_REDUCTION", new ItemStack(Material.FEATHER), "Dodge Cooldown Reduction", new String[] { "Reduces the dodging cooldown (%)." }, new String[] { "!miscellaneous", "all" });
|
||||
public static final ItemStat PARRY_RATING = new DoubleStat("PARRY_RATING", new ItemStack(Material.BUCKET), "Parry Rating", new String[] { "The chance to parry an attack.", "Parrying negates the damage", "and knocks the attacker back." }, new String[] { "!miscellaneous", "all" });
|
||||
public static final ItemStat PARRY_COOLDOWN_REDUCTION = new DoubleStat("PARRY_COOLDOWN_REDUCTION", new ItemStack(Material.BUCKET), "Parry Cooldown Reduction", new String[] { "Reduces the parrying cooldown (%)." }, new String[] { "!miscellaneous", "all" });
|
||||
public static final ItemStat RANGE = new DoubleStat("RANGE", new ItemStack(Material.STICK), "Range", new String[] { "The range of your item attacks." }, new String[] { "staff", "whip", "wand", "musket" });
|
||||
public static final ItemStat MANA_COST = new DoubleStat("MANA_COST", VersionMaterial.LAPIS_LAZULI.toItem(), "Mana Cost", new String[] { "Mana spent by your weapon to be used." }, new String[] { "piercing", "slashing", "blunt", "range" });
|
||||
public static final ItemStat STAMINA_COST = new DoubleStat("STAMINA_COST", VersionMaterial.LIGHT_GRAY_DYE.toItem(), "Stamina Cost", new String[] { "Stamina spent by your weapon to be used." }, new String[] { "piercing", "slashing", "blunt", "range" });
|
||||
public static final ItemStat ARROW_VELOCITY = new DoubleStat("ARROW_VELOCITY", new ItemStack(Material.ARROW), "Arrow Velocity", new String[] { "Determins how far your", "crossbow can shoot.", "Default: 1.0" }, new String[] { "bow", "crossbow" });
|
||||
public static final ItemStat PVE_DAMAGE = new DoubleStat("PVE_DAMAGE", VersionMaterial.PORKCHOP.toItem(), "PvE Damage", new String[] { "Additional damage against", "non human entities in %." }, new String[] { "piercing", "slashing", "blunt", "offhand", "range", "tool", "armor", "gem_stone", "accessory" });
|
||||
public static final ItemStat PVP_DAMAGE = new DoubleStat("PVP_DAMAGE", VersionMaterial.SKELETON_SKULL.toItem(), "PvP Damage", new String[] { "Additional damage", "against players in %." }, new String[] { "piercing", "slashing", "blunt", "offhand", "range", "tool", "armor", "gem_stone", "accessory" });
|
||||
public static final ItemStat BLUNT_POWER = new DoubleStat("BLUNT_POWER", new ItemStack(Material.IRON_AXE), "Blunt Power", new String[] { "The radius of the AoE attack.", "If set to 2.0, enemies within 2 blocks", "around your target will take damage." }, new String[] { "blunt", "gem_stone" });
|
||||
public static final ItemStat BLUNT_RATING = new DoubleStat("BLUNT_RATING", new ItemStack(Material.BRICK), "Blunt Rating", new String[] { "The force of the blunt attack.", "If set to 50%, enemies hit by the attack", "will take 50% of the initial damage." }, new String[] { "blunt", "gem_stone" });
|
||||
public static final ItemStat WEAPON_DAMAGE = new DoubleStat("WEAPON_DAMAGE", new ItemStack(Material.IRON_SWORD), "Weapon Damage", new String[] { "Additional on-hit weapon damage in %." });
|
||||
public static final ItemStat SKILL_DAMAGE = new DoubleStat("SKILL_DAMAGE", new ItemStack(Material.BOOK), "Skill Damage", new String[] { "Additional ability damage in %." });
|
||||
public static final ItemStat PROJECTILE_DAMAGE = new DoubleStat("PROJECTILE_DAMAGE", new ItemStack(Material.ARROW), "Projectile Damage", new String[] { "Additional skill/weapon projectile damage." });
|
||||
public static final ItemStat MAGIC_DAMAGE = new DoubleStat("MAGIC_DAMAGE", new ItemStack(Material.BOOK), "Magic Damage", new String[] { "Additional magic skill damage in %." });
|
||||
public static final ItemStat PHYSICAL_DAMAGE = new DoubleStat("PHYSICAL_DAMAGE", new ItemStack(Material.IRON_AXE), "Physical Damage", new String[] { "Additional skill/weapon physical damage." });
|
||||
public static final ItemStat DAMAGE_REDUCTION = new DoubleStat("DAMAGE_REDUCTION", new ItemStack(Material.IRON_CHESTPLATE), "Damage Reduction", new String[] { "Reduces damage from any source.", "In %." });
|
||||
public static final ItemStat FALL_DAMAGE_REDUCTION = new DoubleStat("FALL_DAMAGE_REDUCTION", new ItemStack(Material.FEATHER), "Fall Damage Reduction", new String[] { "Reduces fall damage.", "In %." });
|
||||
public static final ItemStat PROJECTILE_DAMAGE_REDUCTION = new DoubleStat("PROJECTILE_DAMAGE_REDUCTION", new ItemStack(Material.IRON_CHESTPLATE), "Projectile Damage Reduction", new String[] { "Reduces projectile damage.", "In %." });
|
||||
public static final ItemStat PHYSICAL_DAMAGE_REDUCTION = new DoubleStat("PHYSICAL_DAMAGE_REDUCTION", new ItemStack(Material.LEATHER_CHESTPLATE), "Physical Damage Reduction", new String[] { "Reduces physical damage.", "In %." });
|
||||
public static final ItemStat FIRE_DAMAGE_REDUCTION = new DoubleStat("FIRE_DAMAGE_REDUCTION", new ItemStack(Material.BLAZE_POWDER), "Fire Damage Reduction", new String[] { "Reduces fire damage.", "In %." });
|
||||
public static final ItemStat MAGIC_DAMAGE_REDUCTION = new DoubleStat("MAGIC_DAMAGE_REDUCTION", new ItemStack(Material.POTION), "Magic Damage Reduction", new String[] { "Reduce magic damage dealt by potions.", "In %." });
|
||||
public static final ItemStat PVE_DAMAGE_REDUCTION = new DoubleStat("PVE_DAMAGE_REDUCTION", VersionMaterial.PORKCHOP.toItem(), "PvE Damage Reduction", new String[] { "Reduces damage dealt by mobs.", "In %." });
|
||||
public static final ItemStat PVP_DAMAGE_REDUCTION = new DoubleStat("PVP_DAMAGE_REDUCTION", VersionMaterial.SKELETON_SKULL.toItem(), "PvP Damage Reduction", new String[] { "Reduces damage dealt by players", "In %." });
|
||||
public static final ItemStat UNDEAD_DAMAGE = new DoubleStat("UNDEAD_DAMAGE", VersionMaterial.SKELETON_SKULL.toItem(), "Undead Damage", new String[] { "Deals additional damage to undead.", "In %." });
|
||||
public static final ItemStat UNBREAKABLE = new Unbreakable(), TIER = new Item_Tier(), SET = new Item_Set(), ARMOR = new Armor(), ARMOR_TOUGHNESS = new Armor_Toughness(), MAX_HEALTH = new Max_Health();
|
||||
public static final ItemStat MAX_MANA = new DoubleStat(VersionMaterial.LAPIS_LAZULI.toItem(), "Max Mana", new String[] { "Adds mana to your max mana bar." }, "max-mana");
|
||||
public static final ItemStat MAX_MANA = new DoubleStat("MAX_MANA", VersionMaterial.LAPIS_LAZULI.toItem(), "Max Mana", new String[] { "Adds mana to your max mana bar." });
|
||||
public static final ItemStat KNOCKBACK_RESISTANCE = new Knockback_Resistance(), MOVEMENT_SPEED = new Movement_Speed();
|
||||
|
||||
public static final ItemStat TWO_HANDED = new BooleanStat(new ItemStack(Material.IRON_INGOT), "Two Handed", new String[] { "If set to true, a player will be", "significantly slower if holding two", "items, one being Two Handed." }, "two-handed", new String[] { "piercing", "slashing", "blunt", "offhand", "range", "tool" });
|
||||
public static final ItemStat TWO_HANDED = new BooleanStat("TWO_HANDED", new ItemStack(Material.IRON_INGOT), "Two Handed", new String[] { "If set to true, a player will be", "significantly slower if holding two", "items, one being Two Handed." }, new String[] { "piercing", "slashing", "blunt", "offhand", "range", "tool" });
|
||||
|
||||
public static final ItemStat RESTORE = new Restore();
|
||||
public static final ItemStat RESTORE_MANA = new DoubleStat(VersionMaterial.LAPIS_LAZULI.toItem(), "Restore Mana", new String[] { "The amount of mana", "your consumable restores." }, "restore-mana", new String[] { "consumable" });
|
||||
public static final ItemStat RESTORE_STAMINA = new DoubleStat(VersionMaterial.LIGHT_GRAY_DYE.toItem(), "Restore Stamina", new String[] { "The amount of stamina/power", "your consumable restores." }, "restore-stamina", new String[] { "consumable" });
|
||||
public static final ItemStat CAN_IDENTIFY = new BooleanStat(new ItemStack(Material.PAPER), "Can Identify?", new String[] { "Players can identify & make their", "item usable using this consumable." }, "can-identify", new String[] { "consumable" });
|
||||
public static final ItemStat CAN_DECONSTRUCT = new BooleanStat(new ItemStack(Material.PAPER), "Can Deconstruct?", new String[] { "Players can deconstruct their item", "using this consumable, creating", "another random item." }, "can-deconstruct", new String[] { "consumable" });
|
||||
public static final ItemStat RESTORE_MANA = new DoubleStat("RESTORE_MANA", VersionMaterial.LAPIS_LAZULI.toItem(), "Restore Mana", new String[] { "The amount of mana", "your consumable restores." }, new String[] { "consumable" });
|
||||
public static final ItemStat RESTORE_STAMINA = new DoubleStat("RESTORE_STAMINA", VersionMaterial.LIGHT_GRAY_DYE.toItem(), "Restore Stamina", new String[] { "The amount of stamina/power", "your consumable restores." }, new String[] { "consumable" });
|
||||
public static final ItemStat CAN_IDENTIFY = new BooleanStat("CAN_IDENTIFY", new ItemStack(Material.PAPER), "Can Identify?", new String[] { "Players can identify & make their", "item usable using this consumable." }, new String[] { "consumable" });
|
||||
public static final ItemStat CAN_DECONSTRUCT = new BooleanStat("CAN_DECONSTRUCT", new ItemStack(Material.PAPER), "Can Deconstruct?", new String[] { "Players can deconstruct their item", "using this consumable, creating", "another random item." }, new String[] { "consumable" });
|
||||
public static final ItemStat EFFECTS = new Effects(), PERM_EFFECTS = new Perm_Effects();
|
||||
public static final ItemStat SOULBINDING_CHANCE = new DoubleStat(new ItemStack(VersionMaterial.ENDER_EYE.toMaterial()), "Soulbinding Chance", new String[] { "Defines the chance your item has to", "link another item to your soul,", "preventing other players from using it." }, "soulbinding-chance", new String[] { "consumable" });
|
||||
public static final ItemStat SOULBOUND_BREAK_CHANCE = new DoubleStat(new ItemStack(VersionMaterial.ENDER_EYE.toMaterial()), "Soulbound Break Chance", new String[] { "The chance of breaking an item's", "soulbound when drag & drop'd on it.", "This chance is lowered depending", "on the soulbound's level." }, "soulbound-break-chance", new String[] { "consumable" });
|
||||
public static final ItemStat SOULBINDING_CHANCE = new DoubleStat("SOULBINDING_CHANCE", VersionMaterial.ENDER_EYE.toItem(), "Soulbinding Chance", new String[] { "Defines the chance your item has to", "link another item to your soul,", "preventing other players from using it." }, new String[] { "consumable" });
|
||||
public static final ItemStat SOULBOUND_BREAK_CHANCE = new DoubleStat("SOULBOUND_BREAK_CHANCE", VersionMaterial.ENDER_EYE.toItem(), "Soulbound Break Chance", new String[] { "The chance of breaking an item's", "soulbound when drag & drop'd on it.", "This chance is lowered depending", "on the soulbound's level." }, new String[] { "consumable" });
|
||||
public static final ItemStat SOULBOUND_LEVEL = new Soulbound_Level();
|
||||
public static final ItemStat ITEM_COOLDOWN = new DoubleStat(new ItemStack(Material.COOKED_CHICKEN), "Item Cooldown", new String[] { "This cooldown applies for consumables", "as well as for item commands." }, "item-cooldown", new String[] { "!armor", "!gem_stone", "all" });
|
||||
public static final ItemStat DISABLE_RIGHT_CLICK_CONSUME = new DisableStat(Material.BARRIER, "right-click-consume", "Disable Right Click Consume", new String[] { "consumable" }, "This item will not be consumed", "when eaten by players.");
|
||||
public static final ItemStat ITEM_COOLDOWN = new DoubleStat("ITEM_COOLDOWN", new ItemStack(Material.COOKED_CHICKEN), "Item Cooldown", new String[] { "This cooldown applies for consumables", "as well as for item commands." }, new String[] { "!armor", "!gem_stone", "all" });
|
||||
public static final ItemStat VANILLA_EATING_ANIMATION = new Vanilla_Eating_Animation(), INEDIBLE = new Inedible(), GEM_COLOR = new Gem_Color(), ITEM_TYPE_RESTRICTION = new Item_Type_Restriction();
|
||||
public static final ItemStat MAX_CONSUME = new DoubleStat(new ItemStack(Material.BLAZE_POWDER), "Max Consume", new String[] { "Max amount of usage before", "item disappears." }, "max-consume", new String[] { "consumable" });
|
||||
public static final ItemStat MAX_CONSUME = new DoubleStat("MAX_CONSUME", new ItemStack(Material.BLAZE_POWDER), "Max Consume", new String[] { "Max amount of usage before", "item disappears." }, new String[] { "consumable" });
|
||||
|
||||
public static final ItemStat SUCCESS_RATE = new DoubleStat(new ItemStack(Material.EMERALD), "Success Rate", new String[] { "The chance of your gem to successfully", "apply onto an item. This value is 100%", "by default. If it is not successfully", "applied, the gem stone will be lost." }, "success-rate", new String[] { "gem_stone", "skin" });
|
||||
public static final ItemStat SUCCESS_RATE = new DoubleStat("SUCCESS_RATE", new ItemStack(Material.EMERALD), "Success Rate", new String[] { "The chance of your gem to successfully", "apply onto an item. This value is 100%", "by default. If it is not successfully", "applied, the gem stone will be lost." }, new String[] { "gem_stone", "skin" });
|
||||
public static final ItemStat COMPATIBLE_TYPES = new Compatible_Types();
|
||||
|
||||
public static final ItemStat CRAFTING = new Crafting(), CRAFT_PERMISSION = new Craft_Permission();
|
||||
public static final ItemStat AUTOSMELT = new BooleanStat(new ItemStack(Material.COAL), "Autosmelt", new String[] { "If set to true, your tool will", "automaticaly smelt mined ores." }, "autosmelt", new String[] { "tool" });
|
||||
public static final ItemStat BOUNCING_CRACK = new BooleanStat(new ItemStack(VersionMaterial.COBBLESTONE_WALL.toMaterial()), "Bouncing Crack", new String[] { "If set to true, your tool will", "also break nearby blocks." }, "bouncing-crack", new String[] { "tool" });
|
||||
public static final ItemStat AUTOSMELT = new BooleanStat("AUTOSMELT", new ItemStack(Material.COAL), "Autosmelt", new String[] { "If set to true, your tool will", "automaticaly smelt mined ores." }, new String[] { "tool" });
|
||||
public static final ItemStat BOUNCING_CRACK = new BooleanStat("BOUNCING_CRACK", VersionMaterial.COBBLESTONE_WALL.toItem(), "Bouncing Crack", new String[] { "If set to true, your tool will", "also break nearby blocks." }, new String[] { "tool" });
|
||||
public static final ItemStat PICKAXE_POWER = new Pickaxe_Power();
|
||||
public static final ItemStat CUSTOM_SOUNDS = new CustomSounds();
|
||||
public static final ItemStat ELEMENTS = new Elements();
|
||||
public static final ItemStat COMMANDS = new Commands(), STAFF_SPIRIT = new Staff_Spirit(), LUTE_ATTACK_SOUND = new Lute_Attack_Sound(), LUTE_ATTACK_EFFECT = new Lute_Attack_Effect();
|
||||
public static final ItemStat NOTE_WEIGHT = new DoubleStat(new ItemStack(VersionMaterial.MUSIC_DISC_MALL.toMaterial()), "Note Weight", new String[] { "Defines how the projectile cast", "by your lute tilts downwards." }, "note-weight", new String[] { "lute" });
|
||||
public static final ItemStat REMOVE_ON_CRAFT = new BooleanStat(new ItemStack(Material.GLASS_BOTTLE), "Remove on Craft", new String[] { "If the item should be completely", "removed when used in a recipe,", "or if it should become an", "empty bottle or bucket." }, "remove-on-craft", new String[] { "all" }, Material.POTION, Material.SPLASH_POTION, Material.LINGERING_POTION, Material.MILK_BUCKET, Material.LAVA_BUCKET, Material.WATER_BUCKET);
|
||||
public static final ItemStat NOTE_WEIGHT = new DoubleStat("NOTE_WEIGHT", VersionMaterial.MUSIC_DISC_MALL.toItem(), "Note Weight", new String[] { "Defines how the projectile cast", "by your lute tilts downwards." }, new String[] { "lute" });
|
||||
public static final ItemStat REMOVE_ON_CRAFT = new BooleanStat("REMOVE_ON_CRAFT", new ItemStack(Material.GLASS_BOTTLE), "Remove on Craft", new String[] { "If the item should be completely", "removed when used in a recipe,", "or if it should become an", "empty bottle or bucket." }, new String[] { "all" }, Material.POTION, Material.SPLASH_POTION, Material.LINGERING_POTION, Material.MILK_BUCKET, Material.LAVA_BUCKET, Material.WATER_BUCKET);
|
||||
public static final ItemStat GEM_SOCKETS = new Gem_Sockets();
|
||||
public static final ItemStat REPAIR = new DoubleStat(new ItemStack(Material.ANVIL), "Repair", new String[] { "The amount of durability your item", "can repair when set an item." }, "repair", new String[] { "consumable" });
|
||||
public static final ItemStat REPAIR = new DoubleStat("REPAIR", new ItemStack(Material.ANVIL), "Repair", new String[] { "The amount of durability your item", "can repair when set an item." }, new String[] { "consumable" });
|
||||
public static final ItemStat REPAIR_MATERIAL = new Repair_Material();
|
||||
|
||||
public static final ItemStat KNOCKBACK = new DoubleStat(new ItemStack(VersionMaterial.IRON_HORSE_ARMOR.toMaterial()), "Knockback", new String[] { "Using this musket will knock", "the user back if positive." }, "knockback", new String[] { "musket" });
|
||||
public static final ItemStat RECOIL = new DoubleStat(new ItemStack(VersionMaterial.IRON_HORSE_ARMOR.toMaterial()), "Recoil", new String[] { "Corresponds to the shooting innacuracy." }, "recoil", new String[] { "musket" });
|
||||
public static final ItemStat KNOCKBACK = new DoubleStat("KNOCKBACK", VersionMaterial.IRON_HORSE_ARMOR.toItem(), "Knockback", new String[] { "Using this musket will knock", "the user back if positive." }, new String[] { "musket" });
|
||||
public static final ItemStat RECOIL = new DoubleStat("RECOIL", VersionMaterial.IRON_HORSE_ARMOR.toItem(), "Recoil", new String[] { "Corresponds to the shooting innacuracy." }, new String[] { "musket" });
|
||||
|
||||
public static final ItemStat ABILITIES = new Abilities(), UPGRADE = new Upgrade_Stat();
|
||||
public static final ItemStat SKULL_TEXTURE = new Skull_Texture(), DYE_COLOR = new Dye_Color(), POTION_EFFECTS = new Potion_Effects(), POTION_COLOR = new Potion_Color(), SHIELD_PATTERN = new Shield_Pattern(), HIDE_POTION_EFFECTS = new Hide_Potion_Effects();
|
||||
@ -170,8 +170,7 @@ public abstract class ItemStat {
|
||||
public static final Soulbound SOULBOUND = new Soulbound();
|
||||
public static final ItemStat STORED_TAGS = new StoredTags();
|
||||
|
||||
private String id;
|
||||
private final String name, path;
|
||||
private final String id, name;
|
||||
private final ItemStack item;
|
||||
|
||||
private final String[] lore, compatibleTypes;
|
||||
@ -183,15 +182,11 @@ public abstract class ItemStat {
|
||||
*/
|
||||
private boolean enabled = true;
|
||||
|
||||
public ItemStat(String name, String[] lore, String path, String[] types) {
|
||||
this(new ItemStack(Material.BARRIER), name, lore, path, types);
|
||||
}
|
||||
|
||||
public ItemStat(ItemStack item, String name, String[] lore, String path, String[] types, Material... materials) {
|
||||
public ItemStat(String id, ItemStack item, String name, String[] lore, String[] types, Material... materials) {
|
||||
this.id = id;
|
||||
this.item = item;
|
||||
this.lore = lore == null ? new String[0] : lore;
|
||||
this.compatibleTypes = types == null ? new String[0] : types;
|
||||
this.path = path;
|
||||
this.name = name;
|
||||
this.compatibleMaterials = Arrays.asList(materials);
|
||||
}
|
||||
@ -242,16 +237,12 @@ public abstract class ItemStat {
|
||||
return id;
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO in a distant future, remove path field and make it depend only on
|
||||
* path to reduce confusion.
|
||||
*/
|
||||
public String getPath() {
|
||||
return path;
|
||||
return id.toLowerCase().replace("_", "-");
|
||||
}
|
||||
|
||||
public String getNBTPath() {
|
||||
return "MMOITEMS_" + path.toUpperCase().replace("-", "_");
|
||||
return "MMOITEMS_" + id;
|
||||
}
|
||||
|
||||
public ItemStack getItem() {
|
||||
@ -274,10 +265,6 @@ public abstract class ItemStat {
|
||||
return compatibleTypes;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public boolean hasValidMaterial(ItemStack item) {
|
||||
return compatibleMaterials.size() == 0 || compatibleMaterials.contains(item.getType());
|
||||
}
|
||||
@ -294,8 +281,8 @@ public abstract class ItemStat {
|
||||
}
|
||||
|
||||
public String translate() {
|
||||
String str = MMOItems.plugin.getLanguage().getStatFormat(path);
|
||||
return str == null ? "<TranslationNotFound:" + path + ">" : str;
|
||||
String str = MMOItems.plugin.getLanguage().getStatFormat(getPath());
|
||||
return str == null ? "<TranslationNotFound:" + getPath() + ">" : str;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
11
src/main/java/net/Indyuce/mmoitems/stat/type/ProperStat.java
Normal file
11
src/main/java/net/Indyuce/mmoitems/stat/type/ProperStat.java
Normal file
@ -0,0 +1,11 @@
|
||||
package net.Indyuce.mmoitems.stat.type;
|
||||
|
||||
public interface ProperStat {
|
||||
|
||||
/*
|
||||
* proper stats are numeric statistics which are proper to the item and
|
||||
* which cannot be modified when applying a gem stone! for instance,
|
||||
* "Success Rate" is a numeric stat but must not be applied onto the item
|
||||
* when a gem stone with X Success Rate is being used!
|
||||
*/
|
||||
}
|
@ -22,8 +22,8 @@ import net.mmogroup.mmolib.api.item.ItemTag;
|
||||
import net.mmogroup.mmolib.api.item.NBTItem;
|
||||
|
||||
public class StringStat extends ItemStat {
|
||||
public StringStat(ItemStack item, String name, String[] lore, String path, String[] types, Material... materials) {
|
||||
super(item, name, lore, path, types, materials);
|
||||
public StringStat(String id, ItemStack item, String name, String[] lore, String[] types, Material... materials) {
|
||||
super(id, item, name, lore, types, materials);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -5,6 +5,12 @@ import net.Indyuce.mmoitems.stat.data.upgrade.UpgradeInfo;
|
||||
|
||||
public interface Upgradable {
|
||||
|
||||
/*
|
||||
* an upgradable stat can be used in an upgrade template to be upgraded!
|
||||
* TODO add abilities so that ability damage, effect duration etc. can
|
||||
* increase when upgrading the item!
|
||||
*/
|
||||
|
||||
/*
|
||||
* argument 'obj' is either a primitive object like string, boolean or
|
||||
* double or a configuration section. the method must check if this argument
|
||||
|
Loading…
Reference in New Issue
Block a user