Now built against Paper 1.20.6

This commit is contained in:
Jules 2024-06-12 23:16:53 -07:00
parent 180d6e7e1b
commit 987b7fbea4
79 changed files with 450 additions and 433 deletions

View File

@ -58,11 +58,6 @@
<url>https://jitpack.io</url>
</repository>
<repository>
<id>mojang</id>
<url>https://libraries.minecraft.net/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
@ -104,29 +99,30 @@
<dependencies>
<!-- Spigot API -->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.20.1-R0.1-SNAPSHOT</version>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.20.6-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<optional>true</optional>
<exclusions>
<exclusion>
<groupId>com.mojang</groupId>
<artifactId>brigadier</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-clean-plugin -->
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
<version>3.3.2</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<!-- AuthLib -->
<dependency>
<groupId>com.mojang</groupId>
<artifactId>authlib</artifactId>
<version>1.5.21</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<!-- MMOCore Api -->
<!-- MMOCore API -->
<dependency>
<groupId>net.Indyuce</groupId>
<artifactId>MMOCore-API</artifactId>
@ -148,6 +144,14 @@
<artifactId>auraskills-api-bukkit</artifactId>
<version>2.0.0-SNAPSHOT</version>
<scope>provided</scope>
<optional>true</optional>
<exclusions>
<exclusion>
<groupId>org.spongepowered</groupId>
<artifactId>configurate-yaml</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- PhatLoots -->
<dependency>
@ -177,9 +181,32 @@
<dependency>
<groupId>com.sk89q.worldguard</groupId>
<artifactId>worldguard-bukkit</artifactId>
<version>7.0.2-SNAPSHOT</version>
<version>7.0.9-SNAPSHOT</version>
<scope>provided</scope>
<optional>true</optional>
<exclusions>
<exclusion>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.antlr</groupId>
<artifactId>antlr4</artifactId>
</exclusion>
<exclusion>
<groupId>org.mozilla</groupId>
<artifactId>rhino-runtime</artifactId>
</exclusion>
<exclusion>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
</exclusion>
<exclusion>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Vault -->
<dependency>

View File

