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 net.Indyuce.mmoitems.stat.*;
import net.Indyuce.mmoitems.stat.annotation.DeprecatedStat;
import net.Indyuce.mmoitems.stat.block.*;
import net.Indyuce.mmoitems.stat.type.*;
import org.bukkit.Material;
@ -69,44 +68,44 @@ public class ItemStats {
REQUIRED_CLASS = new RequiredClass(),
ATTACK_DAMAGE = new AttackDamage(),
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_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"}),
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_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"}),
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_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_COOLDOWN_REDUCTION = new DoubleStat("BLOCK_COOLDOWN_REDUCTION", Material.IRON_HELMET, "Block Cooldown Reduction", new String[]{"Reduces the blocking cooldown (%)."}, 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"}),
DODGE_COOLDOWN_REDUCTION = new DoubleStat("DODGE_COOLDOWN_REDUCTION", Material.FEATHER, "Dodge Cooldown Reduction", new String[]{"Reduces the dodging cooldown (%)."}, 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"}),
PARRY_COOLDOWN_REDUCTION = new DoubleStat("PARRY_COOLDOWN_REDUCTION", Material.BUCKET, "Parry Cooldown Reduction", new String[]{"Reduces the parrying cooldown (%)."}, new String[]{"!miscellaneous", "!block", "all"}),
COOLDOWN_REDUCTION = new DoubleStat("COOLDOWN_REDUCTION", Material.BOOK, "Cooldown Reduction", new String[]{"Reduces cooldowns of item and player skills (%)."}),
RANGE = new DoubleStat("RANGE", Material.STICK, "Range", new String[]{"The range of your item attacks."}, new String[]{"staff", "whip", "wand", "musket", "gem_stone"}),
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"}).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"}).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"}).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"}).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"}).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"}).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"}).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"}).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"}).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"}).setCategory(StatCategories.OFFENSE),
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"}).setCategory(StatCategories.RANGED_WEAPONS),
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"}),
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"}),
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"}).setCategory(StatCategories.RANGED_WEAPONS),
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"}),
PVP_DAMAGE = new DoubleStat("PVP_DAMAGE", Material.SKELETON_SKULL, "PvP Damage", new String[]{"Additional damage", "against players in %."}, new String[]{"equipment", "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"}),
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"}),
WEAPON_DAMAGE = new DoubleStat("WEAPON_DAMAGE", Material.IRON_SWORD, "Weapon Damage", new String[]{"Additional on-hit weapon damage in %."}),
SKILL_DAMAGE = new DoubleStat("SKILL_DAMAGE", Material.BOOK, "Skill Damage", new String[]{"Additional ability damage in %."}),
PROJECTILE_DAMAGE = new DoubleStat("PROJECTILE_DAMAGE", Material.ARROW, "Projectile Damage", new String[]{"Additional skill/weapon projectile damage."}),
MAGIC_DAMAGE = new DoubleStat("MAGIC_DAMAGE", Material.MAGMA_CREAM, "Magic Damage", new String[]{"Additional magic skill damage in %."}),
PHYSICAL_DAMAGE = new DoubleStat("PHYSICAL_DAMAGE", Material.IRON_AXE, "Physical Damage", new String[]{"Additional skill/weapon physical damage."}),
DEFENSE = new DoubleStat("DEFENSE", Material.SHIELD, "Defense", new String[]{"Reduces damage from any source.", "Formula can be set in MMOLib Config."}),
DAMAGE_REDUCTION = new DoubleStat("DAMAGE_REDUCTION", Material.IRON_CHESTPLATE, "Damage Reduction", new String[]{"Reduces damage from any source.", "In %."}),
FALL_DAMAGE_REDUCTION = new DoubleStat("FALL_DAMAGE_REDUCTION", Material.FEATHER, "Fall Damage Reduction", new String[]{"Reduces fall damage.", "In %."}),
PROJECTILE_DAMAGE_REDUCTION = new DoubleStat("PROJECTILE_DAMAGE_REDUCTION", Material.SNOWBALL, "Projectile Damage Reduction", new String[]{"Reduces projectile damage.", "In %."}),
PHYSICAL_DAMAGE_REDUCTION = new DoubleStat("PHYSICAL_DAMAGE_REDUCTION", Material.LEATHER_CHESTPLATE, "Physical Damage Reduction", new String[]{"Reduces physical damage.", "In %."}),
FIRE_DAMAGE_REDUCTION = new DoubleStat("FIRE_DAMAGE_REDUCTION", Material.BLAZE_POWDER, "Fire Damage Reduction", new String[]{"Reduces fire damage.", "In %."}),
MAGIC_DAMAGE_REDUCTION = new DoubleStat("MAGIC_DAMAGE_REDUCTION", Material.POTION, "Magic Damage Reduction", new String[]{"Reduce magic damage dealt by potions.", "In %."}),
PVE_DAMAGE_REDUCTION = new DoubleStat("PVE_DAMAGE_REDUCTION", Material.PORKCHOP, "PvE Damage Reduction", new String[]{"Reduces damage dealt by mobs.", "In %."}),
PVP_DAMAGE_REDUCTION = new DoubleStat("PVP_DAMAGE_REDUCTION", Material.SKELETON_SKULL, "PvP Damage Reduction", new String[]{"Reduces damage dealt by players", "In %."}),
UNDEAD_DAMAGE = new DoubleStat("UNDEAD_DAMAGE", Material.SKELETON_SKULL, "Undead Damage", new String[]{"Deals additional damage to undead.", "In %."}),
LIFESTEAL = new DoubleStat("LIFESTEAL", Material.REDSTONE, "Lifesteal", new String[]{"Percentage of damage you gain back as", "health when inflicting weapon 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."}),
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"}).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"}).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"}).setCategory(StatCategories.DAMAGE_MITIGATION),
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 %."}).setCategory(StatCategories.DAMAGE_MITIGATION),
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 %."}).setCategory(StatCategories.DAMAGE_MITIGATION),
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."}).setCategory(StatCategories.DAMAGE_MITIGATION),
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 %."}).setCategory(StatCategories.DAMAGE_MITIGATION),
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 %."}).setCategory(StatCategories.DAMAGE_MITIGATION),
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 %."}).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 %."}).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 %."}).setCategory(StatCategories.DAMAGE_MITIGATION),
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."}).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."}).setCategory(StatCategories.OFFENSE),
// Extra Stats
UNBREAKABLE = new Unbreakable(),
@ -116,10 +115,10 @@ public class ItemStats {
ARMOR_TOUGHNESS = new ArmorToughness(),
MAX_HEALTH = new MaxHealth(),
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(),
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(),
DROP_ON_DEATH = new DisableDeathDrop(),
HIDE_DURABILITY_BAR = new HideDurabilityBar(),
@ -163,8 +162,8 @@ public class ItemStats {
SOULBOUND_BREAK_CHANCE = new SoulbindingBreakChance(),
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"}),
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"}),
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"}),
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"}).setCategory(StatCategories.ABILITIES),
VANILLA_EATING_ANIMATION = new VanillaEatingAnimation(),
GEM_COLOR = new GemColor(),
GEM_UPGRADE_SCALING = new GemUpgradeScaling(),
@ -178,8 +177,8 @@ 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]),
// 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"}),
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"}),
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"}).setCategory(StatCategories.TOOLS),
PICKAXE_POWER = new PickaxePower(),
CUSTOM_SOUNDS = new CustomSounds(),
ELEMENTS = new Elements(),
@ -187,8 +186,8 @@ public class ItemStats {
// STAFF_SPIRIT = new StaffSpiritStat(),
LUTE_ATTACK_SOUND = new LuteAttackSoundStat(),
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"}),
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),
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).setCategory(StatCategories.MISC),
COMPATIBLE_TYPES = new CompatibleTypes(),
COMPATIBLE_IDS = new CompatibleIds(),
COMPATIBLE_MATERIALS = new CompatibleMaterials(),
@ -198,19 +197,19 @@ public class ItemStats {
REPAIR = new RepairPower(),
REPAIR_PERCENT = new RepairPowerPercent(),
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"}),
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."),
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"}),
RECOIL = new DoubleStat("RECOIL", Material.IRON_HORSE_ARMOR, "Recoil", new String[]{"Corresponds to the shooting innacuracy."}, new String[]{"musket", "gem_stone"}),
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"}),
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.").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"}).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"}).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"}).setCategory(StatCategories.MISC),
AMPHIBIAN = new Amphibian(),
// Abilities & Upgrading
ABILITIES = new Abilities(),
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_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_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_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"}).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).setCategory(StatCategories.UPGRADING),
// Unique Item Stats
DYE_COLOR = new DyeColor(),
@ -231,10 +230,10 @@ public class ItemStats {
BROWSER_DISPLAY_IDX = new BrowserDisplayIDX();
/**
* @deprecated Item damage is now {@link ItemDamage} and
* custom durability is now {@link CustomDurability}
* @see ItemDamage
* @see CustomDurability
* @deprecated
*/
@Deprecated
@DeprecatedStat
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)
findRpgPlugins();
statManager.reload(false); // Elemental stats must be loaded before sets
/*
* After tiers, sets and upgrade templates are loaded, MI template data
* can be fully loaded
*/
statManager.loadElements(); // Why is this call made there?
loreManager.reload();
tierManager = new TierManager();
setManager = new SetManager();
@ -179,7 +180,6 @@ public class MMOItems extends MMOPlugin {
dropTableManager = new DropTableManager();
worldGenManager = new WorldGenManager();
blockManager = new BlockManager();
statManager.reload(false);
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.util.PostLoadAction;
import io.lumine.mythic.lib.util.PreloadedObject;
import io.lumine.mythic.lib.util.annotation.BackwardsCompatibility;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.interaction.*;
import net.Indyuce.mmoitems.api.interaction.weapon.Weapon;
@ -26,12 +27,10 @@ import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.*;
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 {
// 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
*/
private final List<ItemStat> available = new ArrayList<>();
private final List<ItemStat<?, ?>> statCache = new ArrayList<>();
private final PostLoadAction postLoadAction = new PostLoadAction(true, config -> {
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
* loaded and is a PRETTY GOOD performance improvement.
*/
public List<ItemStat> getAvailableStats() {
return available;
public List<ItemStat<?, ?>> getAvailableStats() {
return statCache;
}
/**
@ -396,5 +395,12 @@ public class Type implements CooldownObject, PreloadedObject {
return getId();
}
@BackwardsCompatibility(version = "6.10.1")
public Collection<Type> LEGACY_TYPES = Arrays.asList(
);
//endregion
}

View File

@ -75,11 +75,15 @@ public class MMOItemTemplate implements ItemReference, PreloadedObject {
for (String key : config.getConfigurationSection("base").getKeys(false))
try {
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));
RandomStatData data = stat.whenInitialized(config.get("base." + key));
if (data != null)
base.put(stat, data);
RandomStatData<?> data = stat.whenInitialized(config.get("base." + key));
if (data != null) base.put(stat, data);
} catch (IllegalArgumentException exception) {

View File

@ -66,6 +66,10 @@ public class ModifierNode implements PreloadedObject {
try {
final String statId = UtilityMethods.enumName(key);
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 + "'");
ModifierNode.this.data.put(stat, stat.whenInitialized(statSection.get(key)));
} 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.api.item.NBTItem;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.event.MMOItemReforgeEvent;
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.type.ItemStat;
import net.advancedplugins.ae.api.EnchantApplyEvent;
@ -11,8 +13,14 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
public class AdvancedEnchantmentsHook implements Listener {
public static final ItemStat ADVANCED_ENCHANTMENTS = new AdvancedEnchantsStat();
public static final ItemStat DISABLE_ADVANCED_ENCHANTMENTS = new DisableAdvancedEnchantments();
public static final StatCategory STAT_CATEGORY = new StatCategory("AE", "Advanced Enchants", "Advanced Enchants");
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
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.PlayerResourceUpdateEvent;
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.Profession;
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.player.PlayerData;
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.RequiredAttribute;
import net.Indyuce.mmoitems.comp.mmocore.stat.RequiredProfession;
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.event.EventHandler;
import org.bukkit.event.EventPriority;
@ -29,8 +27,6 @@ import org.bukkit.event.Listener;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.Damageable;
import java.util.Locale;
public class MMOCoreHook implements RPGHandler, Listener {
/**
@ -48,10 +44,7 @@ public class MMOCoreHook implements RPGHandler, Listener {
for (Profession profession : MMOCore.plugin.professionManager.getAll()) {
// Adds profession specific Additional Experience stats.
MMOItems.plugin.getStats().register(new DoubleStat((StatType.ADDITIONAL_EXPERIENCE.name() + '_' + profession.getId())
.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 AdditionalProfessionExp(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.droptable.dropitem.DropItem;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.StatCategories;
import net.Indyuce.mmoitems.api.block.CustomBlock;
import net.Indyuce.mmoitems.api.crafting.ConditionalDisplay;
import net.Indyuce.mmoitems.comp.mmocore.crafting.AttributeCondition;
@ -28,19 +29,19 @@ import java.util.Optional;
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 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 MANA_REGENERATION = new DoubleStat("MANA_REGENERATION", Material.LAPIS_LAZULI, "Mana Regeneration", new String[]{"Amount of mana pts 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."});
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 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 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."}).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."}).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."}).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."}).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."}).setCategory(StatCategories.RESOURCES);
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",
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,
"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

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.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.data.DoubleData;
import net.Indyuce.mmoitems.stat.type.DoubleStat;
import org.bukkit.Material;
import org.jetbrains.annotations.NotNull;
@HasCategory(cat = "mmocore_attributes")
public class ExtraAttribute extends DoubleStat {
public ExtraAttribute(PlayerAttribute attribute) {
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.mmoitems.api.player.RPGPlayer;
import net.Indyuce.mmoitems.api.util.message.Message;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.type.RequiredLevelStat;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.Sound;
@HasCategory(cat = "mmocore_attributes")
public class RequiredAttribute extends RequiredLevelStat {
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.mmoitems.api.player.RPGPlayer;
import net.Indyuce.mmoitems.api.util.message.Message;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.type.RequiredLevelStat;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.Sound;
@HasCategory(cat = "mmocore_professions")
public class RequiredProfession extends RequiredLevelStat {
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.api.item.build.ItemStackBuilder;
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.type.GemStoneStat;
import net.Indyuce.mmoitems.stat.type.StringStat;
@ -12,6 +13,7 @@ import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.jetbrains.annotations.NotNull;
@HasCategory(cat = "misc")
public class AccessorySet extends StringStat implements GemStoneStat {
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" });

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.DamageType;
import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.player.PlayerData;
import net.Indyuce.mmoitems.api.player.RPGPlayer;
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.ItemRestriction;
import net.Indyuce.mmoitems.stat.type.ItemStat;
@ -43,11 +45,15 @@ import java.util.Set;
public class HeroesHook implements RPGHandler, Listener, AttackHandler {
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() {
MythicLib.plugin.getDamage().registerHandler(this);
MMOItems.plugin.getStats().registerCategory(STAT_CATEGORY);
damages.put(SkillType.ABILITY_PROPERTY_PHYSICAL, DamageType.PHYSICAL);
damages.put(SkillType.ABILITY_PROPERTY_MAGICAL, DamageType.MAGIC);

View File

@ -1,22 +1,23 @@
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.exceptions.McMMOPlayerNotFoundException;
import com.gmail.nossr50.events.experience.McMMOPlayerLevelDownEvent;
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.RPGPlayer;
import net.Indyuce.mmoitems.stat.category.StatCategory;
import net.Indyuce.mmoitems.stat.type.DisableStat;
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 static final StatCategory STAT_CATEGORY = new StatCategory("MCMMO", "mcMMO", "mcMMO");
/**
* 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
@ -24,7 +25,11 @@ public class McMMOHook implements RPGHandler, Listener {
* not in the constructor of that class
*/
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)
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 net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.StatCategories;
import net.Indyuce.mmoitems.api.ConfigFile;
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.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.util.ElementStatType;
import org.apache.commons.lang.Validate;
@ -23,6 +26,8 @@ import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Modifier;
import java.util.*;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.logging.Level;
public class StatManager {
@ -37,6 +42,9 @@ public class StatManager {
@BackwardsCompatibility(version = "not_specified")
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
* the first time to make their access easier. Check the classes
@ -54,33 +62,38 @@ public class StatManager {
public void loadBuiltins() {
// Builtin categories
for (Field field : StatCategory.class.getFields())
try {
if (Modifier.isStatic(field.getModifiers())
&& Modifier.isFinal(field.getModifiers())
&& 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()));
}
forEachField(StatCategories.class, StatCategory.class, this::registerCategory, "Couldn't register category called '%s': %s");
// Load builtin config adapters
forEachField(LegacyConfigAdapters.class, LegacyConfigAdapter.class, this::registerLegacyConfigAdapter, "Internal error '%s': %s");
// Load builtin stats
for (Field field : ItemStats.class.getFields())
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()));
}
forEachField(ItemStats.class, ItemStat.class, this::register, "Couldn't register stat called '%s': %s");
// Custom stats
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) {
// 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
// Register elemental stats
loadElements();
registerElementStats();
// Load stat translation objects (nothing to do with stats)
final ConfigurationSection statOptions = new ConfigFile("/language", "stats").getConfig();
for (ItemStat<?, ?> stat : getAll())
try {
@Nullable Object object = statOptions.get(stat.getPath());
if (object == null) object = statOptions.get(stat.getLegacyTranslationPath());
stat.loadConfiguration(statOptions, object != null ? object : "<TranslationNotFound:" + stat.getPath() + ">");
stat.readTranslationFile(statOptions);
} catch (RuntimeException exception) {
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
*/
@ -110,24 +127,32 @@ public class StatManager {
ConfigFile config = new ConfigFile("custom-stats");
ConfigurationSection section = config.getConfig().getConfigurationSection("custom-stats");
Validate.notNull(section, "Custom stats section is null");
section.getKeys(true).stream().filter(section::isConfigurationSection).map(section::getConfigurationSection).filter(Objects::nonNull).forEach(this::registerCustomStat);
}
/**
* Register all MythicLib elements as stats
* <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));
section.getKeys(true).stream()
.filter(section::isConfigurationSection)
.map(section::getConfigurationSection)
.filter(Objects::nonNull)
.forEach(this::registerCustomStat);
}
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);
}
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
public StatCategory getCategory(@NotNull String 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);
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);
if (stat != null) return stat;
@ -231,6 +256,9 @@ public class StatManager {
HasCategory statCatAnnot = stat.getClass().getAnnotation(HasCategory.class);
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
* 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
* take it into account
*/
if (MMOItems.plugin.getTypes() != null)
MMOItems.plugin.getTypes().getAll().stream().filter(stat::isCompatible).forEach(type -> type.getAvailableStats().add(stat));
if (MMOItems.plugin.getTypes() != null) for (Type itemType : MMOItems.plugin.getTypes().getAll())
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) {
@ -278,6 +330,7 @@ public class StatManager {
// Create a new stat instance
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]);
stat.setCategory(StatCategories.CUSTOM);
register(stat);
} catch (InstantiationException | IllegalAccessException | InvocationTargetException |
NoSuchMethodException e) {
@ -302,4 +355,9 @@ public class StatManager {
public void loadInternalStats() {
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
* both item generation (and GUI) calculations. probably the thing
* which takes the most time when loading item types.
* Caches all the stats which the type can have to reduce future
* both item generation (and GUI) calculations. This is a great
* optimisation when loading items, it is less important when
* displaying the item editor UI
*/
type.getAvailableStats().clear();
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.EditionInventory;
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.AbilityListData;
import net.Indyuce.mmoitems.stat.data.random.RandomAbilityData;
@ -33,6 +34,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
@HasCategory(cat = "abilities")
public class Abilities extends ItemStat<RandomAbilityListData, AbilityListData> {
public Abilities() {
super("ABILITY", Material.BLAZE_POWDER, "Item Abilities",
@ -57,21 +59,11 @@ public class Abilities extends ItemStat<RandomAbilityListData, AbilityListData>
@BackwardsCompatibility(version = "6.10")
@Override
public void loadConfiguration(@NotNull ConfigurationSection legacyLanguageFile, @NotNull Object configObject) {
// COMPATIBILITY CODE FOR MI <6.10
if (!(configObject instanceof ConfigurationSection)) {
generalFormat = legacyLanguageFile.getString("ability-format");
modifierIfAny = "\n";
modifierNewLine = "\n";
modifierForEach = legacyLanguageFile.getString("ability-modifier");
modifierSplitter = "";
abilitySplitter = legacyLanguageFile.getString("ability-splitter");
useAbilitySplitter = abilitySplitter != null && !abilitySplitter.isEmpty();
modifiersPerLine = 1;
return;
}
public void readTranslationFile(@NotNull ConfigurationSection translationFile) {
Object configObject = translationFile.get("ability");
// Up to date code
if (configObject instanceof ConfigurationSection) {
final ConfigurationSection config = (ConfigurationSection) configObject;
generalFormat = config.getString("general-format");
modifierIfAny = config.getString("modifier-if-any", ""); // Backwards compatibility
@ -83,6 +75,19 @@ public class Abilities extends ItemStat<RandomAbilityListData, AbilityListData>
modifiersPerLine = config.getInt("modifiers-per-line");
}
// COMPATIBILITY CODE FOR MI <6.10
else {
generalFormat = translationFile.getString("ability-format");
modifierIfAny = "\n";
modifierNewLine = "\n";
modifierForEach = translationFile.getString("ability-modifier");
modifierSplitter = "";
abilitySplitter = translationFile.getString("ability-splitter");
useAbilitySplitter = abilitySplitter != null && !abilitySplitter.isEmpty();
modifiersPerLine = 1;
}
}
@Override
public void whenApplied(@NotNull ItemStackBuilder item, @NotNull AbilityListData data) {
final List<String> abilityLore = new ArrayList<>();
@ -126,11 +131,6 @@ public class Abilities extends ItemStat<RandomAbilityListData, AbilityListData>
item.addItemTag(getAppliedNBT(data));
}
@Override
public String getLegacyTranslationPath() {
return "ability-format";
}
@NotNull
@Override
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.mmoitem.ReadMMOItem;
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.type.StringStat;
import org.bukkit.Material;
@ -15,6 +16,7 @@ import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
@HasCategory(cat = "abilities")
public class ActionLeftClick extends StringStat {
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"});

View File

@ -6,11 +6,13 @@ import io.lumine.mythic.lib.api.item.ItemTag;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
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.type.StringStat;
import org.bukkit.Material;
import org.jetbrains.annotations.NotNull;
@HasCategory(cat = "abilities")
public class ActionRightClick extends StringStat {
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"});

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.util.ui.SilentNumbers;
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.type.ChooseStat;
import net.Indyuce.mmoitems.stat.type.GemStoneStat;
@ -21,6 +22,7 @@ import java.util.ArrayList;
/**
* @author Gunging
*/
@HasCategory(cat = "requirement")
public class Amphibian extends ChooseStat implements ItemRestriction, GemStoneStat {
public static final StatChoice
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.gui.edition.ArrowParticlesEdition;
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.type.StatData;
import net.Indyuce.mmoitems.stat.type.ItemStat;
@ -30,6 +31,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
@HasCategory(cat = "misc")
public class ArrowParticles extends ItemStat<ArrowParticlesData, ArrowParticlesData> {
public ArrowParticles() {
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.mmoitem.ReadMMOItem;
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.PotionEffectListData;
import net.Indyuce.mmoitems.stat.data.random.RandomPotionEffectData;
@ -33,6 +34,7 @@ import org.jetbrains.annotations.Nullable;
import java.util.*;
@HasCategory(cat = "misc")
public class ArrowPotionEffects extends ItemStat<RandomPotionEffectListData, PotionEffectListData> {
public ArrowPotionEffects() {
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.data.DoubleData;
import net.Indyuce.mmoitems.stat.type.DoubleStat;
import net.Indyuce.mmoitems.stat.type.TemplateOption;
import org.bukkit.Material;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@ -18,19 +19,15 @@ import java.util.HashMap;
import java.util.Map;
@HasCategory(cat = "template_option")
public class BrowserDisplayIDX extends DoubleStat {
public class BrowserDisplayIDX extends DoubleStat implements TemplateOption {
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.
*

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.mmoitem.ReadMMOItem;
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.data.StringListData;
import net.Indyuce.mmoitems.stat.data.type.StatData;
@ -29,6 +30,7 @@ import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
@HasCategory(cat = "misc")
@VersionDependant(version = {1, 20, 6})
public class CanBreak extends ItemStat<StringListData, StringListData> {
public CanBreak() {

View File

@ -2,6 +2,7 @@ package net.Indyuce.mmoitems.stat;
import java.util.List;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
@ -23,6 +24,7 @@ import net.Indyuce.mmoitems.stat.type.ConsumableItemInteraction;
import io.lumine.mythic.lib.api.item.NBTItem;
import org.jetbrains.annotations.NotNull;
@HasCategory(cat = "consumables")
public class CanDeconstruct extends BooleanStat implements ConsumableItemInteraction {
public CanDeconstruct() {
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.player.PlayerData;
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.SkullTextureData;
import net.Indyuce.mmoitems.stat.type.BooleanStat;
@ -32,6 +33,7 @@ import org.jetbrains.annotations.NotNull;
import java.util.Objects;
import java.util.logging.Level;
@HasCategory(cat = "consumables")
public class CanDeskin extends BooleanStat implements ConsumableItemInteraction {
public CanDeskin() {
super("CAN_DESKIN", Material.LEATHER, "Can Deskin?",

View File

@ -1,5 +1,6 @@
package net.Indyuce.mmoitems.stat;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
@ -19,6 +20,7 @@ import net.Indyuce.mmoitems.stat.type.ConsumableItemInteraction;
import io.lumine.mythic.lib.api.item.NBTItem;
import org.jetbrains.annotations.NotNull;
@HasCategory(cat = "consumables")
public class CanIdentify extends BooleanStat implements ConsumableItemInteraction {
public CanIdentify() {
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 net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.util.MMOUtils;
import net.Indyuce.mmoitems.api.Type;
import net.Indyuce.mmoitems.api.interaction.Consumable;
@ -29,6 +30,7 @@ import java.util.List;
*
* @author Gunging
*/
@HasCategory(cat = "consumables")
public class CanUnsocket extends BooleanStat implements ConsumableItemInteraction {
public CanUnsocket() {
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.gui.edition.CommandListEdition;
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.CommandListData;
import net.Indyuce.mmoitems.stat.type.ItemStat;
@ -25,6 +26,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
@HasCategory(cat = "abilities")
public class Commands extends ItemStat<CommandListData, CommandListData> {
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.mmoitem.ReadMMOItem;
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.type.StatData;
import net.Indyuce.mmoitems.stat.type.ItemStat;
@ -26,6 +27,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
@HasCategory(cat = "skins")
public class CompatibleIds extends ItemStat<StringListData, StringListData> {
public CompatibleIds() {
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.mmoitem.ReadMMOItem;
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.type.StatData;
import net.Indyuce.mmoitems.stat.type.ItemStat;
@ -27,6 +28,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
@HasCategory(cat = "skins")
public class CompatibleMaterials extends ItemStat<StringListData, StringListData> {
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.mmoitem.ReadMMOItem;
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.type.StatData;
import net.Indyuce.mmoitems.stat.type.ItemStat;
@ -26,6 +27,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
@HasCategory(cat = "skins")
public class CompatibleTypes extends ItemStat<StringListData, StringListData> {
public CompatibleTypes() {
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.gui.RecipeEditorGUI;
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.random.RandomStatData;
import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.ItemStat;
import net.Indyuce.mmoitems.stat.type.TemplateOption;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
@ -30,7 +32,8 @@ import java.util.ArrayList;
import java.util.List;
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() {
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]);

View File

@ -1,14 +1,19 @@
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.StringStat;
import net.Indyuce.mmoitems.stat.type.TemplateOption;
import org.bukkit.Material;
@HasCategory(cat = "template_option")
public class CraftingPermission extends StringStat implements TemplateOption, GemStoneStat {
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[0]);
null);
}
}

View File

@ -2,6 +2,7 @@ package net.Indyuce.mmoitems.stat;
import io.lumine.mythic.lib.api.item.ItemTag;
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.type.StatData;
import net.Indyuce.mmoitems.stat.type.DoubleStat;
@ -21,6 +22,7 @@ import org.jetbrains.annotations.NotNull;
*
* @author indyuce
*/
@HasCategory(cat = "durability")
public class CustomDurability extends DoubleStat implements InternalStat {
public CustomDurability() {
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.mmoitem.ReadMMOItem;
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.random.RandomStatData;
import net.Indyuce.mmoitems.stat.data.type.StatData;
@ -16,6 +17,7 @@ import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
@HasCategory(cat = "item")
public class CustomModelData extends DoubleStat implements GemStoneStat {
public CustomModelData() {
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 net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.util.MMOUtils;
import net.Indyuce.mmoitems.api.CustomSound;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
@ -33,6 +34,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
@HasCategory(cat = "misc")
public class CustomSounds extends ItemStat<SoundListData, SoundListData> implements GemStoneStat, PlayerConsumable {
public CustomSounds() {
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;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.type.BooleanStat;
import org.bukkit.Material;
@HasCategory(cat = "toggles")
public class DisableDeathDrop extends BooleanStat {
public DisableDeathDrop() {
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.item.build.ItemStackBuilder;
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.type.GemStoneStat;
import net.Indyuce.mmoitems.stat.type.NameData;
@ -21,6 +22,7 @@ import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
@HasCategory(cat = "tooltip")
public class DisplayName extends StringStat implements GemStoneStat {
public DisplayName() {

View File

@ -1,11 +1,17 @@
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.StringStat;
import org.bukkit.Material;
@HasCategory(cat = "tooltip")
public class DisplayedType extends StringStat implements GemStoneStat {
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.mmoitem.ReadMMOItem;
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.type.StatData;
import net.Indyuce.mmoitems.stat.type.ItemStat;
@ -26,6 +27,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
@HasCategory(cat = "item")
public class DyeColor extends ItemStat<ColorData, ColorData> {
public DyeColor() {
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.message.FFPMMOItems;
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.PotionEffectListData;
import net.Indyuce.mmoitems.stat.data.random.RandomPotionEffectData;
@ -37,6 +38,7 @@ import org.jetbrains.annotations.Nullable;
import java.util.*;
@HasCategory(cat = "consumables")
public class Effects extends ItemStat<RandomPotionEffectListData, PotionEffectListData> implements PlayerConsumable {
public Effects() {
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.SupportedNBTTagValues;
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 net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.util.MMOUtils;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.api.util.NumericStatFormula;
import net.Indyuce.mmoitems.gui.edition.EditionInventory;
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.random.RandomElementListData;
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.Pair;
import org.apache.commons.lang.Validate;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
@ -33,6 +31,7 @@ import org.jetbrains.annotations.Nullable;
import java.util.*;
@HasCategory(cat = "elements")
public class Elements extends ItemStat<RandomElementListData, ElementListData> implements Previewable<RandomElementListData, ElementListData> {
public Elements() {
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<>();
@Override
public void loadConfiguration(@NotNull ConfigurationSection legacyLanguageFile, @NotNull Object configObject) {
// LEGACY CODE
if (configObject instanceof String) {
for (ElementStatType statType : ElementStatType.values())
statFormat.put(statType, legacyLanguageFile.getString("elemental-" + statType.lowerCaseName(), "<TranslationNotFound:" + statType.name().toLowerCase() + ">"));
}
public void readTranslationFile(@NotNull ConfigurationSection translationFile) {
// Up-to-date code
else {
Validate.isTrue(configObject instanceof ConfigurationSection, "Must be a config section");
Object configObject = translationFile.get("element");
if (configObject instanceof ConfigurationSection) {
final ConfigurationSection config = (ConfigurationSection) configObject;
for (ElementStatType statType : ElementStatType.values())
statFormat.put(statType, config.getString(statType.lowerCaseName(), "<TranslationNotFound:" + statType.lowerCaseName() + ">"));
}
}
@Override
public String getLegacyTranslationPath() {
// Arbitrary
return "elemental-damage";
// LEGACY CODE
else {
for (ElementStatType statType : ElementStatType.values())
statFormat.put(statType, translationFile.getString("elemental-" + statType.lowerCaseName(), "<TranslationNotFound:" + statType.name().toLowerCase() + ">"));
}
}
@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.comp.enchants.EnchantPlugin;
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.random.RandomEnchantListData;
import net.Indyuce.mmoitems.stat.data.type.StatData;
@ -41,6 +42,7 @@ import org.jetbrains.annotations.Nullable;
import java.util.*;
@HasCategory(cat = "item")
public class Enchants extends ItemStat<RandomEnchantListData, EnchantListData> implements Upgradable {
public Enchants() {
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;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.annotation.VersionDependant;
import net.Indyuce.mmoitems.stat.type.DoubleStat;
import org.bukkit.Material;
@VersionDependant(version = {1, 20, 5})
@HasCategory(cat = "vanilla_attribute")
public class FallDamageMultiplier extends DoubleStat {
public FallDamageMultiplier() {
super("FALL_DAMAGE_MULTIPLIER",

View File

@ -2,12 +2,14 @@ package net.Indyuce.mmoitems.stat;
import io.lumine.mythic.lib.api.item.ItemTag;
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.type.GemStoneStat;
import net.Indyuce.mmoitems.stat.type.StringStat;
import org.bukkit.Material;
import org.jetbrains.annotations.NotNull;
@HasCategory(cat = "gem_stones")
public class GemColor extends StringStat implements GemStoneStat {
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" });

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.mmoitem.ReadMMOItem;
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.GemstoneData;
import net.Indyuce.mmoitems.stat.data.type.StatData;
@ -30,6 +31,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
@HasCategory(cat = "gem_stones")
public class GemSockets extends ItemStat<GemSocketsData, GemSocketsData> {
public GemSockets() {
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;
@Override
public void loadConfiguration(@NotNull ConfigurationSection legacyLanguageFile, @NotNull Object configObject) {
// LEGACY CODE
if (configObject instanceof String) {
emptyGemSocketFormat = legacyLanguageFile.getString("empty-gem-socket");
filledGemSocketFormat = legacyLanguageFile.getString("filled-gem-socket");
}
public void readTranslationFile(@NotNull ConfigurationSection translationFile) {
// Up-to-date code
else {
Validate.isTrue(configObject instanceof ConfigurationSection, "Must be a config section");
Object configObject = translationFile.get("gem-sockets");
if (configObject instanceof ConfigurationSection) {
final ConfigurationSection config = (ConfigurationSection) configObject;
emptyGemSocketFormat = config.getString("empty");
filledGemSocketFormat = config.getString("filled");
}
}
@Override
public String getLegacyTranslationPath() {
return "empty-gem-socket";
// LEGACY CODE
else {
emptyGemSocketFormat = translationFile.getString("empty-gem-socket");
filledGemSocketFormat = translationFile.getString("filled-gem-socket");
}
}
@Override

View File

@ -1,5 +1,6 @@
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.ChooseStat;
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.
*/
@HasCategory(cat = "gem_stones")
public class GemUpgradeScaling extends ChooseStat implements GemStoneStat {
public static final StatChoice
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.api.edition.StatEdition;
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.type.GemStoneStat;
import net.Indyuce.mmoitems.stat.type.StringListStat;
@ -20,10 +21,14 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
@HasCategory(cat = "misc")
public class GrantedPermissions extends StringListStat implements GemStoneStat {
public GrantedPermissions() {
super("GRANTED_PERMISSIONS", Material.NAME_TAG, "Granted Permissions",
new String[] { "A list of permissions that will,", "be granted by the item." }, new String[0]);
super("GRANTED_PERMISSIONS",
Material.NAME_TAG,
"Granted Permissions",
new String[]{"A list of permissions that will,", "be granted by the item."},
new String[0]);
}
@Override

View File

@ -1,11 +1,13 @@
package net.Indyuce.mmoitems.stat;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.stat.type.BooleanStat;
import org.bukkit.Material;
@HasCategory(cat = "tooltip")
public class HideDurabilityBar extends BooleanStat {
public HideDurabilityBar() {
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.api.item.build.ItemStackBuilder;
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.type.BooleanStat;
import net.Indyuce.mmoitems.stat.annotation.VersionDependant;
@ -19,6 +20,7 @@ import java.util.ArrayList;
*/
@Deprecated
@VersionDependant(version = {1, 16, 3})
@HasCategory(cat = "tooltip")
public class HideDye extends BooleanStat {
public HideDye() {
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.api.item.build.ItemStackBuilder;
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.type.StatData;
import net.Indyuce.mmoitems.stat.type.BooleanStat;
@ -18,6 +19,7 @@ import java.util.ArrayList;
* @deprecated Merge with other Hide- stats
*/
@Deprecated
@HasCategory(cat = "tooltip")
public class HideEnchants extends BooleanStat {
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]);

View File

@ -6,6 +6,7 @@ import io.lumine.mythic.lib.util.annotation.BackwardsCompatibility;
import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
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.type.BooleanStat;
import org.bukkit.Material;
@ -19,6 +20,7 @@ import java.util.Arrays;
/**
* @deprecated Merge with other Hide- stats
*/
@HasCategory(cat = "tooltip")
@Deprecated
public class HidePotionEffects extends BooleanStat {
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.api.item.build.ItemStackBuilder;
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.type.BooleanStat;
import net.Indyuce.mmoitems.stat.annotation.VersionDependant;
@ -19,6 +20,7 @@ import java.util.ArrayList;
*/
@Deprecated
@VersionDependant(version = {1, 20})
@HasCategory(cat = "tooltip")
public class HideTrim extends BooleanStat {
public HideTrim() {
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.mmoitem.ReadMMOItem;
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.type.DoubleStat;
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,
* all version-friendly implementations must use ItemMeta methods.
*/
@HasCategory(cat = "durability")
public class ItemDamage extends DoubleStat implements GemStoneStat {
public ItemDamage() {
super("ITEM_DAMAGE", Material.FISHING_ROD, "Base Item Damage",
@ -73,6 +75,7 @@ public class ItemDamage extends DoubleStat implements GemStoneStat {
@Override
public String getLegacyTranslationPath() {
// Should be useless
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.util.NumericStatFormula;
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.type.StatData;
import net.Indyuce.mmoitems.stat.type.InternalStat;
@ -20,13 +21,16 @@ import java.util.ArrayList;
import java.util.List;
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() {
super("ITEM_LEVEL", Material.EXPERIENCE_BOTTLE, "Item Level", new String[] { "The item level" }, new String[0]);
}
@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
@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.ParticlesEdition;
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.type.StatData;
import net.Indyuce.mmoitems.stat.type.ItemStat;
@ -31,10 +32,11 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
@HasCategory(cat = "misc")
public class ItemParticles extends ItemStat<ParticleData, ParticleData> {
public ItemParticles() {
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

View File

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

View File

@ -1,5 +1,6 @@
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 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 org.jetbrains.annotations.NotNull;
@HasCategory(cat = "rarity")
public class ItemTierStat extends StringStat implements GemStoneStat {
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",

View File

@ -7,6 +7,7 @@ import java.util.Optional;
import io.lumine.mythic.lib.api.item.SupportedNBTTagValues;
import io.lumine.mythic.lib.api.util.ui.SilentNumbers;
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.type.ItemStat;
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.Nullable;
@HasCategory(cat = "gem_stones")
public class ItemTypeRestriction extends ItemStat<StringListData, StringListData> {
public ItemTypeRestriction() {
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.item.build.ItemStackBuilder;
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.type.GemStoneStat;
import net.Indyuce.mmoitems.stat.type.StringListStat;
@ -21,6 +22,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
@HasCategory(cat = "tooltip")
public class Lore extends StringListStat implements GemStoneStat {
public Lore() {
super("LORE", Material.WRITABLE_BOOK, "Lore", new String[]{"The item lore."}, new String[0]);

View File

@ -1,23 +1,24 @@
package net.Indyuce.mmoitems.stat;
import net.Indyuce.mmoitems.stat.data.StringData;
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 io.lumine.mythic.lib.api.item.ItemTag;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
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 io.lumine.mythic.lib.api.item.ItemTag;
import org.apache.commons.lang.Validate;
import org.bukkit.Material;
import org.jetbrains.annotations.NotNull;
@HasCategory(cat = "tooltip")
public class LoreFormat extends StringStat implements GemStoneStat {
public LoreFormat() {
super("LORE_FORMAT", Material.MAP, "Lore Format", new String[] { "The lore format decides",
"where each stat goes.", "&9Formats can be configured in", "&9the lore-formats folder" },
super("LORE_FORMAT",
Material.MAP,
"Lore Format",
new String[]{"The lore format decides where each", "stat goes. Formats can be configured", "in the lore-formats folder"},
new String[0]);
}

View File

@ -1,5 +1,6 @@
package net.Indyuce.mmoitems.stat;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import org.bukkit.Material;
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 org.jetbrains.annotations.NotNull;
@HasCategory(cat = "durability")
public class LostWhenBroken extends BooleanStat {
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" });

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.item.build.ItemStackBuilder;
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.type.GemStoneStat;
import net.Indyuce.mmoitems.stat.type.StringStat;
@ -18,6 +19,11 @@ import org.jetbrains.annotations.NotNull;
import java.util.Objects;
/**
* @deprecated To be removed
*/
@Deprecated
@HasCategory(cat = "abilities")
public class LuteAttackEffectStat extends StringStat implements GemStoneStat {
public LuteAttackEffectStat() {
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 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.type.GemStoneStat;
import net.Indyuce.mmoitems.stat.type.StringStat;
import org.bukkit.Material;
import org.jetbrains.annotations.NotNull;
/**
* @deprecated To be removed
*/
@Deprecated
@HasCategory(cat = "abilities")
public class LuteAttackSoundStat extends StringStat implements GemStoneStat {
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" });

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.RPGPlayer;
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.type.DoubleStat;
import net.Indyuce.mmoitems.stat.type.ItemRestriction;
@ -21,13 +22,13 @@ import org.jetbrains.annotations.NotNull;
* @author Roch Blondiaux
* @date 24/10/2022
*/
@HasCategory(cat = "use_cost")
public class ManaCost extends DoubleStat implements ItemRestriction, PlayerConsumable {
public ManaCost() {
super("MANA_COST", Material.LAPIS_LAZULI, "Mana Cost", new String[]{"Mana spent by your weapon to be used."}, new String[]{"weapon"});
}
@Override
public boolean canUse(RPGPlayer player, NBTItem item, boolean message) {
// 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.mmoitem.ReadMMOItem;
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.type.ItemStat;
import net.md_5.bungee.api.ChatColor;
@ -27,6 +28,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
@HasCategory(cat = "item")
public class MaterialStat extends ItemStat<MaterialData, MaterialData> {
public MaterialStat() {
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 net.Indyuce.mmoitems.MMOItems;
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.type.DoubleStat;
import org.bukkit.Material;
import org.checkerframework.checker.index.qual.HasSubsequence;
import org.jetbrains.annotations.NotNull;
@HasCategory(cat = "consumables")
public class MaxConsume extends DoubleStat {
public MaxConsume() {
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;
@VersionDependant(version = {1, 20, 5})
@HasCategory(cat = "durability")
public class MaxItemDamage extends DoubleStat implements GemStoneStat {
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"});

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.util.NumericStatFormula;
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.MaterialData;
import net.Indyuce.mmoitems.stat.type.DoubleStat;
@ -25,6 +26,7 @@ import org.jetbrains.annotations.NotNull;
*
* @author indyuce
*/
@HasCategory(cat = "durability")
public class MaximumDurability extends DoubleStat implements ItemRestriction, GemStoneStat, Upgradable {
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"});
@ -36,9 +38,8 @@ public class MaximumDurability extends DoubleStat implements ItemRestriction, Ge
}
@Override
public void loadConfiguration(@NotNull ConfigurationSection legacyLanguageFile, @NotNull Object configObject) {
generalStatFormat = legacyLanguageFile.getString("item-damage");
if (generalStatFormat == null) generalStatFormat = legacyLanguageFile.getString("durability");
public void readTranslationFile(@NotNull ConfigurationSection legacyLanguageFile) {
generalStatFormat = legacyLanguageFile.getString("durability");
}
@Override

View File

@ -7,6 +7,7 @@ import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.edition.StatEdition;
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.type.StringListStat;
import org.apache.commons.lang.Validate;
@ -21,6 +22,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Optional;
@HasCategory(cat = "misc")
public class NBTTags extends StringListStat {
public NBTTags() {
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.util.NumericStatFormula;
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.PotionEffectListData;
import net.Indyuce.mmoitems.stat.data.random.RandomPotionEffectData;
@ -37,10 +38,7 @@ import java.util.List;
import java.util.Optional;
import java.util.Set;
/**
* This class has not been updated for the item generation update!!! The potion
* amplifier and duration are not numeric formulas but flat values.... TODO
*/
@HasCategory(cat = "misc")
public class PermanentEffects extends ItemStat<RandomPotionEffectListData, PotionEffectListData> {
public PermanentEffects() {
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.util.message.Message;
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.type.StatData;
import net.Indyuce.mmoitems.stat.type.ItemRestriction;
@ -29,6 +30,7 @@ import java.util.Arrays;
import java.util.List;
import java.util.Optional;
@HasCategory(cat = "requirement")
public class Permission extends StringListStat implements ItemRestriction {
public 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 net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
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.type.DoubleStat;
import org.apache.commons.lang.Validate;
import org.bukkit.Material;
import org.jetbrains.annotations.NotNull;
@HasCategory(cat = "tools")
public class PickaxePower extends DoubleStat {
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"});

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.mmoitem.ReadMMOItem;
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.type.ItemStat;
import org.apache.commons.lang.NotImplementedException;
@ -25,6 +26,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
@HasCategory(cat = "item")
public class PotionColor extends ItemStat<ColorData, ColorData> {
public PotionColor() {
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 net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.util.MMOUtils;
import net.Indyuce.mmoitems.api.edition.StatEdition;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
@ -34,6 +35,7 @@ import java.util.List;
import java.util.Optional;
import java.util.Set;
@HasCategory(cat = "consumables")
public class PotionEffects extends ItemStat<RandomPotionEffectListData, PotionEffectListData> {
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." },

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.mmoitem.ReadMMOItem;
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.type.StatData;
import net.Indyuce.mmoitems.stat.type.ItemStat;
@ -34,7 +35,7 @@ import java.util.Optional;
*
* @author Kasprr
*/
@HasCategory(cat = "misc")
public class ProjectileParticles extends ItemStat<ProjectileParticlesData, ProjectileParticlesData> {
public ProjectileParticles() {
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.player.PlayerData;
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.GemSocketsData;
import net.Indyuce.mmoitems.stat.data.GemstoneData;
@ -39,6 +40,7 @@ import java.util.logging.Level;
*
* @author Gunging
*/
@HasCategory(cat = "consumables")
public class RandomUnsocket extends DoubleStat implements ConsumableItemInteraction {
public RandomUnsocket() {
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.util.message.Message;
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.DoubleStat;
import net.Indyuce.mmoitems.util.MMOUtils;
@ -23,6 +24,7 @@ import org.jetbrains.annotations.Nullable;
import java.util.function.Function;
@HasCategory(cat = "consumables")
public class RepairPower extends DoubleStat implements ConsumableItemInteraction {
public RepairPower() {
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.interaction.Consumable;
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.DoubleStat;
import org.bukkit.Material;
@ -12,6 +13,7 @@ import org.bukkit.event.inventory.InventoryClickEvent;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@HasCategory(cat = "consumables")
public class RepairPowerPercent extends DoubleStat implements ConsumableItemInteraction {
public RepairPowerPercent() {
super("REPAIR_PERCENT", Material.DAMAGED_ANVIL, "Repair Percentage",

View File

@ -1,9 +1,11 @@
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.StringStat;
import org.bukkit.Material;
@HasCategory(cat = "consumables")
public class RepairReference extends StringStat implements GemStoneStat {
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]);

View File

@ -5,6 +5,7 @@ import io.lumine.mythic.lib.api.item.NBTItem;
import io.lumine.mythic.lib.api.item.SupportedNBTTagValues;
import net.Indyuce.mmoitems.MMOItems;
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.type.StatData;
import net.Indyuce.mmoitems.stat.type.GemStoneStat;
@ -17,6 +18,7 @@ import java.util.ArrayList;
/**
* @author Gunging
*/
@HasCategory(cat = "requirement")
public class RequiredBiomes extends StringListStat implements ItemRestriction, GemStoneStat {
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" });

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.util.message.Message;
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.type.StatData;
import net.Indyuce.mmoitems.stat.type.GemStoneStat;
@ -30,6 +31,7 @@ import java.util.List;
import java.util.Optional;
import java.util.regex.Pattern;
@HasCategory(cat = "requirement")
public class RequiredClass extends StringListStat implements ItemRestriction, GemStoneStat {
public RequiredClass() {
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.api.player.RPGPlayer;
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.type.RequiredLevelStat;
import org.bukkit.ChatColor;
@ -11,6 +12,7 @@ import org.bukkit.Material;
import org.bukkit.Sound;
import org.jetbrains.annotations.NotNull;
@HasCategory(cat = "requirement")
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 net.Indyuce.mmoitems.ItemStats;
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.type.DoubleStat;
import net.Indyuce.mmoitems.stat.type.PlayerConsumable;
@ -18,9 +19,14 @@ import org.jetbrains.annotations.NotNull;
*
* @author Gunging
*/
@HasCategory(cat = "consumables")
public class RestoreFood extends DoubleStat implements PlayerConsumable {
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

View File

@ -2,6 +2,7 @@ package net.Indyuce.mmoitems.stat;
import net.Indyuce.mmoitems.ItemStats;
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.type.DoubleStat;
import net.Indyuce.mmoitems.stat.type.PlayerConsumable;
@ -15,6 +16,7 @@ import org.jetbrains.annotations.NotNull;
*
* @author Gunging
*/
@HasCategory(cat = "consumables")
public class RestoreHealth extends DoubleStat implements PlayerConsumable {
public RestoreHealth() {
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.api.item.mmoitem.VolatileMMOItem;
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.type.DoubleStat;
import net.Indyuce.mmoitems.stat.type.PlayerConsumable;
@ -15,6 +16,7 @@ import org.jetbrains.annotations.NotNull;
*
* @author Gunging
*/
@HasCategory(cat = "consumables")
public class RestoreMana extends DoubleStat implements PlayerConsumable {
public RestoreMana() {
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 net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import net.Indyuce.mmoitems.util.MMOUtils;
import net.Indyuce.mmoitems.api.item.mmoitem.VolatileMMOItem;
import net.Indyuce.mmoitems.stat.data.DoubleData;
@ -17,6 +18,7 @@ import org.jetbrains.annotations.NotNull;
*
* @author Gunging
*/
@HasCategory(cat = "consumables")
public class RestoreSaturation extends DoubleStat implements PlayerConsumable {
public RestoreSaturation() {
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.api.item.mmoitem.VolatileMMOItem;
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.type.DoubleStat;
import net.Indyuce.mmoitems.stat.type.PlayerConsumable;
@ -15,6 +16,7 @@ import org.jetbrains.annotations.NotNull;
*
* @author Gunging
*/
@HasCategory(cat = "consumables")
public class RestoreStamina extends DoubleStat implements PlayerConsumable {
public RestoreStamina() {
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.gui.edition.EditionInventory;
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.type.GemStoneStat;
import net.Indyuce.mmoitems.stat.type.ItemStat;
@ -24,13 +25,17 @@ import java.util.Optional;
/**
* Regarding the auto updating of items
*
* @see RevisionInventory
* @see MMOItemReforger
*/
@HasCategory(cat = "general")
public class RevisionID extends ItemStat<NumericStatFormula, DoubleData> implements GemStoneStat {
public RevisionID() {
super("REVISION_ID", Material.ITEM_FRAME, "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)."},
super("REVISION_ID",
Material.ITEM_FRAME,
"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]);
}

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.mmoitem.ReadMMOItem;
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.type.ItemStat;
import org.apache.commons.lang.Validate;
@ -31,6 +32,7 @@ import java.util.List;
import java.util.Optional;
import java.util.Set;
@HasCategory(cat = "item")
public class ShieldPatternStat extends ItemStat<ShieldPatternData, ShieldPatternData> {
public ShieldPatternStat() {
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.mmoitem.ReadMMOItem;
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.type.ItemStat;
import org.apache.commons.lang.Validate;
@ -27,6 +28,7 @@ import java.util.List;
import java.util.Optional;
import java.util.UUID;
@HasCategory(cat = "item")
public class SkullTextureStat extends ItemStat<SkullTextureData, SkullTextureData> {
public SkullTextureStat() {
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.mmoitem.ReadMMOItem;
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.random.RandomStatData;
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 new item.
*/
@HasCategory(cat = "misc")
public class StoredTags extends ItemStat<RandomStatData<StoredTagsData>, StoredTagsData> implements InternalStat, GemStoneStat {
public StoredTags() {
super("STORED_TAGS", Material.OAK_SIGN, "Stored Tags",

View File

@ -1,18 +1,22 @@
package net.Indyuce.mmoitems.stat;
import net.Indyuce.mmoitems.stat.annotation.HasCategory;
import org.bukkit.Material;
import net.Indyuce.mmoitems.stat.type.DoubleStat;
import net.Indyuce.mmoitems.stat.type.GemStoneStat;
@HasCategory(cat = "gem_stones")
public class SuccessRate extends DoubleStat implements GemStoneStat {
/**
* in a different class because Success Rate is meant to be a proper stat
*/
public SuccessRate() {
super("SUCCESS_RATE", Material.EMERALD, "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" });
super("SUCCESS_RATE",
Material.EMERALD,
"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 net.Indyuce.mmoitems.MMOItems;
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.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.data.StringData;
@ -13,10 +14,14 @@ import org.apache.commons.lang.Validate;
import org.bukkit.Material;
import org.jetbrains.annotations.NotNull;
@HasCategory(cat = "tooltip")
public class TooltipStat extends StringStat implements GemStoneStat {
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!",
"&9Tooltips are setup in the tooltips.yml file"}, new String[0]);
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!", "Tooltips are setup in the tooltips.yml file"},
new String[0]);
}
@Override
@ -24,7 +29,7 @@ public class TooltipStat extends StringStat implements GemStoneStat {
final String format = UtilityMethods.enumName(data.toString());
final TooltipTexture texture = MMOItems.plugin.getLore().getTooltip(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

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

View File

@ -3,6 +3,7 @@ package net.Indyuce.mmoitems.stat;
import io.lumine.mythic.lib.api.item.SupportedNBTTagValues;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
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.type.StatData;
import net.Indyuce.mmoitems.stat.type.BooleanStat;
@ -14,6 +15,7 @@ import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
@HasCategory(cat = "durability")
public class Unbreakable extends BooleanStat {
public Unbreakable() {
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