Gave categories to all stats inside the item browser

This commit is contained in:
Jules 2024-10-25 00:05:18 +02:00
parent b1243045fc
commit 5bda049802
134 changed files with 902 additions and 480 deletions

View File

@ -2,7 +2,6 @@ package net.Indyuce.mmoitems;
import io.lumine.mythic.lib.version.VMaterial; import io.lumine.mythic.lib.version.VMaterial;
import net.Indyuce.mmoitems.stat.*; import net.Indyuce.mmoitems.stat.*;
import net.Indyuce.mmoitems.stat.annotation.DeprecatedStat;
import net.Indyuce.mmoitems.stat.block.*; import net.Indyuce.mmoitems.stat.block.*;
import net.Indyuce.mmoitems.stat.type.*; import net.Indyuce.mmoitems.stat.type.*;
import org.bukkit.Material; import org.bukkit.Material;
@ -69,44 +68,44 @@ public class ItemStats {
REQUIRED_CLASS = new RequiredClass(), REQUIRED_CLASS = new RequiredClass(),
ATTACK_DAMAGE = new AttackDamage(), ATTACK_DAMAGE = new AttackDamage(),
ATTACK_SPEED = new AttackSpeed(), ATTACK_SPEED = new AttackSpeed(),
CRITICAL_STRIKE_CHANCE = new DoubleStat("CRITICAL_STRIKE_CHANCE", Material.NETHER_STAR, "Critical Strike Chance", new String[]{"Critical Strikes deal more damage.", "In % chance."}, new String[]{"!miscellaneous", "!block", "all"}), CRITICAL_STRIKE_CHANCE = new DoubleStat("CRITICAL_STRIKE_CHANCE", Material.NETHER_STAR, "Critical Strike Chance", new String[]{"Critical Strikes deal more damage.", "In % chance."}, new String[]{"!miscellaneous", "!block", "all"}).setCategory(StatCategories.OFFENSE),
CRITICAL_STRIKE_POWER = new DoubleStat("CRITICAL_STRIKE_POWER", Material.NETHER_STAR, "Critical Strike Power", new String[]{"The extra damage weapon crits deals.", "(Stacks with default value)", "In %."}, new String[]{"!miscellaneous", "!block", "all"}), CRITICAL_STRIKE_POWER = new DoubleStat("CRITICAL_STRIKE_POWER", Material.NETHER_STAR, "Critical Strike Power", new String[]{"The extra damage weapon crits deals.", "(Stacks with default value)", "In %."}, new String[]{"!miscellaneous", "!block", "all"}).setCategory(StatCategories.OFFENSE),
SKILL_CRITICAL_STRIKE_CHANCE = new DoubleStat("SKILL_CRITICAL_STRIKE_CHANCE", Material.NETHER_STAR, "Skill Critical Strike Chance", new String[]{"Increases the chance of dealing skill crits (in %)."}, new String[]{"!miscellaneous", "!block", "all"}), SKILL_CRITICAL_STRIKE_CHANCE = new DoubleStat("SKILL_CRITICAL_STRIKE_CHANCE", Material.NETHER_STAR, "Skill Critical Strike Chance", new String[]{"Increases the chance of dealing skill crits (in %)."}, new String[]{"!miscellaneous", "!block", "all"}).setCategory(StatCategories.OFFENSE),
SKILL_CRITICAL_STRIKE_POWER = new DoubleStat("SKILL_CRITICAL_STRIKE_POWER", Material.NETHER_STAR, "Skill Critical Strike Power", new String[]{"Extra damage dealt (in %) by skill crits.", "(Stacks with default value)", "In %."}, new String[]{"!miscellaneous", "!block", "all"}), SKILL_CRITICAL_STRIKE_POWER = new DoubleStat("SKILL_CRITICAL_STRIKE_POWER", Material.NETHER_STAR, "Skill Critical Strike Power", new String[]{"Extra damage dealt (in %) by skill crits.", "(Stacks with default value)", "In %."}, new String[]{"!miscellaneous", "!block", "all"}).setCategory(StatCategories.OFFENSE),
BLOCK_POWER = new DoubleStat("BLOCK_POWER", Material.IRON_HELMET, "Block Power", new String[]{"The % of the damage your", "armor/shield can block.", "Default: 25%"}, new String[]{"!miscellaneous", "!block", "all"}), BLOCK_POWER = new DoubleStat("BLOCK_POWER", Material.IRON_HELMET, "Block Power", new String[]{"The % of the damage your", "armor/shield can block.", "Default: 25%"}, new String[]{"!miscellaneous", "!block", "all"}).setCategory(StatCategories.OFFENSE),
BLOCK_RATING = new DoubleStat("BLOCK_RATING", Material.IRON_HELMET, "Block Rating", new String[]{"The chance your piece of armor", "has to block any entity attack."}, new String[]{"!miscellaneous", "!block", "all"}), BLOCK_RATING = new DoubleStat("BLOCK_RATING", Material.IRON_HELMET, "Block Rating", new String[]{"The chance your piece of armor", "has to block any entity attack."}, new String[]{"!miscellaneous", "!block", "all"}).setCategory(StatCategories.OFFENSE),
BLOCK_COOLDOWN_REDUCTION = new DoubleStat("BLOCK_COOLDOWN_REDUCTION", Material.IRON_HELMET, "Block Cooldown Reduction", new String[]{"Reduces the blocking cooldown (%)."}, new String[]{"!miscellaneous", "!block", "all"}), BLOCK_COOLDOWN_REDUCTION = new DoubleStat("BLOCK_COOLDOWN_REDUCTION", Material.IRON_HELMET, "Block Cooldown Reduction", new String[]{"Reduces the blocking cooldown (%)."}, new String[]{"!miscellaneous", "!block", "all"}).setCategory(StatCategories.OFFENSE),
DODGE_RATING = new DoubleStat("DODGE_RATING", Material.FEATHER, "Dodge Rating", new String[]{"The chance to dodge an attack.", "Dodging completely negates", "the attack damage."}, new String[]{"!miscellaneous", "!block", "all"}), DODGE_RATING = new DoubleStat("DODGE_RATING", Material.FEATHER, "Dodge Rating", new String[]{"The chance to dodge an attack.", "Dodging completely negates", "the attack damage."}, new String[]{"!miscellaneous", "!block", "all"}).setCategory(StatCategories.OFFENSE),
DODGE_COOLDOWN_REDUCTION = new DoubleStat("DODGE_COOLDOWN_REDUCTION", Material.FEATHER, "Dodge Cooldown Reduction", new String[]{"Reduces the dodging cooldown (%)."}, new String[]{"!miscellaneous", "!block", "all"}), DODGE_COOLDOWN_REDUCTION = new DoubleStat("DODGE_COOLDOWN_REDUCTION", Material.FEATHER, "Dodge Cooldown Reduction", new String[]{"Reduces the dodging cooldown (%)."}, new String[]{"!miscellaneous", "!block", "all"}).setCategory(StatCategories.OFFENSE),
PARRY_RATING = new DoubleStat("PARRY_RATING", Material.BUCKET, "Parry Rating", new String[]{"The chance to parry an attack.", "Parrying negates the damage", "and knocks the attacker back."}, new String[]{"!miscellaneous", "!block", "all"}), PARRY_RATING = new DoubleStat("PARRY_RATING", Material.BUCKET, "Parry Rating", new String[]{"The chance to parry an attack.", "Parrying negates the damage", "and knocks the attacker back."}, new String[]{"!miscellaneous", "!block", "all"}).setCategory(StatCategories.OFFENSE),
PARRY_COOLDOWN_REDUCTION = new DoubleStat("PARRY_COOLDOWN_REDUCTION", Material.BUCKET, "Parry Cooldown Reduction", new String[]{"Reduces the parrying cooldown (%)."}, new String[]{"!miscellaneous", "!block", "all"}), PARRY_COOLDOWN_REDUCTION = new DoubleStat("PARRY_COOLDOWN_REDUCTION", Material.BUCKET, "Parry Cooldown Reduction", new String[]{"Reduces the parrying cooldown (%)."}, new String[]{"!miscellaneous", "!block", "all"}).setCategory(StatCategories.OFFENSE),
COOLDOWN_REDUCTION = new DoubleStat("COOLDOWN_REDUCTION", Material.BOOK, "Cooldown Reduction", new String[]{"Reduces cooldowns of item and player skills (%)."}), COOLDOWN_REDUCTION = new DoubleStat("COOLDOWN_REDUCTION", Material.BOOK, "Cooldown Reduction", new String[]{"Reduces cooldowns of item and player skills (%)."}).setCategory(StatCategories.OFFENSE),
RANGE = new DoubleStat("RANGE", Material.STICK, "Range", new String[]{"The range of your item attacks."}, new String[]{"staff", "whip", "wand", "musket", "gem_stone"}), RANGE = new DoubleStat("RANGE", Material.STICK, "Range", new String[]{"The range of your item attacks."}, new String[]{"staff", "whip", "wand", "musket", "gem_stone"}).setCategory(StatCategories.RANGED_WEAPONS),
MANA_COST = new ManaCost(), MANA_COST = new ManaCost(),
STAMINA_COST = new DoubleStat("STAMINA_COST", Material.LIGHT_GRAY_DYE, "Stamina Cost", new String[]{"Stamina spent by your weapon to be used."}, new String[]{"weapon"}), STAMINA_COST = new DoubleStat("STAMINA_COST", Material.LIGHT_GRAY_DYE, "Stamina Cost", new String[]{"Stamina spent by your weapon to be used."}, new String[]{"weapon"}).setCategory(StatCategories.USE_COST),
ARROW_VELOCITY = new DoubleStat("ARROW_VELOCITY", Material.ARROW, "Arrow Velocity", new String[]{"Determines how far your", "weapon can shoot.", "Default: 1.0"}, new String[]{"gem_stone", "bow", "crossbow"}), ARROW_VELOCITY = new DoubleStat("ARROW_VELOCITY", Material.ARROW, "Arrow Velocity", new String[]{"Determines how far your", "weapon can shoot.", "Default: 1.0"}, new String[]{"gem_stone", "bow", "crossbow"}).setCategory(StatCategories.RANGED_WEAPONS),
ARROW_POTION_EFFECTS = new ArrowPotionEffects(), ARROW_POTION_EFFECTS = new ArrowPotionEffects(),
PVE_DAMAGE = new DoubleStat("PVE_DAMAGE", Material.PORKCHOP, "PvE Damage", new String[]{"Additional damage against", "non human entities in %."}, new String[]{"equipment", "gem_stone"}), PVE_DAMAGE = new DoubleStat("PVE_DAMAGE", Material.PORKCHOP, "PvE Damage", new String[]{"Additional damage against", "non human entities in %."}, new String[]{"equipment", "gem_stone"}).setCategory(StatCategories.OFFENSE),
PVP_DAMAGE = new DoubleStat("PVP_DAMAGE", Material.SKELETON_SKULL, "PvP Damage", new String[]{"Additional damage", "against players in %."}, new String[]{"equipment", "gem_stone"}), PVP_DAMAGE = new DoubleStat("PVP_DAMAGE", Material.SKELETON_SKULL, "PvP Damage", new String[]{"Additional damage", "against players in %."}, new String[]{"equipment", "gem_stone"}).setCategory(StatCategories.OFFENSE),
BLUNT_POWER = new DoubleStat("BLUNT_POWER", 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.", "&9This stat only applies to Blunt weapons."}, new String[]{"weapon", "gem_stone"}), BLUNT_POWER = new DoubleStat("BLUNT_POWER", 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.", "&9This stat only applies to Blunt weapons."}, new String[]{"weapon", "gem_stone"}).setCategory(StatCategories.DAMAGE_MITIGATION),
BLUNT_RATING = new DoubleStat("BLUNT_RATING", 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.", "&9This stat only applies to Blunt weapons."}, new String[]{"weapon", "gem_stone"}), BLUNT_RATING = new DoubleStat("BLUNT_RATING", 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.", "&9This stat only applies to Blunt weapons."}, new String[]{"weapon", "gem_stone"}).setCategory(StatCategories.DAMAGE_MITIGATION),
WEAPON_DAMAGE = new DoubleStat("WEAPON_DAMAGE", Material.IRON_SWORD, "Weapon Damage", new String[]{"Additional on-hit weapon damage in %."}), WEAPON_DAMAGE = new DoubleStat("WEAPON_DAMAGE", Material.IRON_SWORD, "Weapon Damage", new String[]{"Additional on-hit weapon damage in %."}).setCategory(StatCategories.DAMAGE_MITIGATION),
SKILL_DAMAGE = new DoubleStat("SKILL_DAMAGE", Material.BOOK, "Skill Damage", new String[]{"Additional ability damage in %."}), SKILL_DAMAGE = new DoubleStat("SKILL_DAMAGE", Material.BOOK, "Skill Damage", new String[]{"Additional ability damage in %."}).setCategory(StatCategories.DAMAGE_MITIGATION),
PROJECTILE_DAMAGE = new DoubleStat("PROJECTILE_DAMAGE", Material.ARROW, "Projectile Damage", new String[]{"Additional skill/weapon projectile damage."}), PROJECTILE_DAMAGE = new DoubleStat("PROJECTILE_DAMAGE", Material.ARROW, "Projectile Damage", new String[]{"Additional skill/weapon projectile damage."}).setCategory(StatCategories.DAMAGE_MITIGATION),
MAGIC_DAMAGE = new DoubleStat("MAGIC_DAMAGE", Material.MAGMA_CREAM, "Magic Damage", new String[]{"Additional magic skill damage in %."}), MAGIC_DAMAGE = new DoubleStat("MAGIC_DAMAGE", Material.MAGMA_CREAM, "Magic Damage", new String[]{"Additional magic skill damage in %."}).setCategory(StatCategories.DAMAGE_MITIGATION),
PHYSICAL_DAMAGE = new DoubleStat("PHYSICAL_DAMAGE", Material.IRON_AXE, "Physical Damage", new String[]{"Additional skill/weapon physical damage."}), PHYSICAL_DAMAGE = new DoubleStat("PHYSICAL_DAMAGE", Material.IRON_AXE, "Physical Damage", new String[]{"Additional skill/weapon physical damage."}).setCategory(StatCategories.DAMAGE_MITIGATION),
DEFENSE = new DoubleStat("DEFENSE", Material.SHIELD, "Defense", new String[]{"Reduces damage from any source.", "Formula can be set in MMOLib Config."}), DEFENSE = new DoubleStat("DEFENSE", Material.SHIELD, "Defense", new String[]{"Reduces damage from any source.", "Formula can be set in MMOLib Config."}).setCategory(StatCategories.DAMAGE_MITIGATION),
DAMAGE_REDUCTION = new DoubleStat("DAMAGE_REDUCTION", Material.IRON_CHESTPLATE, "Damage Reduction", new String[]{"Reduces damage from any source.", "In %."}), DAMAGE_REDUCTION = new DoubleStat("DAMAGE_REDUCTION", Material.IRON_CHESTPLATE, "Damage Reduction", new String[]{"Reduces damage from any source.", "In %."}).setCategory(StatCategories.DAMAGE_MITIGATION),
FALL_DAMAGE_REDUCTION = new DoubleStat("FALL_DAMAGE_REDUCTION", Material.FEATHER, "Fall Damage Reduction", new String[]{"Reduces fall damage.", "In %."}), FALL_DAMAGE_REDUCTION = new DoubleStat("FALL_DAMAGE_REDUCTION", Material.FEATHER, "Fall Damage Reduction", new String[]{"Reduces fall damage.", "In %."}).setCategory(StatCategories.DAMAGE_MITIGATION),
PROJECTILE_DAMAGE_REDUCTION = new DoubleStat("PROJECTILE_DAMAGE_REDUCTION", Material.SNOWBALL, "Projectile Damage Reduction", new String[]{"Reduces projectile damage.", "In %."}), PROJECTILE_DAMAGE_REDUCTION = new DoubleStat("PROJECTILE_DAMAGE_REDUCTION", Material.SNOWBALL, "Projectile Damage Reduction", new String[]{"Reduces projectile damage.", "In %."}).setCategory(StatCategories.DAMAGE_MITIGATION),
PHYSICAL_DAMAGE_REDUCTION = new DoubleStat("PHYSICAL_DAMAGE_REDUCTION", Material.LEATHER_CHESTPLATE, "Physical Damage Reduction", new String[]{"Reduces physical damage.", "In %."}), PHYSICAL_DAMAGE_REDUCTION = new DoubleStat("PHYSICAL_DAMAGE_REDUCTION", Material.LEATHER_CHESTPLATE, "Physical Damage Reduction", new String[]{"Reduces physical damage.", "In %."}).setCategory(StatCategories.DAMAGE_MITIGATION),
FIRE_DAMAGE_REDUCTION = new DoubleStat("FIRE_DAMAGE_REDUCTION", Material.BLAZE_POWDER, "Fire Damage Reduction", new String[]{"Reduces fire damage.", "In %."}), FIRE_DAMAGE_REDUCTION = new DoubleStat("FIRE_DAMAGE_REDUCTION", Material.BLAZE_POWDER, "Fire Damage Reduction", new String[]{"Reduces fire damage.", "In %."}).setCategory(StatCategories.DAMAGE_MITIGATION),
MAGIC_DAMAGE_REDUCTION = new DoubleStat("MAGIC_DAMAGE_REDUCTION", Material.POTION, "Magic Damage Reduction", new String[]{"Reduce magic damage dealt by potions.", "In %."}), MAGIC_DAMAGE_REDUCTION = new DoubleStat("MAGIC_DAMAGE_REDUCTION", Material.POTION, "Magic Damage Reduction", new String[]{"Reduce magic damage dealt by potions.", "In %."}).setCategory(StatCategories.DAMAGE_MITIGATION),
PVE_DAMAGE_REDUCTION = new DoubleStat("PVE_DAMAGE_REDUCTION", Material.PORKCHOP, "PvE Damage Reduction", new String[]{"Reduces damage dealt by mobs.", "In %."}), PVE_DAMAGE_REDUCTION = new DoubleStat("PVE_DAMAGE_REDUCTION", Material.PORKCHOP, "PvE Damage Reduction", new String[]{"Reduces damage dealt by mobs.", "In %."}).setCategory(StatCategories.DAMAGE_MITIGATION),
PVP_DAMAGE_REDUCTION = new DoubleStat("PVP_DAMAGE_REDUCTION", Material.SKELETON_SKULL, "PvP Damage Reduction", new String[]{"Reduces damage dealt by players", "In %."}), PVP_DAMAGE_REDUCTION = new DoubleStat("PVP_DAMAGE_REDUCTION", Material.SKELETON_SKULL, "PvP Damage Reduction", new String[]{"Reduces damage dealt by players", "In %."}).setCategory(StatCategories.DAMAGE_MITIGATION),
UNDEAD_DAMAGE = new DoubleStat("UNDEAD_DAMAGE", Material.SKELETON_SKULL, "Undead Damage", new String[]{"Deals additional damage to undead.", "In %."}), UNDEAD_DAMAGE = new DoubleStat("UNDEAD_DAMAGE", Material.SKELETON_SKULL, "Undead Damage", new String[]{"Deals additional damage to undead.", "In %."}).setCategory(StatCategories.OFFENSE),
LIFESTEAL = new DoubleStat("LIFESTEAL", Material.REDSTONE, "Lifesteal", new String[]{"Percentage of damage you gain back as", "health when inflicting weapon damage."}), LIFESTEAL = new DoubleStat("LIFESTEAL", Material.REDSTONE, "Lifesteal", new String[]{"Percentage of damage you gain back as", "health when inflicting weapon damage."}).setCategory(StatCategories.OFFENSE),
SPELL_VAMPIRISM = new DoubleStat("SPELL_VAMPIRISM", Material.REDSTONE, "Spell Vampirism", new String[]{"Percentage of damage you gain back as", "health when inflicting skill damage."}), SPELL_VAMPIRISM = new DoubleStat("SPELL_VAMPIRISM", Material.REDSTONE, "Spell Vampirism", new String[]{"Percentage of damage you gain back as", "health when inflicting skill damage."}).setCategory(StatCategories.OFFENSE),
// Extra Stats // Extra Stats
UNBREAKABLE = new Unbreakable(), UNBREAKABLE = new Unbreakable(),
@ -116,10 +115,10 @@ public class ItemStats {
ARMOR_TOUGHNESS = new ArmorToughness(), ARMOR_TOUGHNESS = new ArmorToughness(),
MAX_HEALTH = new MaxHealth(), MAX_HEALTH = new MaxHealth(),
UNSTACKABLE = new Unstackable(), UNSTACKABLE = new Unstackable(),
MAX_MANA = new DoubleStat("MAX_MANA", Material.LAPIS_LAZULI, "Max Mana", new String[]{"Adds mana to your max mana bar."}), MAX_MANA = new DoubleStat("MAX_MANA", Material.LAPIS_LAZULI, "Max Mana", new String[]{"Adds mana to your max mana bar."}).setCategory(StatCategories.MISC_STATS),
KNOCKBACK_RESISTANCE = new KnockbackResistance(), KNOCKBACK_RESISTANCE = new KnockbackResistance(),
MOVEMENT_SPEED = new MovementSpeed(), MOVEMENT_SPEED = new MovementSpeed(),
TWO_HANDED = new BooleanStat("TWO_HANDED", 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[]{"handheld"}), TWO_HANDED = new BooleanStat("TWO_HANDED", 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[]{"handheld"}).setCategory(StatCategories.MISC),
REQUIRED_BIOMES = new RequiredBiomes(), REQUIRED_BIOMES = new RequiredBiomes(),
DROP_ON_DEATH = new DisableDeathDrop(), DROP_ON_DEATH = new DisableDeathDrop(),
HIDE_DURABILITY_BAR = new HideDurabilityBar(), HIDE_DURABILITY_BAR = new HideDurabilityBar(),
@ -163,8 +162,8 @@ public class ItemStats {
SOULBOUND_BREAK_CHANCE = new SoulbindingBreakChance(), SOULBOUND_BREAK_CHANCE = new SoulbindingBreakChance(),
SOULBOUND_LEVEL = new SoulboundLevel(), SOULBOUND_LEVEL = new SoulboundLevel(),
// AUTO_SOULBIND = new BooleanStat("AUTO_SOULBIND", VersionMaterial.ENDER_EYE.toMaterial(), "Auto-Soulbind", new String[]{"Automatically soulbinds this item to", "a player when he acquires it."}, new String[]{"!consumable", "all"}), // AUTO_SOULBIND = new BooleanStat("AUTO_SOULBIND", VersionMaterial.ENDER_EYE.toMaterial(), "Auto-Soulbind", new String[]{"Automatically soulbinds this item to", "a player when he acquires it."}, new String[]{"!consumable", "all"}),
ITEM_COOLDOWN = new DoubleStat("ITEM_COOLDOWN", Material.COOKED_CHICKEN, "Item Cooldown", new String[]{"This cooldown applies for consumables", "as well as for item commands."}, new String[]{"!armor", "!gem_stone", "!block", "all"}), ITEM_COOLDOWN = new DoubleStat("ITEM_COOLDOWN", Material.COOKED_CHICKEN, "Item Cooldown", new String[]{"This cooldown applies for consumables", "as well as for item commands."}, new String[]{"!armor", "!gem_stone", "!block", "all"}).setCategory(StatCategories.ABILITIES),
COOLDOWN_REFERENCE = new StringStat("COOLDOWN_REFERENCE", Material.CHICKEN, "Cooldown Reference", new String[]{"Two items with the same cooldown reference", "will share their cooldowns. This is useful", "for health or mana pots for example."}, new String[]{"!armor", "!gem_stone", "!block", "all"}), COOLDOWN_REFERENCE = new StringStat("COOLDOWN_REFERENCE", Material.CHICKEN, "Cooldown Reference", new String[]{"Two items with the same cooldown reference", "will share their cooldowns. This is useful", "for health or mana pots for example."}, new String[]{"!armor", "!gem_stone", "!block", "all"}).setCategory(StatCategories.ABILITIES),
VANILLA_EATING_ANIMATION = new VanillaEatingAnimation(), VANILLA_EATING_ANIMATION = new VanillaEatingAnimation(),
GEM_COLOR = new GemColor(), GEM_COLOR = new GemColor(),
GEM_UPGRADE_SCALING = new GemUpgradeScaling(), GEM_UPGRADE_SCALING = new GemUpgradeScaling(),
@ -178,17 +177,17 @@ public class ItemStats {
//CRAFT_AMOUNT = new DoubleStat("CRAFTED_AMOUNT", Material.WOODEN_AXE, "Crafted Amount", new String[]{"The stack count for", "this item when crafted."}, new String[0]), //CRAFT_AMOUNT = new DoubleStat("CRAFTED_AMOUNT", Material.WOODEN_AXE, "Crafted Amount", new String[]{"The stack count for", "this item when crafted."}, new String[0]),
// Unique Stats // Unique Stats
AUTOSMELT = new BooleanStat("AUTOSMELT", Material.COAL, "Autosmelt", new String[]{"If set to true, your tool will", "automaticaly smelt mined ores."}, new String[]{"tool"}), AUTOSMELT = new BooleanStat("AUTOSMELT", Material.COAL, "Autosmelt", new String[]{"If set to true, your tool will", "automaticaly smelt mined ores."}, new String[]{"tool"}).setCategory(StatCategories.TOOLS),
BOUNCING_CRACK = new BooleanStat("BOUNCING_CRACK", Material.COBBLESTONE_WALL, "Bouncing Crack", new String[]{"If set to true, your tool will", "also break nearby blocks."}, new String[]{"tool"}), BOUNCING_CRACK = new BooleanStat("BOUNCING_CRACK", Material.COBBLESTONE_WALL, "Bouncing Crack", new String[]{"If set to true, your tool will", "also break nearby blocks."}, new String[]{"tool"}).setCategory(StatCategories.TOOLS),
PICKAXE_POWER = new PickaxePower(), PICKAXE_POWER = new PickaxePower(),
CUSTOM_SOUNDS = new CustomSounds(), CUSTOM_SOUNDS = new CustomSounds(),
ELEMENTS = new Elements(), ELEMENTS = new Elements(),
COMMANDS = new Commands(), COMMANDS = new Commands(),
// STAFF_SPIRIT = new StaffSpiritStat(), // STAFF_SPIRIT = new StaffSpiritStat(),
LUTE_ATTACK_SOUND = new LuteAttackSoundStat(), LUTE_ATTACK_SOUND = new LuteAttackSoundStat(),
LUTE_ATTACK_EFFECT = new LuteAttackEffectStat(), LUTE_ATTACK_EFFECT = new LuteAttackEffectStat(),
NOTE_WEIGHT = new DoubleStat("NOTE_WEIGHT", Material.MUSIC_DISC_MALL, "Note Weight", new String[]{"Defines how the projectile cast", "by your lute tilts downwards."}, new String[]{"lute"}), NOTE_WEIGHT = new DoubleStat("NOTE_WEIGHT", Material.MUSIC_DISC_MALL, "Note Weight", new String[]{"Defines how the projectile cast", "by your lute tilts downwards."}, new String[]{"lute"}).setCategory(StatCategories.RANGED_WEAPONS),
REMOVE_ON_CRAFT = new BooleanStat("REMOVE_ON_CRAFT", 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[0], Material.POTION, Material.SPLASH_POTION, Material.LINGERING_POTION, Material.MILK_BUCKET, Material.LAVA_BUCKET, Material.WATER_BUCKET), REMOVE_ON_CRAFT = new BooleanStat("REMOVE_ON_CRAFT", 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[0], Material.POTION, Material.SPLASH_POTION, Material.LINGERING_POTION, Material.MILK_BUCKET, Material.LAVA_BUCKET, Material.WATER_BUCKET).setCategory(StatCategories.MISC),
COMPATIBLE_TYPES = new CompatibleTypes(), COMPATIBLE_TYPES = new CompatibleTypes(),
COMPATIBLE_IDS = new CompatibleIds(), COMPATIBLE_IDS = new CompatibleIds(),
COMPATIBLE_MATERIALS = new CompatibleMaterials(), COMPATIBLE_MATERIALS = new CompatibleMaterials(),
@ -198,19 +197,19 @@ public class ItemStats {
REPAIR = new RepairPower(), REPAIR = new RepairPower(),
REPAIR_PERCENT = new RepairPowerPercent(), REPAIR_PERCENT = new RepairPowerPercent(),
REPAIR_TYPE = new RepairReference(), REPAIR_TYPE = new RepairReference(),
INEDIBLE = new BooleanStat("INEDIBLE", Material.POISONOUS_POTATO, "Inedible", new String[]{"Players won't be able to right-click this consumable.", "", "No effects of it will take place."}, new String[]{"consumable"}), INEDIBLE = new BooleanStat("INEDIBLE", Material.POISONOUS_POTATO, "Inedible", new String[]{"Players won't be able to right-click this consumable.", "", "No effects of it will take place."}, new String[]{"consumable"}).setCategory(StatCategories.CONSUMABLES),
DISABLE_RIGHT_CLICK_CONSUME = new DisableStat("RIGHT_CLICK_CONSUME", Material.BAKED_POTATO, "Infinite Consume", new String[]{"consumable"}, "Players will be able to right-click this consumable", "and benefit from its effects, but it won't be consumed."), DISABLE_RIGHT_CLICK_CONSUME = new DisableStat("RIGHT_CLICK_CONSUME", Material.BAKED_POTATO, "Infinite Consume", new String[]{"consumable"}, "Players will be able to right-click this consumable", "and benefit from its effects, but it won't be consumed.").setCategory(StatCategories.CONSUMABLES),
KNOCKBACK = new DoubleStat("KNOCKBACK", Material.IRON_HORSE_ARMOR, "Knockback", new String[]{"Using this musket will knock", "the user back if positive."}, new String[]{"musket", "gem_stone"}), KNOCKBACK = new DoubleStat("KNOCKBACK", Material.IRON_HORSE_ARMOR, "Knockback", new String[]{"Using this musket will knock", "the user back if positive."}, new String[]{"musket", "gem_stone"}).setCategory(StatCategories.RANGED_WEAPONS),
RECOIL = new DoubleStat("RECOIL", Material.IRON_HORSE_ARMOR, "Recoil", new String[]{"Corresponds to the shooting innacuracy."}, new String[]{"musket", "gem_stone"}), RECOIL = new DoubleStat("RECOIL", Material.IRON_HORSE_ARMOR, "Recoil", new String[]{"Corresponds to the shooting innacuracy."}, new String[]{"musket", "gem_stone"}).setCategory(StatCategories.RANGED_WEAPONS),
HANDWORN = new BooleanStat("HANDWORN", Material.STRING, "Handworn", new String[]{"This item can be held along with a", "two-handed weapon in the other hand."}, new String[]{"catalyst", "off_catalyst", "main_catalyst"}), HANDWORN = new BooleanStat("HANDWORN", Material.STRING, "Handworn", new String[]{"This item can be held along with a", "two-handed weapon in the other hand."}, new String[]{"catalyst", "off_catalyst", "main_catalyst"}).setCategory(StatCategories.MISC),
AMPHIBIAN = new Amphibian(), AMPHIBIAN = new Amphibian(),
// Abilities & Upgrading // Abilities & Upgrading
ABILITIES = new Abilities(), ABILITIES = new Abilities(),
UPGRADE = new UpgradeStat(), UPGRADE = new UpgradeStat(),
DOWNGRADE_ON_BREAK = new BooleanStat("BREAK_DOWNGRADE", Material.DAMAGED_ANVIL, "Downgrade when Broken", new String[]{"If this item's durability reaches 0,", "it will be fully repaired but also", "downgraded by one level.", "", "&cIt will only break if it cannot be", "&cdowngraded further", "", "Requires to define an &6Upgrade Template", "Required to define &6Custom Durability"}, new String[]{"equipment"}), DOWNGRADE_ON_BREAK = new BooleanStat("BREAK_DOWNGRADE", Material.DAMAGED_ANVIL, "Downgrade when Broken", new String[]{"If this item's durability reaches 0,", "it will be fully repaired but also", "downgraded by one level.", "", "&cIt will only break if it cannot be", "&cdowngraded further", "", "Requires to define an &6Upgrade Template", "Required to define &6Custom Durability"}, new String[]{"equipment"}).setCategory(StatCategories.UPGRADING),
DOWNGRADE_ON_DEATH = new BooleanStat("DEATH_DOWNGRADE", Material.DAMAGED_ANVIL, "Downgrade on Death", new String[]{"If the wearer of this item dies, it may", "downgrade (based on &6Death Downgrade", "&6Chance &7stat)", "", "Required to define an &6Upgrade Template", "Requires keep-inventory gamerule. "}, new String[]{"equipment"}), DOWNGRADE_ON_DEATH = new BooleanStat("DEATH_DOWNGRADE", Material.DAMAGED_ANVIL, "Downgrade on Death", new String[]{"If the wearer of this item dies, it may", "downgrade (based on &6Death Downgrade", "&6Chance &7stat)", "", "Required to define an &6Upgrade Template", "Requires keep-inventory gamerule. "}, new String[]{"equipment"}).setCategory(StatCategories.UPGRADING),
DOWNGRADE_ON_DEATH_CHANCE = new DoubleStat("DEATH_DOWNGRADE_CHANCE", Material.SKELETON_SKULL, "Death Downgrade Chance", new String[]{"Probability that an item with &cDowngrade ", "&con Death&7 will be downgraded when the", "player dies. ", "", "Exceeding 100% will for sure downgrade", "one item, and roll again to downgrade", "another (with the excess probability).", "&6The same item wont be downgraded twice."}, new String[]{"equipment"}, false), DOWNGRADE_ON_DEATH_CHANCE = new DoubleStat("DEATH_DOWNGRADE_CHANCE", Material.SKELETON_SKULL, "Death Downgrade Chance", new String[]{"Probability that an item with &cDowngrade ", "&con Death&7 will be downgraded when the", "player dies. ", "", "Exceeding 100% will for sure downgrade", "one item, and roll again to downgrade", "another (with the excess probability).", "&6The same item wont be downgraded twice."}, new String[]{"equipment"}, false).setCategory(StatCategories.UPGRADING),
// Unique Item Stats // Unique Item Stats
DYE_COLOR = new DyeColor(), DYE_COLOR = new DyeColor(),
@ -231,10 +230,10 @@ public class ItemStats {
BROWSER_DISPLAY_IDX = new BrowserDisplayIDX(); BROWSER_DISPLAY_IDX = new BrowserDisplayIDX();
/** /**
* @deprecated Item damage is now {@link ItemDamage} and * @see ItemDamage
* custom durability is now {@link CustomDurability} * @see CustomDurability
* @deprecated
*/ */
@Deprecated @Deprecated
@DeprecatedStat
public static final ItemStat DURABILITY = ITEM_DAMAGE; public static final ItemStat DURABILITY = ITEM_DAMAGE;
} }

View File

@ -165,11 +165,12 @@ public class MMOItems extends MMOPlugin {
// This needs to be before modifier registration (MMOCore) // This needs to be before modifier registration (MMOCore)
findRpgPlugins(); findRpgPlugins();
statManager.reload(false); // Elemental stats must be loaded before sets
/* /*
* After tiers, sets and upgrade templates are loaded, MI template data * After tiers, sets and upgrade templates are loaded, MI template data
* can be fully loaded * can be fully loaded
*/ */
statManager.loadElements(); // Why is this call made there?
loreManager.reload(); loreManager.reload();
tierManager = new TierManager(); tierManager = new TierManager();
setManager = new SetManager(); setManager = new SetManager();
@ -179,7 +180,6 @@ public class MMOItems extends MMOPlugin {
dropTableManager = new DropTableManager(); dropTableManager = new DropTableManager();
worldGenManager = new WorldGenManager(); worldGenManager = new WorldGenManager();
blockManager = new BlockManager(); blockManager = new BlockManager();
statManager.reload(false);
PluginUtils.hookDependencyIfPresent("Vault", true, u -> vaultSupport = new VaultSupport()); PluginUtils.hookDependencyIfPresent("Vault", true, u -> vaultSupport = new VaultSupport());

View File

@ -0,0 +1,41 @@
package net.Indyuce.mmoitems;
import net.Indyuce.mmoitems.stat.category.StatCategory;
public class StatCategories {
public static final StatCategory
NONE = new StatCategory("NONE", "Anything Else!", "No Category"),
MISC = new StatCategory("MISC", "Miscellaneous", "Miscellaneous"),
RARITY = new StatCategory("RARITY", "Rarity", "Rarity"),
TEMPLATE_OPTION = new StatCategory("TEMPLATE_OPTION", "Template Options", "Template Option"),
SOULBOUND = new StatCategory("SOULBOUND", "Soulbound", "Soulbound"),
ELEMENTS = new StatCategory("ELEMENTS", "Elements", "Elements", true),
TOOLS = new StatCategory("TOOLS", "Tools", "Tools"),
VANILLA_ATTRIBUTE = new StatCategory("VANILLA_ATTRIBUTE", "Vanilla Attributes", "Vanilla Attribute"),
OFFENSE = new StatCategory("OFFENSE", "Offense", "Offense"),
MISC_STATS = new StatCategory("MISC_STATS", "Misc Stats", "Misc Stats"),
RANGED_WEAPONS = new StatCategory("RANGED_WEAPONS", "Ranged Weapons", "Ranged Weapons"),
CUSTOM = new StatCategory("CUSTOM", "Custom Stat", "Custom Stat"),
BLOCKS = new StatCategory("BLOCKS", "Blocks", "Blocks"),
RESOURCES = new StatCategory("RESOURCES", "Resources", "Resources"),
DAMAGE_MITIGATION = new StatCategory("DAMAGE_MITIGATION", "Damage Mitigation", "Damage Mitigation"),
REQUIREMENT = new StatCategory("REQUIREMENT", "Item Requirements", "Item Requirement"),
USE_COST = new StatCategory("USE_COST", "Item Costs", "Use Cost"),
UPGRADING = new StatCategory("UPGRADING", "Upgrading", "Upgrading"),
DURABILITY = new StatCategory("DURABILITY", "Durability", "Durability"),
CONSUMABLES = new StatCategory("CONSUMABLES", "Consumables", "Consumables"),
GEM_STONES = new StatCategory("GEM_STONES", "Gem Stones", "Gem Stones"),
SKINS = new StatCategory("SKINS", "Item Skins", "Skins"),
ABILITIES = new StatCategory("ABILITIES", "Actions, Scripts & Abilities", "Actions & Abilities"),
TOOLTIP = new StatCategory("TOOLTIP", "Tooltips", "Tooltips"),
GENERAL = new StatCategory("GENERAL", "General", "General"),
SPECIAL = new StatCategory("SPECIAL", "Special", "Special"),
TOGGLES = new StatCategory("TOGGLES", "Toggles", "Toggles"),
MMOCORE_PROFESSIONS = new StatCategory("MMOCORE_PROFESSIONS", "MMOCore Professions", "MMOCore Professions", true),
MMOCORE_ATTRIBUTES = new StatCategory("MMOCORE_ATTRIBUTES", "MMOCore Attributes", "MMOCore Attributes", true),
ITEM = new StatCategory("ITEM", "Item & Texture", "Item & Texture");
/* NONE = new StatCategory("NONE", "Anything Else!", "No Category"),
NONE = new StatCategory("NONE", "Anything Else!", "No Category"),
NONE = new StatCategory("NONE", "Anything Else!", "No Category");*/
}

View File

@ -8,6 +8,7 @@ import io.lumine.mythic.lib.player.modifier.ModifierSource;
import io.lumine.mythic.lib.skill.handler.SkillHandler; import io.lumine.mythic.lib.skill.handler.SkillHandler;
import io.lumine.mythic.lib.util.PostLoadAction; import io.lumine.mythic.lib.util.PostLoadAction;
import io.lumine.mythic.lib.util.PreloadedObject; import io.lumine.mythic.lib.util.PreloadedObject;
import io.lumine.mythic.lib.util.annotation.BackwardsCompatibility;
import net.Indyuce.mmoitems.MMOItems; import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.interaction.*; import net.Indyuce.mmoitems.api.interaction.*;
import net.Indyuce.mmoitems.api.interaction.weapon.Weapon; import net.Indyuce.mmoitems.api.interaction.weapon.Weapon;
@ -26,12 +27,10 @@ import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import java.util.ArrayList; import java.util.*;
import java.util.List;
import java.util.Objects;
import java.util.function.BiFunction; import java.util.function.BiFunction;
@SuppressWarnings("unused") // TODO remove most of premade types. Add type categories for applicable stats.
public class Type implements CooldownObject, PreloadedObject { public class Type implements CooldownObject, PreloadedObject {
// Slashing // Slashing
@ -108,7 +107,7 @@ public class Type implements CooldownObject, PreloadedObject {
/** /**
* Cached list of stats which can be applied onto an item with this type * Cached list of stats which can be applied onto an item with this type
*/ */
private final List<ItemStat> available = new ArrayList<>(); private final List<ItemStat<?, ?>> statCache = new ArrayList<>();
private final PostLoadAction postLoadAction = new PostLoadAction(true, config -> { private final PostLoadAction postLoadAction = new PostLoadAction(true, config -> {
onLeftClick = config.contains("on-left-click") ? MythicLib.plugin.getSkills().loadSkillHandler(config.get("on-left-click")) : null; onLeftClick = config.contains("on-left-click") ? MythicLib.plugin.getSkills().loadSkillHandler(config.get("on-left-click")) : null;
@ -269,8 +268,8 @@ public class Type implements CooldownObject, PreloadedObject {
* specific item type. This list is cached when types are being * specific item type. This list is cached when types are being
* loaded and is a PRETTY GOOD performance improvement. * loaded and is a PRETTY GOOD performance improvement.
*/ */
public List<ItemStat> getAvailableStats() { public List<ItemStat<?, ?>> getAvailableStats() {
return available; return statCache;
} }
/** /**
@ -396,5 +395,12 @@ public class Type implements CooldownObject, PreloadedObject {
return getId(); return getId();
} }
@BackwardsCompatibility(version = "6.10.1")
public Collection<Type> LEGACY_TYPES = Arrays.asList(
);
//endregion //endregion
} }

View File

@ -75,11 +75,15 @@ public class MMOItemTemplate implements ItemReference, PreloadedObject {
for (String key : config.getConfigurationSection("base").getKeys(false)) for (String key : config.getConfigurationSection("base").getKeys(false))
try { try {
final String id = UtilityMethods.enumName(key); final String id = UtilityMethods.enumName(key);
final ItemStat stat = MMOItems.plugin.getStats().get(id); final ItemStat<?, ?> stat = MMOItems.plugin.getStats().get(id);
// Adapt legacy configs
if (stat == null && MMOItems.plugin.getStats().adaptLegacyConfig(base, key, k -> config.get("base." + k)))
continue;
Validate.notNull(stat, FriendlyFeedbackProvider.quickForConsole(FFPMMOItems.get(), "Could not find stat with ID '$i{0}$b'", id)); Validate.notNull(stat, FriendlyFeedbackProvider.quickForConsole(FFPMMOItems.get(), "Could not find stat with ID '$i{0}$b'", id));
RandomStatData data = stat.whenInitialized(config.get("base." + key)); RandomStatData<?> data = stat.whenInitialized(config.get("base." + key));
if (data != null) if (data != null) base.put(stat, data);
base.put(stat, data);
} catch (IllegalArgumentException exception) { } catch (IllegalArgumentException exception) {

View File

@ -66,6 +66,10 @@ public class ModifierNode implements PreloadedObject {
try { try {
final String statId = UtilityMethods.enumName(key); final String statId = UtilityMethods.enumName(key);
final ItemStat<?, ?> stat = MMOItems.plugin.getStats().get(statId); final ItemStat<?, ?> stat = MMOItems.plugin.getStats().get(statId);
// Adapt legacy configs
if (stat == null && MMOItems.plugin.getStats().adaptLegacyConfig(ModifierNode.this.data, key, statSection::get)) continue;
Validate.notNull(stat, "Could not find stat with ID '" + statId + "'"); Validate.notNull(stat, "Could not find stat with ID '" + statId + "'");
ModifierNode.this.data.put(stat, stat.whenInitialized(statSection.get(key))); ModifierNode.this.data.put(stat, stat.whenInitialized(statSection.get(key)));
} catch (IllegalArgumentException exception) { } catch (IllegalArgumentException exception) {

View File

@ -2,8 +2,10 @@ package net.Indyuce.mmoitems.comp.enchants.advanced_enchants;
import io.lumine.mythic.lib.MythicLib; import io.lumine.mythic.lib.MythicLib;
import io.lumine.mythic.lib.api.item.NBTItem; import io.lumine.mythic.lib.api.item.NBTItem;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.event.MMOItemReforgeEvent; import net.Indyuce.mmoitems.api.event.MMOItemReforgeEvent;
import net.Indyuce.mmoitems.comp.enchants.DisableAdvancedEnchantments; import net.Indyuce.mmoitems.comp.enchants.DisableAdvancedEnchantments;
import net.Indyuce.mmoitems.stat.category.StatCategory;
import net.Indyuce.mmoitems.stat.data.type.StatData; import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.ItemStat; import net.Indyuce.mmoitems.stat.type.ItemStat;
import net.advancedplugins.ae.api.EnchantApplyEvent; import net.advancedplugins.ae.api.EnchantApplyEvent;
@ -11,8 +13,14 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
public class AdvancedEnchantmentsHook implements Listener { public class AdvancedEnchantmentsHook implements Listener {
public static final ItemStat ADVANCED_ENCHANTMENTS = new AdvancedEnchantsStat(); public static final StatCategory STAT_CATEGORY = new StatCategory("AE", "Advanced Enchants", "Advanced Enchants");
public static final ItemStat DISABLE_ADVANCED_ENCHANTMENTS = new DisableAdvancedEnchantments();
public static final ItemStat ADVANCED_ENCHANTMENTS = new AdvancedEnchantsStat().setCategory(STAT_CATEGORY);
public static final ItemStat DISABLE_ADVANCED_ENCHANTMENTS = new DisableAdvancedEnchantments().setCategory(STAT_CATEGORY);
public AdvancedEnchantmentsHook() {
MMOItems.plugin.getStats().registerCategory(STAT_CATEGORY);
}
@EventHandler @EventHandler
public void onEnchantApply(EnchantApplyEvent event) { public void onEnchantApply(EnchantApplyEvent event) {

View File

@ -6,7 +6,6 @@ import net.Indyuce.mmocore.api.event.PlayerChangeClassEvent;
import net.Indyuce.mmocore.api.event.PlayerLevelUpEvent; import net.Indyuce.mmocore.api.event.PlayerLevelUpEvent;
import net.Indyuce.mmocore.api.event.PlayerResourceUpdateEvent; import net.Indyuce.mmocore.api.event.PlayerResourceUpdateEvent;
import net.Indyuce.mmocore.api.player.attribute.PlayerAttribute; import net.Indyuce.mmocore.api.player.attribute.PlayerAttribute;
import net.Indyuce.mmocore.api.player.stats.StatType;
import net.Indyuce.mmocore.experience.EXPSource; import net.Indyuce.mmocore.experience.EXPSource;
import net.Indyuce.mmocore.experience.Profession; import net.Indyuce.mmocore.experience.Profession;
import net.Indyuce.mmocore.experience.source.RepairItemExperienceSource; import net.Indyuce.mmocore.experience.source.RepairItemExperienceSource;
@ -16,12 +15,11 @@ import net.Indyuce.mmoitems.api.event.item.ItemCustomRepairEvent;
import net.Indyuce.mmoitems.api.event.item.RepairItemEvent; import net.Indyuce.mmoitems.api.event.item.RepairItemEvent;
import net.Indyuce.mmoitems.api.player.PlayerData; import net.Indyuce.mmoitems.api.player.PlayerData;
import net.Indyuce.mmoitems.api.player.RPGPlayer; import net.Indyuce.mmoitems.api.player.RPGPlayer;
import net.Indyuce.mmoitems.comp.mmocore.stat.AdditionalProfessionExp;
import net.Indyuce.mmoitems.comp.mmocore.stat.ExtraAttribute; import net.Indyuce.mmoitems.comp.mmocore.stat.ExtraAttribute;
import net.Indyuce.mmoitems.comp.mmocore.stat.RequiredAttribute; import net.Indyuce.mmoitems.comp.mmocore.stat.RequiredAttribute;
import net.Indyuce.mmoitems.comp.mmocore.stat.RequiredProfession; import net.Indyuce.mmoitems.comp.mmocore.stat.RequiredProfession;
import net.Indyuce.mmoitems.comp.rpg.RPGHandler; import net.Indyuce.mmoitems.comp.rpg.RPGHandler;
import net.Indyuce.mmoitems.stat.type.DoubleStat;
import org.bukkit.Material;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
@ -29,8 +27,6 @@ import org.bukkit.event.Listener;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.Damageable; import org.bukkit.inventory.meta.Damageable;
import java.util.Locale;
public class MMOCoreHook implements RPGHandler, Listener { public class MMOCoreHook implements RPGHandler, Listener {
/** /**
@ -48,10 +44,7 @@ public class MMOCoreHook implements RPGHandler, Listener {
for (Profession profession : MMOCore.plugin.professionManager.getAll()) { for (Profession profession : MMOCore.plugin.professionManager.getAll()) {
// Adds profession specific Additional Experience stats. // Adds profession specific Additional Experience stats.
MMOItems.plugin.getStats().register(new DoubleStat((StatType.ADDITIONAL_EXPERIENCE.name() + '_' + profession.getId()) MMOItems.plugin.getStats().register(new AdditionalProfessionExp(profession));
.replace('-', '_').replace(' ', '_').toUpperCase(Locale.ROOT),
Material.EXPERIENCE_BOTTLE, profession.getName() + ' ' + "Additional Experience (MMOCore)"
, new String[]{"Additional MMOCore profession " + profession.getName() + " experience in %."}, new String[]{"!block", "all"}));
MMOItems.plugin.getStats().register(new RequiredProfession(profession)); MMOItems.plugin.getStats().register(new RequiredProfession(profession));
} }
} }

View File

@ -12,6 +12,7 @@ import net.Indyuce.mmocore.experience.source.type.ExperienceSource;
import net.Indyuce.mmocore.loot.chest.condition.Condition; import net.Indyuce.mmocore.loot.chest.condition.Condition;
import net.Indyuce.mmocore.loot.droptable.dropitem.DropItem; import net.Indyuce.mmocore.loot.droptable.dropitem.DropItem;
import net.Indyuce.mmoitems.MMOItems; import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.StatCategories;
import net.Indyuce.mmoitems.api.block.CustomBlock; import net.Indyuce.mmoitems.api.block.CustomBlock;
import net.Indyuce.mmoitems.api.crafting.ConditionalDisplay; import net.Indyuce.mmoitems.api.crafting.ConditionalDisplay;
import net.Indyuce.mmoitems.comp.mmocore.crafting.AttributeCondition; import net.Indyuce.mmoitems.comp.mmocore.crafting.AttributeCondition;
@ -28,19 +29,19 @@ import java.util.Optional;
public class MMOCoreMMOLoader extends MMOLoader { public class MMOCoreMMOLoader extends MMOLoader {
private static final ItemStat HEALTH_REGENERATION = new DoubleStat("HEALTH_REGENERATION", Material.BREAD, "Health Regeneration", new String[]{"Amount of health pts regenerated every second."}); private static final ItemStat HEALTH_REGENERATION = new DoubleStat("HEALTH_REGENERATION", Material.BREAD, "Health Regeneration", new String[]{"Amount of health pts regenerated every second."}).setCategory(StatCategories.RESOURCES);
private static final ItemStat MAX_HEALTH_REGENERATION = new DoubleStat("MAX_HEALTH_REGENERATION", Material.BREAD, "Max Health Regeneration", new String[]{"Percentage of max health regenerated every second."}); private static final ItemStat MAX_HEALTH_REGENERATION = new DoubleStat("MAX_HEALTH_REGENERATION", Material.BREAD, "Max Health Regeneration", new String[]{"Percentage of max health regenerated every second."}).setCategory(StatCategories.RESOURCES);
private static final ItemStat MANA_REGENERATION = new DoubleStat("MANA_REGENERATION", Material.LAPIS_LAZULI, "Mana Regeneration", new String[]{"Amount of mana pts regenerated every second."}); private static final ItemStat MANA_REGENERATION = new DoubleStat("MANA_REGENERATION", Material.LAPIS_LAZULI, "Mana Regeneration", new String[]{"Amount of mana pts regenerated every second."}).setCategory(StatCategories.RESOURCES);
private static final ItemStat MAX_MANA_REGENERATION = new DoubleStat("MAX_MANA_REGENERATION", Material.LAPIS_LAZULI, "Max Mana Regeneration", new String[]{"Percentage of max mana regenerated every second."}); private static final ItemStat MAX_MANA_REGENERATION = new DoubleStat("MAX_MANA_REGENERATION", Material.LAPIS_LAZULI, "Max Mana Regeneration", new String[]{"Percentage of max mana regenerated every second."}).setCategory(StatCategories.RESOURCES);
private static final ItemStat STAMINA_REGENERATION = new DoubleStat("STAMINA_REGENERATION", Material.LIGHT_BLUE_DYE, "Stamina Regeneration", new String[]{"Amount of stamina pts regenerated every second."}); private static final ItemStat STAMINA_REGENERATION = new DoubleStat("STAMINA_REGENERATION", Material.LIGHT_BLUE_DYE, "Stamina Regeneration", new String[]{"Amount of stamina pts regenerated every second."}).setCategory(StatCategories.RESOURCES);
private static final ItemStat MAX_STAMINA_REGENERATION = new DoubleStat("MAX_STAMINA_REGENERATION", Material.LIGHT_BLUE_DYE, "Max Stamina Regeneration", new String[]{"Percentage of max stamina regenerated every second."}); private static final ItemStat MAX_STAMINA_REGENERATION = new DoubleStat("MAX_STAMINA_REGENERATION", Material.LIGHT_BLUE_DYE, "Max Stamina Regeneration", new String[]{"Percentage of max stamina regenerated every second."}).setCategory(StatCategories.RESOURCES);
private static final ItemStat MAX_STAMINA = new DoubleStat("MAX_STAMINA", Material.LIGHT_BLUE_DYE, "Max Stamina", private static final ItemStat MAX_STAMINA = new DoubleStat("MAX_STAMINA", Material.LIGHT_BLUE_DYE, "Max Stamina",
new String[]{"Adds stamina to your max stamina bar."}); new String[]{"Adds stamina to your max stamina bar."}).setCategory(StatCategories.RESOURCES);
private static final ItemStat MAX_STELLIUM = new DoubleStat("MAX_STELLIUM", Material.ENDER_EYE, "Max Stellium", private static final ItemStat MAX_STELLIUM = new DoubleStat("MAX_STELLIUM", Material.ENDER_EYE, "Max Stellium",
new String[]{"Additional maximum stellium."}); new String[]{"Additional maximum stellium."}).setCategory(StatCategories.RESOURCES);
private static final ItemStat ADDITIONAL_EXPERIENCE = new DoubleStat("ADDITIONAL_EXPERIENCE", Material.EXPERIENCE_BOTTLE, private static final ItemStat ADDITIONAL_EXPERIENCE = new DoubleStat("ADDITIONAL_EXPERIENCE", Material.EXPERIENCE_BOTTLE,
"Additional Experience", new String[]{"Additional MMOCore main class experience in %."}); "Additional Experience", new String[]{"Additional MMOCore main class experience in %."}).setCategory(StatCategories.MISC_STATS);
/* /*
* Called when MMOItems loads * Called when MMOItems loads

View File

@ -0,0 +1,21 @@
package net.Indyuce.mmoitems.comp.mmocore.stat;
import net.Indyuce.mmocore.api.player.stats.StatType;
import net.Indyuce.mmocore.experience.Profession;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.type.DoubleStat;
import org.bukkit.Material;
import org.jetbrains.annotations.NotNull;
import java.util.Locale;
@HasCategory(cat = "mmocore_professions")
public class AdditionalProfessionExp extends DoubleStat {
public AdditionalProfessionExp(@NotNull Profession profession) {
super((StatType.ADDITIONAL_EXPERIENCE.name() + '_' + profession.getId()).replace('-', '_').replace(' ', '_').toUpperCase(Locale.ROOT),
Material.EXPERIENCE_BOTTLE,
profession.getName() + " Additional Experience",
new String[]{"Additional MMOCore profession " + profession.getName() + " experience in %."},
new String[]{"!block", "all"});
}
}

View File

@ -2,11 +2,13 @@ package net.Indyuce.mmoitems.comp.mmocore.stat;
import net.Indyuce.mmocore.api.player.attribute.PlayerAttribute; import net.Indyuce.mmocore.api.player.attribute.PlayerAttribute;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.DoubleData; import net.Indyuce.mmoitems.stat.data.DoubleData;
import net.Indyuce.mmoitems.stat.type.DoubleStat; import net.Indyuce.mmoitems.stat.type.DoubleStat;
import org.bukkit.Material; import org.bukkit.Material;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@HasCategory(cat = "mmocore_attributes")
public class ExtraAttribute extends DoubleStat { public class ExtraAttribute extends DoubleStat {
public ExtraAttribute(PlayerAttribute attribute) { public ExtraAttribute(PlayerAttribute attribute) {
super("ADDITIONAL_" + attribute.getId().toUpperCase().replace("-", "_"), Material.LIME_DYE, super("ADDITIONAL_" + attribute.getId().toUpperCase().replace("-", "_"), Material.LIME_DYE,

View File

@ -6,11 +6,13 @@ import net.Indyuce.mmocore.api.player.PlayerData;
import net.Indyuce.mmocore.api.player.attribute.PlayerAttribute; import net.Indyuce.mmocore.api.player.attribute.PlayerAttribute;
import net.Indyuce.mmoitems.api.player.RPGPlayer; import net.Indyuce.mmoitems.api.player.RPGPlayer;
import net.Indyuce.mmoitems.api.util.message.Message; import net.Indyuce.mmoitems.api.util.message.Message;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.type.RequiredLevelStat; import net.Indyuce.mmoitems.stat.type.RequiredLevelStat;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Sound; import org.bukkit.Sound;
@HasCategory(cat = "mmocore_attributes")
public class RequiredAttribute extends RequiredLevelStat { public class RequiredAttribute extends RequiredLevelStat {
private final PlayerAttribute attribute; private final PlayerAttribute attribute;

View File

@ -6,11 +6,13 @@ import net.Indyuce.mmocore.api.player.PlayerData;
import net.Indyuce.mmocore.experience.Profession; import net.Indyuce.mmocore.experience.Profession;
import net.Indyuce.mmoitems.api.player.RPGPlayer; import net.Indyuce.mmoitems.api.player.RPGPlayer;
import net.Indyuce.mmoitems.api.util.message.Message; import net.Indyuce.mmoitems.api.util.message.Message;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.type.RequiredLevelStat; import net.Indyuce.mmoitems.stat.type.RequiredLevelStat;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Sound; import org.bukkit.Sound;
@HasCategory(cat = "mmocore_professions")
public class RequiredProfession extends RequiredLevelStat { public class RequiredProfession extends RequiredLevelStat {
private final Profession profession; private final Profession profession;

View File

@ -5,6 +5,7 @@ import io.lumine.mythic.lib.api.item.ItemTag;
import net.Indyuce.mmoitems.MMOItems; import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.StringData; import net.Indyuce.mmoitems.stat.data.StringData;
import net.Indyuce.mmoitems.stat.type.GemStoneStat; import net.Indyuce.mmoitems.stat.type.GemStoneStat;
import net.Indyuce.mmoitems.stat.type.StringStat; import net.Indyuce.mmoitems.stat.type.StringStat;
@ -12,6 +13,7 @@ import org.bukkit.ChatColor;
import org.bukkit.Material; import org.bukkit.Material;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@HasCategory(cat = "misc")
public class AccessorySet extends StringStat implements GemStoneStat { public class AccessorySet extends StringStat implements GemStoneStat {
public AccessorySet() { public AccessorySet() {
super("ACCESSORY_SET", Material.OAK_SIGN, "Accessory Set (MMOInventory)", new String[] { "Used with MMOInventory's unique", "restriction to only allow one", "accessory to be equipped per set." }, new String[] { "!block", "all" }); super("ACCESSORY_SET", Material.OAK_SIGN, "Accessory Set (MMOInventory)", new String[] { "Used with MMOInventory's unique", "restriction to only allow one", "accessory to be equipped per set." }, new String[] { "!block", "all" });

View File

@ -16,9 +16,11 @@ import io.lumine.mythic.lib.damage.AttackMetadata;
import io.lumine.mythic.lib.damage.DamageMetadata; import io.lumine.mythic.lib.damage.DamageMetadata;
import io.lumine.mythic.lib.damage.DamageType; import io.lumine.mythic.lib.damage.DamageType;
import net.Indyuce.mmoitems.ItemStats; import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.player.PlayerData; import net.Indyuce.mmoitems.api.player.PlayerData;
import net.Indyuce.mmoitems.api.player.RPGPlayer; import net.Indyuce.mmoitems.api.player.RPGPlayer;
import net.Indyuce.mmoitems.api.util.message.Message; import net.Indyuce.mmoitems.api.util.message.Message;
import net.Indyuce.mmoitems.stat.category.StatCategory;
import net.Indyuce.mmoitems.stat.type.DoubleStat; import net.Indyuce.mmoitems.stat.type.DoubleStat;
import net.Indyuce.mmoitems.stat.type.ItemRestriction; import net.Indyuce.mmoitems.stat.type.ItemRestriction;
import net.Indyuce.mmoitems.stat.type.ItemStat; import net.Indyuce.mmoitems.stat.type.ItemStat;
@ -43,11 +45,15 @@ import java.util.Set;
public class HeroesHook implements RPGHandler, Listener, AttackHandler { public class HeroesHook implements RPGHandler, Listener, AttackHandler {
private final Map<SkillType, DamageType> damages = new HashMap<>(); private final Map<SkillType, DamageType> damages = new HashMap<>();
public static final ItemStat MAX_STAMINA = new DoubleStat("MAX_STAMINA", Material.EMERALD, "Max Stamina", new String[]{"Adds stamina to your max stamina bar"}), REQUIRED_SECONDARY_HERO_LEVEL = new RequiredSecondaryLevel(); public static final StatCategory STAT_CATEGORY = new StatCategory("HEROES", "Heroes", "Heroes");
public static final ItemStat MAX_STAMINA = new DoubleStat("MAX_STAMINA", Material.EMERALD, "Max Stamina", new String[]{"Adds stamina to your max stamina bar"}).setCategory(STAT_CATEGORY),
REQUIRED_SECONDARY_HERO_LEVEL = new RequiredSecondaryLevel().setCategory(STAT_CATEGORY);
public HeroesHook() { public HeroesHook() {
MythicLib.plugin.getDamage().registerHandler(this); MythicLib.plugin.getDamage().registerHandler(this);
MMOItems.plugin.getStats().registerCategory(STAT_CATEGORY);
damages.put(SkillType.ABILITY_PROPERTY_PHYSICAL, DamageType.PHYSICAL); damages.put(SkillType.ABILITY_PROPERTY_PHYSICAL, DamageType.PHYSICAL);
damages.put(SkillType.ABILITY_PROPERTY_MAGICAL, DamageType.MAGIC); damages.put(SkillType.ABILITY_PROPERTY_MAGICAL, DamageType.MAGIC);

View File

@ -1,22 +1,23 @@
package net.Indyuce.mmoitems.comp.rpg; package net.Indyuce.mmoitems.comp.rpg;
import net.Indyuce.mmoitems.MMOItems;
import org.bukkit.Material;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import com.gmail.nossr50.api.ExperienceAPI; import com.gmail.nossr50.api.ExperienceAPI;
import com.gmail.nossr50.api.exceptions.McMMOPlayerNotFoundException; import com.gmail.nossr50.api.exceptions.McMMOPlayerNotFoundException;
import com.gmail.nossr50.events.experience.McMMOPlayerLevelDownEvent; import com.gmail.nossr50.events.experience.McMMOPlayerLevelDownEvent;
import com.gmail.nossr50.events.experience.McMMOPlayerLevelUpEvent; import com.gmail.nossr50.events.experience.McMMOPlayerLevelUpEvent;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.player.PlayerData; import net.Indyuce.mmoitems.api.player.PlayerData;
import net.Indyuce.mmoitems.api.player.RPGPlayer; import net.Indyuce.mmoitems.api.player.RPGPlayer;
import net.Indyuce.mmoitems.stat.category.StatCategory;
import net.Indyuce.mmoitems.stat.type.DisableStat; import net.Indyuce.mmoitems.stat.type.DisableStat;
import net.Indyuce.mmoitems.stat.type.ItemStat; import net.Indyuce.mmoitems.stat.type.ItemStat;
import org.bukkit.Material;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
public class McMMOHook implements RPGHandler, Listener { public class McMMOHook implements RPGHandler, Listener {
public static final StatCategory STAT_CATEGORY = new StatCategory("MCMMO", "mcMMO", "mcMMO");
/** /**
* McMMO is a special plugin, it can be used along with other RPG plugins * McMMO is a special plugin, it can be used along with other RPG plugins
* like MMOCore. That stat must be registered even if McMMO is not the main * like MMOCore. That stat must be registered even if McMMO is not the main
@ -24,7 +25,11 @@ public class McMMOHook implements RPGHandler, Listener {
* not in the constructor of that class * not in the constructor of that class
*/ */
public static final ItemStat disableMcMMORepair = new DisableStat("MCMMO_REPAIR", Material.IRON_BLOCK, "Disable McMMO Repair", public static final ItemStat disableMcMMORepair = new DisableStat("MCMMO_REPAIR", Material.IRON_BLOCK, "Disable McMMO Repair",
"Players can't repair this with McMMO."); "Players can't repair this with McMMO.").setCategory(STAT_CATEGORY);
public McMMOHook() {
MMOItems.plugin.getStats().registerCategory(STAT_CATEGORY);
}
@EventHandler(ignoreCancelled = true) @EventHandler(ignoreCancelled = true)
public void a(McMMOPlayerLevelUpEvent event) { public void a(McMMOPlayerLevelUpEvent event) {

View File

@ -6,11 +6,14 @@ import io.lumine.mythic.lib.element.Element;
import io.lumine.mythic.lib.util.annotation.BackwardsCompatibility; import io.lumine.mythic.lib.util.annotation.BackwardsCompatibility;
import net.Indyuce.mmoitems.ItemStats; import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.MMOItems; import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.StatCategories;
import net.Indyuce.mmoitems.api.ConfigFile; import net.Indyuce.mmoitems.api.ConfigFile;
import net.Indyuce.mmoitems.api.Type; import net.Indyuce.mmoitems.api.Type;
import net.Indyuce.mmoitems.stat.annotation.DeprecatedStat;
import net.Indyuce.mmoitems.stat.annotation.HasCategory; import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.category.StatCategory; import net.Indyuce.mmoitems.stat.category.StatCategory;
import net.Indyuce.mmoitems.stat.data.random.RandomStatData;
import net.Indyuce.mmoitems.stat.legacy.LegacyConfigAdapter;
import net.Indyuce.mmoitems.stat.legacy.LegacyConfigAdapters;
import net.Indyuce.mmoitems.stat.type.*; import net.Indyuce.mmoitems.stat.type.*;
import net.Indyuce.mmoitems.util.ElementStatType; import net.Indyuce.mmoitems.util.ElementStatType;
import org.apache.commons.lang.Validate; import org.apache.commons.lang.Validate;
@ -23,6 +26,8 @@ import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Modifier; import java.lang.reflect.Modifier;
import java.util.*; import java.util.*;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.logging.Level; import java.util.logging.Level;
public class StatManager { public class StatManager {
@ -37,6 +42,9 @@ public class StatManager {
@BackwardsCompatibility(version = "not_specified") @BackwardsCompatibility(version = "not_specified")
private final Map<String, ItemStat<?, ?>> legacyAliases = new HashMap<>(); private final Map<String, ItemStat<?, ?>> legacyAliases = new HashMap<>();
@BackwardsCompatibility(version = "6.10.1")
private final Map<String, LegacyConfigAdapter> legacyConfigAdapters = new HashMap<>();
/* /*
* These lists are sets of stats collected when the stats are registered for * These lists are sets of stats collected when the stats are registered for
* the first time to make their access easier. Check the classes * the first time to make their access easier. Check the classes
@ -54,33 +62,38 @@ public class StatManager {
public void loadBuiltins() { public void loadBuiltins() {
// Builtin categories // Builtin categories
for (Field field : StatCategory.class.getFields()) forEachField(StatCategories.class, StatCategory.class, this::registerCategory, "Couldn't register category called '%s': %s");
try {
if (Modifier.isStatic(field.getModifiers()) // Load builtin config adapters
&& Modifier.isFinal(field.getModifiers()) forEachField(LegacyConfigAdapters.class, LegacyConfigAdapter.class, this::registerLegacyConfigAdapter, "Internal error '%s': %s");
&& field.get(null) instanceof StatCategory)
registerCategory((StatCategory) field.get(null));
} catch (IllegalArgumentException | IllegalAccessException exception) {
MMOItems.plugin.getLogger().log(Level.SEVERE, String.format("Couldn't register category called '%s': %s", field.getName(), exception.getMessage()));
}
// Load builtin stats // Load builtin stats
for (Field field : ItemStats.class.getFields()) forEachField(ItemStats.class, ItemStat.class, this::register, "Couldn't register stat called '%s': %s");
try {
if (Modifier.isStatic(field.getModifiers())
&& Modifier.isFinal(field.getModifiers())
&& field.get(null) instanceof ItemStat
&& field.getAnnotation(DeprecatedStat.class) == null)
register((ItemStat<?, ?>) field.get(null));
} catch (IllegalArgumentException | IllegalAccessException exception) {
MMOItems.plugin.getLogger().log(Level.SEVERE, String.format("Couldn't register stat called '%s': %s", field.getName(), exception.getMessage()));
}
// Custom stats // Custom stats
loadCustomStats(); loadCustomStats();
} }
// TODO refactor with stat categories private <T> void forEachField(@NotNull Class<?> builtinRegistry,
@NotNull Class<T> objectClass,
@NotNull Consumer<T> action,
@NotNull String errorMessage) {
for (Field field : builtinRegistry.getFields())
try {
Object fieldValue;
if (Modifier.isStatic(field.getModifiers())
// Modifier is static final
&& Modifier.isFinal(field.getModifiers())
// Is instance of object class
&& objectClass.isInstance(fieldValue = field.get(null))
// Not deprecated
&& field.getAnnotation(Deprecated.class) == null)
action.accept((T) fieldValue);
} catch (Exception exception) {
MMOItems.plugin.getLogger().log(Level.SEVERE, String.format(errorMessage, field.getName(), exception.getMessage()));
}
}
public void reload(boolean cleanFirst) { public void reload(boolean cleanFirst) {
// Clean fictive numeric stats before // Clean fictive numeric stats before
@ -88,20 +101,24 @@ public class StatManager {
numericStats.removeIf(stat -> stat instanceof FakeElementalStat); // temporary fix, this is for elements TODO improve numericStats.removeIf(stat -> stat instanceof FakeElementalStat); // temporary fix, this is for elements TODO improve
// Register elemental stats // Register elemental stats
loadElements(); registerElementStats();
// Load stat translation objects (nothing to do with stats) // Load stat translation objects (nothing to do with stats)
final ConfigurationSection statOptions = new ConfigFile("/language", "stats").getConfig(); final ConfigurationSection statOptions = new ConfigFile("/language", "stats").getConfig();
for (ItemStat<?, ?> stat : getAll()) for (ItemStat<?, ?> stat : getAll())
try { try {
@Nullable Object object = statOptions.get(stat.getPath()); stat.readTranslationFile(statOptions);
if (object == null) object = statOptions.get(stat.getLegacyTranslationPath());
stat.loadConfiguration(statOptions, object != null ? object : "<TranslationNotFound:" + stat.getPath() + ">");
} catch (RuntimeException exception) { } catch (RuntimeException exception) {
MMOItems.plugin.getLogger().log(Level.SEVERE, "Could not load translation info for stat '" + stat.getId() + "': " + exception.getMessage()); MMOItems.plugin.getLogger().log(Level.SEVERE, "Could not load translation info for stat '" + stat.getId() + "': " + exception.getMessage());
} }
} }
private void registerElementStats() {
for (ElementStatType type : ElementStatType.values())
for (Element element : MythicLib.plugin.getElements().getAll())
numericStats.add(new FakeElementalStat(element, type));
}
/** /**
* Load custom stats * Load custom stats
*/ */
@ -110,24 +127,32 @@ public class StatManager {
ConfigFile config = new ConfigFile("custom-stats"); ConfigFile config = new ConfigFile("custom-stats");
ConfigurationSection section = config.getConfig().getConfigurationSection("custom-stats"); ConfigurationSection section = config.getConfig().getConfigurationSection("custom-stats");
Validate.notNull(section, "Custom stats section is null"); Validate.notNull(section, "Custom stats section is null");
section.getKeys(true).stream().filter(section::isConfigurationSection).map(section::getConfigurationSection).filter(Objects::nonNull).forEach(this::registerCustomStat); section.getKeys(true).stream()
} .filter(section::isConfigurationSection)
.map(section::getConfigurationSection)
/** .filter(Objects::nonNull)
* Register all MythicLib elements as stats .forEach(this::registerCustomStat);
* <p>
* TODO refactor with stat categories
*/
public void loadElements() {
for (ElementStatType type : ElementStatType.values())
for (Element element : MythicLib.plugin.getElements().getAll())
numericStats.add(new FakeElementalStat(element, type));
} }
public void registerCategory(@NotNull StatCategory category) { public void registerCategory(@NotNull StatCategory category) {
Validate.isTrue(!categories.containsKey(category.getId()), "A category with ID '" + category.getId() + "' already exists");
categories.put(category.getId(), category); categories.put(category.getId(), category);
} }
public void registerLegacyConfigAdapter(@NotNull LegacyConfigAdapter adapter) {
legacyConfigAdapters.put(adapter.getKey(), adapter);
}
@BackwardsCompatibility(version = "6.10.1")
public boolean adaptLegacyConfig(@NotNull Map<ItemStat, RandomStatData> data,
@NotNull String configKey,
@NotNull Function<String, Object> supplier) {
final LegacyConfigAdapter adapter = legacyConfigAdapters.get(UtilityMethods.enumName(configKey).toLowerCase()); // Snake case
final boolean result = adapter != null;
if (result) adapter.adapt(data, supplier.apply(configKey));
return result;
}
@NotNull @NotNull
public StatCategory getCategory(@NotNull String id) { public StatCategory getCategory(@NotNull String id) {
return Objects.requireNonNull(categories.get(id), "No stat category found with ID '" + id + "'"); return Objects.requireNonNull(categories.get(id), "No stat category found with ID '" + id + "'");
@ -187,7 +212,7 @@ public class StatManager {
ItemStat<?, ?> stat = stats.get(id); ItemStat<?, ?> stat = stats.get(id);
if (stat != null) return stat; if (stat != null) return stat;
// Numeric registry (see to-do) // Numeric registry TODO remove this useless registry once elements are properly implemented
stat = numericStats.stream().filter(doubleStat -> doubleStat.getId().equals(id)).findFirst().orElse(null); stat = numericStats.stream().filter(doubleStat -> doubleStat.getId().equals(id)).findFirst().orElse(null);
if (stat != null) return stat; if (stat != null) return stat;
@ -231,6 +256,9 @@ public class StatManager {
HasCategory statCatAnnot = stat.getClass().getAnnotation(HasCategory.class); HasCategory statCatAnnot = stat.getClass().getAnnotation(HasCategory.class);
if (statCatAnnot != null) stat.setCategory(getCategory(UtilityMethods.enumName(statCatAnnot.cat()))); if (statCatAnnot != null) stat.setCategory(getCategory(UtilityMethods.enumName(statCatAnnot.cat())));
if (stat.getCategory() == null)
MMOItems.plugin.getLogger().log(Level.WARNING, "Registered stat " + stat.getName() + " with no category");
/* /*
* Cache stat for every type which may have this stat. Really important * Cache stat for every type which may have this stat. Really important
* otherwise the stat will NOT be used anywhere in the plugin. This * otherwise the stat will NOT be used anywhere in the plugin. This
@ -238,8 +266,32 @@ public class StatManager {
* but since stats can be registered after types are loaded, we must * but since stats can be registered after types are loaded, we must
* take it into account * take it into account
*/ */
if (MMOItems.plugin.getTypes() != null) if (MMOItems.plugin.getTypes() != null) for (Type itemType : MMOItems.plugin.getTypes().getAll())
MMOItems.plugin.getTypes().getAll().stream().filter(stat::isCompatible).forEach(type -> type.getAvailableStats().add(stat)); if (stat.isCompatible(itemType)) itemType.getAvailableStats().add(stat);
}
/**
* This method does NOT
*
* @param stat
*/
private void unregister(@NotNull ItemStat<?, ?> stat) {
// Unregister from main stat registry
stats.remove(stat.getId());
// Unregister aliases
for (String alias : stat.getAliases()) legacyAliases.remove(alias);
// Unregister other registries
numericStats.remove(stat);
itemRestrictions.remove(stat);
consumableActions.remove(stat);
playerConsumables.remove(stat);
// Remove stat from all type stat caches
for (Type itemType : MMOItems.plugin.getTypes().getAll())
itemType.getAvailableStats().remove(stat);
} }
private void registerCustomStat(@NotNull ConfigurationSection section) { private void registerCustomStat(@NotNull ConfigurationSection section) {
@ -278,6 +330,7 @@ public class StatManager {
// Create a new stat instance // Create a new stat instance
try { try {
ItemStat<?, ?> stat = statClass.getConstructor(String.class, Material.class, String.class, String[].class, String[].class, Material[].class).newInstance(statId, Material.PAPER, name, lore, new String[]{"!miscellaneous", "!block", "all"}, new Material[0]); ItemStat<?, ?> stat = statClass.getConstructor(String.class, Material.class, String.class, String[].class, String[].class, Material[].class).newInstance(statId, Material.PAPER, name, lore, new String[]{"!miscellaneous", "!block", "all"}, new Material[0]);
stat.setCategory(StatCategories.CUSTOM);
register(stat); register(stat);
} catch (InstantiationException | IllegalAccessException | InvocationTargetException | } catch (InstantiationException | IllegalAccessException | InvocationTargetException |
NoSuchMethodException e) { NoSuchMethodException e) {
@ -302,4 +355,9 @@ public class StatManager {
public void loadInternalStats() { public void loadInternalStats() {
loadBuiltins(); loadBuiltins();
} }
@Deprecated
public void loadElements() {
registerElementStats();
}
} }

View File

@ -60,9 +60,10 @@ public class TypeManager {
} }
/* /*
* caches all the stats which the type can have to reduce future * Caches all the stats which the type can have to reduce future
* both item generation (and GUI) calculations. probably the thing * both item generation (and GUI) calculations. This is a great
* which takes the most time when loading item types. * optimisation when loading items, it is less important when
* displaying the item editor UI
*/ */
type.getAvailableStats().clear(); type.getAvailableStats().clear();
MMOItems.plugin.getStats().getAll().stream().filter(stat -> stat.isCompatible(type)).forEach(stat -> type.getAvailableStats().add(stat)); MMOItems.plugin.getStats().getAll().stream().filter(stat -> stat.isCompatible(type)).forEach(stat -> type.getAvailableStats().add(stat));

View File

@ -16,6 +16,7 @@ import net.Indyuce.mmoitems.api.util.NumericStatFormula.FormulaSaveOption;
import net.Indyuce.mmoitems.gui.edition.AbilityListEdition; import net.Indyuce.mmoitems.gui.edition.AbilityListEdition;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.skill.RegisteredSkill; import net.Indyuce.mmoitems.skill.RegisteredSkill;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.AbilityData; import net.Indyuce.mmoitems.stat.data.AbilityData;
import net.Indyuce.mmoitems.stat.data.AbilityListData; import net.Indyuce.mmoitems.stat.data.AbilityListData;
import net.Indyuce.mmoitems.stat.data.random.RandomAbilityData; import net.Indyuce.mmoitems.stat.data.random.RandomAbilityData;
@ -33,6 +34,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
@HasCategory(cat = "abilities")
public class Abilities extends ItemStat<RandomAbilityListData, AbilityListData> { public class Abilities extends ItemStat<RandomAbilityListData, AbilityListData> {
public Abilities() { public Abilities() {
super("ABILITY", Material.BLAZE_POWDER, "Item Abilities", super("ABILITY", Material.BLAZE_POWDER, "Item Abilities",
@ -57,30 +59,33 @@ public class Abilities extends ItemStat<RandomAbilityListData, AbilityListData>
@BackwardsCompatibility(version = "6.10") @BackwardsCompatibility(version = "6.10")
@Override @Override
public void loadConfiguration(@NotNull ConfigurationSection legacyLanguageFile, @NotNull Object configObject) { public void readTranslationFile(@NotNull ConfigurationSection translationFile) {
Object configObject = translationFile.get("ability");
// COMPATIBILITY CODE FOR MI <6.10 // Up to date code
if (!(configObject instanceof ConfigurationSection)) { if (configObject instanceof ConfigurationSection) {
generalFormat = legacyLanguageFile.getString("ability-format"); final ConfigurationSection config = (ConfigurationSection) configObject;
modifierIfAny = "\n"; generalFormat = config.getString("general-format");
modifierNewLine = "\n"; modifierIfAny = config.getString("modifier-if-any", ""); // Backwards compatibility
modifierForEach = legacyLanguageFile.getString("ability-modifier"); modifierNewLine = "\n" + config.getString("modifier-new-line", ""); // Backwards compatibility
modifierSplitter = ""; modifierForEach = config.getString("modifier-foreach");
abilitySplitter = legacyLanguageFile.getString("ability-splitter"); modifierSplitter = config.getString("modifier-splitter");
useAbilitySplitter = abilitySplitter != null && !abilitySplitter.isEmpty(); abilitySplitter = config.getString("ability-splitter.format");
modifiersPerLine = 1; useAbilitySplitter = config.getBoolean("ability-splitter.enabled");
return; modifiersPerLine = config.getInt("modifiers-per-line");
} }
final ConfigurationSection config = (ConfigurationSection) configObject; // COMPATIBILITY CODE FOR MI <6.10
generalFormat = config.getString("general-format"); else {
modifierIfAny = config.getString("modifier-if-any", ""); // Backwards compatibility generalFormat = translationFile.getString("ability-format");
modifierNewLine = "\n" + config.getString("modifier-new-line", ""); // Backwards compatibility modifierIfAny = "\n";
modifierForEach = config.getString("modifier-foreach"); modifierNewLine = "\n";
modifierSplitter = config.getString("modifier-splitter"); modifierForEach = translationFile.getString("ability-modifier");
abilitySplitter = config.getString("ability-splitter.format"); modifierSplitter = "";
useAbilitySplitter = config.getBoolean("ability-splitter.enabled"); abilitySplitter = translationFile.getString("ability-splitter");
modifiersPerLine = config.getInt("modifiers-per-line"); useAbilitySplitter = abilitySplitter != null && !abilitySplitter.isEmpty();
modifiersPerLine = 1;
}
} }
@Override @Override
@ -126,11 +131,6 @@ public class Abilities extends ItemStat<RandomAbilityListData, AbilityListData>
item.addItemTag(getAppliedNBT(data)); item.addItemTag(getAppliedNBT(data));
} }
@Override
public String getLegacyTranslationPath() {
return "ability-format";
}
@NotNull @NotNull
@Override @Override
public ArrayList<ItemTag> getAppliedNBT(@NotNull AbilityListData data) { public ArrayList<ItemTag> getAppliedNBT(@NotNull AbilityListData data) {

View File

@ -8,6 +8,7 @@ import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.StringData; import net.Indyuce.mmoitems.stat.data.StringData;
import net.Indyuce.mmoitems.stat.type.StringStat; import net.Indyuce.mmoitems.stat.type.StringStat;
import org.bukkit.Material; import org.bukkit.Material;
@ -15,6 +16,7 @@ import org.jetbrains.annotations.NotNull;
import java.util.ArrayList; import java.util.ArrayList;
@HasCategory(cat = "abilities")
public class ActionLeftClick extends StringStat { public class ActionLeftClick extends StringStat {
public ActionLeftClick() { public ActionLeftClick() {
super("ON_LEFT_CLICK", Material.COMMAND_BLOCK_MINECART, "Left Click Action", new String[]{"ID of skill ran when left clicking. When used,", "The item will naturally apply item costs like", "mana, stamina, cooldown. This option overrides the", "script provided by the item type."}, new String[]{"weapon"}); super("ON_LEFT_CLICK", Material.COMMAND_BLOCK_MINECART, "Left Click Action", new String[]{"ID of skill ran when left clicking. When used,", "The item will naturally apply item costs like", "mana, stamina, cooldown. This option overrides the", "script provided by the item type."}, new String[]{"weapon"});

View File

@ -6,11 +6,13 @@ import io.lumine.mythic.lib.api.item.ItemTag;
import net.Indyuce.mmoitems.MMOItems; import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.StringData; import net.Indyuce.mmoitems.stat.data.StringData;
import net.Indyuce.mmoitems.stat.type.StringStat; import net.Indyuce.mmoitems.stat.type.StringStat;
import org.bukkit.Material; import org.bukkit.Material;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@HasCategory(cat = "abilities")
public class ActionRightClick extends StringStat { public class ActionRightClick extends StringStat {
public ActionRightClick() { public ActionRightClick() {
super("ON_RIGHT_CLICK", Material.COMMAND_BLOCK_MINECART, "Right Click Action", new String[]{"ID of skill ran when right clicking. When used,", "The item will naturally apply item costs like", "mana, stamina, cooldown. This option overrides the", "script provided by the item type."}, new String[]{"weapon"}); super("ON_RIGHT_CLICK", Material.COMMAND_BLOCK_MINECART, "Right Click Action", new String[]{"ID of skill ran when right clicking. When used,", "The item will naturally apply item costs like", "mana, stamina, cooldown. This option overrides the", "script provided by the item type."}, new String[]{"weapon"});

View File

@ -5,6 +5,7 @@ import io.lumine.mythic.lib.api.item.NBTItem;
import io.lumine.mythic.lib.api.item.SupportedNBTTagValues; import io.lumine.mythic.lib.api.item.SupportedNBTTagValues;
import io.lumine.mythic.lib.api.util.ui.SilentNumbers; import io.lumine.mythic.lib.api.util.ui.SilentNumbers;
import net.Indyuce.mmoitems.api.player.RPGPlayer; import net.Indyuce.mmoitems.api.player.RPGPlayer;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.StringData; import net.Indyuce.mmoitems.stat.data.StringData;
import net.Indyuce.mmoitems.stat.type.ChooseStat; import net.Indyuce.mmoitems.stat.type.ChooseStat;
import net.Indyuce.mmoitems.stat.type.GemStoneStat; import net.Indyuce.mmoitems.stat.type.GemStoneStat;
@ -21,6 +22,7 @@ import java.util.ArrayList;
/** /**
* @author Gunging * @author Gunging
*/ */
@HasCategory(cat = "requirement")
public class Amphibian extends ChooseStat implements ItemRestriction, GemStoneStat { public class Amphibian extends ChooseStat implements ItemRestriction, GemStoneStat {
public static final StatChoice public static final StatChoice
NORMAL = new StatChoice("NORMAL", "No liquids dependency"), NORMAL = new StatChoice("NORMAL", "No liquids dependency"),

View File

@ -13,6 +13,7 @@ import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.gui.edition.ArrowParticlesEdition; import net.Indyuce.mmoitems.gui.edition.ArrowParticlesEdition;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.ArrowParticlesData; import net.Indyuce.mmoitems.stat.data.ArrowParticlesData;
import net.Indyuce.mmoitems.stat.data.type.StatData; import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.ItemStat; import net.Indyuce.mmoitems.stat.type.ItemStat;
@ -30,6 +31,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
@HasCategory(cat = "misc")
public class ArrowParticles extends ItemStat<ArrowParticlesData, ArrowParticlesData> { public class ArrowParticles extends ItemStat<ArrowParticlesData, ArrowParticlesData> {
public ArrowParticles() { public ArrowParticles() {
super("ARROW_PARTICLES", Material.SPECTRAL_ARROW, "Arrow Particles", super("ARROW_PARTICLES", Material.SPECTRAL_ARROW, "Arrow Particles",

View File

@ -14,6 +14,7 @@ import net.Indyuce.mmoitems.api.interaction.projectile.ArrowPotionEffectArrayIte
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.PotionEffectData; import net.Indyuce.mmoitems.stat.data.PotionEffectData;
import net.Indyuce.mmoitems.stat.data.PotionEffectListData; import net.Indyuce.mmoitems.stat.data.PotionEffectListData;
import net.Indyuce.mmoitems.stat.data.random.RandomPotionEffectData; import net.Indyuce.mmoitems.stat.data.random.RandomPotionEffectData;
@ -33,6 +34,7 @@ import org.jetbrains.annotations.Nullable;
import java.util.*; import java.util.*;
@HasCategory(cat = "misc")
public class ArrowPotionEffects extends ItemStat<RandomPotionEffectListData, PotionEffectListData> { public class ArrowPotionEffects extends ItemStat<RandomPotionEffectListData, PotionEffectListData> {
public ArrowPotionEffects() { public ArrowPotionEffects() {
super("ARROW_POTION_EFFECTS", Material.TIPPED_ARROW, "Arrow Potion Effects", super("ARROW_POTION_EFFECTS", Material.TIPPED_ARROW, "Arrow Potion Effects",

View File

@ -8,6 +8,7 @@ import net.Indyuce.mmoitems.api.util.NumericStatFormula;
import net.Indyuce.mmoitems.stat.annotation.HasCategory; import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.DoubleData; import net.Indyuce.mmoitems.stat.data.DoubleData;
import net.Indyuce.mmoitems.stat.type.DoubleStat; import net.Indyuce.mmoitems.stat.type.DoubleStat;
import net.Indyuce.mmoitems.stat.type.TemplateOption;
import org.bukkit.Material; import org.bukkit.Material;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@ -18,19 +19,15 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
@HasCategory(cat = "template_option") @HasCategory(cat = "template_option")
public class BrowserDisplayIDX extends DoubleStat { public class BrowserDisplayIDX extends DoubleStat implements TemplateOption {
public BrowserDisplayIDX() { public BrowserDisplayIDX() {
super("BROWSER_IDX", Material.GHAST_TEAR, "Browser Index", new String[] {"Used to display similar items together,", "neatly in the GUI \u00a7a/mmoitems browse", "", "Items with the same index are grouped."}, new String[0]); super("BROWSER_IDX",
Material.GHAST_TEAR,
"Browser Index",
new String[]{"Used to display similar items together,", "neatly in the GUI \u00a7a/mmoitems browse", "", "Items with the same index are grouped."},
null);
} }
@Override
public void whenApplied(@NotNull ItemStackBuilder item, @NotNull DoubleData data) {
// Does not participate in actual items
}
@Override
public void whenLoaded(@NotNull ReadMMOItem mmoitem) { }
/** /**
* They will be ordered. * They will be ordered.
* *

View File

@ -12,6 +12,7 @@ import net.Indyuce.mmoitems.api.edition.StatEdition;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.annotation.VersionDependant; import net.Indyuce.mmoitems.stat.annotation.VersionDependant;
import net.Indyuce.mmoitems.stat.data.StringListData; import net.Indyuce.mmoitems.stat.data.StringListData;
import net.Indyuce.mmoitems.stat.data.type.StatData; import net.Indyuce.mmoitems.stat.data.type.StatData;
@ -29,6 +30,7 @@ import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@HasCategory(cat = "misc")
@VersionDependant(version = {1, 20, 6}) @VersionDependant(version = {1, 20, 6})
public class CanBreak extends ItemStat<StringListData, StringListData> { public class CanBreak extends ItemStat<StringListData, StringListData> {
public CanBreak() { public CanBreak() {

View File

@ -2,6 +2,7 @@ package net.Indyuce.mmoitems.stat;
import java.util.List; import java.util.List;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Material; import org.bukkit.Material;
@ -23,6 +24,7 @@ import net.Indyuce.mmoitems.stat.type.ConsumableItemInteraction;
import io.lumine.mythic.lib.api.item.NBTItem; import io.lumine.mythic.lib.api.item.NBTItem;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@HasCategory(cat = "consumables")
public class CanDeconstruct extends BooleanStat implements ConsumableItemInteraction { public class CanDeconstruct extends BooleanStat implements ConsumableItemInteraction {
public CanDeconstruct() { public CanDeconstruct() {
super("CAN_DECONSTRUCT", Material.PAPER, "Can Deconstruct?", super("CAN_DECONSTRUCT", Material.PAPER, "Can Deconstruct?",

View File

@ -14,6 +14,7 @@ import net.Indyuce.mmoitems.api.item.mmoitem.MMOItem;
import net.Indyuce.mmoitems.api.item.template.MMOItemTemplate; import net.Indyuce.mmoitems.api.item.template.MMOItemTemplate;
import net.Indyuce.mmoitems.api.player.PlayerData; import net.Indyuce.mmoitems.api.player.PlayerData;
import net.Indyuce.mmoitems.api.util.message.Message; import net.Indyuce.mmoitems.api.util.message.Message;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.ParticleData; import net.Indyuce.mmoitems.stat.data.ParticleData;
import net.Indyuce.mmoitems.stat.data.SkullTextureData; import net.Indyuce.mmoitems.stat.data.SkullTextureData;
import net.Indyuce.mmoitems.stat.type.BooleanStat; import net.Indyuce.mmoitems.stat.type.BooleanStat;
@ -32,6 +33,7 @@ import org.jetbrains.annotations.NotNull;
import java.util.Objects; import java.util.Objects;
import java.util.logging.Level; import java.util.logging.Level;
@HasCategory(cat = "consumables")
public class CanDeskin extends BooleanStat implements ConsumableItemInteraction { public class CanDeskin extends BooleanStat implements ConsumableItemInteraction {
public CanDeskin() { public CanDeskin() {
super("CAN_DESKIN", Material.LEATHER, "Can Deskin?", super("CAN_DESKIN", Material.LEATHER, "Can Deskin?",

View File

@ -1,5 +1,6 @@
package net.Indyuce.mmoitems.stat; package net.Indyuce.mmoitems.stat;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Material; import org.bukkit.Material;
@ -19,6 +20,7 @@ import net.Indyuce.mmoitems.stat.type.ConsumableItemInteraction;
import io.lumine.mythic.lib.api.item.NBTItem; import io.lumine.mythic.lib.api.item.NBTItem;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@HasCategory(cat = "consumables")
public class CanIdentify extends BooleanStat implements ConsumableItemInteraction { public class CanIdentify extends BooleanStat implements ConsumableItemInteraction {
public CanIdentify() { public CanIdentify() {
super("CAN_IDENTIFY", Material.PAPER, "Can Identify?", super("CAN_IDENTIFY", Material.PAPER, "Can Identify?",

View File

@ -2,6 +2,7 @@ package net.Indyuce.mmoitems.stat;
import io.lumine.mythic.lib.api.item.NBTItem; import io.lumine.mythic.lib.api.item.NBTItem;
import net.Indyuce.mmoitems.ItemStats; import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.util.MMOUtils; import net.Indyuce.mmoitems.util.MMOUtils;
import net.Indyuce.mmoitems.api.Type; import net.Indyuce.mmoitems.api.Type;
import net.Indyuce.mmoitems.api.interaction.Consumable; import net.Indyuce.mmoitems.api.interaction.Consumable;
@ -29,6 +30,7 @@ import java.util.List;
* *
* @author Gunging * @author Gunging
*/ */
@HasCategory(cat = "consumables")
public class CanUnsocket extends BooleanStat implements ConsumableItemInteraction { public class CanUnsocket extends BooleanStat implements ConsumableItemInteraction {
public CanUnsocket() { public CanUnsocket() {
super("CAN_UNSOCKET", Material.PAPER, "Can Unsocket?", super("CAN_UNSOCKET", Material.PAPER, "Can Unsocket?",

View File

@ -9,6 +9,7 @@ import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.gui.edition.CommandListEdition; import net.Indyuce.mmoitems.gui.edition.CommandListEdition;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.CommandData; import net.Indyuce.mmoitems.stat.data.CommandData;
import net.Indyuce.mmoitems.stat.data.CommandListData; import net.Indyuce.mmoitems.stat.data.CommandListData;
import net.Indyuce.mmoitems.stat.type.ItemStat; import net.Indyuce.mmoitems.stat.type.ItemStat;
@ -25,6 +26,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
@HasCategory(cat = "abilities")
public class Commands extends ItemStat<CommandListData, CommandListData> { public class Commands extends ItemStat<CommandListData, CommandListData> {
private static final int MAXIMUM_COMMANDS = 15; private static final int MAXIMUM_COMMANDS = 15;

View File

@ -11,6 +11,7 @@ import net.Indyuce.mmoitems.api.edition.StatEdition;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.StringListData; import net.Indyuce.mmoitems.stat.data.StringListData;
import net.Indyuce.mmoitems.stat.data.type.StatData; import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.ItemStat; import net.Indyuce.mmoitems.stat.type.ItemStat;
@ -26,6 +27,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
@HasCategory(cat = "skins")
public class CompatibleIds extends ItemStat<StringListData, StringListData> { public class CompatibleIds extends ItemStat<StringListData, StringListData> {
public CompatibleIds() { public CompatibleIds() {
super("COMPATIBLE_IDS", Material.COMMAND_BLOCK, "Compatible IDs", super("COMPATIBLE_IDS", Material.COMMAND_BLOCK, "Compatible IDs",

View File

@ -12,6 +12,7 @@ import net.Indyuce.mmoitems.api.edition.StatEdition;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.StringListData; import net.Indyuce.mmoitems.stat.data.StringListData;
import net.Indyuce.mmoitems.stat.data.type.StatData; import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.ItemStat; import net.Indyuce.mmoitems.stat.type.ItemStat;
@ -27,6 +28,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
@HasCategory(cat = "skins")
public class CompatibleMaterials extends ItemStat<StringListData, StringListData> { public class CompatibleMaterials extends ItemStat<StringListData, StringListData> {
public CompatibleMaterials() { public CompatibleMaterials() {

View File

@ -11,6 +11,7 @@ import net.Indyuce.mmoitems.api.edition.StatEdition;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.StringListData; import net.Indyuce.mmoitems.stat.data.StringListData;
import net.Indyuce.mmoitems.stat.data.type.StatData; import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.ItemStat; import net.Indyuce.mmoitems.stat.type.ItemStat;
@ -26,6 +27,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
@HasCategory(cat = "skins")
public class CompatibleTypes extends ItemStat<StringListData, StringListData> { public class CompatibleTypes extends ItemStat<StringListData, StringListData> {
public CompatibleTypes() { public CompatibleTypes() {
super("COMPATIBLE_TYPES", Material.COMMAND_BLOCK, "Compatible Types", super("COMPATIBLE_TYPES", Material.COMMAND_BLOCK, "Compatible Types",

View File

@ -14,10 +14,12 @@ import net.Indyuce.mmoitems.gui.edition.recipe.RecipeTypeListGUI;
import net.Indyuce.mmoitems.gui.edition.recipe.button.RecipeButtonAction; import net.Indyuce.mmoitems.gui.edition.recipe.button.RecipeButtonAction;
import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeEditorGUI; import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeEditorGUI;
import net.Indyuce.mmoitems.gui.edition.recipe.interpreter.RMG_RecipeInterpreter; import net.Indyuce.mmoitems.gui.edition.recipe.interpreter.RMG_RecipeInterpreter;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.StringData; import net.Indyuce.mmoitems.stat.data.StringData;
import net.Indyuce.mmoitems.stat.data.random.RandomStatData; import net.Indyuce.mmoitems.stat.data.random.RandomStatData;
import net.Indyuce.mmoitems.stat.data.type.StatData; import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.ItemStat; import net.Indyuce.mmoitems.stat.type.ItemStat;
import net.Indyuce.mmoitems.stat.type.TemplateOption;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
@ -30,7 +32,8 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
public class Crafting extends ItemStat<RandomStatData<StatData>, StatData> { @HasCategory(cat = "misc")
public class Crafting extends ItemStat<RandomStatData<StatData>, StatData> implements TemplateOption {
public Crafting() { public Crafting() {
super("CRAFTING", Material.CRAFTING_TABLE, "Crafting", super("CRAFTING", Material.CRAFTING_TABLE, "Crafting",
new String[] { "The crafting recipes of your item.", "Changing a recipe requires &o/mi reload recipes&7." }, new String[0]); new String[] { "The crafting recipes of your item.", "Changing a recipe requires &o/mi reload recipes&7." }, new String[0]);

View File

@ -1,14 +1,19 @@
package net.Indyuce.mmoitems.stat; package net.Indyuce.mmoitems.stat;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.StringData;
import net.Indyuce.mmoitems.stat.type.GemStoneStat; import net.Indyuce.mmoitems.stat.type.GemStoneStat;
import net.Indyuce.mmoitems.stat.type.StringStat; import net.Indyuce.mmoitems.stat.type.StringStat;
import net.Indyuce.mmoitems.stat.type.TemplateOption; import net.Indyuce.mmoitems.stat.type.TemplateOption;
import org.bukkit.Material; import org.bukkit.Material;
@HasCategory(cat = "template_option")
public class CraftingPermission extends StringStat implements TemplateOption, GemStoneStat { public class CraftingPermission extends StringStat implements TemplateOption, GemStoneStat {
public CraftingPermission() { public CraftingPermission() {
super("CRAFT_PERMISSION", Material.OAK_SIGN, "Crafting Recipe Permission", super("CRAFT_PERMISSION",
Material.OAK_SIGN,
"Crafting Recipe Permission",
new String[]{"The permission needed to craft this item.", "Changing this value requires &o/mi reload recipes&7."}, new String[]{"The permission needed to craft this item.", "Changing this value requires &o/mi reload recipes&7."},
new String[0]); null);
} }
} }

View File

@ -2,6 +2,7 @@ package net.Indyuce.mmoitems.stat;
import io.lumine.mythic.lib.api.item.ItemTag; import io.lumine.mythic.lib.api.item.ItemTag;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.DoubleData; import net.Indyuce.mmoitems.stat.data.DoubleData;
import net.Indyuce.mmoitems.stat.data.type.StatData; import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.DoubleStat; import net.Indyuce.mmoitems.stat.type.DoubleStat;
@ -21,6 +22,7 @@ import org.jetbrains.annotations.NotNull;
* *
* @author indyuce * @author indyuce
*/ */
@HasCategory(cat = "durability")
public class CustomDurability extends DoubleStat implements InternalStat { public class CustomDurability extends DoubleStat implements InternalStat {
public CustomDurability() { public CustomDurability() {
super("DURABILITY", Material.SHEARS, "Custom Durability", new String[0], new String[]{"!block", "all"}); super("DURABILITY", Material.SHEARS, "Custom Durability", new String[0], new String[]{"!block", "all"});

View File

@ -4,6 +4,7 @@ import io.lumine.mythic.lib.api.item.SupportedNBTTagValues;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.api.util.NumericStatFormula; import net.Indyuce.mmoitems.api.util.NumericStatFormula;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.DoubleData; import net.Indyuce.mmoitems.stat.data.DoubleData;
import net.Indyuce.mmoitems.stat.data.random.RandomStatData; import net.Indyuce.mmoitems.stat.data.random.RandomStatData;
import net.Indyuce.mmoitems.stat.data.type.StatData; import net.Indyuce.mmoitems.stat.data.type.StatData;
@ -16,6 +17,7 @@ import org.jetbrains.annotations.Nullable;
import java.util.ArrayList; import java.util.ArrayList;
@HasCategory(cat = "item")
public class CustomModelData extends DoubleStat implements GemStoneStat { public class CustomModelData extends DoubleStat implements GemStoneStat {
public CustomModelData() { public CustomModelData() {
super("CUSTOM_MODEL_DATA", Material.PAINTING, "Custom Model Data", new String[] { "Your 1.14+ model data." }, new String[] { "!block", "all" }); super("CUSTOM_MODEL_DATA", Material.PAINTING, "Custom Model Data", new String[] { "Your 1.14+ model data." }, new String[] { "!block", "all" });

View File

@ -6,6 +6,7 @@ import io.lumine.mythic.lib.api.item.SupportedNBTTagValues;
import io.lumine.mythic.lib.api.util.AltChar; import io.lumine.mythic.lib.api.util.AltChar;
import net.Indyuce.mmoitems.ItemStats; import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.MMOItems; import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.util.MMOUtils; import net.Indyuce.mmoitems.util.MMOUtils;
import net.Indyuce.mmoitems.api.CustomSound; import net.Indyuce.mmoitems.api.CustomSound;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
@ -33,6 +34,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
@HasCategory(cat = "misc")
public class CustomSounds extends ItemStat<SoundListData, SoundListData> implements GemStoneStat, PlayerConsumable { public class CustomSounds extends ItemStat<SoundListData, SoundListData> implements GemStoneStat, PlayerConsumable {
public CustomSounds() { public CustomSounds() {
super("SOUNDS", Material.JUKEBOX, "Custom Sounds", new String[]{"The custom sounds your item will use."}, super("SOUNDS", Material.JUKEBOX, "Custom Sounds", new String[]{"The custom sounds your item will use."},

View File

@ -1,8 +1,10 @@
package net.Indyuce.mmoitems.stat; package net.Indyuce.mmoitems.stat;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.type.BooleanStat; import net.Indyuce.mmoitems.stat.type.BooleanStat;
import org.bukkit.Material; import org.bukkit.Material;
@HasCategory(cat = "toggles")
public class DisableDeathDrop extends BooleanStat { public class DisableDeathDrop extends BooleanStat {
public DisableDeathDrop() { public DisableDeathDrop() {
super("DISABLE_DEATH_DROP", Material.BONE, "Disable Drop On Death", super("DISABLE_DEATH_DROP", Material.BONE, "Disable Drop On Death",

View File

@ -8,6 +8,7 @@ import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.ItemTier; import net.Indyuce.mmoitems.api.ItemTier;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.StringData; import net.Indyuce.mmoitems.stat.data.StringData;
import net.Indyuce.mmoitems.stat.type.GemStoneStat; import net.Indyuce.mmoitems.stat.type.GemStoneStat;
import net.Indyuce.mmoitems.stat.type.NameData; import net.Indyuce.mmoitems.stat.type.NameData;
@ -21,6 +22,7 @@ import org.jetbrains.annotations.Nullable;
import java.util.ArrayList; import java.util.ArrayList;
@HasCategory(cat = "tooltip")
public class DisplayName extends StringStat implements GemStoneStat { public class DisplayName extends StringStat implements GemStoneStat {
public DisplayName() { public DisplayName() {

View File

@ -1,11 +1,17 @@
package net.Indyuce.mmoitems.stat; package net.Indyuce.mmoitems.stat;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.type.GemStoneStat; import net.Indyuce.mmoitems.stat.type.GemStoneStat;
import net.Indyuce.mmoitems.stat.type.StringStat; import net.Indyuce.mmoitems.stat.type.StringStat;
import org.bukkit.Material; import org.bukkit.Material;
@HasCategory(cat = "tooltip")
public class DisplayedType extends StringStat implements GemStoneStat { public class DisplayedType extends StringStat implements GemStoneStat {
public DisplayedType() { public DisplayedType() {
super("DISPLAYED_TYPE", Material.OAK_SIGN, "Displayed Type", new String[]{"This option will only affect the", "type displayed on the item lore."}, new String[0]); super("DISPLAYED_TYPE",
Material.OAK_SIGN,
"Displayed Type",
new String[]{"This option will only affect the", "type displayed on the item lore."},
null);
} }
} }

View File

@ -8,6 +8,7 @@ import net.Indyuce.mmoitems.api.edition.StatEdition;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.ColorData; import net.Indyuce.mmoitems.stat.data.ColorData;
import net.Indyuce.mmoitems.stat.data.type.StatData; import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.ItemStat; import net.Indyuce.mmoitems.stat.type.ItemStat;
@ -26,6 +27,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
@HasCategory(cat = "item")
public class DyeColor extends ItemStat<ColorData, ColorData> { public class DyeColor extends ItemStat<ColorData, ColorData> {
public DyeColor() { public DyeColor() {
super("DYE_COLOR", Material.RED_DYE, "Dye Color", super("DYE_COLOR", Material.RED_DYE, "Dye Color",

View File

@ -16,6 +16,7 @@ import net.Indyuce.mmoitems.api.item.mmoitem.VolatileMMOItem;
import net.Indyuce.mmoitems.api.util.NumericStatFormula; import net.Indyuce.mmoitems.api.util.NumericStatFormula;
import net.Indyuce.mmoitems.api.util.message.FFPMMOItems; import net.Indyuce.mmoitems.api.util.message.FFPMMOItems;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.PotionEffectData; import net.Indyuce.mmoitems.stat.data.PotionEffectData;
import net.Indyuce.mmoitems.stat.data.PotionEffectListData; import net.Indyuce.mmoitems.stat.data.PotionEffectListData;
import net.Indyuce.mmoitems.stat.data.random.RandomPotionEffectData; import net.Indyuce.mmoitems.stat.data.random.RandomPotionEffectData;
@ -37,6 +38,7 @@ import org.jetbrains.annotations.Nullable;
import java.util.*; import java.util.*;
@HasCategory(cat = "consumables")
public class Effects extends ItemStat<RandomPotionEffectListData, PotionEffectListData> implements PlayerConsumable { public class Effects extends ItemStat<RandomPotionEffectListData, PotionEffectListData> implements PlayerConsumable {
public Effects() { public Effects() {
super("EFFECTS", Material.POTION, "Effects", new String[]{"The potion effects your", "consumable item grants."}, super("EFFECTS", Material.POTION, "Effects", new String[]{"The potion effects your", "consumable item grants."},

View File

@ -4,15 +4,14 @@ import io.lumine.mythic.lib.UtilityMethods;
import io.lumine.mythic.lib.api.item.ItemTag; import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.api.item.SupportedNBTTagValues; import io.lumine.mythic.lib.api.item.SupportedNBTTagValues;
import io.lumine.mythic.lib.api.util.AltChar; import io.lumine.mythic.lib.api.util.AltChar;
import io.lumine.mythic.lib.api.util.ui.SilentNumbers;
import io.lumine.mythic.lib.element.Element; import io.lumine.mythic.lib.element.Element;
import net.Indyuce.mmoitems.MMOItems; import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.util.MMOUtils;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.api.util.NumericStatFormula; import net.Indyuce.mmoitems.api.util.NumericStatFormula;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.gui.edition.ElementsEdition; import net.Indyuce.mmoitems.gui.edition.ElementsEdition;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.ElementListData; import net.Indyuce.mmoitems.stat.data.ElementListData;
import net.Indyuce.mmoitems.stat.data.random.RandomElementListData; import net.Indyuce.mmoitems.stat.data.random.RandomElementListData;
import net.Indyuce.mmoitems.stat.data.type.StatData; import net.Indyuce.mmoitems.stat.data.type.StatData;
@ -22,7 +21,6 @@ import net.Indyuce.mmoitems.stat.type.Previewable;
import net.Indyuce.mmoitems.util.ElementStatType; import net.Indyuce.mmoitems.util.ElementStatType;
import net.Indyuce.mmoitems.util.Pair; import net.Indyuce.mmoitems.util.Pair;
import org.apache.commons.lang.Validate; import org.apache.commons.lang.Validate;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
@ -33,6 +31,7 @@ import org.jetbrains.annotations.Nullable;
import java.util.*; import java.util.*;
@HasCategory(cat = "elements")
public class Elements extends ItemStat<RandomElementListData, ElementListData> implements Previewable<RandomElementListData, ElementListData> { public class Elements extends ItemStat<RandomElementListData, ElementListData> implements Previewable<RandomElementListData, ElementListData> {
public Elements() { public Elements() {
super("ELEMENT", Material.SLIME_BALL, "Elements", new String[]{"The elements of your item."}, super("ELEMENT", Material.SLIME_BALL, "Elements", new String[]{"The elements of your item."},
@ -105,27 +104,21 @@ public class Elements extends ItemStat<RandomElementListData, ElementListData> i
private Map<ElementStatType, String> statFormat = new HashMap<>(); private Map<ElementStatType, String> statFormat = new HashMap<>();
@Override @Override
public void loadConfiguration(@NotNull ConfigurationSection legacyLanguageFile, @NotNull Object configObject) { public void readTranslationFile(@NotNull ConfigurationSection translationFile) {
// LEGACY CODE
if (configObject instanceof String) {
for (ElementStatType statType : ElementStatType.values())
statFormat.put(statType, legacyLanguageFile.getString("elemental-" + statType.lowerCaseName(), "<TranslationNotFound:" + statType.name().toLowerCase() + ">"));
}
// Up-to-date code // Up-to-date code
else { Object configObject = translationFile.get("element");
Validate.isTrue(configObject instanceof ConfigurationSection, "Must be a config section"); if (configObject instanceof ConfigurationSection) {
final ConfigurationSection config = (ConfigurationSection) configObject; final ConfigurationSection config = (ConfigurationSection) configObject;
for (ElementStatType statType : ElementStatType.values()) for (ElementStatType statType : ElementStatType.values())
statFormat.put(statType, config.getString(statType.lowerCaseName(), "<TranslationNotFound:" + statType.lowerCaseName() + ">")); statFormat.put(statType, config.getString(statType.lowerCaseName(), "<TranslationNotFound:" + statType.lowerCaseName() + ">"));
} }
}
@Override // LEGACY CODE
public String getLegacyTranslationPath() { else {
// Arbitrary for (ElementStatType statType : ElementStatType.values())
return "elemental-damage"; statFormat.put(statType, translationFile.getString("elemental-" + statType.lowerCaseName(), "<TranslationNotFound:" + statType.name().toLowerCase() + ">"));
}
} }
@NotNull @NotNull

View File

@ -18,6 +18,7 @@ import net.Indyuce.mmoitems.api.util.NumericStatFormula;
import net.Indyuce.mmoitems.api.util.message.FFPMMOItems; import net.Indyuce.mmoitems.api.util.message.FFPMMOItems;
import net.Indyuce.mmoitems.comp.enchants.EnchantPlugin; import net.Indyuce.mmoitems.comp.enchants.EnchantPlugin;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.EnchantListData; import net.Indyuce.mmoitems.stat.data.EnchantListData;
import net.Indyuce.mmoitems.stat.data.random.RandomEnchantListData; import net.Indyuce.mmoitems.stat.data.random.RandomEnchantListData;
import net.Indyuce.mmoitems.stat.data.type.StatData; import net.Indyuce.mmoitems.stat.data.type.StatData;
@ -41,6 +42,7 @@ import org.jetbrains.annotations.Nullable;
import java.util.*; import java.util.*;
@HasCategory(cat = "item")
public class Enchants extends ItemStat<RandomEnchantListData, EnchantListData> implements Upgradable { public class Enchants extends ItemStat<RandomEnchantListData, EnchantListData> implements Upgradable {
public Enchants() { public Enchants() {
super("ENCHANTS", Material.ENCHANTED_BOOK, "Enchantments", new String[]{"The item enchants."}, new String[0]); super("ENCHANTS", Material.ENCHANTED_BOOK, "Enchantments", new String[]{"The item enchants."}, new String[0]);

View File

@ -1,10 +1,12 @@
package net.Indyuce.mmoitems.stat; package net.Indyuce.mmoitems.stat;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.annotation.VersionDependant; import net.Indyuce.mmoitems.stat.annotation.VersionDependant;
import net.Indyuce.mmoitems.stat.type.DoubleStat; import net.Indyuce.mmoitems.stat.type.DoubleStat;
import org.bukkit.Material; import org.bukkit.Material;
@VersionDependant(version = {1, 20, 5}) @VersionDependant(version = {1, 20, 5})
@HasCategory(cat = "vanilla_attribute")
public class FallDamageMultiplier extends DoubleStat { public class FallDamageMultiplier extends DoubleStat {
public FallDamageMultiplier() { public FallDamageMultiplier() {
super("FALL_DAMAGE_MULTIPLIER", super("FALL_DAMAGE_MULTIPLIER",

View File

@ -2,12 +2,14 @@ package net.Indyuce.mmoitems.stat;
import io.lumine.mythic.lib.api.item.ItemTag; import io.lumine.mythic.lib.api.item.ItemTag;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.StringData; import net.Indyuce.mmoitems.stat.data.StringData;
import net.Indyuce.mmoitems.stat.type.GemStoneStat; import net.Indyuce.mmoitems.stat.type.GemStoneStat;
import net.Indyuce.mmoitems.stat.type.StringStat; import net.Indyuce.mmoitems.stat.type.StringStat;
import org.bukkit.Material; import org.bukkit.Material;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@HasCategory(cat = "gem_stones")
public class GemColor extends StringStat implements GemStoneStat { public class GemColor extends StringStat implements GemStoneStat {
public GemColor() { public GemColor() {
super("GEM_COLOR", Material.LIGHT_BLUE_DYE, "Gem Color", new String[] { "Defines the color of the socket in", "which the gem can be applied." }, new String[] { "gem_stone" }); super("GEM_COLOR", Material.LIGHT_BLUE_DYE, "Gem Color", new String[] { "Defines the color of the socket in", "which the gem can be applied." }, new String[] { "gem_stone" });

View File

@ -13,6 +13,7 @@ import net.Indyuce.mmoitems.api.edition.StatEdition;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.GemSocketsData; import net.Indyuce.mmoitems.stat.data.GemSocketsData;
import net.Indyuce.mmoitems.stat.data.GemstoneData; import net.Indyuce.mmoitems.stat.data.GemstoneData;
import net.Indyuce.mmoitems.stat.data.type.StatData; import net.Indyuce.mmoitems.stat.data.type.StatData;
@ -30,6 +31,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
@HasCategory(cat = "gem_stones")
public class GemSockets extends ItemStat<GemSocketsData, GemSocketsData> { public class GemSockets extends ItemStat<GemSocketsData, GemSocketsData> {
public GemSockets() { public GemSockets() {
super("GEM_SOCKETS", Material.EMERALD, "Gem Sockets", new String[]{"The amount of gem", "sockets your weapon has."}, super("GEM_SOCKETS", Material.EMERALD, "Gem Sockets", new String[]{"The amount of gem", "sockets your weapon has."},
@ -46,26 +48,21 @@ public class GemSockets extends ItemStat<GemSocketsData, GemSocketsData> {
private String emptyGemSocketFormat, filledGemSocketFormat; private String emptyGemSocketFormat, filledGemSocketFormat;
@Override @Override
public void loadConfiguration(@NotNull ConfigurationSection legacyLanguageFile, @NotNull Object configObject) { public void readTranslationFile(@NotNull ConfigurationSection translationFile) {
// LEGACY CODE
if (configObject instanceof String) {
emptyGemSocketFormat = legacyLanguageFile.getString("empty-gem-socket");
filledGemSocketFormat = legacyLanguageFile.getString("filled-gem-socket");
}
// Up-to-date code // Up-to-date code
else { Object configObject = translationFile.get("gem-sockets");
Validate.isTrue(configObject instanceof ConfigurationSection, "Must be a config section"); if (configObject instanceof ConfigurationSection) {
final ConfigurationSection config = (ConfigurationSection) configObject; final ConfigurationSection config = (ConfigurationSection) configObject;
emptyGemSocketFormat = config.getString("empty"); emptyGemSocketFormat = config.getString("empty");
filledGemSocketFormat = config.getString("filled"); filledGemSocketFormat = config.getString("filled");
} }
}
@Override // LEGACY CODE
public String getLegacyTranslationPath() { else {
return "empty-gem-socket"; emptyGemSocketFormat = translationFile.getString("empty-gem-socket");
filledGemSocketFormat = translationFile.getString("filled-gem-socket");
}
} }
@Override @Override

View File

@ -1,5 +1,6 @@
package net.Indyuce.mmoitems.stat; package net.Indyuce.mmoitems.stat;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.StringData; import net.Indyuce.mmoitems.stat.data.StringData;
import net.Indyuce.mmoitems.stat.type.ChooseStat; import net.Indyuce.mmoitems.stat.type.ChooseStat;
import net.Indyuce.mmoitems.stat.type.GemStoneStat; import net.Indyuce.mmoitems.stat.type.GemStoneStat;
@ -10,6 +11,7 @@ import org.jetbrains.annotations.NotNull;
/** /**
* Defines how gem stats will scale when the item they are put on upgrades. * Defines how gem stats will scale when the item they are put on upgrades.
*/ */
@HasCategory(cat = "gem_stones")
public class GemUpgradeScaling extends ChooseStat implements GemStoneStat { public class GemUpgradeScaling extends ChooseStat implements GemStoneStat {
public static final StatChoice public static final StatChoice
NEVER = new StatChoice("NEVER", "Gem stats are never scaled by upgrading the item."), NEVER = new StatChoice("NEVER", "Gem stats are never scaled by upgrading the item."),

View File

@ -6,6 +6,7 @@ import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.MMOItems; import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.edition.StatEdition; import net.Indyuce.mmoitems.api.edition.StatEdition;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.StringListData; import net.Indyuce.mmoitems.stat.data.StringListData;
import net.Indyuce.mmoitems.stat.type.GemStoneStat; import net.Indyuce.mmoitems.stat.type.GemStoneStat;
import net.Indyuce.mmoitems.stat.type.StringListStat; import net.Indyuce.mmoitems.stat.type.StringListStat;
@ -20,10 +21,14 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
@HasCategory(cat = "misc")
public class GrantedPermissions extends StringListStat implements GemStoneStat { public class GrantedPermissions extends StringListStat implements GemStoneStat {
public GrantedPermissions() { public GrantedPermissions() {
super("GRANTED_PERMISSIONS", Material.NAME_TAG, "Granted Permissions", super("GRANTED_PERMISSIONS",
new String[] { "A list of permissions that will,", "be granted by the item." }, new String[0]); Material.NAME_TAG,
"Granted Permissions",
new String[]{"A list of permissions that will,", "be granted by the item."},
new String[0]);
} }
@Override @Override

View File

@ -1,11 +1,13 @@
package net.Indyuce.mmoitems.stat; package net.Indyuce.mmoitems.stat;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.type.BooleanStat; import net.Indyuce.mmoitems.stat.type.BooleanStat;
import org.bukkit.Material; import org.bukkit.Material;
@HasCategory(cat = "tooltip")
public class HideDurabilityBar extends BooleanStat { public class HideDurabilityBar extends BooleanStat {
public HideDurabilityBar() { public HideDurabilityBar() {
super("DURABILITY_BAR", Material.DAMAGED_ANVIL, "Hide Durability Bar", super("DURABILITY_BAR", Material.DAMAGED_ANVIL, "Hide Durability Bar",
new String[] { "Enable this to have the green bar", "hidden when using &ncustom&7 durability.", "Does not work when using vanilla durability." }, new String[] { "!block", "all"}); new String[]{"Enable this to have the green bar", "hidden when using &ncustom&7 durability.", "Does not work when using vanilla durability."}, new String[]{"!block", "all"});
} }
} }

View File

@ -4,6 +4,7 @@ import io.lumine.mythic.lib.api.item.ItemTag;
import net.Indyuce.mmoitems.ItemStats; import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.BooleanData; import net.Indyuce.mmoitems.stat.data.BooleanData;
import net.Indyuce.mmoitems.stat.type.BooleanStat; import net.Indyuce.mmoitems.stat.type.BooleanStat;
import net.Indyuce.mmoitems.stat.annotation.VersionDependant; import net.Indyuce.mmoitems.stat.annotation.VersionDependant;
@ -19,6 +20,7 @@ import java.util.ArrayList;
*/ */
@Deprecated @Deprecated
@VersionDependant(version = {1, 16, 3}) @VersionDependant(version = {1, 16, 3})
@HasCategory(cat = "tooltip")
public class HideDye extends BooleanStat { public class HideDye extends BooleanStat {
public HideDye() { public HideDye() {
super("HIDE_DYE", Material.CYAN_DYE, "Hide Dyed", new String[] { "Enable to hide the 'Dyed' tag from the item." }, new String[0], super("HIDE_DYE", Material.CYAN_DYE, "Hide Dyed", new String[] { "Enable to hide the 'Dyed' tag from the item." }, new String[0],

View File

@ -4,6 +4,7 @@ import io.lumine.mythic.lib.api.item.ItemTag;
import net.Indyuce.mmoitems.ItemStats; import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.BooleanData; import net.Indyuce.mmoitems.stat.data.BooleanData;
import net.Indyuce.mmoitems.stat.data.type.StatData; import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.BooleanStat; import net.Indyuce.mmoitems.stat.type.BooleanStat;
@ -18,6 +19,7 @@ import java.util.ArrayList;
* @deprecated Merge with other Hide- stats * @deprecated Merge with other Hide- stats
*/ */
@Deprecated @Deprecated
@HasCategory(cat = "tooltip")
public class HideEnchants extends BooleanStat { public class HideEnchants extends BooleanStat {
public HideEnchants() { public HideEnchants() {
super("HIDE_ENCHANTS", Material.BOOK, "Hide Enchantments", new String[] { "Enable to completely hide your item", "enchants. You can still see the glowing effect." }, new String[0]); super("HIDE_ENCHANTS", Material.BOOK, "Hide Enchantments", new String[] { "Enable to completely hide your item", "enchants. You can still see the glowing effect." }, new String[0]);

View File

@ -6,6 +6,7 @@ import io.lumine.mythic.lib.util.annotation.BackwardsCompatibility;
import net.Indyuce.mmoitems.ItemStats; import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.BooleanData; import net.Indyuce.mmoitems.stat.data.BooleanData;
import net.Indyuce.mmoitems.stat.type.BooleanStat; import net.Indyuce.mmoitems.stat.type.BooleanStat;
import org.bukkit.Material; import org.bukkit.Material;
@ -19,6 +20,7 @@ import java.util.Arrays;
/** /**
* @deprecated Merge with other Hide- stats * @deprecated Merge with other Hide- stats
*/ */
@HasCategory(cat = "tooltip")
@Deprecated @Deprecated
public class HidePotionEffects extends BooleanStat { public class HidePotionEffects extends BooleanStat {
public HidePotionEffects() { public HidePotionEffects() {

View File

@ -4,6 +4,7 @@ import io.lumine.mythic.lib.api.item.ItemTag;
import net.Indyuce.mmoitems.ItemStats; import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.BooleanData; import net.Indyuce.mmoitems.stat.data.BooleanData;
import net.Indyuce.mmoitems.stat.type.BooleanStat; import net.Indyuce.mmoitems.stat.type.BooleanStat;
import net.Indyuce.mmoitems.stat.annotation.VersionDependant; import net.Indyuce.mmoitems.stat.annotation.VersionDependant;
@ -19,6 +20,7 @@ import java.util.ArrayList;
*/ */
@Deprecated @Deprecated
@VersionDependant(version = {1, 20}) @VersionDependant(version = {1, 20})
@HasCategory(cat = "tooltip")
public class HideTrim extends BooleanStat { public class HideTrim extends BooleanStat {
public HideTrim() { public HideTrim() {
super("HIDE_ARMOR_TRIM", Material.LEATHER_CHESTPLATE, "Hide Armor Trim", new String[]{"Hides armor trim from item lore."}, new String[]{"armor", "skin"}); super("HIDE_ARMOR_TRIM", Material.LEATHER_CHESTPLATE, "Hide Armor Trim", new String[]{"Hides armor trim from item lore."}, new String[]{"armor", "skin"});

View File

@ -5,6 +5,7 @@ import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.api.util.NumericStatFormula; import net.Indyuce.mmoitems.api.util.NumericStatFormula;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.DoubleData; import net.Indyuce.mmoitems.stat.data.DoubleData;
import net.Indyuce.mmoitems.stat.type.DoubleStat; import net.Indyuce.mmoitems.stat.type.DoubleStat;
import net.Indyuce.mmoitems.stat.type.GemStoneStat; import net.Indyuce.mmoitems.stat.type.GemStoneStat;
@ -24,6 +25,7 @@ import java.util.ArrayList;
* @implNote Due to 1.20.5+ modifying the location of many vanilla tags, * @implNote Due to 1.20.5+ modifying the location of many vanilla tags,
* all version-friendly implementations must use ItemMeta methods. * all version-friendly implementations must use ItemMeta methods.
*/ */
@HasCategory(cat = "durability")
public class ItemDamage extends DoubleStat implements GemStoneStat { public class ItemDamage extends DoubleStat implements GemStoneStat {
public ItemDamage() { public ItemDamage() {
super("ITEM_DAMAGE", Material.FISHING_ROD, "Base Item Damage", super("ITEM_DAMAGE", Material.FISHING_ROD, "Base Item Damage",
@ -73,6 +75,7 @@ public class ItemDamage extends DoubleStat implements GemStoneStat {
@Override @Override
public String getLegacyTranslationPath() { public String getLegacyTranslationPath() {
// Should be useless
return "durability"; return "durability";
} }
} }

View File

@ -6,6 +6,7 @@ import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.api.util.NumericStatFormula; import net.Indyuce.mmoitems.api.util.NumericStatFormula;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.DoubleData; import net.Indyuce.mmoitems.stat.data.DoubleData;
import net.Indyuce.mmoitems.stat.data.type.StatData; import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.InternalStat; import net.Indyuce.mmoitems.stat.type.InternalStat;
@ -20,13 +21,16 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
public class ItemLevel extends ItemStat<NumericStatFormula, DoubleData> implements InternalStat { @HasCategory(cat = "rarity")
public class ItemLevel extends ItemStat<NumericStatFormula, DoubleData> implements InternalStat<NumericStatFormula, DoubleData> {
public ItemLevel() { public ItemLevel() {
super("ITEM_LEVEL", Material.EXPERIENCE_BOTTLE, "Item Level", new String[] { "The item level" }, new String[0]); super("ITEM_LEVEL", Material.EXPERIENCE_BOTTLE, "Item Level", new String[] { "The item level" }, new String[0]);
} }
@Override @Override
public void whenApplied(@NotNull ItemStackBuilder item, @NotNull DoubleData data) { item.addItemTag(getAppliedNBT(data)); } public void whenApplied(@NotNull ItemStackBuilder item, @NotNull DoubleData data) {
item.addItemTag(getAppliedNBT(data));
}
@Nullable @Nullable
@Override @Override

View File

@ -13,6 +13,7 @@ import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.gui.edition.ParticlesEdition; import net.Indyuce.mmoitems.gui.edition.ParticlesEdition;
import net.Indyuce.mmoitems.particle.api.ParticleType; import net.Indyuce.mmoitems.particle.api.ParticleType;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.ParticleData; import net.Indyuce.mmoitems.stat.data.ParticleData;
import net.Indyuce.mmoitems.stat.data.type.StatData; import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.ItemStat; import net.Indyuce.mmoitems.stat.type.ItemStat;
@ -31,10 +32,11 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
@HasCategory(cat = "misc")
public class ItemParticles extends ItemStat<ParticleData, ParticleData> { public class ItemParticles extends ItemStat<ParticleData, ParticleData> {
public ItemParticles() { public ItemParticles() {
super("ITEM_PARTICLES", Material.PINK_STAINED_GLASS, "Item Particles", new String[] { "The particles displayed when", super("ITEM_PARTICLES", Material.PINK_STAINED_GLASS, "Item Particles", new String[] { "The particles displayed when",
"holding/wearing your item.", "", ChatColor.BLUE + "A tutorial is available on the wiki." }, new String[] { "all", "!block" }); "holding/wearing your item.", "Please refer to the wiki for further info." }, new String[] { "all", "!block" });
} }
@Override @Override

View File

@ -5,6 +5,7 @@ import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.ItemSet; import net.Indyuce.mmoitems.api.ItemSet;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.StringData; import net.Indyuce.mmoitems.stat.data.StringData;
import net.Indyuce.mmoitems.stat.type.GemStoneStat; import net.Indyuce.mmoitems.stat.type.GemStoneStat;
import net.Indyuce.mmoitems.stat.type.StringStat; import net.Indyuce.mmoitems.stat.type.StringStat;
@ -17,6 +18,7 @@ import org.jetbrains.annotations.NotNull;
import java.util.ArrayList; import java.util.ArrayList;
@HasCategory(cat = "rarity")
public class ItemSetStat extends StringStat implements GemStoneStat { public class ItemSetStat extends StringStat implements GemStoneStat {
public ItemSetStat() { public ItemSetStat() {
super("SET", Material.LEATHER_CHESTPLATE, "Item Set", super("SET", Material.LEATHER_CHESTPLATE, "Item Set",

View File

@ -1,5 +1,6 @@
package net.Indyuce.mmoitems.stat; package net.Indyuce.mmoitems.stat;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.StringData; import net.Indyuce.mmoitems.stat.data.StringData;
import net.Indyuce.mmoitems.stat.type.GemStoneStat; import net.Indyuce.mmoitems.stat.type.GemStoneStat;
import org.apache.commons.lang.Validate; import org.apache.commons.lang.Validate;
@ -14,6 +15,7 @@ import net.Indyuce.mmoitems.stat.type.StringStat;
import io.lumine.mythic.lib.api.item.ItemTag; import io.lumine.mythic.lib.api.item.ItemTag;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@HasCategory(cat = "rarity")
public class ItemTierStat extends StringStat implements GemStoneStat { public class ItemTierStat extends StringStat implements GemStoneStat {
public ItemTierStat() { public ItemTierStat() {
super("TIER", Material.DIAMOND, "Item Tier", new String[] { "The tier defines how rare your item is", "and what item is dropped when your", super("TIER", Material.DIAMOND, "Item Tier", new String[] { "The tier defines how rare your item is", "and what item is dropped when your",

View File

@ -7,6 +7,7 @@ import java.util.Optional;
import io.lumine.mythic.lib.api.item.SupportedNBTTagValues; import io.lumine.mythic.lib.api.item.SupportedNBTTagValues;
import io.lumine.mythic.lib.api.util.ui.SilentNumbers; import io.lumine.mythic.lib.api.util.ui.SilentNumbers;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.StringData; import net.Indyuce.mmoitems.stat.data.StringData;
import net.Indyuce.mmoitems.stat.type.ItemStat; import net.Indyuce.mmoitems.stat.type.ItemStat;
import org.apache.commons.lang.Validate; import org.apache.commons.lang.Validate;
@ -30,6 +31,7 @@ import io.lumine.mythic.lib.api.util.AltChar;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@HasCategory(cat = "gem_stones")
public class ItemTypeRestriction extends ItemStat<StringListData, StringListData> { public class ItemTypeRestriction extends ItemStat<StringListData, StringListData> {
public ItemTypeRestriction() { public ItemTypeRestriction() {
super("ITEM_TYPE_RESTRICTION", Material.EMERALD, "Item Type Restriction", super("ITEM_TYPE_RESTRICTION", Material.EMERALD, "Item Type Restriction",

View File

@ -7,6 +7,7 @@ import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.edition.StatEdition; import net.Indyuce.mmoitems.api.edition.StatEdition;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.StringListData; import net.Indyuce.mmoitems.stat.data.StringListData;
import net.Indyuce.mmoitems.stat.type.GemStoneStat; import net.Indyuce.mmoitems.stat.type.GemStoneStat;
import net.Indyuce.mmoitems.stat.type.StringListStat; import net.Indyuce.mmoitems.stat.type.StringListStat;
@ -21,6 +22,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
@HasCategory(cat = "tooltip")
public class Lore extends StringListStat implements GemStoneStat { public class Lore extends StringListStat implements GemStoneStat {
public Lore() { public Lore() {
super("LORE", Material.WRITABLE_BOOK, "Lore", new String[]{"The item lore."}, new String[0]); super("LORE", Material.WRITABLE_BOOK, "Lore", new String[]{"The item lore."}, new String[0]);

View File

@ -1,40 +1,41 @@
package net.Indyuce.mmoitems.stat; package net.Indyuce.mmoitems.stat;
import net.Indyuce.mmoitems.stat.data.StringData; import io.lumine.mythic.lib.api.item.ItemTag;
import net.Indyuce.mmoitems.stat.data.StringListData;
import net.Indyuce.mmoitems.stat.type.GemStoneStat;
import org.apache.commons.lang.Validate;
import org.bukkit.Material;
import net.Indyuce.mmoitems.MMOItems; import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.data.type.StatData; import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.StringData;
import net.Indyuce.mmoitems.stat.type.GemStoneStat;
import net.Indyuce.mmoitems.stat.type.StringStat; import net.Indyuce.mmoitems.stat.type.StringStat;
import io.lumine.mythic.lib.api.item.ItemTag; import org.apache.commons.lang.Validate;
import org.bukkit.Material;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@HasCategory(cat = "tooltip")
public class LoreFormat extends StringStat implements GemStoneStat { public class LoreFormat extends StringStat implements GemStoneStat {
public LoreFormat() { public LoreFormat() {
super("LORE_FORMAT", Material.MAP, "Lore Format", new String[] { "The lore format decides", super("LORE_FORMAT",
"where each stat goes.", "&9Formats can be configured in", "&9the lore-formats folder" }, Material.MAP,
new String[0]); "Lore Format",
} new String[]{"The lore format decides where each", "stat goes. Formats can be configured", "in the lore-formats folder"},
new String[0]);
}
@Override @Override
public void whenApplied(@NotNull ItemStackBuilder item, @NotNull StringData data) { public void whenApplied(@NotNull ItemStackBuilder item, @NotNull StringData data) {
String path = data.toString(); String path = data.toString();
Validate.isTrue(MMOItems.plugin.getLore().hasFormat(path), "Could not find lore format with ID '" + path + "'"); Validate.isTrue(MMOItems.plugin.getLore().hasFormat(path), "Could not find lore format with ID '" + path + "'");
item.addItemTag(new ItemTag(getNBTPath(), path)); item.addItemTag(new ItemTag(getNBTPath(), path));
} }
@Override @Override
public void whenInput(@NotNull EditionInventory inv, @NotNull String message, Object... info) { public void whenInput(@NotNull EditionInventory inv, @NotNull String message, Object... info) {
Validate.isTrue(MMOItems.plugin.getLore().hasFormat(message), "Couldn't find lore format with ID '" + message + "'."); Validate.isTrue(MMOItems.plugin.getLore().hasFormat(message), "Couldn't find lore format with ID '" + message + "'.");
inv.getEditedSection().set(getPath(), message); inv.getEditedSection().set(getPath(), message);
inv.registerTemplateEdition(); inv.registerTemplateEdition();
inv.getPlayer().sendMessage(MMOItems.plugin.getPrefix() + "Lore Format successfully changed to " + message + "."); inv.getPlayer().sendMessage(MMOItems.plugin.getPrefix() + "Lore Format successfully changed to " + message + ".");
} }
} }

View File

@ -1,5 +1,6 @@
package net.Indyuce.mmoitems.stat; package net.Indyuce.mmoitems.stat;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import org.bukkit.Material; import org.bukkit.Material;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
@ -9,6 +10,7 @@ import net.Indyuce.mmoitems.stat.type.BooleanStat;
import io.lumine.mythic.lib.api.item.ItemTag; import io.lumine.mythic.lib.api.item.ItemTag;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@HasCategory(cat = "durability")
public class LostWhenBroken extends BooleanStat { public class LostWhenBroken extends BooleanStat {
public LostWhenBroken() { public LostWhenBroken() {
super("WILL_BREAK", Material.SHEARS, "Lost when Broken?", new String[] { "If set to true, the item will be lost", "once it reaches 0 durability." }, new String[] { "!block", "all" }); super("WILL_BREAK", Material.SHEARS, "Lost when Broken?", new String[] { "If set to true, the item will be lost", "once it reaches 0 durability." }, new String[] { "!block", "all" });

View File

@ -8,6 +8,7 @@ import net.Indyuce.mmoitems.api.edition.StatEdition;
import net.Indyuce.mmoitems.api.interaction.weapon.untargeted.lute.*; import net.Indyuce.mmoitems.api.interaction.weapon.untargeted.lute.*;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.StringData; import net.Indyuce.mmoitems.stat.data.StringData;
import net.Indyuce.mmoitems.stat.type.GemStoneStat; import net.Indyuce.mmoitems.stat.type.GemStoneStat;
import net.Indyuce.mmoitems.stat.type.StringStat; import net.Indyuce.mmoitems.stat.type.StringStat;
@ -18,6 +19,11 @@ import org.jetbrains.annotations.NotNull;
import java.util.Objects; import java.util.Objects;
/**
* @deprecated To be removed
*/
@Deprecated
@HasCategory(cat = "abilities")
public class LuteAttackEffectStat extends StringStat implements GemStoneStat { public class LuteAttackEffectStat extends StringStat implements GemStoneStat {
public LuteAttackEffectStat() { public LuteAttackEffectStat() {
super("LUTE_ATTACK_EFFECT", Material.DIAMOND_HORSE_ARMOR, "Lute Attack Effect", super("LUTE_ATTACK_EFFECT", Material.DIAMOND_HORSE_ARMOR, "Lute Attack Effect",

View File

@ -2,12 +2,18 @@ package net.Indyuce.mmoitems.stat;
import io.lumine.mythic.lib.api.item.ItemTag; import io.lumine.mythic.lib.api.item.ItemTag;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.StringData; import net.Indyuce.mmoitems.stat.data.StringData;
import net.Indyuce.mmoitems.stat.type.GemStoneStat; import net.Indyuce.mmoitems.stat.type.GemStoneStat;
import net.Indyuce.mmoitems.stat.type.StringStat; import net.Indyuce.mmoitems.stat.type.StringStat;
import org.bukkit.Material; import org.bukkit.Material;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
/**
* @deprecated To be removed
*/
@Deprecated
@HasCategory(cat = "abilities")
public class LuteAttackSoundStat extends StringStat implements GemStoneStat { public class LuteAttackSoundStat extends StringStat implements GemStoneStat {
public LuteAttackSoundStat() { public LuteAttackSoundStat() {
super("LUTE_ATTACK_SOUND", Material.GOLDEN_HORSE_ARMOR, "Lute Attack Sound", new String[] { "The sound played when", "basic attacking with this lute." }, new String[] { "lute" }); super("LUTE_ATTACK_SOUND", Material.GOLDEN_HORSE_ARMOR, "Lute Attack Sound", new String[] { "The sound played when", "basic attacking with this lute." }, new String[] { "lute" });

View File

@ -6,6 +6,7 @@ import net.Indyuce.mmoitems.api.item.mmoitem.VolatileMMOItem;
import net.Indyuce.mmoitems.api.player.PlayerData; import net.Indyuce.mmoitems.api.player.PlayerData;
import net.Indyuce.mmoitems.api.player.RPGPlayer; import net.Indyuce.mmoitems.api.player.RPGPlayer;
import net.Indyuce.mmoitems.api.util.message.Message; import net.Indyuce.mmoitems.api.util.message.Message;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.DoubleData; import net.Indyuce.mmoitems.stat.data.DoubleData;
import net.Indyuce.mmoitems.stat.type.DoubleStat; import net.Indyuce.mmoitems.stat.type.DoubleStat;
import net.Indyuce.mmoitems.stat.type.ItemRestriction; import net.Indyuce.mmoitems.stat.type.ItemRestriction;
@ -21,13 +22,13 @@ import org.jetbrains.annotations.NotNull;
* @author Roch Blondiaux * @author Roch Blondiaux
* @date 24/10/2022 * @date 24/10/2022
*/ */
@HasCategory(cat = "use_cost")
public class ManaCost extends DoubleStat implements ItemRestriction, PlayerConsumable { public class ManaCost extends DoubleStat implements ItemRestriction, PlayerConsumable {
public ManaCost() { public ManaCost() {
super("MANA_COST", Material.LAPIS_LAZULI, "Mana Cost", new String[]{"Mana spent by your weapon to be used."}, new String[]{"weapon"}); super("MANA_COST", Material.LAPIS_LAZULI, "Mana Cost", new String[]{"Mana spent by your weapon to be used."}, new String[]{"weapon"});
} }
@Override @Override
public boolean canUse(RPGPlayer player, NBTItem item, boolean message) { public boolean canUse(RPGPlayer player, NBTItem item, boolean message) {
// No data no service // No data no service

View File

@ -11,6 +11,7 @@ import net.Indyuce.mmoitems.api.edition.StatEdition;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.MaterialData; import net.Indyuce.mmoitems.stat.data.MaterialData;
import net.Indyuce.mmoitems.stat.type.ItemStat; import net.Indyuce.mmoitems.stat.type.ItemStat;
import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.ChatColor;
@ -27,6 +28,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
@HasCategory(cat = "item")
public class MaterialStat extends ItemStat<MaterialData, MaterialData> { public class MaterialStat extends ItemStat<MaterialData, MaterialData> {
public MaterialStat() { public MaterialStat() {
super("MATERIAL", VMaterial.GRASS_BLOCK.get(), "Material", new String[] { "Your item material." }, new String[0]); super("MATERIAL", VMaterial.GRASS_BLOCK.get(), "Material", new String[] { "Your item material." }, new String[0]);

View File

@ -3,11 +3,14 @@ package net.Indyuce.mmoitems.stat;
import io.lumine.mythic.lib.api.item.ItemTag; import io.lumine.mythic.lib.api.item.ItemTag;
import net.Indyuce.mmoitems.MMOItems; import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.DoubleData; import net.Indyuce.mmoitems.stat.data.DoubleData;
import net.Indyuce.mmoitems.stat.type.DoubleStat; import net.Indyuce.mmoitems.stat.type.DoubleStat;
import org.bukkit.Material; import org.bukkit.Material;
import org.checkerframework.checker.index.qual.HasSubsequence;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@HasCategory(cat = "consumables")
public class MaxConsume extends DoubleStat { public class MaxConsume extends DoubleStat {
public MaxConsume() { public MaxConsume() {
super("MAX_CONSUME", Material.BLAZE_POWDER, "Max Consume", new String[]{"Max amount of usage before", "item disappears."}, new String[]{"consumable"}); super("MAX_CONSUME", Material.BLAZE_POWDER, "Max Consume", new String[]{"Max amount of usage before", "item disappears."}, new String[]{"consumable"});

View File

@ -20,6 +20,7 @@ import org.jetbrains.annotations.Nullable;
import java.util.ArrayList; import java.util.ArrayList;
@VersionDependant(version = {1, 20, 5}) @VersionDependant(version = {1, 20, 5})
@HasCategory(cat = "durability")
public class MaxItemDamage extends DoubleStat implements GemStoneStat { public class MaxItemDamage extends DoubleStat implements GemStoneStat {
public MaxItemDamage() { public MaxItemDamage() {
super("MAX_ITEM_DAMAGE", Material.DAMAGED_ANVIL, "Maximum Vanilla Durability", new String[]{"Only available in 1.20.5+", "Maximum amount of durability on your item.", "This works using vanilla durability and is", "much more stable than Custom Durability."}, new String[]{"all"}); super("MAX_ITEM_DAMAGE", Material.DAMAGED_ANVIL, "Maximum Vanilla Durability", new String[]{"Only available in 1.20.5+", "Maximum amount of durability on your item.", "This works using vanilla durability and is", "much more stable than Custom Durability."}, new String[]{"all"});

View File

@ -8,6 +8,7 @@ import net.Indyuce.mmoitems.api.item.mmoitem.MMOItem;
import net.Indyuce.mmoitems.api.player.RPGPlayer; import net.Indyuce.mmoitems.api.player.RPGPlayer;
import net.Indyuce.mmoitems.api.util.NumericStatFormula; import net.Indyuce.mmoitems.api.util.NumericStatFormula;
import net.Indyuce.mmoitems.api.util.message.Message; import net.Indyuce.mmoitems.api.util.message.Message;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.DoubleData; import net.Indyuce.mmoitems.stat.data.DoubleData;
import net.Indyuce.mmoitems.stat.data.MaterialData; import net.Indyuce.mmoitems.stat.data.MaterialData;
import net.Indyuce.mmoitems.stat.type.DoubleStat; import net.Indyuce.mmoitems.stat.type.DoubleStat;
@ -25,6 +26,7 @@ import org.jetbrains.annotations.NotNull;
* *
* @author indyuce * @author indyuce
*/ */
@HasCategory(cat = "durability")
public class MaximumDurability extends DoubleStat implements ItemRestriction, GemStoneStat, Upgradable { public class MaximumDurability extends DoubleStat implements ItemRestriction, GemStoneStat, Upgradable {
public MaximumDurability() { public MaximumDurability() {
super("MAX_DURABILITY", Material.SHEARS, "Maximum Custom Durability", new String[]{"The amount of uses before your", "item becomes unusable/breaks."}, new String[]{"!block", "all"}); super("MAX_DURABILITY", Material.SHEARS, "Maximum Custom Durability", new String[]{"The amount of uses before your", "item becomes unusable/breaks."}, new String[]{"!block", "all"});
@ -36,9 +38,8 @@ public class MaximumDurability extends DoubleStat implements ItemRestriction, Ge
} }
@Override @Override
public void loadConfiguration(@NotNull ConfigurationSection legacyLanguageFile, @NotNull Object configObject) { public void readTranslationFile(@NotNull ConfigurationSection legacyLanguageFile) {
generalStatFormat = legacyLanguageFile.getString("item-damage"); generalStatFormat = legacyLanguageFile.getString("durability");
if (generalStatFormat == null) generalStatFormat = legacyLanguageFile.getString("durability");
} }
@Override @Override

View File

@ -7,6 +7,7 @@ import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.MMOItems; import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.edition.StatEdition; import net.Indyuce.mmoitems.api.edition.StatEdition;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.StringListData; import net.Indyuce.mmoitems.stat.data.StringListData;
import net.Indyuce.mmoitems.stat.type.StringListStat; import net.Indyuce.mmoitems.stat.type.StringListStat;
import org.apache.commons.lang.Validate; import org.apache.commons.lang.Validate;
@ -21,6 +22,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
@HasCategory(cat = "misc")
public class NBTTags extends StringListStat { public class NBTTags extends StringListStat {
public NBTTags() { public NBTTags() {
super("CUSTOM_NBT", Material.NAME_TAG, "NBT Tags", new String[] { "Custom NBT Tags." }, new String[0]); super("CUSTOM_NBT", Material.NAME_TAG, "NBT Tags", new String[] { "Custom NBT Tags." }, new String[0]);

View File

@ -15,6 +15,7 @@ import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.api.util.NumericStatFormula; import net.Indyuce.mmoitems.api.util.NumericStatFormula;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.PotionEffectData; import net.Indyuce.mmoitems.stat.data.PotionEffectData;
import net.Indyuce.mmoitems.stat.data.PotionEffectListData; import net.Indyuce.mmoitems.stat.data.PotionEffectListData;
import net.Indyuce.mmoitems.stat.data.random.RandomPotionEffectData; import net.Indyuce.mmoitems.stat.data.random.RandomPotionEffectData;
@ -37,10 +38,7 @@ import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.Set; import java.util.Set;
/** @HasCategory(cat = "misc")
* This class has not been updated for the item generation update!!! The potion
* amplifier and duration are not numeric formulas but flat values.... TODO
*/
public class PermanentEffects extends ItemStat<RandomPotionEffectListData, PotionEffectListData> { public class PermanentEffects extends ItemStat<RandomPotionEffectListData, PotionEffectListData> {
public PermanentEffects() { public PermanentEffects() {
super("PERM_EFFECTS", Material.POTION, "Permanent Effects", new String[]{"The potion effects your", "item grants to the holder."}, super("PERM_EFFECTS", Material.POTION, "Permanent Effects", new String[]{"The potion effects your", "item grants to the holder."},

View File

@ -11,6 +11,7 @@ import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.api.player.RPGPlayer; import net.Indyuce.mmoitems.api.player.RPGPlayer;
import net.Indyuce.mmoitems.api.util.message.Message; import net.Indyuce.mmoitems.api.util.message.Message;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.StringListData; import net.Indyuce.mmoitems.stat.data.StringListData;
import net.Indyuce.mmoitems.stat.data.type.StatData; import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.ItemRestriction; import net.Indyuce.mmoitems.stat.type.ItemRestriction;
@ -29,6 +30,7 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
@HasCategory(cat = "requirement")
public class Permission extends StringListStat implements ItemRestriction { public class Permission extends StringListStat implements ItemRestriction {
public Permission() { public Permission() {
super("PERMISSION", Material.OAK_SIGN, "Permission", super("PERMISSION", Material.OAK_SIGN, "Permission",

View File

@ -3,12 +3,14 @@ package net.Indyuce.mmoitems.stat;
import io.lumine.mythic.lib.api.item.ItemTag; import io.lumine.mythic.lib.api.item.ItemTag;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.util.NumericStatFormula; import net.Indyuce.mmoitems.api.util.NumericStatFormula;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.DoubleData; import net.Indyuce.mmoitems.stat.data.DoubleData;
import net.Indyuce.mmoitems.stat.type.DoubleStat; import net.Indyuce.mmoitems.stat.type.DoubleStat;
import org.apache.commons.lang.Validate; import org.apache.commons.lang.Validate;
import org.bukkit.Material; import org.bukkit.Material;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@HasCategory(cat = "tools")
public class PickaxePower extends DoubleStat { public class PickaxePower extends DoubleStat {
public PickaxePower() { public PickaxePower() {
super("PICKAXE_POWER", Material.IRON_PICKAXE, "Pickaxe Power", new String[]{"The breaking strength of the", "item when mining custom blocks."}, new String[]{"tool"}); super("PICKAXE_POWER", Material.IRON_PICKAXE, "Pickaxe Power", new String[]{"The breaking strength of the", "item when mining custom blocks."}, new String[]{"tool"});

View File

@ -8,6 +8,7 @@ import net.Indyuce.mmoitems.api.edition.StatEdition;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.ColorData; import net.Indyuce.mmoitems.stat.data.ColorData;
import net.Indyuce.mmoitems.stat.type.ItemStat; import net.Indyuce.mmoitems.stat.type.ItemStat;
import org.apache.commons.lang.NotImplementedException; import org.apache.commons.lang.NotImplementedException;
@ -25,6 +26,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
@HasCategory(cat = "item")
public class PotionColor extends ItemStat<ColorData, ColorData> { public class PotionColor extends ItemStat<ColorData, ColorData> {
public PotionColor() { public PotionColor() {
super("POTION_COLOR", Material.POTION, "Potion Color", super("POTION_COLOR", Material.POTION, "Potion Color",

View File

@ -5,6 +5,7 @@ import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.api.util.AltChar; import io.lumine.mythic.lib.api.util.AltChar;
import net.Indyuce.mmoitems.ItemStats; import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.MMOItems; import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.util.MMOUtils; import net.Indyuce.mmoitems.util.MMOUtils;
import net.Indyuce.mmoitems.api.edition.StatEdition; import net.Indyuce.mmoitems.api.edition.StatEdition;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
@ -34,6 +35,7 @@ import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.Set; import java.util.Set;
@HasCategory(cat = "consumables")
public class PotionEffects extends ItemStat<RandomPotionEffectListData, PotionEffectListData> { public class PotionEffects extends ItemStat<RandomPotionEffectListData, PotionEffectListData> {
public PotionEffects() { public PotionEffects() {
super("POTION_EFFECT", Material.POTION, "Potion Effects", new String[] { "The effects of your potion.", "(May have an impact on color).", "Does NOT support tipped arrows." }, super("POTION_EFFECT", Material.POTION, "Potion Effects", new String[] { "The effects of your potion.", "(May have an impact on color).", "Does NOT support tipped arrows." },

View File

@ -12,6 +12,7 @@ import net.Indyuce.mmoitems.api.edition.StatEdition;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.ProjectileParticlesData; import net.Indyuce.mmoitems.stat.data.ProjectileParticlesData;
import net.Indyuce.mmoitems.stat.data.type.StatData; import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.ItemStat; import net.Indyuce.mmoitems.stat.type.ItemStat;
@ -34,7 +35,7 @@ import java.util.Optional;
* *
* @author Kasprr * @author Kasprr
*/ */
@HasCategory(cat = "misc")
public class ProjectileParticles extends ItemStat<ProjectileParticlesData, ProjectileParticlesData> { public class ProjectileParticles extends ItemStat<ProjectileParticlesData, ProjectileParticlesData> {
public ProjectileParticles() { public ProjectileParticles() {
super("PROJECTILE_PARTICLES", Material.LIME_STAINED_GLASS, "Projectile Particles", super("PROJECTILE_PARTICLES", Material.LIME_STAINED_GLASS, "Projectile Particles",

View File

@ -12,6 +12,7 @@ import net.Indyuce.mmoitems.api.item.mmoitem.MMOItem;
import net.Indyuce.mmoitems.api.item.mmoitem.VolatileMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.VolatileMMOItem;
import net.Indyuce.mmoitems.api.player.PlayerData; import net.Indyuce.mmoitems.api.player.PlayerData;
import net.Indyuce.mmoitems.api.util.message.Message; import net.Indyuce.mmoitems.api.util.message.Message;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.DoubleData; import net.Indyuce.mmoitems.stat.data.DoubleData;
import net.Indyuce.mmoitems.stat.data.GemSocketsData; import net.Indyuce.mmoitems.stat.data.GemSocketsData;
import net.Indyuce.mmoitems.stat.data.GemstoneData; import net.Indyuce.mmoitems.stat.data.GemstoneData;
@ -39,6 +40,7 @@ import java.util.logging.Level;
* *
* @author Gunging * @author Gunging
*/ */
@HasCategory(cat = "consumables")
public class RandomUnsocket extends DoubleStat implements ConsumableItemInteraction { public class RandomUnsocket extends DoubleStat implements ConsumableItemInteraction {
public RandomUnsocket() { public RandomUnsocket() {
super("RANDOM_UNSOCKET", Material.BOWL, "Random Unsocket", super("RANDOM_UNSOCKET", Material.BOWL, "Random Unsocket",

View File

@ -9,6 +9,7 @@ import net.Indyuce.mmoitems.api.interaction.util.DurabilityItem;
import net.Indyuce.mmoitems.api.player.PlayerData; import net.Indyuce.mmoitems.api.player.PlayerData;
import net.Indyuce.mmoitems.api.util.message.Message; import net.Indyuce.mmoitems.api.util.message.Message;
import net.Indyuce.mmoitems.listener.CustomSoundListener; import net.Indyuce.mmoitems.listener.CustomSoundListener;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.type.ConsumableItemInteraction; import net.Indyuce.mmoitems.stat.type.ConsumableItemInteraction;
import net.Indyuce.mmoitems.stat.type.DoubleStat; import net.Indyuce.mmoitems.stat.type.DoubleStat;
import net.Indyuce.mmoitems.util.MMOUtils; import net.Indyuce.mmoitems.util.MMOUtils;
@ -23,6 +24,7 @@ import org.jetbrains.annotations.Nullable;
import java.util.function.Function; import java.util.function.Function;
@HasCategory(cat = "consumables")
public class RepairPower extends DoubleStat implements ConsumableItemInteraction { public class RepairPower extends DoubleStat implements ConsumableItemInteraction {
public RepairPower() { public RepairPower() {
super("REPAIR", Material.ANVIL, "Repair Power", new String[]{"The flat amount of durability your item", "can repair when set an item."}, super("REPAIR", Material.ANVIL, "Repair Power", new String[]{"The flat amount of durability your item", "can repair when set an item."},

View File

@ -5,6 +5,7 @@ import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.api.Type; import net.Indyuce.mmoitems.api.Type;
import net.Indyuce.mmoitems.api.interaction.Consumable; import net.Indyuce.mmoitems.api.interaction.Consumable;
import net.Indyuce.mmoitems.api.player.PlayerData; import net.Indyuce.mmoitems.api.player.PlayerData;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.type.ConsumableItemInteraction; import net.Indyuce.mmoitems.stat.type.ConsumableItemInteraction;
import net.Indyuce.mmoitems.stat.type.DoubleStat; import net.Indyuce.mmoitems.stat.type.DoubleStat;
import org.bukkit.Material; import org.bukkit.Material;
@ -12,6 +13,7 @@ import org.bukkit.event.inventory.InventoryClickEvent;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@HasCategory(cat = "consumables")
public class RepairPowerPercent extends DoubleStat implements ConsumableItemInteraction { public class RepairPowerPercent extends DoubleStat implements ConsumableItemInteraction {
public RepairPowerPercent() { public RepairPowerPercent() {
super("REPAIR_PERCENT", Material.DAMAGED_ANVIL, "Repair Percentage", super("REPAIR_PERCENT", Material.DAMAGED_ANVIL, "Repair Percentage",

View File

@ -1,9 +1,11 @@
package net.Indyuce.mmoitems.stat; package net.Indyuce.mmoitems.stat;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.type.GemStoneStat; import net.Indyuce.mmoitems.stat.type.GemStoneStat;
import net.Indyuce.mmoitems.stat.type.StringStat; import net.Indyuce.mmoitems.stat.type.StringStat;
import org.bukkit.Material; import org.bukkit.Material;
@HasCategory(cat = "consumables")
public class RepairReference extends StringStat implements GemStoneStat { public class RepairReference extends StringStat implements GemStoneStat {
public RepairReference() { public RepairReference() {
super("REPAIR_TYPE", Material.ANVIL, "Repair Reference", new String[]{"A repair consumable may only be used onto", "an item with the same repair reference."}, new String[0]); super("REPAIR_TYPE", Material.ANVIL, "Repair Reference", new String[]{"A repair consumable may only be used onto", "an item with the same repair reference."}, new String[0]);

View File

@ -5,6 +5,7 @@ import io.lumine.mythic.lib.api.item.NBTItem;
import io.lumine.mythic.lib.api.item.SupportedNBTTagValues; import io.lumine.mythic.lib.api.item.SupportedNBTTagValues;
import net.Indyuce.mmoitems.MMOItems; import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.player.RPGPlayer; import net.Indyuce.mmoitems.api.player.RPGPlayer;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.StringListData; import net.Indyuce.mmoitems.stat.data.StringListData;
import net.Indyuce.mmoitems.stat.data.type.StatData; import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.GemStoneStat; import net.Indyuce.mmoitems.stat.type.GemStoneStat;
@ -17,6 +18,7 @@ import java.util.ArrayList;
/** /**
* @author Gunging * @author Gunging
*/ */
@HasCategory(cat = "requirement")
public class RequiredBiomes extends StringListStat implements ItemRestriction, GemStoneStat { public class RequiredBiomes extends StringListStat implements ItemRestriction, GemStoneStat {
public RequiredBiomes() { public RequiredBiomes() {
super("REQUIRED_BIOMES", Material.JUNGLE_SAPLING, "Required Biomes", new String[] { "The biome the player must be within", "for this item to activate." }, new String[] { "!block", "all" }); super("REQUIRED_BIOMES", Material.JUNGLE_SAPLING, "Required Biomes", new String[] { "The biome the player must be within", "for this item to activate." }, new String[] { "!block", "all" });

View File

@ -11,6 +11,7 @@ import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.api.player.RPGPlayer; import net.Indyuce.mmoitems.api.player.RPGPlayer;
import net.Indyuce.mmoitems.api.util.message.Message; import net.Indyuce.mmoitems.api.util.message.Message;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.StringListData; import net.Indyuce.mmoitems.stat.data.StringListData;
import net.Indyuce.mmoitems.stat.data.type.StatData; import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.GemStoneStat; import net.Indyuce.mmoitems.stat.type.GemStoneStat;
@ -30,6 +31,7 @@ import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.regex.Pattern; import java.util.regex.Pattern;
@HasCategory(cat = "requirement")
public class RequiredClass extends StringListStat implements ItemRestriction, GemStoneStat { public class RequiredClass extends StringListStat implements ItemRestriction, GemStoneStat {
public RequiredClass() { public RequiredClass() {
super("REQUIRED_CLASS", Material.WRITABLE_BOOK, "Required Class", super("REQUIRED_CLASS", Material.WRITABLE_BOOK, "Required Class",

View File

@ -4,6 +4,7 @@ import io.lumine.mythic.lib.api.item.NBTItem;
import net.Indyuce.mmoitems.ItemStats; import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.api.player.RPGPlayer; import net.Indyuce.mmoitems.api.player.RPGPlayer;
import net.Indyuce.mmoitems.api.util.message.Message; import net.Indyuce.mmoitems.api.util.message.Message;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.RequiredLevelData; import net.Indyuce.mmoitems.stat.data.RequiredLevelData;
import net.Indyuce.mmoitems.stat.type.RequiredLevelStat; import net.Indyuce.mmoitems.stat.type.RequiredLevelStat;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
@ -11,6 +12,7 @@ import org.bukkit.Material;
import org.bukkit.Sound; import org.bukkit.Sound;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@HasCategory(cat = "requirement")
public class RequiredLevel extends RequiredLevelStat { public class RequiredLevel extends RequiredLevelStat {
/** /**

View File

@ -4,6 +4,7 @@ import io.lumine.mythic.lib.MythicLib;
import io.lumine.mythic.lib.api.util.ui.SilentNumbers; import io.lumine.mythic.lib.api.util.ui.SilentNumbers;
import net.Indyuce.mmoitems.ItemStats; import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.api.item.mmoitem.VolatileMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.VolatileMMOItem;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.DoubleData; import net.Indyuce.mmoitems.stat.data.DoubleData;
import net.Indyuce.mmoitems.stat.type.DoubleStat; import net.Indyuce.mmoitems.stat.type.DoubleStat;
import net.Indyuce.mmoitems.stat.type.PlayerConsumable; import net.Indyuce.mmoitems.stat.type.PlayerConsumable;
@ -18,9 +19,14 @@ import org.jetbrains.annotations.NotNull;
* *
* @author Gunging * @author Gunging
*/ */
@HasCategory(cat = "consumables")
public class RestoreFood extends DoubleStat implements PlayerConsumable { public class RestoreFood extends DoubleStat implements PlayerConsumable {
public RestoreFood() { public RestoreFood() {
super("RESTORE_FOOD", Material.PORKCHOP, "Food Restoration", new String[]{"Food units given when consumed."}, new String[]{"consumable"}); super("RESTORE_FOOD",
Material.PORKCHOP,
"Food Restoration",
new String[]{"Food units given when consumed."},
new String[]{"consumable"});
} }
@Override @Override

View File

@ -2,6 +2,7 @@ package net.Indyuce.mmoitems.stat;
import net.Indyuce.mmoitems.ItemStats; import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.api.item.mmoitem.VolatileMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.VolatileMMOItem;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.DoubleData; import net.Indyuce.mmoitems.stat.data.DoubleData;
import net.Indyuce.mmoitems.stat.type.DoubleStat; import net.Indyuce.mmoitems.stat.type.DoubleStat;
import net.Indyuce.mmoitems.stat.type.PlayerConsumable; import net.Indyuce.mmoitems.stat.type.PlayerConsumable;
@ -15,6 +16,7 @@ import org.jetbrains.annotations.NotNull;
* *
* @author Gunging * @author Gunging
*/ */
@HasCategory(cat = "consumables")
public class RestoreHealth extends DoubleStat implements PlayerConsumable { public class RestoreHealth extends DoubleStat implements PlayerConsumable {
public RestoreHealth() { public RestoreHealth() {
super("RESTORE_HEALTH", Material.RED_DYE, "Health Restoration", new String[]{"Health given when consumed."}, new String[]{"consumable"}); super("RESTORE_HEALTH", Material.RED_DYE, "Health Restoration", new String[]{"Health given when consumed."}, new String[]{"consumable"});

View File

@ -3,6 +3,7 @@ package net.Indyuce.mmoitems.stat;
import net.Indyuce.mmoitems.ItemStats; import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.api.item.mmoitem.VolatileMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.VolatileMMOItem;
import net.Indyuce.mmoitems.api.player.PlayerData; import net.Indyuce.mmoitems.api.player.PlayerData;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.DoubleData; import net.Indyuce.mmoitems.stat.data.DoubleData;
import net.Indyuce.mmoitems.stat.type.DoubleStat; import net.Indyuce.mmoitems.stat.type.DoubleStat;
import net.Indyuce.mmoitems.stat.type.PlayerConsumable; import net.Indyuce.mmoitems.stat.type.PlayerConsumable;
@ -15,6 +16,7 @@ import org.jetbrains.annotations.NotNull;
* *
* @author Gunging * @author Gunging
*/ */
@HasCategory(cat = "consumables")
public class RestoreMana extends DoubleStat implements PlayerConsumable { public class RestoreMana extends DoubleStat implements PlayerConsumable {
public RestoreMana() { public RestoreMana() {
super("RESTORE_MANA", Material.LAPIS_LAZULI, "Restore Mana", new String[]{"The amount of mana", "your consumable restores."}, new String[]{"consumable"}); super("RESTORE_MANA", Material.LAPIS_LAZULI, "Restore Mana", new String[]{"The amount of mana", "your consumable restores."}, new String[]{"consumable"});

View File

@ -2,6 +2,7 @@ package net.Indyuce.mmoitems.stat;
import io.lumine.mythic.lib.MythicLib; import io.lumine.mythic.lib.MythicLib;
import net.Indyuce.mmoitems.ItemStats; import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.util.MMOUtils; import net.Indyuce.mmoitems.util.MMOUtils;
import net.Indyuce.mmoitems.api.item.mmoitem.VolatileMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.VolatileMMOItem;
import net.Indyuce.mmoitems.stat.data.DoubleData; import net.Indyuce.mmoitems.stat.data.DoubleData;
@ -17,6 +18,7 @@ import org.jetbrains.annotations.NotNull;
* *
* @author Gunging * @author Gunging
*/ */
@HasCategory(cat = "consumables")
public class RestoreSaturation extends DoubleStat implements PlayerConsumable { public class RestoreSaturation extends DoubleStat implements PlayerConsumable {
public RestoreSaturation() { public RestoreSaturation() {
super("RESTORE_SATURATION", Material.GOLDEN_CARROT, "Saturation Restoration", new String[]{"Saturation given when consumed."}, new String[]{"consumable"}); super("RESTORE_SATURATION", Material.GOLDEN_CARROT, "Saturation Restoration", new String[]{"Saturation given when consumed."}, new String[]{"consumable"});

View File

@ -3,6 +3,7 @@ package net.Indyuce.mmoitems.stat;
import net.Indyuce.mmoitems.ItemStats; import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.api.item.mmoitem.VolatileMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.VolatileMMOItem;
import net.Indyuce.mmoitems.api.player.PlayerData; import net.Indyuce.mmoitems.api.player.PlayerData;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.DoubleData; import net.Indyuce.mmoitems.stat.data.DoubleData;
import net.Indyuce.mmoitems.stat.type.DoubleStat; import net.Indyuce.mmoitems.stat.type.DoubleStat;
import net.Indyuce.mmoitems.stat.type.PlayerConsumable; import net.Indyuce.mmoitems.stat.type.PlayerConsumable;
@ -15,6 +16,7 @@ import org.jetbrains.annotations.NotNull;
* *
* @author Gunging * @author Gunging
*/ */
@HasCategory(cat = "consumables")
public class RestoreStamina extends DoubleStat implements PlayerConsumable { public class RestoreStamina extends DoubleStat implements PlayerConsumable {
public RestoreStamina() { public RestoreStamina() {
super("RESTORE_STAMINA", Material.LIGHT_GRAY_DYE, "Restore Stamina", new String[]{"The amount of stamina/power", "your consumable restores."}, new String[]{"consumable"}); super("RESTORE_STAMINA", Material.LIGHT_GRAY_DYE, "Restore Stamina", new String[]{"The amount of stamina/power", "your consumable restores."}, new String[]{"consumable"});

View File

@ -9,6 +9,7 @@ import net.Indyuce.mmoitems.api.util.MMOItemReforger;
import net.Indyuce.mmoitems.api.util.NumericStatFormula; import net.Indyuce.mmoitems.api.util.NumericStatFormula;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.gui.edition.RevisionInventory; import net.Indyuce.mmoitems.gui.edition.RevisionInventory;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.DoubleData; import net.Indyuce.mmoitems.stat.data.DoubleData;
import net.Indyuce.mmoitems.stat.type.GemStoneStat; import net.Indyuce.mmoitems.stat.type.GemStoneStat;
import net.Indyuce.mmoitems.stat.type.ItemStat; import net.Indyuce.mmoitems.stat.type.ItemStat;
@ -24,15 +25,19 @@ import java.util.Optional;
/** /**
* Regarding the auto updating of items * Regarding the auto updating of items
*
* @see RevisionInventory * @see RevisionInventory
* @see MMOItemReforger * @see MMOItemReforger
*/ */
@HasCategory(cat = "general")
public class RevisionID extends ItemStat<NumericStatFormula, DoubleData> implements GemStoneStat { public class RevisionID extends ItemStat<NumericStatFormula, DoubleData> implements GemStoneStat {
public RevisionID() { public RevisionID() {
super("REVISION_ID", Material.ITEM_FRAME, "Revision ID", new String[] { "The Revision ID is used to determine", super("REVISION_ID",
"if an item is outdated or not. You", "should increase this whenever", "you make changes to your item!", "", "\u00a76The updater is smart and will apply", "\u00a76changes to the base stats of the item,", "\u00a76keeping gemstones intact (for example)."}, Material.ITEM_FRAME,
new String[0]); "Revision ID",
} new String[]{"The Revision ID is used to determine", "if an item is outdated or not. You", "should increase this whenever", "you make changes to your item!", "", "\u00a76The updater is smart and will apply", "\u00a76changes to the base stats of the item,", "\u00a76keeping gemstones intact (for example)."},
new String[0]);
}
@Override @Override
public NumericStatFormula whenInitialized(Object object) { public NumericStatFormula whenInitialized(Object object) {

View File

@ -9,6 +9,7 @@ import net.Indyuce.mmoitems.api.edition.StatEdition;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.ShieldPatternData; import net.Indyuce.mmoitems.stat.data.ShieldPatternData;
import net.Indyuce.mmoitems.stat.type.ItemStat; import net.Indyuce.mmoitems.stat.type.ItemStat;
import org.apache.commons.lang.Validate; import org.apache.commons.lang.Validate;
@ -31,6 +32,7 @@ import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.Set; import java.util.Set;
@HasCategory(cat = "item")
public class ShieldPatternStat extends ItemStat<ShieldPatternData, ShieldPatternData> { public class ShieldPatternStat extends ItemStat<ShieldPatternData, ShieldPatternData> {
public ShieldPatternStat() { public ShieldPatternStat() {
super("SHIELD_PATTERN", Material.SHIELD, "Shield Pattern", new String[] { "The color & patterns", "of your shield." }, super("SHIELD_PATTERN", Material.SHIELD, "Shield Pattern", new String[] { "The color & patterns", "of your shield." },

View File

@ -9,6 +9,7 @@ import net.Indyuce.mmoitems.api.edition.StatEdition;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.SkullTextureData; import net.Indyuce.mmoitems.stat.data.SkullTextureData;
import net.Indyuce.mmoitems.stat.type.ItemStat; import net.Indyuce.mmoitems.stat.type.ItemStat;
import org.apache.commons.lang.Validate; import org.apache.commons.lang.Validate;
@ -27,6 +28,7 @@ import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.UUID; import java.util.UUID;
@HasCategory(cat = "item")
public class SkullTextureStat extends ItemStat<SkullTextureData, SkullTextureData> { public class SkullTextureStat extends ItemStat<SkullTextureData, SkullTextureData> {
public SkullTextureStat() { public SkullTextureStat() {
super("SKULL_TEXTURE", Material.PLAYER_HEAD, "Skull Texture", new String[]{ super("SKULL_TEXTURE", Material.PLAYER_HEAD, "Skull Texture", new String[]{

View File

@ -5,6 +5,7 @@ import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.StoredTagsData; import net.Indyuce.mmoitems.stat.data.StoredTagsData;
import net.Indyuce.mmoitems.stat.data.random.RandomStatData; import net.Indyuce.mmoitems.stat.data.random.RandomStatData;
import net.Indyuce.mmoitems.stat.type.GemStoneStat; import net.Indyuce.mmoitems.stat.type.GemStoneStat;
@ -25,6 +26,7 @@ import java.util.Optional;
* the NBT tags from the previous item are transferred towards * the NBT tags from the previous item are transferred towards
* the new item. * the new item.
*/ */
@HasCategory(cat = "misc")
public class StoredTags extends ItemStat<RandomStatData<StoredTagsData>, StoredTagsData> implements InternalStat, GemStoneStat { public class StoredTags extends ItemStat<RandomStatData<StoredTagsData>, StoredTagsData> implements InternalStat, GemStoneStat {
public StoredTags() { public StoredTags() {
super("STORED_TAGS", Material.OAK_SIGN, "Stored Tags", super("STORED_TAGS", Material.OAK_SIGN, "Stored Tags",

View File

@ -1,18 +1,22 @@
package net.Indyuce.mmoitems.stat; package net.Indyuce.mmoitems.stat;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import org.bukkit.Material; import org.bukkit.Material;
import net.Indyuce.mmoitems.stat.type.DoubleStat; import net.Indyuce.mmoitems.stat.type.DoubleStat;
import net.Indyuce.mmoitems.stat.type.GemStoneStat; import net.Indyuce.mmoitems.stat.type.GemStoneStat;
@HasCategory(cat = "gem_stones")
public class SuccessRate extends DoubleStat implements GemStoneStat { public class SuccessRate extends DoubleStat implements GemStoneStat {
/** /**
* in a different class because Success Rate is meant to be a proper stat * in a different class because Success Rate is meant to be a proper stat
*/ */
public SuccessRate() { public SuccessRate() {
super("SUCCESS_RATE", Material.EMERALD, "Success Rate", new String[] { "The chance of your gem/skin to successfully", super("SUCCESS_RATE",
"apply onto an item. This value is 100%", "by default. If it is not successfully", "applied, the gem/skin will be lost." }, Material.EMERALD,
new String[] { "gem_stone", "skin" }); "Success Rate",
} new String[]{"The chance of your gem/skin to successfully", "apply onto an item. This value is 100%", "by default. If it is not successfully", "applied, the gem/skin will be lost."},
new String[]{"gem_stone", "skin"});
}
} }

View File

@ -4,6 +4,7 @@ import io.lumine.mythic.lib.UtilityMethods;
import io.lumine.mythic.lib.api.item.ItemTag; import io.lumine.mythic.lib.api.item.ItemTag;
import net.Indyuce.mmoitems.MMOItems; import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.tooltip.TooltipTexture; import net.Indyuce.mmoitems.tooltip.TooltipTexture;
import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.data.StringData; import net.Indyuce.mmoitems.stat.data.StringData;
@ -13,10 +14,14 @@ import org.apache.commons.lang.Validate;
import org.bukkit.Material; import org.bukkit.Material;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@HasCategory(cat = "tooltip")
public class TooltipStat extends StringStat implements GemStoneStat { public class TooltipStat extends StringStat implements GemStoneStat {
public TooltipStat() { public TooltipStat() {
super("TOOLTIP", Material.BIRCH_SIGN, "Tooltip", new String[]{"The identifier of the custom tooltip texture", "you'd like to use. Check the wiki for usage!", super("TOOLTIP",
"&9Tooltips are setup in the tooltips.yml file"}, new String[0]); Material.BIRCH_SIGN,
"Tooltip",
new String[]{"The identifier of the custom tooltip texture", "you'd like to use. Check the wiki for usage!", "Tooltips are setup in the tooltips.yml file"},
new String[0]);
} }
@Override @Override
@ -24,7 +29,7 @@ public class TooltipStat extends StringStat implements GemStoneStat {
final String format = UtilityMethods.enumName(data.toString()); final String format = UtilityMethods.enumName(data.toString());
final TooltipTexture texture = MMOItems.plugin.getLore().getTooltip(format); final TooltipTexture texture = MMOItems.plugin.getLore().getTooltip(format);
Validate.notNull(texture, "Could not find tooltip with ID '" + format + "'"); Validate.notNull(texture, "Could not find tooltip with ID '" + format + "'");
item.addItemTag(new ItemTag("MMOITEMS_TOOLTIP", texture.getId())); item.addItemTag(new ItemTag(getNBTPath(), texture.getId()));
} }
@Override @Override

View File

@ -2,6 +2,7 @@ package net.Indyuce.mmoitems.stat;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.StringData; import net.Indyuce.mmoitems.stat.data.StringData;
import net.Indyuce.mmoitems.stat.type.ChooseStat; import net.Indyuce.mmoitems.stat.type.ChooseStat;
import net.Indyuce.mmoitems.stat.type.GemStoneStat; import net.Indyuce.mmoitems.stat.type.GemStoneStat;
@ -20,6 +21,7 @@ import org.jetbrains.annotations.Nullable;
/** /**
* @author Jules * @author Jules
*/ */
@HasCategory(cat = "item")
@VersionDependant(version = {1, 20}) @VersionDependant(version = {1, 20})
public class TrimMaterialStat extends ChooseStat implements GemStoneStat { public class TrimMaterialStat extends ChooseStat implements GemStoneStat {
public TrimMaterialStat() { public TrimMaterialStat() {

View File

@ -2,6 +2,7 @@ package net.Indyuce.mmoitems.stat;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.StringData; import net.Indyuce.mmoitems.stat.data.StringData;
import net.Indyuce.mmoitems.stat.type.ChooseStat; import net.Indyuce.mmoitems.stat.type.ChooseStat;
import net.Indyuce.mmoitems.stat.type.GemStoneStat; import net.Indyuce.mmoitems.stat.type.GemStoneStat;
@ -20,6 +21,7 @@ import org.jetbrains.annotations.Nullable;
/** /**
* @author Jules * @author Jules
*/ */
@HasCategory(cat = "item")
@VersionDependant(version = {1, 20}) @VersionDependant(version = {1, 20})
public class TrimPatternStat extends ChooseStat implements GemStoneStat { public class TrimPatternStat extends ChooseStat implements GemStoneStat {
public TrimPatternStat() { public TrimPatternStat() {

View File

@ -3,6 +3,7 @@ package net.Indyuce.mmoitems.stat;
import io.lumine.mythic.lib.api.item.SupportedNBTTagValues; import io.lumine.mythic.lib.api.item.SupportedNBTTagValues;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder; import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.BooleanData; import net.Indyuce.mmoitems.stat.data.BooleanData;
import net.Indyuce.mmoitems.stat.data.type.StatData; import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.BooleanStat; import net.Indyuce.mmoitems.stat.type.BooleanStat;
@ -14,6 +15,7 @@ import org.jetbrains.annotations.Nullable;
import java.util.ArrayList; import java.util.ArrayList;
@HasCategory(cat = "durability")
public class Unbreakable extends BooleanStat { public class Unbreakable extends BooleanStat {
public Unbreakable() { public Unbreakable() {
super("UNBREAKABLE", Material.ANVIL, "Unbreakable", new String[]{"Infinite durability if set to true."}, new String[0]); super("UNBREAKABLE", Material.ANVIL, "Unbreakable", new String[]{"Infinite durability if set to true."}, new String[0]);

Some files were not shown because too many files have changed in this diff Show More