@ -1,6 +1,6 @@
package net.Indyuce.mmoitems;
import io.lumine.mythic.lib.version.VersionMaterial;
import io.lumine.mythic.lib.version.VMaterial;
import net.Indyuce.mmoitems.stat.*;
import net.Indyuce.mmoitems.stat.block.*;
import net.Indyuce.mmoitems.stat.type.*;
@ -46,10 +46,10 @@ public class ItemStats {
PROJECTILE_PARTICLES = new ProjectileParticles(),
// Disable Interaction Stats
DISABLE_INTERACTION = new DisableStat("INTERACTION", VersionMaterial.GRASS_BLOCK.toMaterial(), "Disable Interaction", new String[]{"!block", "all"}, "Disable any unwanted interaction:", "block placement, item use..."),
DISABLE_CRAFTING = new DisableStat("CRAFTING", VersionMaterial.CRAFTING_TABLE.toMaterial(), "Disable Crafting", "Players can't use this item while crafting."), DISABLE_SMELTING = new DisableStat("SMELTING", Material.FURNACE, "Disable Smelting", "Players can't use this item in furnaces."),
DISABLE_INTERACTION = new DisableStat("INTERACTION", VMaterial.GRASS_BLOCK.get(), "Disable Interaction", new String[]{"!block", "all"}, "Disable any unwanted interaction:", "block placement, item use..."),
DISABLE_CRAFTING = new DisableStat("CRAFTING", Material.CRAFTING_TABLE, "Disable Crafting", "Players can't use this item while crafting."), DISABLE_SMELTING = new DisableStat("SMELTING", Material.FURNACE, "Disable Smelting", "Players can't use this item in furnaces."),
DISABLE_SMITHING = new DisableStat("SMITHING", Material.DAMAGED_ANVIL, "Disable Smithing", "Players can't smith this item in smithing tables."),
DISABLE_ENCHANTING = new DisableStat("ENCHANTING", VersionMaterial.ENCHANTING_TABLE.toMaterial(), "Disable Enchanting", new String[]{"!block", "all"}, "Players can't enchant this item."),
DISABLE_ENCHANTING = new DisableStat("ENCHANTING", Material.ENCHANTING_TABLE, "Disable Enchanting", new String[]{"!block", "all"}, "Players can't enchant this item."),
DISABLE_REPAIRING = new DisableStat("REPAIRING", Material.ANVIL, "Disable Repairing", new String[]{"!block", "all"}, "Players can't use this item in anvils."),
DISABLE_ARROW_SHOOTING = new DisableStat("ARROW_SHOOTING", Material.ARROW, "Disable Arrow Shooting", new Material[]{Material.ARROW}, "Players can't shoot this", "item using a bow."),
DISABLE_DROP = new DisableStat("DROPING", Material.LAVA_BUCKET, "Disable Item Dropping", new String[0], "Disables the dropping of this item!"),
@ -79,11 +79,11 @@ public class ItemStats {
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"}),
MANA_COST = new ManaCost(),
STAMINA_COST = new DoubleStat("STAMINA_COST", VersionMaterial.LIGHT_GRAY_DYE.toMaterial(), "Stamina Cost", new String[]{"Stamina spent by your weapon to be used."}, new String[]{"weapon"}),
STAMINA_COST = new DoubleStat("STAMINA_COST", Material.LIGHT_GRAY_DYE, "Stamina Cost", new String[]{"Stamina spent by your weapon to be used."}, new String[]{"weapon"}),
ARROW_VELOCITY = new DoubleStat("ARROW_VELOCITY", Material.ARROW, "Arrow Velocity", new String[]{"Determines how far your", "weapon can shoot.", "Default: 1.0"}, new String[]{"gem_stone", "bow", "crossbow"}),
ARROW_POTION_EFFECTS = new ArrowPotionEffects(),
PVE_DAMAGE = new DoubleStat("PVE_DAMAGE", VersionMaterial.PORKCHOP.toMaterial(), "PvE Damage", new String[]{"Additional damage against", "non human entities in %."}, new String[]{"equipment", "gem_stone"}),
PVP_DAMAGE = new DoubleStat("PVP_DAMAGE", VersionMaterial.SKELETON_SKULL.toMaterial(), "PvP Damage", new String[]{"Additional damage", "against players in %."}, new String[]{"equipment", "gem_stone"}),
PVE_DAMAGE = new DoubleStat("PVE_DAMAGE", Material.PORKCHOP, "PvE Damage", new String[]{"Additional damage against", "non human entities in %."}, new String[]{"equipment", "gem_stone"}),
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 %."}),
@ -94,13 +94,13 @@ public class ItemStats {
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", VersionMaterial.SNOWBALL.toMaterial(), "Projectile Damage Reduction", new String[]{"Reduces projectile damage.", "In %."}),
PROJECTILE_DAMAGE_REDUCTION = new DoubleStat("PROJECTILE_DAMAGE_REDUCTION", Material.SNOWBALL, "Projectile Damage Reduction", new String[]{"Reduces projectile damage.", "In %."}),
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", VersionMaterial.PORKCHOP.toMaterial(), "PvE Damage Reduction", new String[]{"Reduces damage dealt by mobs.", "In %."}),
PVP_DAMAGE_REDUCTION = new DoubleStat("PVP_DAMAGE_REDUCTION", VersionMaterial.SKELETON_SKULL.toMaterial(), "PvP Damage Reduction", new String[]{"Reduces damage dealt by players", "In %."}),
UNDEAD_DAMAGE = new DoubleStat("UNDEAD_DAMAGE", VersionMaterial.SKELETON_SKULL.toMaterial(), "Undead Damage", new String[]{"Deals additional damage to undead.", "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."}),
@ -108,11 +108,11 @@ public class ItemStats {
UNBREAKABLE = new Unbreakable(),
TIER = new ItemTierStat(),
SET = new ItemSetStat(),
ARMOR = new DoubleStat("ARMOR", VersionMaterial.GOLDEN_CHESTPLATE.toMaterial(), "Armor", new String[]{"The armor given to the holder."}),
ARMOR = new DoubleStat("ARMOR", Material.GOLDEN_CHESTPLATE, "Armor", new String[]{"The armor given to the holder."}),
ARMOR_TOUGHNESS = new DoubleStat("ARMOR_TOUGHNESS", Material.DIAMOND_CHESTPLATE, "Armor Toughness", new String[]{"Armor toughness reduces damage taken."}),
MAX_HEALTH = new DoubleStat("MAX_HEALTH", Material.GOLDEN_APPLE, "Max Health", new String[]{"The amount of health your", "item gives to the holder."}),
UNSTACKABLE = new Unstackable(),
MAX_MANA = new DoubleStat("MAX_MANA", VersionMaterial.LAPIS_LAZULI.toMaterial(), "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."}),
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"}),
@ -154,7 +154,7 @@ public class ItemStats {
// 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", VersionMaterial.COBBLESTONE_WALL.toMaterial(), "Bouncing Crack", new String[]{"If set to true, your tool will", "also break nearby blocks."}, new String[]{"tool"}),
BOUNCING_CRACK = new BooleanStat("BOUNCING_CRACK", Material.COBBLESTONE_WALL, "Bouncing Crack", new String[]{"If set to true, your tool will", "also break nearby blocks."}, new String[]{"tool"}),
PICKAXE_POWER = new PickaxePower(),
CUSTOM_SOUNDS = new CustomSounds(),
ELEMENTS = new Elements(),
@ -162,7 +162,7 @@ public class ItemStats {
// STAFF_SPIRIT = new StaffSpiritStat(),
LUTE_ATTACK_SOUND = new LuteAttackSoundStat(),
LUTE_ATTACK_EFFECT = new LuteAttackEffectStat(),
NOTE_WEIGHT = new DoubleStat("NOTE_WEIGHT", VersionMaterial.MUSIC_DISC_MALL.toMaterial(), "Note Weight", new String[]{"Defines how the projectile cast", "by your lute tilts downwards."}, new String[]{"lute"}),
NOTE_WEIGHT = new DoubleStat("NOTE_WEIGHT", Material.MUSIC_DISC_MALL, "Note Weight", new String[]{"Defines how the projectile cast", "by your lute tilts downwards."}, new String[]{"lute"}),
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),
COMPATIBLE_TYPES = new CompatibleTypes(),
COMPATIBLE_IDS = new CompatibleIds(),
@ -175,8 +175,8 @@ public class ItemStats {
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", VersionMaterial.IRON_HORSE_ARMOR.toMaterial(), "Knockback", new String[]{"Using this musket will knock", "the user back if positive."}, new String[]{"musket", "gem_stone"}),
RECOIL = new DoubleStat("RECOIL", VersionMaterial.IRON_HORSE_ARMOR.toMaterial(), "Recoil", new String[]{"Corresponds to the shooting innacuracy."}, new String[]{"musket", "gem_stone"}),
KNOCKBACK = new DoubleStat("KNOCKBACK", Material.IRON_HORSE_ARMOR, "Knockback", new String[]{"Using this musket will knock", "the user back if positive."}, new String[]{"musket", "gem_stone"}),
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"}),
AMPHIBIAN = new Amphibian(),

View File

@ -1,7 +1,6 @@
package net.Indyuce.mmoitems.api;
import io.lumine.mythic.lib.UtilityMethods;
import io.lumine.mythic.lib.version.VersionMaterial;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
@ -11,7 +10,7 @@ public enum CustomSound {
ON_BLOCK_BREAK(Material.COBBLESTONE, 25, "Plays when a block is broken with the item."),
ON_PICKUP(Material.IRON_INGOT, 28, "Plays when you pickup the item from the ground."),
ON_LEFT_CLICK(Material.STONE_AXE, 31, "Plays when item is left-clicked."),
ON_CRAFT(VersionMaterial.CRAFTING_TABLE.toMaterial(), 34, "Plays when item is crafted in a crafting inventory", "or when smelted from someting in a furnace."),
ON_CRAFT(Material.CRAFTING_TABLE, 34, "Plays when item is crafted in a crafting inventory", "or when smelted from someting in a furnace."),
ON_CONSUME(Material.APPLE, 37, "Plays when item has been consumed.", "(After eating/drinking animation)"),
ON_ITEM_BREAK(Material.FLINT, 40, "Plays when the item breaks."),
ON_CROSSBOW(Material.ARROW, 38, "Plays when a crossbow shoots an arrow."),

View File

@ -3,7 +3,6 @@ package net.Indyuce.mmoitems.api.interaction;
import io.lumine.mythic.lib.MythicLib;
import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.api.item.NBTItem;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.Type;
@ -14,6 +13,7 @@ import net.Indyuce.mmoitems.stat.data.SkullTextureData;
import net.Indyuce.mmoitems.stat.data.StringListData;
import net.Indyuce.mmoitems.util.MMOUtils;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemFlag;
@ -175,8 +175,8 @@ public class ItemSkin extends UseItem {
// Skull texture
if (volSkin.hasData(ItemStats.SKULL_TEXTURE)
&& item.getType() == VersionMaterial.PLAYER_HEAD.toMaterial()
&& nbtSkin.getItem().getType() == VersionMaterial.PLAYER_HEAD.toMaterial())
&& item.getType() == Material.PLAYER_HEAD
&& nbtSkin.getItem().getType() == Material.PLAYER_HEAD)
MythicLib.plugin.getVersion().getWrapper().setProfile((SkullMeta) meta,
((SkullTextureData) volSkin.getData(ItemStats.SKULL_TEXTURE)).getGameProfile());

View File

@ -7,16 +7,17 @@ import io.lumine.mythic.lib.comp.flags.CustomFlag;
import io.lumine.mythic.lib.math3.geometry.euclidean.threed.Line;
import io.lumine.mythic.lib.math3.geometry.euclidean.threed.Vector3D;
import io.lumine.mythic.lib.version.OreDrops;
import io.lumine.mythic.lib.version.VEnchantment;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.event.BouncingCrackBlockBreakEvent;
import net.Indyuce.mmoitems.api.player.PlayerData;
import net.Indyuce.mmoitems.util.MMOUtils;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.Particle;
import org.bukkit.Sound;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.scheduler.BukkitRunnable;
@ -45,7 +46,8 @@ public class Tool extends UseItem {
if (getNBTItem().getBoolean("MMOITEMS_AUTOSMELT")) {
final OreDrops drops = MythicLib.plugin.getVersion().getWrapper().getOreDrops(block.getType());
if (drops != null) {
UtilityMethods.dropItemNaturally(block.getLocation(), drops.generate(getFortuneLevel()));
final int fortuneLevel = MMOUtils.getLevel(getItem(), VEnchantment.FORTUNE.get());
UtilityMethods.dropItemNaturally(block.getLocation(), drops.generate(fortuneLevel));
block.getWorld().spawnParticle(Particle.LAVA, block.getLocation().add(.5, .5, .5), 4);
block.setType(Material.AIR);
cancel = true;
@ -117,11 +119,6 @@ public class Tool extends UseItem {
return cancel;
}
private int getFortuneLevel() {
if (!getItem().hasItemMeta()) return 0;
return getItem().getItemMeta().getEnchantLevel(Enchantment.LOOT_BONUS_BLOCKS);
}
private Vector3D toJava(Vector vector) {
return new Vector3D(vector.getX(), vector.getY(), vector.getZ());
}

View File

@ -6,8 +6,8 @@ import io.lumine.mythic.lib.MythicLib;
import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.api.item.NBTItem;
import io.lumine.mythic.lib.api.item.SupportedNBTTagValues;
import io.lumine.mythic.lib.version.VEnchantment;
import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.event.item.CustomDurabilityDamage;
import net.Indyuce.mmoitems.api.event.item.ItemCustomRepairEvent;
import net.Indyuce.mmoitems.api.item.mmoitem.LiveMMOItem;
@ -15,11 +15,11 @@ import net.Indyuce.mmoitems.api.item.util.LoreUpdate;
import net.Indyuce.mmoitems.api.player.PlayerData;
import net.Indyuce.mmoitems.stat.data.DoubleData;
import net.Indyuce.mmoitems.stat.data.UpgradeData;
import net.Indyuce.mmoitems.util.MMOUtils;
import org.apache.commons.lang.Validate;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.Sound;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
@ -74,8 +74,7 @@ public class DurabilityItem {
initialDurability = durability = nbtItem.hasTag("MMOITEMS_DURABILITY") ? nbtItem.getInteger("MMOITEMS_DURABILITY") : maxDurability;
barHidden = nbtItem.getBoolean("MMOITEMS_DURABILITY_BAR");
unbreakingLevel = (nbtItem.getItem().getItemMeta() != null && nbtItem.getItem().getItemMeta().hasEnchant(Enchantment.DURABILITY)) ?
nbtItem.getItem().getItemMeta().getEnchantLevel(Enchantment.DURABILITY) : 0;
unbreakingLevel = MMOUtils.getLevel(nbtItem.getItem(), VEnchantment.UNBREAKING.get());
}
public Player getPlayer() {

View File

@ -6,7 +6,7 @@ import io.lumine.mythic.lib.api.player.EquipmentSlot;
import io.lumine.mythic.lib.comp.interaction.InteractionType;
import io.lumine.mythic.lib.damage.DamageType;
import io.lumine.mythic.lib.player.PlayerMetadata;
import io.lumine.mythic.lib.version.VersionSound;
import io.lumine.mythic.lib.version.VSound;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.interaction.weapon.Weapon;
import net.Indyuce.mmoitems.api.player.PlayerData;
@ -48,7 +48,7 @@ public class Lute extends Weapon implements LegacyWeapon {
final Vector weight = new Vector(0, -.003 * stats.getStat("NOTE_WEIGHT"), 0);
final @Nullable LuteAttackEffect effect = LuteAttackEffect.get(getNBTItem());
@Deprecated final SoundReader sound = new SoundReader(getNBTItem().getString("MMOITEMS_LUTE_ATTACK_SOUND"), VersionSound.BLOCK_NOTE_BLOCK_BELL.toSound());
@Deprecated final SoundReader sound = new SoundReader(getNBTItem().getString("MMOITEMS_LUTE_ATTACK_SOUND"), VSound.BLOCK_NOTE_BLOCK_BELL.get());
final @NotNull ProjectileParticlesData projParticle = getNBTItem().hasTag("MMOITEMS_PROJECTILE_PARTICLES") ?
new ProjectileParticlesData(getNBTItem().getString("MMOITEMS_PROJECTILE_PARTICLES")) : ProjectileParticlesData.DEFAULT;

View File

@ -16,7 +16,7 @@ import net.Indyuce.mmoitems.api.util.NumericStatFormula;
import net.Indyuce.mmoitems.api.util.message.FFPMMOItems;
import net.Indyuce.mmoitems.stat.data.random.RandomStatData;
import net.Indyuce.mmoitems.stat.type.ItemStat;
import org.apache.commons.lang.Validate;
import org.apache.commons.lang3.Validate;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;

View File

@ -1,7 +1,6 @@
package net.Indyuce.mmoitems.api.item.template;
import io.lumine.mythic.lib.UtilityMethods;
import net.Indyuce.mmoitems.util.MMOUtils;
import org.apache.commons.lang.Validate;
import org.bukkit.configuration.ConfigurationSection;

View File

@ -3,11 +3,11 @@ package net.Indyuce.mmoitems.api.item.util;
import net.Indyuce.mmoitems.api.item.util.crafting.CraftingRecipeDisplay;
import net.Indyuce.mmoitems.api.item.util.crafting.QueueItemDisplay;
import net.Indyuce.mmoitems.api.item.util.crafting.UpgradingRecipeDisplay;
import io.lumine.mythic.lib.version.VersionMaterial;
import org.bukkit.Material;
public class ConfigItems {
public static final ConfigItem CONFIRM = new ConfigItem("CONFIRM", VersionMaterial.GREEN_STAINED_GLASS_PANE.toMaterial(), "&aConfirm");
public static final ConfigItem FILL = new ConfigItem("FILL", VersionMaterial.GRAY_STAINED_GLASS_PANE.toMaterial(), "&8");
public static final ConfigItem CONFIRM = new ConfigItem("CONFIRM", Material.GREEN_STAINED_GLASS_PANE, "&aConfirm");
public static final ConfigItem FILL = new ConfigItem("FILL", Material.GRAY_STAINED_GLASS_PANE, "&8");
public static final CustomSkull PREVIOUS_PAGE = new CustomSkull("PREVIOUS_PAGE",
"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYmQ2OWUwNmU1ZGFkZmQ4NGU1ZjNkMWMyMTA2M2YyNTUzYjJmYTk0NWVlMWQ0ZDcxNTJmZGM1NDI1YmMxMmE5In19fQ==",
"&aPrevious Page");

View File

@ -4,9 +4,10 @@ import io.lumine.mythic.lib.MythicLib;
import io.lumine.mythic.lib.UtilityMethods;
import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.util.AdventureUtils;
import io.lumine.mythic.lib.version.VersionMaterial;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.SkullMeta;
import java.util.stream.Collectors;
@ -19,13 +20,13 @@ public class CustomSkull extends ConfigItem {
}
public CustomSkull(String id, String textureValue, String name, String... lore) {
super(id, VersionMaterial.PLAYER_HEAD.toMaterial(), name, lore);
super(id, Material.PLAYER_HEAD, name, lore);
this.textureValue = textureValue;
}
public void updateItem() {
setItem(VersionMaterial.PLAYER_HEAD.toItem());
setItem(new ItemStack(Material.PLAYER_HEAD));
SkullMeta meta = (SkullMeta) getItem().getItemMeta();
AdventureUtils.setDisplayName(meta, getName());
meta.addItemFlags(ItemFlag.values());

View File

@ -11,6 +11,7 @@ import io.lumine.mythic.lib.player.modifier.ModifierSource;
import io.lumine.mythic.lib.player.skill.PassiveSkill;
import io.lumine.mythic.lib.skill.trigger.TriggerMetadata;
import io.lumine.mythic.lib.util.Closeable;
import io.lumine.mythic.lib.version.VPotionEffectType;
import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.ItemSet;
@ -277,7 +278,7 @@ public class PlayerData extends SynchronizedDataHolder implements Closeable {
// Two handed slowness
if (encumbered)
getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 40, 1, true, false));
getPlayer().addPotionEffect(new PotionEffect(VPotionEffectType.SLOWNESS.get(), 40, 1, true, false));
}
public InventoryUpdateHandler getInventory() {

View File

@ -3,6 +3,7 @@ package net.Indyuce.mmoitems.api.util;
import io.lumine.mythic.lib.MythicLib;
import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.api.item.NBTItem;
import io.lumine.mythic.lib.version.VEnchantment;
import net.Indyuce.mmoitems.MMOItems;
import org.bukkit.Bukkit;
import org.bukkit.Location;
@ -104,7 +105,7 @@ public class NoClipItem implements Listener {
* to look like a vanilla item if a player somehow picks it up and Luck 0 does nothing.
*/
if (oldItem.getItemMeta().hasEnchants()) {
newItemMeta.addEnchant(Enchantment.LUCK, 0, true);
newItemMeta.addEnchant(VEnchantment.POWER.get(), 0, true);
newItemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
}

View File

@ -1,5 +1,6 @@
package net.Indyuce.mmoitems.command.mmoitems.debug;
import io.lumine.mythic.lib.version.VPotionEffectType;
import org.bukkit.ChatColor;
import org.bukkit.attribute.Attribute;
import org.bukkit.command.CommandSender;
@ -25,8 +26,9 @@ public class HealCommandTreeNode extends CommandTreeNode {
player.setFoodLevel(20);
player.setFireTicks(0);
player.setSaturation(12);
for (PotionEffectType pe : new PotionEffectType[] { PotionEffectType.POISON, PotionEffectType.BLINDNESS, PotionEffectType.CONFUSION,
PotionEffectType.HUNGER, PotionEffectType.WEAKNESS, PotionEffectType.SLOW, PotionEffectType.SLOW_DIGGING })
for (PotionEffectType pe : new PotionEffectType[] { PotionEffectType.POISON, PotionEffectType.BLINDNESS, VPotionEffectType
.NAUSEA.get(),
PotionEffectType.HUNGER, PotionEffectType.WEAKNESS, VPotionEffectType.SLOWNESS.get(), PotionEffectType.MINING_FATIGUE })
player.removePotionEffect(pe);
return CommandResult.SUCCESS;
}

View File

@ -1,10 +1,7 @@
package net.Indyuce.mmoitems.comp.enchants.advanced_enchants;
import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.api.item.SupportedNBTTagValues;
import io.lumine.mythic.lib.api.util.ui.SilentNumbers;
import io.lumine.mythic.lib.util.annotation.BackwardsCompatibility;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
import net.Indyuce.mmoitems.gui.edition.EditionInventory;
@ -12,8 +9,9 @@ import net.Indyuce.mmoitems.stat.data.random.RandomStatData;
import net.Indyuce.mmoitems.stat.type.InternalStat;
import net.Indyuce.mmoitems.stat.type.ItemStat;
import net.advancedplugins.ae.api.AEAPI;
import org.apache.commons.lang3.Validate;
import org.apache.commons.lang.Validate;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.meta.ItemMeta;
@ -34,7 +32,7 @@ public class AdvancedEnchantsStat extends ItemStat<RandomStatData<AdvancedEnchan
private final String aeNamespace;
public AdvancedEnchantsStat() {
super("ADVANCED_ENCHANTS", VersionMaterial.EXPERIENCE_BOTTLE.toMaterial(), "Advanced Enchants", new String[]{"The AEnchants of this item. Format:", "\u00a7e[internal_name] [level]"}, new String[]{"!miscellaneous", "!block", "all"});
super("ADVANCED_ENCHANTS", Material.EXPERIENCE_BOTTLE, "Advanced Enchants", new String[]{"The AEnchants of this item. Format:", "\u00a7e[internal_name] [level]"}, new String[]{"!miscellaneous", "!block", "all"});
ae = Bukkit.getPluginManager().getPlugin("AdvancedEnchantments");
Validate.notNull(ae, "Could not find plugin AdvancedEnchants");

View File

@ -1,7 +1,6 @@
package net.Indyuce.mmoitems.comp.mmocore;
import io.lumine.mythic.lib.api.event.SynchronizedDataLoadEvent;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmocore.MMOCore;
import net.Indyuce.mmocore.api.event.PlayerChangeClassEvent;
import net.Indyuce.mmocore.api.event.PlayerLevelUpEvent;
@ -22,6 +21,7 @@ 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;
@ -50,7 +50,7 @@ public class MMOCoreHook implements RPGHandler, Listener {
// Adds profession specific Additional Experience stats.
MMOItems.plugin.getStats().register(new DoubleStat((StatType.ADDITIONAL_EXPERIENCE.name() + '_' + profession.getId())
.replace('-', '_').replace(' ', '_').toUpperCase(Locale.ROOT),
VersionMaterial.EXPERIENCE_BOTTLE.toMaterial(), profession.getName() + ' ' + "Additional Experience (MMOCore)"
Material.EXPERIENCE_BOTTLE, profession.getName() + ' ' + "Additional Experience (MMOCore)"
, new String[]{"Additional MMOCore profession " + profession.getName() + " experience in %."}, new String[]{"!block", "all"}));
MMOItems.plugin.getStats().register(new RequiredProfession(profession));
}

View File

@ -2,7 +2,6 @@ package net.Indyuce.mmoitems.comp.mmocore;
import io.lumine.mythic.lib.api.MMOLineConfig;
import io.lumine.mythic.lib.api.util.AltChar;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmocore.MMOCore;
import net.Indyuce.mmocore.api.block.BlockType;
import net.Indyuce.mmocore.api.load.MMOLoader;
@ -31,16 +30,16 @@ 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", VersionMaterial.LAPIS_LAZULI.toMaterial(), "Mana Regeneration", new String[]{"Amount of mana pts regenerated every second."});
private static final ItemStat MAX_MANA_REGENERATION = new DoubleStat("MAX_MANA_REGENERATION", VersionMaterial.LAPIS_LAZULI.toMaterial(), "Max Mana Regeneration", new String[]{"Percentage of max mana regenerated every second."});
private static final ItemStat STAMINA_REGENERATION = new DoubleStat("STAMINA_REGENERATION", VersionMaterial.LIGHT_BLUE_DYE.toMaterial(), "Stamina Regeneration", new String[]{"Amount of stamina pts regenerated every second."});
private static final ItemStat MAX_STAMINA_REGENERATION = new DoubleStat("MAX_STAMINA_REGENERATION", VersionMaterial.LIGHT_BLUE_DYE.toMaterial(), "Max Stamina Regeneration", new String[]{"Percentage of max stamina 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 MAX_STAMINA = new DoubleStat("MAX_STAMINA", VersionMaterial.LIGHT_BLUE_DYE.toMaterial(), "Max Stamina",
private static final ItemStat MAX_STAMINA = new DoubleStat("MAX_STAMINA", Material.LIGHT_BLUE_DYE, "Max Stamina",
new String[]{"Adds stamina to your max stamina bar."});
private static final ItemStat MAX_STELLIUM = new DoubleStat("MAX_STELLIUM", VersionMaterial.ENDER_EYE.toMaterial(), "Max Stellium",
private static final ItemStat MAX_STELLIUM = new DoubleStat("MAX_STELLIUM", Material.ENDER_EYE, "Max Stellium",
new String[]{"Additional maximum stellium."});
private static final ItemStat ADDITIONAL_EXPERIENCE = new DoubleStat("ADDITIONAL_EXPERIENCE", VersionMaterial.EXPERIENCE_BOTTLE.toMaterial(),
private static final ItemStat ADDITIONAL_EXPERIENCE = new DoubleStat("ADDITIONAL_EXPERIENCE", Material.EXPERIENCE_BOTTLE,
"Additional Experience", new String[]{"Additional MMOCore main class experience in %."});
/*

View File

@ -1,7 +1,6 @@
package net.Indyuce.mmoitems.comp.mmocore.stat;
import io.lumine.mythic.lib.api.item.NBTItem;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmocore.api.player.PlayerData;
import net.Indyuce.mmocore.api.player.attribute.PlayerAttribute;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
@ -12,6 +11,7 @@ import net.Indyuce.mmoitems.stat.type.DoubleStat;
import net.Indyuce.mmoitems.stat.type.GemStoneStat;
import net.Indyuce.mmoitems.stat.type.ItemRestriction;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.jetbrains.annotations.NotNull;
@ -20,7 +20,7 @@ public class RequiredAttribute extends DoubleStat implements ItemRestriction, Ge
// TODO merge with RequiredLevelStat
public RequiredAttribute(PlayerAttribute attribute) {
super("REQUIRED_" + attribute.getId().toUpperCase().replace("-", "_"), VersionMaterial.GRAY_DYE.toMaterial(), attribute.getName() + " Requirement (MMOCore)", new String[]{"Amount of " + attribute.getName() + " points the", "player needs to use the item."}, new String[]{"!block", "all"});
super("REQUIRED_" + attribute.getId().toUpperCase().replace("-", "_"), Material.GRAY_DYE, attribute.getName() + " Requirement (MMOCore)", new String[]{"Amount of " + attribute.getName() + " points the", "player needs to use the item."}, new String[]{"!block", "all"});
this.attribute = attribute;
}

View File

@ -1,21 +1,20 @@
package net.Indyuce.mmoitems.comp.mmoinventory.stat;
import io.lumine.mythic.lib.MythicLib;
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.StringData;
import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.GemStoneStat;
import net.Indyuce.mmoitems.stat.type.StringStat;
import io.lumine.mythic.lib.MythicLib;
import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.version.VersionMaterial;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.jetbrains.annotations.NotNull;
public class AccessorySet extends StringStat implements GemStoneStat {
public AccessorySet() {
super("ACCESSORY_SET", VersionMaterial.OAK_SIGN.toMaterial(), "Accessory Set (MMOInventory)", new String[] { "Used with MMOInventory's unique", "restriction to only allow one", "accessory to be equipped per set." }, new String[] { "!block", "all" });
super("ACCESSORY_SET", Material.OAK_SIGN, "Accessory Set (MMOInventory)", new String[] { "Used with MMOInventory's unique", "restriction to only allow one", "accessory to be equipped per set." }, new String[] { "!block", "all" });
}
@Override

View File

@ -3,6 +3,7 @@ package net.Indyuce.mmoitems.comp.mythicmobs;
import io.lumine.mythic.bukkit.events.MythicMobDeathEvent;
import io.lumine.mythic.lib.MythicLib;
import io.lumine.mythic.lib.api.item.NBTItem;
import io.lumine.mythic.lib.version.VParticle;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.util.MMOUtils;
import net.Indyuce.mmoitems.api.ItemTier;
@ -24,7 +25,7 @@ import java.util.List;
import java.util.Random;
public class LootsplosionListener implements Listener {
private static final Random random = new Random();
private static final Random RANDOM = new Random();
private final boolean colored;
@ -42,8 +43,8 @@ public class LootsplosionListener implements Listener {
private final List<ItemStack> drops;
/*
* Y coordinate offset so the velocity is not directly negated when the
* item spawns on the ground
* Y coordinate offset so the velocity is not
* directly negated when the item spawns on the ground
*/
private final double offset;
@ -85,7 +86,7 @@ public class LootsplosionListener implements Listener {
private Vector randomVector() {
double offset = MMOItems.plugin.getConfig().getDouble("lootsplosion.offset"),
height = MMOItems.plugin.getConfig().getDouble("lootsplosion.height");
return new Vector(Math.cos(random.nextDouble() * Math.PI * 2) * offset, height, Math.sin(random.nextDouble() * Math.PI * 2) * offset);
return new Vector(Math.cos(RANDOM.nextDouble() * Math.PI * 2) * offset, height, Math.sin(RANDOM.nextDouble() * Math.PI * 2) * offset);
}
public class LootColor extends BukkitRunnable {
@ -108,7 +109,7 @@ public class LootsplosionListener implements Listener {
return;
}
item.getWorld().spawnParticle(Particle.REDSTONE, item.getLocation(), 1, new Particle.DustOptions(color, 1.3f));
item.getWorld().spawnParticle(VParticle.REDSTONE.get(), item.getLocation(), 1, new Particle.DustOptions(color, 1.3f));
}
}
}

View File

@ -1,12 +1,12 @@
package net.Indyuce.mmoitems.comp.mythicmobs.stat;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmoitems.stat.type.DoubleStat;
import org.bukkit.Material;
public class FactionDamage extends DoubleStat {
public FactionDamage(String faction) {
super("FACTION_DAMAGE_" + faction.toUpperCase(), VersionMaterial.RED_DYE.toMaterial(), faction + " Faction Damage", new String[]{"Deals additional damage to mobs", "from the " + faction + " faction in %."}, new String[]{"!block", "all"});
super("FACTION_DAMAGE_" + faction.toUpperCase(), Material.RED_DYE, faction + " Faction Damage", new String[]{"Deals additional damage to mobs", "from the " + faction + " faction in %."}, new String[]{"!block", "all"});
}
}

View File

@ -4,15 +4,14 @@ import dev.aurelium.auraskills.api.AuraSkillsApi;
import dev.aurelium.auraskills.api.event.skill.SkillLevelUpEvent;
import dev.aurelium.auraskills.api.event.user.UserLoadEvent;
import dev.aurelium.auraskills.api.skill.Skill;
import dev.aurelium.auraskills.api.skill.Skills;
import dev.aurelium.auraskills.api.stat.StatModifier;
import dev.aurelium.auraskills.api.stat.Stats;
import dev.aurelium.auraskills.api.skill.Skills;
import dev.aurelium.auraskills.api.trait.TraitModifier;
import dev.aurelium.auraskills.api.trait.Traits;
import dev.aurelium.auraskills.api.user.SkillsUser;
import io.lumine.mythic.lib.UtilityMethods;
import io.lumine.mythic.lib.api.item.NBTItem;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.player.EmptyRPGPlayer;
@ -22,7 +21,10 @@ import net.Indyuce.mmoitems.api.util.message.Message;
import net.Indyuce.mmoitems.stat.type.DoubleStat;
import net.Indyuce.mmoitems.stat.type.ItemStat;
import net.Indyuce.mmoitems.stat.type.RequiredLevelStat;
import org.bukkit.*;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.OfflinePlayer;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
@ -151,7 +153,7 @@ public class AuraSkillsHook implements RPGHandler, Listener {
private final Skill skill;
public RequiredProfessionStat(Skills skill) {
super(skill.name(), VersionMaterial.EXPERIENCE_BOTTLE.toMaterial(), skill.getDisplayName(Locale.getDefault()),
super(skill.name(), Material.EXPERIENCE_BOTTLE, skill.getDisplayName(Locale.getDefault()),
new String[]{"Amount of " + skill.getDisplayName(Locale.getDefault()) + " levels the", "player needs to use the item.", "(AuraSkills)"});
this.skill = aSkills.getGlobalRegistry().getSkill(skill.getId());

View File

@ -9,7 +9,6 @@ import com.archyx.aureliumskills.skills.Skills;
import com.archyx.aureliumskills.stats.Stats;
import io.lumine.mythic.lib.UtilityMethods;
import io.lumine.mythic.lib.api.item.NBTItem;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.player.EmptyRPGPlayer;
import net.Indyuce.mmoitems.api.player.PlayerData;
@ -143,7 +142,7 @@ public class AureliumSkillsHook implements RPGHandler, Listener {
private final Skill skill;
public RequiredProfessionStat(Skills skill) {
super(skill.name(), VersionMaterial.EXPERIENCE_BOTTLE.toMaterial(), skill.getDisplayName(Locale.getDefault()),
super(skill.name(), Material.EXPERIENCE_BOTTLE, skill.getDisplayName(Locale.getDefault()),
new String[]{"Amount of " + skill.getDisplayName(Locale.getDefault()) + " levels the", "player needs to use the item.", "(AureliumSkills)"});
this.skill = aSkills.getSkillRegistry().getSkill(skill.name());

View File

@ -6,7 +6,6 @@ import io.lumine.mythic.lib.api.item.NBTItem;
import io.lumine.mythic.lib.api.util.AltChar;
import io.lumine.mythic.lib.api.util.ui.SilentNumbers;
import io.lumine.mythic.lib.util.AdventureUtils;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.Type;
import net.Indyuce.mmoitems.api.edition.NewItemEdition;
@ -101,7 +100,7 @@ public class ItemBrowser extends PluginInventory {
}
// Fill remainder slots with 'No Type' notice
ItemStack glass = VersionMaterial.GRAY_STAINED_GLASS_PANE.toItem();
ItemStack glass = new ItemStack(Material.GRAY_STAINED_GLASS_PANE);
ItemMeta glassMeta = glass.getItemMeta();
glassMeta.setDisplayName(ChatColor.RED + "- No type -");
glass.setItemMeta(glassMeta);
@ -141,7 +140,7 @@ public class ItemBrowser extends PluginInventory {
/*
* Build cool Item Stacks for buttons and sh
*/
ItemStack error = VersionMaterial.RED_STAINED_GLASS_PANE.toItem();
ItemStack error = new ItemStack(Material.RED_STAINED_GLASS_PANE);
ItemMeta errorMeta = error.getItemMeta();
errorMeta.setDisplayName(ChatColor.RED + "- Error -");
List<String> errorLore = new ArrayList<>();
@ -150,7 +149,7 @@ public class ItemBrowser extends PluginInventory {
errorMeta.setLore(errorLore);
error.setItemMeta(errorMeta);
ItemStack noItem = VersionMaterial.GRAY_STAINED_GLASS_PANE.toItem();
ItemStack noItem = new ItemStack(Material.GRAY_STAINED_GLASS_PANE);
ItemMeta noItemMeta = noItem.getItemMeta();
noItemMeta.setDisplayName(ChatColor.RED + "- No Item -");
noItem.setItemMeta(noItemMeta);
@ -165,12 +164,12 @@ public class ItemBrowser extends PluginInventory {
backMeta.setDisplayName(ChatColor.GREEN + AltChar.rightArrow + " Back");
back.setItemMeta(backMeta);
ItemStack create = new ItemStack(VersionMaterial.WRITABLE_BOOK.toMaterial());
ItemStack create = new ItemStack(new ItemStack(Material.WRITABLE_BOOK));
ItemMeta createMeta = create.getItemMeta();
createMeta.setDisplayName(ChatColor.GREEN + "Create New");
create.setItemMeta(createMeta);
ItemStack delete = new ItemStack(VersionMaterial.CAULDRON.toMaterial());
ItemStack delete = new ItemStack(new ItemStack(Material.CAULDRON));
ItemMeta deleteMeta = delete.getItemMeta();
deleteMeta.setDisplayName(ChatColor.RED + (deleteMode ? "Cancel Deletion" : "Delete Item"));
delete.setItemMeta(deleteMeta);

View File

@ -5,7 +5,6 @@ import io.lumine.mythic.lib.UtilityMethods;
import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.api.util.AltChar;
import io.lumine.mythic.lib.skill.trigger.TriggerType;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.edition.StatEdition;
@ -99,7 +98,7 @@ public class AbilityEdition extends EditionInventory {
if (ability != null) {
ConfigurationSection section = getEditedSection().getConfigurationSection("ability." + configKey);
for (String modifier : ability.getHandler().getModifiers()) {
ItemStack modifierItem = VersionMaterial.GRAY_DYE.toItem();
ItemStack modifierItem = new ItemStack(Material.GRAY_DYE);
ItemMeta modifierItemMeta = modifierItem.getItemMeta();
modifierItemMeta.setDisplayName(ChatColor.GREEN + UtilityMethods.caseOnWords(modifier.toLowerCase().replace("-", " ")));
List<String> modifierItemLore = new ArrayList<>();
@ -129,7 +128,7 @@ public class AbilityEdition extends EditionInventory {
}
}
ItemStack glass = VersionMaterial.GRAY_STAINED_GLASS_PANE.toItem();
ItemStack glass = new ItemStack(Material.GRAY_STAINED_GLASS_PANE);
ItemMeta glassMeta = glass.getItemMeta();
glassMeta.setDisplayName(ChatColor.RED + "- No Modifier -");
glass.setItemMeta(glassMeta);

View File

@ -5,7 +5,6 @@ import io.lumine.mythic.lib.UtilityMethods;
import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.api.util.AltChar;
import io.lumine.mythic.lib.skill.trigger.TriggerType;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.item.template.MMOItemTemplate;
import net.Indyuce.mmoitems.api.util.NumericStatFormula;
@ -88,12 +87,12 @@ public class AbilityListEdition extends EditionInventory {
inventory.setItem(slots[n++], abilityItem);
}
ItemStack glass = VersionMaterial.GRAY_STAINED_GLASS_PANE.toItem();
ItemStack glass = new ItemStack(Material.GRAY_STAINED_GLASS_PANE);
ItemMeta glassMeta = glass.getItemMeta();
glassMeta.setDisplayName(ChatColor.RED + "- No Ability -");
glass.setItemMeta(glassMeta);
ItemStack add = new ItemStack(VersionMaterial.WRITABLE_BOOK.toMaterial());
ItemStack add = new ItemStack(Material.WRITABLE_BOOK);
ItemMeta addMeta = add.getItemMeta();
addMeta.setDisplayName(ChatColor.GREEN + "Add an ability...");
add.setItemMeta(addMeta);

View File

@ -2,7 +2,6 @@ package net.Indyuce.mmoitems.gui.edition;
import io.lumine.mythic.lib.UtilityMethods;
import io.lumine.mythic.lib.api.util.AltChar;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.edition.StatEdition;
@ -53,7 +52,7 @@ public class ArrowParticlesEdition extends EditionInventory {
particleItemMeta.setLore(particleItemLore);
particleItem.setItemMeta(particleItemMeta);
ItemStack amount = VersionMaterial.GRAY_DYE.toItem();
ItemStack amount = new ItemStack(Material.GRAY_DYE);
ItemMeta amountMeta = amount.getItemMeta();
amountMeta.setDisplayName(ChatColor.GREEN + "Amount");
List<String> amountLore = new ArrayList<>();
@ -65,7 +64,7 @@ public class ArrowParticlesEdition extends EditionInventory {
amountMeta.setLore(amountLore);
amount.setItemMeta(amountMeta);
ItemStack offset = VersionMaterial.GRAY_DYE.toItem();
ItemStack offset = new ItemStack(Material.GRAY_DYE);
ItemMeta offsetMeta = offset.getItemMeta();
offsetMeta.setDisplayName(ChatColor.GREEN + "Offset");
List<String> offsetLore = new ArrayList<>();
@ -84,7 +83,7 @@ public class ArrowParticlesEdition extends EditionInventory {
int green = section.getInt("color.green");
int blue = section.getInt("color.blue");
ItemStack speed = VersionMaterial.GRAY_DYE.toItem();
ItemStack speed = new ItemStack(Material.GRAY_DYE);
ItemMeta speedMeta = speed.getItemMeta();
speedMeta.setDisplayName(ChatColor.GREEN + "Particle Color");
List<String> speedLore = new ArrayList<>();
@ -100,7 +99,7 @@ public class ArrowParticlesEdition extends EditionInventory {
inventory.setItem(41, speed);
} else {
ItemStack colorItem = VersionMaterial.GRAY_DYE.toItem();
ItemStack colorItem = new ItemStack(Material.GRAY_DYE);
ItemMeta colorItemMeta = colorItem.getItemMeta();
colorItemMeta.setDisplayName(ChatColor.GREEN + "Speed");
List<String> colorItemLore = new ArrayList<>();

View File

@ -4,17 +4,16 @@ import io.lumine.mythic.lib.MythicLib;
import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.api.item.NBTItem;
import io.lumine.mythic.lib.api.util.AltChar;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.edition.StatEdition;
import net.Indyuce.mmoitems.api.item.template.MMOItemTemplate;
import net.Indyuce.mmoitems.util.MMOUtils;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryAction;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
@ -45,7 +44,7 @@ public class CommandListEdition extends EditionInventory {
boolean console = getEditedSection().getBoolean("commands." + key + ".console"),
op = getEditedSection().getBoolean("commands." + key + ".op");
ItemStack item = new ItemStack(VersionMaterial.COMPARATOR.toMaterial());
ItemStack item = new ItemStack(Material.COMPARATOR);
ItemMeta itemMeta = item.getItemMeta();
itemMeta.setDisplayName(format == null || format.equals("") ? ChatColor.RED + "No Format" : ChatColor.GREEN + format);
List<String> itemLore = new ArrayList<>();
@ -61,12 +60,12 @@ public class CommandListEdition extends EditionInventory {
inventory.setItem(slots[n++], NBTItem.get(item).addTag(new ItemTag("configKey", key)).toItem());
}
ItemStack glass = VersionMaterial.GRAY_STAINED_GLASS_PANE.toItem();
ItemStack glass = new ItemStack(Material.GRAY_STAINED_GLASS_PANE);
ItemMeta glassMeta = glass.getItemMeta();
glassMeta.setDisplayName(ChatColor.RED + "- No Command -");
glass.setItemMeta(glassMeta);
ItemStack add = new ItemStack(VersionMaterial.WRITABLE_BOOK.toMaterial());
ItemStack add = new ItemStack(Material.WRITABLE_BOOK);
ItemMeta addMeta = add.getItemMeta();
addMeta.setDisplayName(ChatColor.GREEN + "Register a command...");
add.setItemMeta(addMeta);

View File

@ -3,7 +3,6 @@ package net.Indyuce.mmoitems.gui.edition;
import io.lumine.mythic.lib.MythicLib;
import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.api.item.NBTItem;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.item.template.MMOItemTemplate;
import net.Indyuce.mmoitems.stat.type.InternalStat;
@ -63,7 +62,7 @@ public class ItemEdition extends EditionInventory {
inventory.setItem(slots[n++], MythicLib.plugin.getVersion().getWrapper().getNBTItem(item).addTag(new ItemTag("guiStat", stat.getId())).toItem());
}
ItemStack glass = VersionMaterial.GRAY_STAINED_GLASS_PANE.toItem();
ItemStack glass = new ItemStack(Material.GRAY_STAINED_GLASS_PANE);
ItemMeta glassMeta = glass.getItemMeta();
glassMeta.setDisplayName(ChatColor.RED + "- No Item Stat -");
glass.setItemMeta(glassMeta);

View File

@ -4,7 +4,6 @@ import io.lumine.mythic.lib.UtilityMethods;
import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.api.item.NBTItem;
import io.lumine.mythic.lib.api.util.AltChar;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.edition.StatEdition;
@ -18,7 +17,6 @@ import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryAction;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
@ -47,7 +45,7 @@ public class ParticlesEdition extends EditionInventory {
} catch (Exception ignored) {
}
ItemStack particleTypeItem = VersionMaterial.PINK_STAINED_GLASS.toItem();
ItemStack particleTypeItem = new ItemStack(Material.PINK_STAINED_GLASS);
ItemMeta particleTypeItemMeta = particleTypeItem.getItemMeta();
particleTypeItemMeta.setDisplayName(ChatColor.GREEN + "Particle Pattern");
List<String> particleTypeItemLore = new ArrayList<>();
@ -69,7 +67,7 @@ public class ParticlesEdition extends EditionInventory {
if (particleType != null) {
ConfigurationSection psection = getEditedSection().getConfigurationSection("item-particles");
for (String modifier : particleType.getModifiers()) {
ItemStack modifierItem = VersionMaterial.GRAY_DYE.toItem();
ItemStack modifierItem = new ItemStack(Material.GRAY_DYE);
ItemMeta modifierItemMeta = modifierItem.getItemMeta();
modifierItemMeta.setDisplayName(ChatColor.GREEN + UtilityMethods.caseOnWords(modifier.toLowerCase().replace("-", " ")));
List<String> modifierItemLore = new ArrayList<>();
@ -114,7 +112,7 @@ public class ParticlesEdition extends EditionInventory {
int green = getEditedSection().getInt("item-particles.color.green");
int blue = getEditedSection().getInt("item-particles.color.blue");
ItemStack colorItem = VersionMaterial.RED_DYE.toItem();
ItemStack colorItem = new ItemStack(Material.RED_DYE);
ItemMeta colorItemMeta = colorItem.getItemMeta();
colorItemMeta.setDisplayName(ChatColor.GREEN + "Particle Color");
List<String> colorItemLore = new ArrayList<>();
@ -132,7 +130,7 @@ public class ParticlesEdition extends EditionInventory {
inventory.setItem(25, colorItem);
}
ItemStack glass = VersionMaterial.GRAY_STAINED_GLASS_PANE.toItem();
ItemStack glass = new ItemStack(Material.GRAY_STAINED_GLASS_PANE);
ItemMeta glassMeta = glass.getItemMeta();
glassMeta.setDisplayName(ChatColor.RED + "- No Modifier -");
glass.setItemMeta(glassMeta);

View File

@ -2,7 +2,6 @@ package net.Indyuce.mmoitems.gui.edition;
import io.lumine.mythic.lib.api.util.ItemFactory;
import io.lumine.mythic.lib.api.util.ui.SilentNumbers;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.item.template.MMOItemTemplate;
@ -51,7 +50,7 @@ public class RevisionInventory extends EditionInventory {
"The display name of the old item will be transferred to the new one"
, 40, "\u00a77")).build();
lore = ItemFactory.of(VersionMaterial.WRITABLE_BOOK.toMaterial()).name("\u00a7dLore").lore(SilentNumbers.chop(
lore = ItemFactory.of(Material.WRITABLE_BOOK).name("\u00a7dLore").lore(SilentNumbers.chop(
"Specifically keeps lore lines that begin with the color code \u00a7n&7"
, 40, "\u00a77")).build();

View File

@ -2,7 +2,6 @@ package net.Indyuce.mmoitems.gui.edition;
import io.lumine.mythic.lib.api.util.AltChar;
import io.lumine.mythic.lib.api.util.ItemFactory;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.Type;
@ -38,7 +37,7 @@ public class UpgradingEdition extends EditionInventory {
boolean workbench = getEditedSection().getBoolean("upgrade.workbench");
if (!template.getType().corresponds(Type.CONSUMABLE)) {
ItemStack workbenchItem = new ItemStack(VersionMaterial.CRAFTING_TABLE.toMaterial());
ItemStack workbenchItem = new ItemStack(Material.CRAFTING_TABLE);
ItemMeta workbenchItemMeta = workbenchItem.getItemMeta();
workbenchItemMeta.setDisplayName(ChatColor.GREEN + "Workbench Upgrade Only?");
List<String> workbenchItemLore = new ArrayList<>();
@ -54,7 +53,7 @@ public class UpgradingEdition extends EditionInventory {
inventory.setItem(20, workbenchItem);
String upgradeTemplate = getEditedSection().getString("upgrade.template");
ItemStack templateItem = new ItemStack(VersionMaterial.OAK_SIGN.toMaterial());
ItemStack templateItem = new ItemStack(Material.OAK_SIGN);
ItemMeta templateItemMeta = templateItem.getItemMeta();
templateItemMeta.setDisplayName(ChatColor.GREEN + "Upgrade Template");
List<String> templateItemLore = new ArrayList<>();
@ -130,7 +129,7 @@ public class UpgradingEdition extends EditionInventory {
inventory.setItem(38, notAvailable);
double success = getEditedSection().getDouble("upgrade.success");
ItemStack successItem = new ItemStack(VersionMaterial.EXPERIENCE_BOTTLE.toMaterial());
ItemStack successItem = new ItemStack(Material.EXPERIENCE_BOTTLE);
ItemMeta successItemMeta = successItem.getItemMeta();
successItemMeta.setDisplayName(ChatColor.GREEN + "Success Chance");
List<String> successItemLore = new ArrayList<>();

View File

@ -9,6 +9,7 @@ import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.api.edition.StatEdition;
import net.Indyuce.mmoitems.api.util.message.FFPMMOItems;
import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeEditorGUI;
import net.Indyuce.mmoitems.stat.HidePotionEffects;
import org.bukkit.ChatColor;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
@ -49,7 +50,7 @@ public class RBA_AmountOutput extends RecipeButtonAction {
if (MythicLib.plugin.getVersion().isStrictlyHigher(1, 13) && resultMeta.hasCustomModelData()) { buttonMeta.setCustomModelData(resultMeta.getCustomModelData()); }
if (resultMeta instanceof LeatherArmorMeta) { ((LeatherArmorMeta) buttonMeta).setColor(((LeatherArmorMeta) resultMeta).getColor()); }
if (resultMeta instanceof BannerMeta) { ((BannerMeta) buttonMeta).setPatterns(((BannerMeta) resultMeta).getPatterns()); }
buttonMeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES, ItemFlag.HIDE_DYE, ItemFlag.HIDE_POTION_EFFECTS);
buttonMeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES, ItemFlag.HIDE_DYE, HidePotionEffects.ITEM_FLAG);
button.setItemMeta(buttonMeta);
}

View File

@ -2,8 +2,7 @@ package net.Indyuce.mmoitems.gui.edition.recipe.registry.burninglegacy;
import io.lumine.mythic.lib.MythicLib;
import io.lumine.mythic.lib.UtilityMethods;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmoitems.util.MMOUtils;
import io.lumine.mythic.lib.version.VMaterial;
import net.Indyuce.mmoitems.manager.RecipeManager;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
@ -14,9 +13,9 @@ public enum CraftingType {
//SHAPED(21, "The C. Table Recipe (Shaped) for this item", VersionMaterial.CRAFTING_TABLE, null),
//SHAPELESS(22, "The C. Table Recipe (Shapeless) for this item", VersionMaterial.CRAFTING_TABLE, null),
FURNACE(23, "The Furnace Recipe for this item", Material.FURNACE, RecipeManager.BurningRecipeType.FURNACE),
BLAST(29, "The Blast Furnace Recipe for this item", VersionMaterial.BLAST_FURNACE, RecipeManager.BurningRecipeType.BLAST, 1, 14),
SMOKER(30, "The Smoker Recipe for this item", VersionMaterial.SMOKER, RecipeManager.BurningRecipeType.SMOKER, 1, 14),
CAMPFIRE(32, "The Campfire Recipe for this item", VersionMaterial.CAMPFIRE, RecipeManager.BurningRecipeType.CAMPFIRE, 1, 14);
BLAST(29, "The Blast Furnace Recipe for this item", VMaterial.BLAST_FURNACE, RecipeManager.BurningRecipeType.BLAST, 1, 14),
SMOKER(30, "The Smoker Recipe for this item", VMaterial.SMOKER, RecipeManager.BurningRecipeType.SMOKER, 1, 14),
CAMPFIRE(32, "The Campfire Recipe for this item", VMaterial.CAMPFIRE, RecipeManager.BurningRecipeType.CAMPFIRE, 1, 14);
//SMITHING(33, "The Smithing Recipe for this item", VersionMaterial.SMITHING_TABLE, null, 1, 15);
private final int slot;
@ -25,8 +24,8 @@ public enum CraftingType {
private final int[] mustBeHigher;
private final RecipeManager.BurningRecipeType burning;
private CraftingType(int slot, String lore, VersionMaterial material, @Nullable RecipeManager.BurningRecipeType burn, int... mustBeHigher) {
this(slot, lore, material.toMaterial(), burn, mustBeHigher);
private CraftingType(int slot, String lore, VMaterial material, @Nullable RecipeManager.BurningRecipeType burn, int... mustBeHigher) {
this(slot, lore, material.get(), burn, mustBeHigher);
}
private CraftingType(int slot, String lore, Material material, @Nullable RecipeManager.BurningRecipeType burn, int... mustBeHigher) {

View File

@ -7,7 +7,7 @@ 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.version.VersionMaterial;
import io.lumine.mythic.lib.version.VParticle;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
@ -19,6 +19,7 @@ import net.Indyuce.mmoitems.stat.type.ItemStat;
import net.Indyuce.mmoitems.util.MMOUtils;
import org.apache.commons.lang.Validate;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.Particle;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.event.inventory.InventoryClickEvent;
@ -31,7 +32,7 @@ import java.util.Optional;
public class ArrowParticles extends ItemStat<ArrowParticlesData, ArrowParticlesData> {
public ArrowParticles() {
super("ARROW_PARTICLES", VersionMaterial.LIME_STAINED_GLASS.toMaterial(), "Arrow Particles",
super("ARROW_PARTICLES", Material.SPECTRAL_ARROW, "Arrow Particles",
new String[] { "Particles that display around", "the arrows your bow fires." }, new String[] { "bow", "crossbow" });
}
@ -200,6 +201,6 @@ public class ArrowParticles extends ItemStat<ArrowParticlesData, ArrowParticlesD
@NotNull
@Override
public ArrowParticlesData getClearStatData() {
return new ArrowParticlesData(Particle.EXPLOSION_LARGE, 1, 0, 1);
return new ArrowParticlesData(VParticle.LARGE_EXPLOSION.get(), 1, 0, 1);
}
}

View File

@ -1,12 +1,12 @@
package net.Indyuce.mmoitems.stat;
import net.Indyuce.mmoitems.stat.type.AttackWeaponStat;
import io.lumine.mythic.lib.version.VersionMaterial;
import org.bukkit.Material;
import org.bukkit.attribute.Attribute;
public class AttackSpeed extends AttackWeaponStat {
public AttackSpeed() {
super("ATTACK_SPEED", VersionMaterial.LIGHT_GRAY_DYE.toMaterial(), "Attack Speed",
super("ATTACK_SPEED", Material.LIGHT_GRAY_DYE, "Attack Speed",
new String[] { "The speed at which your weapon strikes.", "In attacks/sec." }, Attribute.GENERIC_ATTACK_SPEED);
}
}

View File

@ -5,7 +5,6 @@ import io.lumine.mythic.lib.MythicLib;
import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.api.item.NBTItem;
import io.lumine.mythic.lib.api.util.SmartGive;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.Type;
@ -87,8 +86,8 @@ public class CanDeskin extends BooleanStat implements ConsumableItemInteraction
else targetItemMeta.removeItemFlags(ItemFlag.HIDE_ARMOR_TRIM);
}
if (target.hasTag("SkullOwner") && (targetItem.getType() == VersionMaterial.PLAYER_HEAD.toMaterial())
&& (originalItem.getType() == VersionMaterial.PLAYER_HEAD.toMaterial()))
if (target.hasTag("SkullOwner") && (targetItem.getType() == Material.PLAYER_HEAD)
&& (originalItem.getType() == Material.PLAYER_HEAD))
MythicLib.plugin.getVersion().getWrapper().setProfile((SkullMeta) targetItemMeta,
((SkullTextureData) originalMmoitem.getData(ItemStats.SKULL_TEXTURE)).getGameProfile());

View File

@ -4,9 +4,7 @@ import com.google.gson.*;
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.version.VersionMaterial;
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.gui.edition.CommandListEdition;
@ -14,8 +12,10 @@ import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.data.CommandData;
import net.Indyuce.mmoitems.stat.data.CommandListData;
import net.Indyuce.mmoitems.stat.type.ItemStat;
import net.Indyuce.mmoitems.util.MMOUtils;
import org.apache.commons.lang.Validate;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.jetbrains.annotations.NotNull;
@ -29,7 +29,7 @@ public class Commands extends ItemStat<CommandListData, CommandListData> {
private static final int MAXIMUM_COMMANDS = 15;
public Commands() {
super("COMMANDS", VersionMaterial.COMMAND_BLOCK_MINECART.toMaterial(), "Commands",
super("COMMANDS", Material.COMMAND_BLOCK_MINECART, "Commands",
new String[]{"The commands your item", "performs when right clicked."}, new String[]{"!armor", "!block", "!gem_stone", "all"});
}

View File

@ -6,7 +6,6 @@ import com.google.gson.JsonSyntaxException;
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.version.VersionMaterial;
import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.edition.StatEdition;
@ -18,6 +17,7 @@ import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.ItemStat;
import org.apache.commons.lang.Validate;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.event.inventory.InventoryAction;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.jetbrains.annotations.NotNull;
@ -29,7 +29,7 @@ import java.util.Optional;
public class CompatibleIds extends ItemStat<StringListData, StringListData> {
public CompatibleIds() {
super("COMPATIBLE_IDS", VersionMaterial.COMMAND_BLOCK.toMaterial(), "Compatible IDs",
super("COMPATIBLE_IDS", Material.COMMAND_BLOCK, "Compatible IDs",
new String[]{"The item ids this skin is", "compatible with."}, new String[]{"skin"});
}

View File

@ -6,7 +6,6 @@ import com.google.gson.JsonSyntaxException;
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.version.VersionMaterial;
import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.edition.StatEdition;
@ -33,7 +32,7 @@ import java.util.Optional;
public class CompatibleMaterials extends ItemStat<StringListData, StringListData> {
public CompatibleMaterials() {
super("COMPATIBLE_MATERIALS", VersionMaterial.COMMAND_BLOCK.toMaterial(), "Compatible Materials",
super("COMPATIBLE_MATERIALS", Material.COMMAND_BLOCK, "Compatible Materials",
new String[]{"The item materials this skin is", "compatible with."}, new String[]{"skin"});
}

View File

@ -6,7 +6,6 @@ import com.google.gson.JsonSyntaxException;
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.version.VersionMaterial;
import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.edition.StatEdition;
@ -18,6 +17,7 @@ import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.ItemStat;
import org.apache.commons.lang.Validate;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.event.inventory.InventoryAction;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.jetbrains.annotations.NotNull;
@ -29,7 +29,7 @@ import java.util.Optional;
public class CompatibleTypes extends ItemStat<StringListData, StringListData> {
public CompatibleTypes() {
super("COMPATIBLE_TYPES", VersionMaterial.COMMAND_BLOCK.toMaterial(), "Compatible Types",
super("COMPATIBLE_TYPES", Material.COMMAND_BLOCK, "Compatible Types",
new String[]{"The item types this skin is", "compatible with."}, new String[]{"skin"});
}

View File

@ -1,39 +1,38 @@
package net.Indyuce.mmoitems.stat;
import io.lumine.mythic.lib.api.crafting.uimanager.ProvidedUIFilter;
import io.lumine.mythic.lib.api.crafting.uimanager.UIFilterManager;
import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.api.util.AltChar;
import io.lumine.mythic.lib.api.util.ui.QuickNumberRange;
import io.lumine.mythic.lib.api.util.ui.SilentNumbers;
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.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.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 org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.event.inventory.InventoryAction;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import io.lumine.mythic.lib.api.crafting.uimanager.ProvidedUIFilter;
import io.lumine.mythic.lib.api.crafting.uimanager.UIFilterManager;
import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.api.util.ui.QuickNumberRange;
import io.lumine.mythic.lib.api.util.ui.SilentNumbers;
import net.Indyuce.mmoitems.gui.edition.recipe.RecipeTypeListGUI;
import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeEditorGUI;
import net.Indyuce.mmoitems.gui.edition.recipe.interpreter.RMG_RecipeInterpreter;
import net.Indyuce.mmoitems.gui.edition.recipe.button.RecipeButtonAction;
import net.Indyuce.mmoitems.stat.data.StringData;
import org.bukkit.ChatColor;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.event.inventory.InventoryAction;
import org.bukkit.event.inventory.InventoryClickEvent;
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.data.random.RandomStatData;
import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.ItemStat;
import io.lumine.mythic.lib.api.util.AltChar;
import io.lumine.mythic.lib.version.VersionMaterial;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class Crafting extends ItemStat<RandomStatData<StatData>, StatData> {
public Crafting() {
super("CRAFTING", VersionMaterial.CRAFTING_TABLE.toMaterial(), "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,13 +1,13 @@
package net.Indyuce.mmoitems.stat;
import io.lumine.mythic.lib.version.VersionMaterial;
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;
public class CraftingPermission extends StringStat implements TemplateOption, GemStoneStat {
public CraftingPermission() {
super("CRAFT_PERMISSION", VersionMaterial.OAK_SIGN.toMaterial(), "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]);
}

View File

@ -4,7 +4,6 @@ import io.lumine.mythic.lib.MythicLib;
import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.api.item.SupportedNBTTagValues;
import io.lumine.mythic.lib.comp.adventure.AdventureParser;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.ItemTier;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
@ -16,6 +15,7 @@ import net.Indyuce.mmoitems.stat.type.StatHistory;
import net.Indyuce.mmoitems.stat.type.StringStat;
import org.apache.commons.lang.Validate;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@ -24,7 +24,7 @@ import java.util.ArrayList;
public class DisplayName extends StringStat implements GemStoneStat {
public DisplayName() {
super("NAME", VersionMaterial.OAK_SIGN.toMaterial(), "Display Name", new String[]{"The item display name."},
super("NAME", Material.OAK_SIGN, "Display Name", new String[]{"The item display name."},
new String[0]);
}

View File

@ -1,11 +1,11 @@
package net.Indyuce.mmoitems.stat;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmoitems.stat.type.GemStoneStat;
import net.Indyuce.mmoitems.stat.type.StringStat;
import org.bukkit.Material;
public class DisplayedType extends StringStat implements GemStoneStat {
public DisplayedType() {
super("DISPLAYED_TYPE", VersionMaterial.OAK_SIGN.toMaterial(), "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."}, new String[0]);
}
}

View File

@ -1,10 +1,16 @@
package net.Indyuce.mmoitems.stat;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
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.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.data.ColorData;
import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.ItemStat;
import org.apache.commons.lang.Validate;
import org.bukkit.ChatColor;
import org.bukkit.Color;
@ -13,27 +19,18 @@ import org.bukkit.event.inventory.InventoryAction;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.LeatherArmorMeta;
import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.MMOItems;
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.data.ColorData;
import net.Indyuce.mmoitems.stat.data.random.RandomStatData;
import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.ItemStat;
import io.lumine.mythic.lib.api.util.AltChar;
import io.lumine.mythic.lib.version.VersionMaterial;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
public class DyeColor extends ItemStat<ColorData, ColorData> {
public DyeColor() {
super("DYE_COLOR", VersionMaterial.RED_DYE.toMaterial(), "Dye Color",
super("DYE_COLOR", Material.RED_DYE, "Dye Color",
new String[] { "The color of your item", "(for dyeable items).", "In RGB." }, new String[0], Material.LEATHER_HELMET,
Material.LEATHER_CHESTPLATE, Material.LEATHER_LEGGINGS, Material.LEATHER_BOOTS, VersionMaterial.LEATHER_HORSE_ARMOR.toMaterial());
Material.LEATHER_CHESTPLATE, Material.LEATHER_LEGGINGS, Material.LEATHER_BOOTS, Material.LEATHER_HORSE_ARMOR);
}
@Override

View File

@ -1,17 +1,16 @@
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.data.StringData;
import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.GemStoneStat;
import net.Indyuce.mmoitems.stat.type.StringStat;
import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.version.VersionMaterial;
import org.bukkit.Material;
import org.jetbrains.annotations.NotNull;
public class GemColor extends StringStat implements GemStoneStat {
public GemColor() {
super("GEM_COLOR", VersionMaterial.LIGHT_BLUE_DYE.toMaterial(), "Gem Color", new String[] { "Defines the color of the socket in", "which the gem can be applied." }, new String[] { "gem_stone" });
super("GEM_COLOR", Material.LIGHT_BLUE_DYE, "Gem Color", new String[] { "Defines the color of the socket in", "which the gem can be applied." }, new String[] { "gem_stone" });
}
@Override

View File

@ -1,15 +1,12 @@
package net.Indyuce.mmoitems.stat;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmoitems.stat.data.StringData;
import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.ChooseStat;
import net.Indyuce.mmoitems.stat.type.GemStoneStat;
import net.Indyuce.mmoitems.util.StatChoice;
import org.bukkit.Material;
import org.jetbrains.annotations.NotNull;
import java.util.HashMap;
/**
* Defines how gem stats will scale when the item they are put on upgrades.
*/
@ -25,7 +22,7 @@ public class GemUpgradeScaling extends ChooseStat implements GemStoneStat {
public static String defaultValue = SUBSEQUENT.getId();
public GemUpgradeScaling() {
super("GEM_UPGRADE_SCALING", VersionMaterial.LIME_DYE.toMaterial(), "Gem Upgrade Scaling", new String[] { "Gem stones add their stats to items, but you may also", "upgrade your items via crafting stations or consumables.", "", "\u00a76Should this gem stone stats be affected by upgrading?" }, new String[] { "gem_stone" });
super("GEM_UPGRADE_SCALING", Material.LIME_DYE, "Gem Upgrade Scaling", new String[] { "Gem stones add their stats to items, but you may also", "upgrade your items via crafting stations or consumables.", "", "\u00a76Should this gem stone stats be affected by upgrading?" }, new String[] { "gem_stone" });
// Set the acceptable values
addChoices(SUBSEQUENT, NEVER, HISTORIC);

View File

@ -1,7 +1,6 @@
package net.Indyuce.mmoitems.stat;
import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
@ -23,7 +22,7 @@ import java.util.ArrayList;
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],
Material.LEATHER_HELMET, Material.LEATHER_CHESTPLATE, Material.LEATHER_LEGGINGS, Material.LEATHER_BOOTS, VersionMaterial.LEATHER_HORSE_ARMOR.toMaterial());
Material.LEATHER_HELMET, Material.LEATHER_CHESTPLATE, Material.LEATHER_LEGGINGS, Material.LEATHER_BOOTS, Material.LEATHER_HORSE_ARMOR);
}
@Override

View File

@ -1,11 +1,12 @@
package net.Indyuce.mmoitems.stat;
import io.lumine.mythic.lib.UtilityMethods;
import io.lumine.mythic.lib.api.item.ItemTag;
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.data.BooleanData;
import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.BooleanStat;
import org.bukkit.Material;
import org.bukkit.inventory.ItemFlag;
@ -13,41 +14,50 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.Arrays;
/**
* @deprecated Merge with other Hide- stats
*/
@Deprecated
public class HidePotionEffects extends BooleanStat {
public HidePotionEffects() {
super("HIDE_POTION_EFFECTS", Material.POTION, "Hide Potion Effects", new String[] { "Hides potion effects & 'No Effects'", "from your item lore." }, new String[0], Material.POTION, Material.SPLASH_POTION, Material.LINGERING_POTION, Material.TIPPED_ARROW);
}
public HidePotionEffects() {
super("HIDE_POTION_EFFECTS", Material.POTION, "Hide Additional Tooltips", new String[]{"Hides potion effects & additional", "vanilla tooltips from the item lore."}, new String[0], Material.POTION, Material.SPLASH_POTION, Material.LINGERING_POTION, Material.TIPPED_ARROW);
}
@Override
public void whenApplied(@NotNull ItemStackBuilder item, @NotNull BooleanData data) {
if (data.isEnabled())
item.getMeta().addItemFlags(ItemFlag.HIDE_POTION_EFFECTS);
}
@BackwardsCompatibility(version = "1.20.5")
public static final ItemFlag ITEM_FLAG = UtilityMethods.resolveEnumField(ItemFlag::valueOf,
() -> Arrays.stream(ItemFlag.values()).findAny().get(),
"HIDE_ADDITIONAL_TOOLTIP", "HIDE_POTION_EFFECTS");
@Override
public void whenLoaded(@NotNull ReadMMOItem mmoitem) {
if (mmoitem.getNBT().getItem().getItemMeta().hasItemFlag(ItemFlag.HIDE_POTION_EFFECTS))
mmoitem.setData(ItemStats.HIDE_POTION_EFFECTS, new BooleanData(true));
}
@Override
public void whenApplied(@NotNull ItemStackBuilder item, @NotNull BooleanData data) {
if (data.isEnabled()) item.getMeta().addItemFlags(ITEM_FLAG);
}
/**
* This stat is saved not as a custom tag, but as the vanilla HideFlag itself.
* Alas this is an empty array
*/
@NotNull
@Override
public ArrayList<ItemTag> getAppliedNBT(@NotNull BooleanData data) { return new ArrayList<>(); }
@Override
public void whenLoaded(@NotNull ReadMMOItem mmoitem) {
if (mmoitem.getNBT().getItem().getItemMeta().hasItemFlag(ITEM_FLAG))
mmoitem.setData(ItemStats.HIDE_POTION_EFFECTS, new BooleanData(true));
}
/**
* This stat is saved not as a custom tag, but as the vanilla HideFlag itself.
* Alas this method returns null.
*/
@Nullable
@Override
public BooleanData getLoadedNBT(@NotNull ArrayList<ItemTag> storedTags) { return null; }
/**
* This stat is saved not as a custom tag, but as the vanilla HideFlag itself.
* Alas this is an empty array
*/
@NotNull
@Override
public ArrayList<ItemTag> getAppliedNBT(@NotNull BooleanData data) {
return new ArrayList<>();
}
/**
* This stat is saved not as a custom tag, but as the vanilla HideFlag itself.
* Alas this method returns null.
*/
@Nullable
@Override
public BooleanData getLoadedNBT(@NotNull ArrayList<ItemTag> storedTags) {
return null;
}
}

View File

@ -1,5 +1,6 @@
package net.Indyuce.mmoitems.stat;
import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.api.item.SupportedNBTTagValues;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
@ -8,10 +9,9 @@ import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.data.DoubleData;
import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.InternalStat;
import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmoitems.stat.type.ItemStat;
import org.apache.commons.lang.NotImplementedException;
import org.bukkit.Material;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@ -22,7 +22,7 @@ import java.util.Optional;
public class ItemLevel extends ItemStat<NumericStatFormula, DoubleData> implements InternalStat {
public ItemLevel() {
super("ITEM_LEVEL", VersionMaterial.EXPERIENCE_BOTTLE.toMaterial(), "Item Level", new String[] { "The item level" }, new String[0]);
super("ITEM_LEVEL", Material.EXPERIENCE_BOTTLE, "Item Level", new String[] { "The item level" }, new String[0]);
}
@Override

View File

@ -6,7 +6,7 @@ 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.version.VersionMaterial;
import io.lumine.mythic.lib.version.VParticle;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
@ -19,6 +19,7 @@ import net.Indyuce.mmoitems.stat.type.ItemStat;
import net.Indyuce.mmoitems.util.MMOUtils;
import org.apache.commons.lang.Validate;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.Particle;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.event.inventory.InventoryAction;
@ -32,7 +33,7 @@ import java.util.Optional;
public class ItemParticles extends ItemStat<ParticleData, ParticleData> {
public ItemParticles() {
super("ITEM_PARTICLES", VersionMaterial.PINK_STAINED_GLASS.toMaterial(), "Item Particles", new String[] { "The particles displayed when",
super("ITEM_PARTICLES", Material.PINK_STAINED_GLASS, "Item Particles", new String[] { "The particles displayed when",
"holding/wearing your item.", "", ChatColor.BLUE + "A tutorial is available on the wiki." }, new String[] { "all", "!block" });
}
@ -81,7 +82,7 @@ public class ItemParticles extends ItemStat<ParticleData, ParticleData> {
@NotNull
@Override
public ParticleData getClearStatData() { return new ParticleData(ParticleType.AURA, Particle.EXPLOSION_LARGE); }
public ParticleData getClearStatData() { return new ParticleData(ParticleType.AURA, VParticle.LARGE_EXPLOSION.get()); }
@Override
public void whenInput(@NotNull EditionInventory inv, @NotNull String message, Object... info) {

View File

@ -2,7 +2,6 @@ package net.Indyuce.mmoitems.stat;
import io.lumine.mythic.lib.MythicLib;
import io.lumine.mythic.lib.api.util.AltChar;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.edition.StatEdition;
@ -13,6 +12,7 @@ import net.Indyuce.mmoitems.stat.type.GemStoneStat;
import net.Indyuce.mmoitems.stat.type.StringListStat;
import org.apache.commons.lang.Validate;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.event.inventory.InventoryAction;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.jetbrains.annotations.NotNull;
@ -23,7 +23,7 @@ import java.util.Optional;
public class Lore extends StringListStat implements GemStoneStat {
public Lore() {
super("LORE", VersionMaterial.WRITABLE_BOOK.toMaterial(), "Lore", new String[]{"The item lore."}, new String[0]);
super("LORE", Material.WRITABLE_BOOK, "Lore", new String[]{"The item lore."}, new String[0]);
}
@Override

View File

@ -3,17 +3,15 @@ package net.Indyuce.mmoitems.stat;
import io.lumine.mythic.lib.UtilityMethods;
import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.api.item.NBTItem;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmoitems.MMOItems;
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.data.StringData;
import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.GemStoneStat;
import net.Indyuce.mmoitems.stat.type.StringStat;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.Material;
import org.bukkit.event.inventory.InventoryAction;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.jetbrains.annotations.NotNull;
@ -22,7 +20,7 @@ import java.util.Objects;
public class LuteAttackEffectStat extends StringStat implements GemStoneStat {
public LuteAttackEffectStat() {
super("LUTE_ATTACK_EFFECT", VersionMaterial.DIAMOND_HORSE_ARMOR.toMaterial(), "Lute Attack Effect",
super("LUTE_ATTACK_EFFECT", Material.DIAMOND_HORSE_ARMOR, "Lute Attack Effect",
new String[] { "Changes how your lute behaves", "when right clicked.", "&9Tip: /mi list lute" }, new String[] { "lute" });
}

View File

@ -1,17 +1,16 @@
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.data.StringData;
import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.GemStoneStat;
import net.Indyuce.mmoitems.stat.type.StringStat;
import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.version.VersionMaterial;
import org.bukkit.Material;
import org.jetbrains.annotations.NotNull;
public class LuteAttackSoundStat extends StringStat implements GemStoneStat {
public LuteAttackSoundStat() {
super("LUTE_ATTACK_SOUND", VersionMaterial.GOLDEN_HORSE_ARMOR.toMaterial(), "Lute Attack Sound", new String[] { "The sound played when", "basic attacking with this lute." }, new String[] { "lute" });
super("LUTE_ATTACK_SOUND", Material.GOLDEN_HORSE_ARMOR, "Lute Attack Sound", new String[] { "The sound played when", "basic attacking with this lute." }, new String[] { "lute" });
}
@Override

View File

@ -1,7 +1,6 @@
package net.Indyuce.mmoitems.stat;
import io.lumine.mythic.lib.api.item.NBTItem;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.api.item.mmoitem.VolatileMMOItem;
import net.Indyuce.mmoitems.api.player.PlayerData;
@ -12,6 +11,7 @@ import net.Indyuce.mmoitems.stat.type.DoubleStat;
import net.Indyuce.mmoitems.stat.type.ItemRestriction;
import net.Indyuce.mmoitems.stat.type.PlayerConsumable;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
@ -24,7 +24,7 @@ import org.jetbrains.annotations.NotNull;
public class ManaCost extends DoubleStat implements ItemRestriction, PlayerConsumable {
public ManaCost() {
super("MANA_COST", VersionMaterial.LAPIS_LAZULI.toMaterial(), "Mana Cost", new String[]{"Mana spent by your weapon to be used."}, new String[]{"weapon"});
super("MANA_COST", Material.LAPIS_LAZULI, "Mana Cost", new String[]{"Mana spent by your weapon to be used."}, new String[]{"weapon"});
}

View File

@ -4,7 +4,7 @@ import io.lumine.mythic.lib.UtilityMethods;
import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.api.util.AltChar;
import io.lumine.mythic.lib.api.util.EnumUtils;
import io.lumine.mythic.lib.version.VersionMaterial;
import io.lumine.mythic.lib.version.VMaterial;
import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.edition.StatEdition;
@ -29,7 +29,7 @@ import java.util.Optional;
public class MaterialStat extends ItemStat<MaterialData, MaterialData> {
public MaterialStat() {
super("MATERIAL", VersionMaterial.GRASS_BLOCK.toMaterial(), "Material", new String[] { "Your item material." }, new String[0]);
super("MATERIAL", VMaterial.GRASS_BLOCK.get(), "Material", new String[] { "Your item material." }, new String[0]);
}
@Override

View File

@ -4,22 +4,20 @@ import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.api.item.NBTItem;
import io.lumine.mythic.lib.api.item.SupportedNBTTagValues;
import io.lumine.mythic.lib.api.util.AltChar;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.MMOItems;
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.api.player.RPGPlayer;
import net.Indyuce.mmoitems.api.util.message.Message;
import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.data.StringListData;
import net.Indyuce.mmoitems.stat.data.random.RandomStatData;
import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.ItemRestriction;
import net.Indyuce.mmoitems.stat.type.StringListStat;
import org.apache.commons.lang.Validate;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.event.inventory.InventoryAction;
import org.bukkit.event.inventory.InventoryClickEvent;
@ -33,7 +31,7 @@ import java.util.Optional;
public class Permission extends StringListStat implements ItemRestriction {
public Permission() {
super("PERMISSION", VersionMaterial.OAK_SIGN.toMaterial(), "Permission",
super("PERMISSION", Material.OAK_SIGN, "Permission",
new String[] { "The permission needed to use this item." }, new String[] { "!block", "all" });
}

View File

@ -7,7 +7,6 @@ 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.version.VersionMaterial;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.edition.StatEdition;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
@ -19,6 +18,7 @@ import net.Indyuce.mmoitems.stat.type.ItemStat;
import net.Indyuce.mmoitems.util.MMOUtils;
import org.apache.commons.lang.Validate;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.Particle;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.event.inventory.InventoryAction;
@ -37,7 +37,7 @@ import java.util.Optional;
public class ProjectileParticles extends ItemStat<ProjectileParticlesData, ProjectileParticlesData> {
public ProjectileParticles() {
super("PROJECTILE_PARTICLES", VersionMaterial.LIME_STAINED_GLASS.toMaterial(), "Projectile Particles",
super("PROJECTILE_PARTICLES", Material.LIME_STAINED_GLASS, "Projectile Particles",
new String[]{"The projectile particle that your weapon shoots"}, new String[]{"lute"});
}
@ -49,7 +49,7 @@ public class ProjectileParticles extends ItemStat<ProjectileParticlesData, Proje
Validate.isTrue(config.contains("particle"), "Could not find projectile particle");
Particle particle = Particle.valueOf(config.getString("particle").toUpperCase().replace("-", "_").replace(" ", ""));
return ProjectileParticlesData.isColorable(particle)
return MMOUtils.isColorable(particle)
? new ProjectileParticlesData(particle, config.getInt("color.red"), config.getInt("color.green"), config.getInt("color.blue"))
: new ProjectileParticlesData(particle);
}
@ -81,7 +81,7 @@ public class ProjectileParticles extends ItemStat<ProjectileParticlesData, Proje
lore.add(ChatColor.GRAY + "Current Value: " + ChatColor.GREEN + particle);
if (ProjectileParticlesData.isColorable(particle)) {
if (MMOUtils.isColorable(particle)) {
String colorStr = particle == Particle.NOTE ? String.valueOf(data.getRed()) : data.getRed() + " " + data.getGreen() + " " + data.getBlue();
lore.add(ChatColor.GRAY + "Color: " + ChatColor.GREEN + colorStr);
}
@ -97,7 +97,7 @@ public class ProjectileParticles extends ItemStat<ProjectileParticlesData, Proje
public void whenInput(@NotNull EditionInventory inv, @NotNull String message, Object... info) {
String[] msg = message.replace(", ", " ").replace(",", " ").split(" ");
Particle particle = Particle.valueOf(msg[0].toUpperCase().replace("-", "_").replace(" ", "_"));
if (ProjectileParticlesData.isColorable(particle)) {
if (MMOUtils.isColorable(particle)) {
Validate.isTrue(msg.length <= 4, "Too many arguments provided.");
if (particle.equals(Particle.NOTE)) {
Validate.isTrue(msg.length == 2, "You must provide a color for this particle.\n"
@ -172,7 +172,7 @@ public class ProjectileParticles extends ItemStat<ProjectileParticlesData, Proje
JsonObject json = new JsonParser().parse((String) tags.getValue()).getAsJsonObject();
Particle particle = Particle.valueOf(json.get("Particle").getAsString());
if (ProjectileParticlesData.isColorable(particle)) {
if (MMOUtils.isColorable(particle)) {
return new ProjectileParticlesData(particle, json.get("Red").getAsInt(), json.get("Green").getAsInt(), json.get("Blue").getAsInt());
} else {
return new ProjectileParticlesData(particle);

View File

@ -1,43 +1,38 @@
package net.Indyuce.mmoitems.stat;
import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.api.item.NBTItem;
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.api.edition.StatEdition;
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.data.StringListData;
import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.GemStoneStat;
import net.Indyuce.mmoitems.stat.type.ItemRestriction;
import net.Indyuce.mmoitems.stat.type.StringListStat;
import org.apache.commons.lang.Validate;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.event.inventory.InventoryAction;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.regex.Pattern;
import com.google.gson.JsonArray;
import com.google.gson.JsonParser;
import io.lumine.mythic.lib.api.item.SupportedNBTTagValues;
import net.Indyuce.mmoitems.ItemStats;
import org.apache.commons.lang.Validate;
import org.bukkit.ChatColor;
import org.bukkit.Sound;
import org.bukkit.event.inventory.InventoryAction;
import org.bukkit.event.inventory.InventoryClickEvent;
import net.Indyuce.mmoitems.MMOItems;
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.api.player.RPGPlayer;
import net.Indyuce.mmoitems.api.util.message.Message;
import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.data.StringListData;
import net.Indyuce.mmoitems.stat.data.random.RandomStatData;
import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.GemStoneStat;
import net.Indyuce.mmoitems.stat.type.ItemRestriction;
import net.Indyuce.mmoitems.stat.type.StringListStat;
import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.api.item.NBTItem;
import io.lumine.mythic.lib.api.util.AltChar;
import io.lumine.mythic.lib.version.VersionMaterial;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class RequiredClass extends StringListStat implements ItemRestriction, GemStoneStat {
public RequiredClass() {
super("REQUIRED_CLASS", VersionMaterial.WRITABLE_BOOK.toMaterial(), "Required Class",
super("REQUIRED_CLASS", Material.WRITABLE_BOOK, "Required Class",
new String[] { "The class you need to", "profess to use your item." }, new String[] { "!block", "all" });
}

View File

@ -3,7 +3,6 @@ package net.Indyuce.mmoitems.stat;
import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.api.item.NBTItem;
import io.lumine.mythic.lib.api.item.SupportedNBTTagValues;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
@ -17,6 +16,7 @@ import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.DoubleStat;
import net.Indyuce.mmoitems.stat.type.ItemRestriction;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@ -31,7 +31,7 @@ public class RequiredLevel extends DoubleStat implements ItemRestriction {
* only keep the highest levels of the two and not sum the two values
*/
public RequiredLevel() {
super("REQUIRED_LEVEL", VersionMaterial.EXPERIENCE_BOTTLE.toMaterial(), "Required Level",
super("REQUIRED_LEVEL", Material.EXPERIENCE_BOTTLE, "Required Level",
new String[]{"The level your item needs", "in order to be used."}, new String[]{"!block", "all"});
}

View File

@ -2,13 +2,13 @@ package net.Indyuce.mmoitems.stat;
import io.lumine.mythic.lib.MythicLib;
import io.lumine.mythic.lib.api.util.ui.SilentNumbers;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.util.MMOUtils;
import net.Indyuce.mmoitems.api.item.mmoitem.VolatileMMOItem;
import net.Indyuce.mmoitems.stat.data.DoubleData;
import net.Indyuce.mmoitems.stat.type.DoubleStat;
import net.Indyuce.mmoitems.stat.type.PlayerConsumable;
import net.Indyuce.mmoitems.util.MMOUtils;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
@ -20,7 +20,7 @@ import org.jetbrains.annotations.NotNull;
*/
public class RestoreFood extends DoubleStat implements PlayerConsumable {
public RestoreFood() {
super("RESTORE_FOOD", VersionMaterial.PORKCHOP.toMaterial(), "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

@ -1,12 +1,12 @@
package net.Indyuce.mmoitems.stat;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.util.MMOUtils;
import net.Indyuce.mmoitems.api.item.mmoitem.VolatileMMOItem;
import net.Indyuce.mmoitems.stat.data.DoubleData;
import net.Indyuce.mmoitems.stat.type.DoubleStat;
import net.Indyuce.mmoitems.stat.type.PlayerConsumable;
import net.Indyuce.mmoitems.util.MMOUtils;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
@ -17,7 +17,7 @@ import org.jetbrains.annotations.NotNull;
*/
public class RestoreHealth extends DoubleStat implements PlayerConsumable {
public RestoreHealth() {
super("RESTORE_HEALTH", VersionMaterial.RED_DYE.toMaterial(), "Health Restoration", new String[]{"Health given when consumed."}, new String[]{"consumable"});
super("RESTORE_HEALTH", Material.RED_DYE, "Health Restoration", new String[]{"Health given when consumed."}, new String[]{"consumable"});
}

View File

@ -1,12 +1,12 @@
package net.Indyuce.mmoitems.stat;
import io.lumine.mythic.lib.version.VersionMaterial;
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.data.DoubleData;
import net.Indyuce.mmoitems.stat.type.DoubleStat;
import net.Indyuce.mmoitems.stat.type.PlayerConsumable;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
@ -17,7 +17,7 @@ import org.jetbrains.annotations.NotNull;
*/
public class RestoreMana extends DoubleStat implements PlayerConsumable {
public RestoreMana() {
super("RESTORE_MANA", VersionMaterial.LAPIS_LAZULI.toMaterial(), "Restore Mana", new String[]{"The amount of mana", "your consumable restores."}, new String[]{"consumable"});
super("RESTORE_MANA", Material.LAPIS_LAZULI, "Restore Mana", new String[]{"The amount of mana", "your consumable restores."}, new String[]{"consumable"});
}
@Override

View File

@ -1,12 +1,12 @@
package net.Indyuce.mmoitems.stat;
import io.lumine.mythic.lib.version.VersionMaterial;
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.data.DoubleData;
import net.Indyuce.mmoitems.stat.type.DoubleStat;
import net.Indyuce.mmoitems.stat.type.PlayerConsumable;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
@ -17,7 +17,7 @@ import org.jetbrains.annotations.NotNull;
*/
public class RestoreStamina extends DoubleStat implements PlayerConsumable {
public RestoreStamina() {
super("RESTORE_STAMINA", VersionMaterial.LIGHT_GRAY_DYE.toMaterial(), "Restore Stamina", new String[]{"The amount of stamina/power", "your consumable restores."}, new String[]{"consumable"});
super("RESTORE_STAMINA", Material.LIGHT_GRAY_DYE, "Restore Stamina", new String[]{"The amount of stamina/power", "your consumable restores."}, new String[]{"consumable"});
}
@Override

View File

@ -1,33 +1,27 @@
package net.Indyuce.mmoitems.stat;
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 net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.item.mmoitem.ReadMMOItem;
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.data.DoubleData;
import net.Indyuce.mmoitems.stat.type.GemStoneStat;
import net.Indyuce.mmoitems.stat.type.ItemStat;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import io.lumine.mythic.lib.api.item.SupportedNBTTagValues;
import net.Indyuce.mmoitems.api.util.MMOItemReforger;
import net.Indyuce.mmoitems.gui.edition.AbilityListEdition;
import net.Indyuce.mmoitems.gui.edition.RevisionInventory;
import net.Indyuce.mmoitems.stat.type.GemStoneStat;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.event.inventory.InventoryAction;
import org.bukkit.event.inventory.InventoryClickEvent;
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.data.DoubleData;
import net.Indyuce.mmoitems.stat.data.random.RandomStatData;
import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.ItemStat;
import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.api.util.AltChar;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import scala.math.Numeric;
/**
* Regarding the auto updating of items
* @see RevisionInventory

View File

@ -67,7 +67,7 @@ public class ShieldPatternStat extends ItemStat<ShieldPatternData, ShieldPattern
banner.setBaseColor(data.getBaseColor());
banner.setPatterns(data.getPatterns());
((BlockStateMeta) item.getMeta()).setBlockState(banner);
item.getMeta().addItemFlags(ItemFlag.HIDE_POTION_EFFECTS);
item.getMeta().addItemFlags(HidePotionEffects.ITEM_FLAG);
}
/**

View File

@ -3,7 +3,6 @@ package net.Indyuce.mmoitems.stat;
import io.lumine.mythic.lib.MythicLib;
import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.api.util.AltChar;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.edition.StatEdition;
@ -14,6 +13,7 @@ import net.Indyuce.mmoitems.stat.data.SkullTextureData;
import net.Indyuce.mmoitems.stat.type.ItemStat;
import org.apache.commons.lang.Validate;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.event.inventory.InventoryAction;
import org.bukkit.event.inventory.InventoryClickEvent;
@ -29,11 +29,11 @@ import java.util.UUID;
public class SkullTextureStat extends ItemStat<SkullTextureData, SkullTextureData> {
public SkullTextureStat() {
super("SKULL_TEXTURE", VersionMaterial.PLAYER_HEAD.toMaterial(), "Skull Texture", new String[]{
super("SKULL_TEXTURE", Material.PLAYER_HEAD, "Skull Texture", new String[]{
"The skull texture &nvalue&7 which can be found on",
"head databases. 1.20+ users can also provide the",
"texture URL directly (starting with https://...)."
}, new String[0], VersionMaterial.PLAYER_HEAD.toMaterial());
}, new String[0], Material.PLAYER_HEAD);
}
@Override
@ -70,7 +70,7 @@ public class SkullTextureStat extends ItemStat<SkullTextureData, SkullTextureDat
@Override
public void whenApplied(@NotNull ItemStackBuilder item, @NotNull SkullTextureData data) {
if (item.getItemStack().getType() != VersionMaterial.PLAYER_HEAD.toMaterial()) return;
if (item.getItemStack().getType() != Material.PLAYER_HEAD) return;
if (data.getGameProfile() != null)
MythicLib.plugin.getVersion().getWrapper().setProfile((SkullMeta) item.getMeta(), data.getGameProfile());

View File

@ -1,9 +1,7 @@
package net.Indyuce.mmoitems.stat;
import io.lumine.mythic.lib.api.item.NBTItem;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.util.MMOUtils;
import net.Indyuce.mmoitems.api.Type;
import net.Indyuce.mmoitems.api.event.item.BreakSoulboundEvent;
import net.Indyuce.mmoitems.api.interaction.Consumable;
@ -15,8 +13,10 @@ import net.Indyuce.mmoitems.api.util.message.Message;
import net.Indyuce.mmoitems.stat.data.SoulboundData;
import net.Indyuce.mmoitems.stat.type.ConsumableItemInteraction;
import net.Indyuce.mmoitems.stat.type.DoubleStat;
import net.Indyuce.mmoitems.util.MMOUtils;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryClickEvent;
@ -28,7 +28,7 @@ public class SoulbindingBreakChance extends DoubleStat implements ConsumableItem
private static final Random random = new Random();
public SoulbindingBreakChance() {
super("SOULBOUND_BREAK_CHANCE", VersionMaterial.ENDER_EYE.toMaterial(), "Soulbound Break Chance",
super("SOULBOUND_BREAK_CHANCE", Material.ENDER_EYE, "Soulbound Break Chance",
new String[] { "The chance of breaking an item's", "soulbound when drag & drop'd on it.", "This chance is lowered depending",
"on the soulbound's level." },
new String[] { "consumable" });

View File

@ -1,9 +1,7 @@
package net.Indyuce.mmoitems.stat;
import io.lumine.mythic.lib.api.item.NBTItem;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmoitems.ItemStats;
import net.Indyuce.mmoitems.util.MMOUtils;
import net.Indyuce.mmoitems.api.Type;
import net.Indyuce.mmoitems.api.event.item.ApplySoulboundEvent;
import net.Indyuce.mmoitems.api.interaction.Consumable;
@ -15,8 +13,10 @@ import net.Indyuce.mmoitems.api.util.message.Message;
import net.Indyuce.mmoitems.stat.data.SoulboundData;
import net.Indyuce.mmoitems.stat.type.ConsumableItemInteraction;
import net.Indyuce.mmoitems.stat.type.DoubleStat;
import net.Indyuce.mmoitems.util.MMOUtils;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryClickEvent;
@ -29,7 +29,7 @@ public class SoulbindingChance extends DoubleStat implements ConsumableItemInter
private static final Random random = new Random();
public SoulbindingChance() {
super("SOULBINDING_CHANCE", VersionMaterial.ENDER_EYE.toMaterial(), "Soulbinding Chance",
super("SOULBINDING_CHANCE", Material.ENDER_EYE, "Soulbinding Chance",
new String[] { "Defines the chance your item has to", "link another item to your soul,", "preventing other players from using it." },
new String[] { "consumable" });
}

View File

@ -1,43 +1,41 @@
package net.Indyuce.mmoitems.stat;
import com.google.gson.JsonParser;
import com.google.gson.JsonSyntaxException;
import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.api.item.NBTItem;
import io.lumine.mythic.lib.api.item.SupportedNBTTagValues;
import net.Indyuce.mmoitems.ItemStats;
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.api.player.RPGPlayer;
import net.Indyuce.mmoitems.api.util.message.Message;
import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.data.SoulboundData;
import net.Indyuce.mmoitems.stat.data.random.RandomStatData;
import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.InternalStat;
import net.Indyuce.mmoitems.stat.type.ItemRestriction;
import net.Indyuce.mmoitems.stat.type.ItemStat;
import net.Indyuce.mmoitems.util.MMOUtils;
import org.apache.commons.lang.NotImplementedException;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.UUID;
import java.util.regex.Pattern;
import io.lumine.mythic.lib.api.item.SupportedNBTTagValues;
import net.Indyuce.mmoitems.gui.edition.EditionInventory;
import net.Indyuce.mmoitems.stat.data.random.RandomStatData;
import net.Indyuce.mmoitems.stat.type.ItemStat;
import org.apache.commons.lang.NotImplementedException;
import org.bukkit.ChatColor;
import org.bukkit.Sound;
import com.google.gson.JsonParser;
import com.google.gson.JsonSyntaxException;
import net.Indyuce.mmoitems.ItemStats;
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.player.RPGPlayer;
import net.Indyuce.mmoitems.api.util.message.Message;
import net.Indyuce.mmoitems.stat.data.SoulboundData;
import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.InternalStat;
import net.Indyuce.mmoitems.stat.type.ItemRestriction;
import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.api.item.NBTItem;
import io.lumine.mythic.lib.version.VersionMaterial;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class Soulbound extends ItemStat<RandomStatData<SoulboundData>, SoulboundData> implements InternalStat, ItemRestriction {
public Soulbound() {
super("SOULBOUND", VersionMaterial.ENDER_EYE.toMaterial(), "Soulbound", new String[0], new String[0]);
super("SOULBOUND", Material.ENDER_EYE, "Soulbound", new String[0], new String[0]);
}
@Nullable

View File

@ -1,12 +1,12 @@
package net.Indyuce.mmoitems.stat;
import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmoitems.util.MMOUtils;
import net.Indyuce.mmoitems.api.item.build.ItemStackBuilder;
import net.Indyuce.mmoitems.api.util.NumericStatFormula;
import net.Indyuce.mmoitems.stat.data.DoubleData;
import net.Indyuce.mmoitems.stat.type.DoubleStat;
import net.Indyuce.mmoitems.util.MMOUtils;
import org.bukkit.Material;
import org.jetbrains.annotations.NotNull;
/**
@ -14,7 +14,7 @@ import org.jetbrains.annotations.NotNull;
*/
public class SoulboundLevel extends DoubleStat {
public SoulboundLevel() {
super("SOULBOUND_LEVEL", VersionMaterial.ENDER_EYE.toMaterial(), "Soulbinding Level", new String[]{"The soulbound level defines how much", "damage players will take when trying", "to use a soulbound item. It also determines", "how hard it is to break the binding."}, new String[]{"consumable"});
super("SOULBOUND_LEVEL", Material.ENDER_EYE, "Soulbinding Level", new String[]{"The soulbound level defines how much", "damage players will take when trying", "to use a soulbound item. It also determines", "how hard it is to break the binding."}, new String[]{"consumable"});
}
// Writes soulbound level with roman writing in lore

View File

@ -1,5 +1,6 @@
package net.Indyuce.mmoitems.stat;
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;
@ -8,10 +9,9 @@ import net.Indyuce.mmoitems.stat.data.StoredTagsData;
import net.Indyuce.mmoitems.stat.data.random.RandomStatData;
import net.Indyuce.mmoitems.stat.type.GemStoneStat;
import net.Indyuce.mmoitems.stat.type.InternalStat;
import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.version.VersionMaterial;
import net.Indyuce.mmoitems.stat.type.ItemStat;
import org.apache.commons.lang.NotImplementedException;
import org.bukkit.Material;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@ -27,7 +27,7 @@ import java.util.Optional;
*/
public class StoredTags extends ItemStat<RandomStatData<StoredTagsData>, StoredTagsData> implements InternalStat, GemStoneStat {
public StoredTags() {
super("STORED_TAGS", VersionMaterial.OAK_SIGN.toMaterial(), "Stored Tags",
super("STORED_TAGS", Material.OAK_SIGN, "Stored Tags",
new String[] { "You found a secret dev easter egg", "introduced during the 2020 epidemic!" }, new String[0]);
}

View File

@ -4,6 +4,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import io.lumine.mythic.lib.version.VParticle;
import net.Indyuce.mmoitems.util.MMOUtils;
import org.apache.commons.lang.Validate;
import org.bukkit.Color;
@ -93,10 +94,10 @@ public class ParticleData implements StatData, RandomStatData<ParticleData> {
}
public void display(Location location, int amount, float offsetX, float offsetY, float offsetZ, float speed) {
if (particle == Particle.REDSTONE) {
if (particle == VParticle.REDSTONE.get()) {
location.getWorld().spawnParticle(particle, location, amount, offsetX, offsetY, offsetZ, new Particle.DustOptions(color, 1));
}
else if (particle == Particle.SPELL_MOB || particle == Particle.SPELL_MOB_AMBIENT) {
else if (particle == VParticle.ENTITY_EFFECT.get() || particle == VParticle.ENTITY_EFFECT_AMBIENT.get()) {
// 0 for amount to allow colors (Thats why there is a for loop). Then the offsets are RGB values from 0.0 - 1.0, last 1 is the brightness.
for (int i = 0; i < amount; i++) {
location.getWorld().spawnParticle(particle, location, 0, (float) color.getRed() / 255, (float) color.getGreen() / 255, (float) color.getBlue() / 255, 1);
@ -143,4 +144,8 @@ public class ParticleData implements StatData, RandomStatData<ParticleData> {
public ParticleData randomize(MMOItemBuilder builder) {
return this;
}
public void spawn(Location location, Particle particle, int amount, double speed, double offsetX, double offsetY, double offsetZ) {
}
}

View File

@ -2,9 +2,11 @@ package net.Indyuce.mmoitems.stat.data;
import io.lumine.mythic.lib.MythicLib;
import io.lumine.mythic.lib.gson.JsonObject;
import io.lumine.mythic.lib.version.VParticle;
import net.Indyuce.mmoitems.api.item.build.MMOItemBuilder;
import net.Indyuce.mmoitems.stat.data.random.RandomStatData;
import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.util.MMOUtils;
import org.bukkit.Color;
import org.bukkit.Location;
import org.bukkit.Material;
@ -48,7 +50,7 @@ public class ProjectileParticlesData implements StatData, RandomStatData<Project
final JsonObject obj = MythicLib.plugin.getGson().fromJson(jsonObject, JsonObject.class);
particle = Particle.valueOf(obj.get("Particle").getAsString());
if (isColorable(particle)) {
if (MMOUtils.isColorable(particle)) {
colored = true;
red = obj.get("Red").getAsInt();
green = obj.get("Green").getAsInt();
@ -82,8 +84,9 @@ public class ProjectileParticlesData implements StatData, RandomStatData<Project
return false;
}
@Deprecated
public static boolean isColorable(Particle particle) {
return particle == Particle.REDSTONE || particle == Particle.SPELL_MOB || particle == Particle.SPELL_MOB_AMBIENT || particle == Particle.NOTE;
return MMOUtils.isColorable(particle);
}
@Override
@ -104,32 +107,29 @@ public class ProjectileParticlesData implements StatData, RandomStatData<Project
}
public void shootParticle(Location loc, int amount, double offset) {
if (isColorable(particle)) {
switch (particle) {
case REDSTONE:
// REDSTONE particles take dustOptions with RGB values. Normal REDSTONE particles are size 1 but can realistically be anything.
Particle.DustOptions dustOptions = new Particle.DustOptions(Color.fromRGB(red, green, blue), 1);
loc.getWorld().spawnParticle(Particle.REDSTONE, loc, amount, offset, offset, offset, 0, dustOptions);
break;
case NOTE:
// NOTE particles only have 24 colors. offsetX must be a number between 0 and 1 in intervals of 1/24. offsetY and offsetZ must be 0. Count should be 0 and "extra" should be 1.
double note = red / 24D;
loc.getWorld().spawnParticle(Particle.NOTE, loc, 0, note, 0, 0, 1);
break;
default:
// SPELL_MOB and SPELL_MOB_AMBIENT must be a value between 0 and 1 in intervals in 1/255. "Extra" must be 1 or the color will not be correct. 0 will be black and anything else will be random.
double red = this.red / 255D;
double green = this.green / 255D;
double blue = this.blue / 255D;
loc.getWorld().spawnParticle(particle, loc, 0, red, green, blue, 1);
if (MMOUtils.isColorable(particle)) {
if (particle == VParticle.REDSTONE.get()) {
// REDSTONE particles take dustOptions with RGB values. Normal REDSTONE particles are size 1 but can realistically be anything.
Particle.DustOptions dustOptions = new Particle.DustOptions(Color.fromRGB(red, green, blue), 1);
loc.getWorld().spawnParticle(particle, loc, amount, offset, offset, offset, 0, dustOptions);
} else if (particle == Particle.NOTE) {
// NOTE particles only have 24 colors. offsetX must be a number between 0 and 1 in intervals of 1/24. offsetY and offsetZ must be 0. Count should be 0 and "extra" should be 1.
double note = red / 24D;
loc.getWorld().spawnParticle(Particle.NOTE, loc, 0, note, 0, 0, 1);
} else {
// SPELL_MOB and SPELL_MOB_AMBIENT must be a value between 0 and 1 in intervals in 1/255. "Extra" must be 1 or the color will not be correct. 0 will be black and anything else will be random.
double red = this.red / 255D;
double green = this.green / 255D;
double blue = this.blue / 255D;
loc.getWorld().spawnParticle(particle, loc, 0, red, green, blue, 1);
}
} else if (particle == Particle.ITEM_CRACK) {
} else if (particle == VParticle.ITEM.get()) {
// Some particles require a material. I don't really want to handle this right now so just make it stone.
ItemStack materialData = new ItemStack(Material.STONE);
loc.getWorld().spawnParticle(particle, loc, amount, offset, offset, offset, 0, materialData);
} else if (particle == Particle.ITEM_CRACK || particle == Particle.BLOCK_CRACK || particle == Particle.BLOCK_DUST || particle == Particle.FALLING_DUST) {
} else if (particle == VParticle.BLOCK.get() || particle == VParticle.BLOCK_DUST.get() || particle == Particle.FALLING_DUST) {
BlockData fallingDustData = Material.STONE.createBlockData();
loc.getWorld().spawnParticle(particle, loc, amount, offset, offset, offset, 0, fallingDustData);

View File

@ -7,10 +7,12 @@ import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.api.item.NBTItem;
import io.lumine.mythic.lib.api.item.SupportedNBTTagValues;
import io.lumine.mythic.lib.skill.trigger.TriggerType;
import io.lumine.mythic.lib.version.VPotionEffectType;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.Type;
import org.bukkit.*;
import org.bukkit.attribute.Attribute;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
@ -254,6 +256,10 @@ public class MMOUtils {
return null;
}
public static int getLevel(@NotNull ItemStack item, @NotNull Enchantment enchant) {
return item.hasItemMeta() ? item.getItemMeta().getEnchantLevel(enchant) : 0;
}
/**
* The last 5 seconds of nausea are useless, night vision flashes in the
* last 10 seconds, blindness takes a few seconds to decay as well, and
@ -265,7 +271,7 @@ public class MMOUtils {
* "permanent" potion effects, depending on the potion effect type
*/
public static int getEffectDuration(PotionEffectType type) {
return type.equals(PotionEffectType.NIGHT_VISION) || type.equals(PotionEffectType.CONFUSION) ? 260 : type.equals(PotionEffectType.BLINDNESS) ? 140 : 100;
return type.equals(PotionEffectType.NIGHT_VISION) || type.equals(VPotionEffectType.NAUSEA.get()) ? 260 : type.equals(PotionEffectType.BLINDNESS) ? 140 : 100;
}
@NotNull

View File

@ -17,11 +17,18 @@
<!-- Spigot API -->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.18-R0.1-SNAPSHOT</version>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.20.6-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<optional>true</optional>
<exclusions>
<exclusion>
<groupId>com.mojang</groupId>
<artifactId>brigadier</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- MMOItems API -->

View File

@ -1,12 +1,12 @@
speed: Speed
slow: Slow
fast-digging: Fast Digging
slow-digging: Slow Digging
increase-damage: Increase Damage
fast-digging: Haste
slow-digging: Mining Fatigue
increase-damage: Strength
heal: Heal
harm: Harm
jump: Jump
confusion: Confusion
jump: Jump Boost
confusion: Nausea
regeneration: Regeneration
damage-resistance: Damage Resistance
fire-resistance: Fire Resistance
@ -24,10 +24,11 @@ saturation: Saturation
glowing: Glowing
levitation: Levitation
luck: Luck
unluck: Unluck
unluck: Bad Luck
slow-falling: Slow Falling
conduit-power: Conduit Power
dolphins-grace: Dolphins Grace
bad-omen: Bad Omen
hero-of-the-village: Hero Of The Village
darkness: Darkness
wind-charged:

View File

@ -5,7 +5,8 @@ author: Indyuce
description: ${project.description}
depend: [MythicLib]
softdepend: [WorldGuard,Residence,BossShopPro,SkillAPI,SkillsPro,MMOCore,MMOProfiles,MythicMobs,MMOInventory,PlaceholderAPI,Vault,Denizen,AureliumSkills,AuraSkills]
api-version: 1.13
api-version: 1.14
website: www.phoenixdevt.fr
commands:
mmoitems:
description: MMOItems main command.