From 1087e345a0fd896f1f470b123b65771612c78f77 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Thu, 28 Sep 2023 18:45:22 +0500 Subject: [PATCH] v3.5.8 --- .gitignore | 8 +- Core/pom.xml | 29 ++--- .../excellentenchants/ExcellentEnchants.java | 2 + .../api/enchantment/meta/Arrowed.java | 4 +- .../excellentenchants/config/Lang.java | 2 + .../impl/armor/DarknessCloakEnchant.java | 4 +- .../impl/armor/EnchantFlameWalker.java | 8 +- .../impl/armor/EnchantIceShield.java | 6 +- .../impl/armor/EnchantRegrowth.java | 4 +- .../impl/bow/DarknessArrowsEnchant.java | 4 +- .../impl/bow/EnchantConfusingArrows.java | 8 +- .../impl/bow/EnchantDragonfireArrows.java | 4 +- .../impl/bow/EnchantElectrifiedArrows.java | 8 +- .../impl/bow/EnchantExplosiveArrows.java | 4 +- .../enchantment/impl/bow/EnchantHover.java | 8 +- .../impl/bow/EnchantPoisonedArrows.java | 8 +- .../impl/bow/EnchantWitheredArrows.java | 8 +- .../enchantment/impl/bow/FlareEnchant.java | 4 +- .../impl/fishing/CurseOfDrownedEnchant.java | 8 +- .../impl/meta/ArrowImplementation.java | 18 +-- .../impl/tool/EnchantDivineTouch.java | 4 +- .../impl/tool/EnchantReplanter.java | 4 +- .../enchantment/impl/tool/EnchantSmelter.java | 11 +- .../impl/tool/EnchantTreasures.java | 7 +- .../impl/weapon/EnchantBaneOfNetherspawn.java | 4 +- .../impl/weapon/EnchantBlindness.java | 4 +- .../impl/weapon/EnchantConfusion.java | 6 +- .../enchantment/impl/weapon/EnchantCure.java | 4 +- .../impl/weapon/EnchantCutter.java | 9 +- .../impl/weapon/EnchantDecapitator.java | 5 +- .../impl/weapon/EnchantDoubleStrike.java | 8 +- .../impl/weapon/EnchantExhaust.java | 5 +- .../impl/weapon/EnchantIceAspect.java | 5 +- .../impl/weapon/EnchantParalyze.java | 4 +- .../enchantment/impl/weapon/EnchantRage.java | 4 +- .../impl/weapon/EnchantRocket.java | 4 +- .../impl/weapon/EnchantSurprise.java | 8 +- .../impl/weapon/EnchantVampire.java | 4 +- .../enchantment/impl/weapon/EnchantVenom.java | 4 +- .../impl/weapon/EnchantVillageDefender.java | 4 +- .../impl/weapon/EnchantWither.java | 4 +- .../listener/EnchantAnvilListener.java | 4 +- .../enchantment/task/ArrowTrailsTask.java | 6 +- .../util/EnchantDropContainer.java | 30 ----- NMS/pom.xml | 2 +- V1_17_R1/pom.xml | 4 +- V1_18_R2/pom.xml | 4 +- V1_19_R3/pom.xml | 4 +- V1_20_R1/pom.xml | 8 +- V1_20_R2/pom.xml | 71 +++++++++++ .../excellentenchants/nms/V1_20_R2.java | 116 ++++++++++++++++++ pom.xml | 5 +- 52 files changed, 328 insertions(+), 187 deletions(-) delete mode 100644 Core/src/main/java/su/nightexpress/excellentenchants/enchantment/util/EnchantDropContainer.java create mode 100644 V1_20_R2/pom.xml create mode 100644 V1_20_R2/src/main/java/su/nightexpress/excellentenchants/nms/V1_20_R2.java diff --git a/.gitignore b/.gitignore index b413499..94be98e 100644 --- a/.gitignore +++ b/.gitignore @@ -9,11 +9,9 @@ /V1_17_R1/pom.xml.versionsBackup /V1_18_R2/target/ /V1_18_R2/pom.xml.versionsBackup -/V1_19_R1/target/ -/V1_19_R1/pom.xml.versionsBackup -/V1_19_R2/target/ -/V1_19_R2/pom.xml.versionsBackup /V1_19_R3/target/ /V1_19_R3/pom.xml.versionsBackup /V1_20_R1/target/ -/V1_20_R1/pom.xml.versionsBackup \ No newline at end of file +/V1_20_R1/pom.xml.versionsBackup +/V1_20_R2/target/ +/V1_20_R2/pom.xml.versionsBackup \ No newline at end of file diff --git a/Core/pom.xml b/Core/pom.xml index 2d2e185..ec12f26 100644 --- a/Core/pom.xml +++ b/Core/pom.xml @@ -5,7 +5,7 @@ ExcellentEnchants su.nightexpress.excellentenchants - 3.5.7 + 3.5.8 4.0.0 @@ -73,35 +73,35 @@ 2.11.2 provided - - su.nexmedia.playerblocktracker - PlayerBlockTracker - 1.0.1 - su.nightexpress.excellentenchants NMS - 3.5.7 + 3.5.8 su.nightexpress.excellentenchants V1_17_R1 - 3.5.7 + 3.5.8 su.nightexpress.excellentenchants V1_18_R2 - 3.5.7 + 3.5.8 su.nightexpress.excellentenchants V1_19_R3 - 3.5.7 + 3.5.8 su.nightexpress.excellentenchants V1_20_R1 - 3.5.7 + 3.5.8 + + + su.nightexpress.excellentenchants + V1_20_R2 + 3.5.8 @@ -141,15 +141,8 @@ su.nightexpress.excellentenchants* - su.nexmedia.playerblocktracker:* - - - su.nexmedia.playerblocktracker. - su.nightexpress.excellentenchants.playerblocktracker. - - diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/ExcellentEnchants.java b/Core/src/main/java/su/nightexpress/excellentenchants/ExcellentEnchants.java index 9e7b424..34c0b84 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/ExcellentEnchants.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/ExcellentEnchants.java @@ -19,6 +19,7 @@ import su.nightexpress.excellentenchants.hook.HookId; import su.nightexpress.excellentenchants.hook.impl.PlaceholderHook; import su.nightexpress.excellentenchants.hook.impl.ProtocolHook; import su.nightexpress.excellentenchants.nms.EnchantNMS; +import su.nightexpress.excellentenchants.nms.V1_20_R2; import su.nightexpress.excellentenchants.nms.v1_17_R1.V1_17_R1; import su.nightexpress.excellentenchants.nms.v1_18_R2.V1_18_R2; import su.nightexpress.excellentenchants.nms.v1_19_R3.V1_19_R3; @@ -87,6 +88,7 @@ public class ExcellentEnchants extends NexPlugin { case V1_18_R2 -> new V1_18_R2(); case V1_19_R3 -> new V1_19_R3(); case V1_20_R1 -> new V1_20_R1(); + case V1_20_R2 -> new V1_20_R2(); default -> null; }; } diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/api/enchantment/meta/Arrowed.java b/Core/src/main/java/su/nightexpress/excellentenchants/api/enchantment/meta/Arrowed.java index 155e66b..d9ff04b 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/api/enchantment/meta/Arrowed.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/api/enchantment/meta/Arrowed.java @@ -2,7 +2,7 @@ package su.nightexpress.excellentenchants.api.enchantment.meta; import org.bukkit.entity.Projectile; import org.jetbrains.annotations.NotNull; -import su.nexmedia.engine.api.particle.SimpleParticle; +import su.nexmedia.engine.utils.values.UniParticle; import java.util.Optional; @@ -11,7 +11,7 @@ public interface Arrowed { @NotNull Arrowed getArrowImplementation(); @NotNull - default Optional getTrailParticle() { + default Optional getTrailParticle() { return this.getArrowImplementation().getTrailParticle(); } diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/config/Lang.java b/Core/src/main/java/su/nightexpress/excellentenchants/config/Lang.java index 54fd362..301e437 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/config/Lang.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/config/Lang.java @@ -4,6 +4,8 @@ import su.nexmedia.engine.api.lang.LangKey; import su.nexmedia.engine.lang.EngineLang; import su.nightexpress.excellentenchants.Placeholders; +import static su.nexmedia.engine.utils.Colors.*; + public class Lang extends EngineLang { public static final LangKey COMMAND_LIST_DESC = LangKey.of("Command.List.Desc", "List of all custom enchantments."); diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/armor/DarknessCloakEnchant.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/armor/DarknessCloakEnchant.java index c2600bf..c879bad 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/armor/DarknessCloakEnchant.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/armor/DarknessCloakEnchant.java @@ -7,7 +7,7 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; -import su.nexmedia.engine.api.particle.SimpleParticle; +import su.nexmedia.engine.utils.values.UniParticle; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.Placeholders; import su.nightexpress.excellentenchants.api.enchantment.meta.Chanced; @@ -73,7 +73,7 @@ public class DarknessCloakEnchant extends ExcellentEnchant implements Chanced, P if (!this.addEffect(damager, level)) return false; if (this.hasVisualEffects()) { - SimpleParticle.of(Particle.ASH).play(damager.getEyeLocation(), 0.75, 0.1, 30); + UniParticle.of(Particle.ASH).play(damager.getEyeLocation(), 0.75, 0.1, 30); } return true; diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/armor/EnchantFlameWalker.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/armor/EnchantFlameWalker.java index 95ccb28..2012b33 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/armor/EnchantFlameWalker.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/armor/EnchantFlameWalker.java @@ -2,7 +2,6 @@ package su.nightexpress.excellentenchants.enchantment.impl.armor; import org.bukkit.Location; import org.bukkit.Material; -import org.bukkit.Particle; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import org.bukkit.enchantments.Enchantment; @@ -20,10 +19,10 @@ import org.bukkit.inventory.EntityEquipment; import org.bukkit.inventory.ItemStack; import org.jetbrains.annotations.NotNull; import su.nexmedia.engine.Version; -import su.nexmedia.engine.api.particle.SimpleParticle; import su.nexmedia.engine.api.server.AbstractTask; import su.nexmedia.engine.utils.Pair; import su.nexmedia.engine.utils.random.Rnd; +import su.nexmedia.engine.utils.values.UniParticle; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.api.enchantment.Cleanable; import su.nightexpress.excellentenchants.enchantment.config.EnchantScaler; @@ -188,10 +187,7 @@ public class EnchantFlameWalker extends ExcellentEnchant implements Cleanable { } block.setType(Material.LAVA); - - SimpleParticle.of(Particle.BLOCK_CRACK, Material.MAGMA_BLOCK.createBlockData()) - .play(block.getLocation(), 0.5, 0.7, 0.5, 0.03, 30); - + UniParticle.blockCrack(Material.MAGMA_BLOCK).play(block.getLocation(), 0.5, 0.7, 0.5, 0.03, 30); return true; } else if (Version.isAtLeast(Version.V1_19_R3)) { diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/armor/EnchantIceShield.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/armor/EnchantIceShield.java index 5735c4b..ec4bca6 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/armor/EnchantIceShield.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/armor/EnchantIceShield.java @@ -1,14 +1,13 @@ package su.nightexpress.excellentenchants.enchantment.impl.armor; import org.bukkit.Material; -import org.bukkit.Particle; import org.bukkit.enchantments.EnchantmentTarget; import org.bukkit.entity.LivingEntity; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; -import su.nexmedia.engine.api.particle.SimpleParticle; +import su.nexmedia.engine.utils.values.UniParticle; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.Placeholders; import su.nightexpress.excellentenchants.api.enchantment.meta.Chanced; @@ -74,8 +73,7 @@ public class EnchantIceShield extends ExcellentEnchant implements Chanced, Potio damager.setFreezeTicks(damager.getMaxFreezeTicks()); if (this.hasVisualEffects()) { - SimpleParticle.of(Particle.BLOCK_CRACK, Material.ICE.createBlockData()) - .play(damager.getEyeLocation(), 0.25, 0.1, 20); + UniParticle.blockCrack(Material.ICE).play(damager.getEyeLocation(), 0.25, 0.1, 20); } return true; } diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/armor/EnchantRegrowth.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/armor/EnchantRegrowth.java index dcc3332..c0c17e2 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/armor/EnchantRegrowth.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/armor/EnchantRegrowth.java @@ -7,9 +7,9 @@ import org.bukkit.entity.LivingEntity; import org.bukkit.inventory.ItemStack; import org.jetbrains.annotations.NotNull; import su.nexmedia.engine.api.config.JOption; -import su.nexmedia.engine.api.particle.SimpleParticle; import su.nexmedia.engine.utils.EntityUtil; import su.nexmedia.engine.utils.NumberUtil; +import su.nexmedia.engine.utils.values.UniParticle; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.Placeholders; import su.nightexpress.excellentenchants.api.enchantment.Cleanable; @@ -123,7 +123,7 @@ public class EnchantRegrowth extends ExcellentEnchant implements Chanced, Passiv entity.setHealth(amount); if (this.hasVisualEffects()) { - SimpleParticle.of(Particle.HEART).play(entity.getEyeLocation(), 0.25, 0.1, 5); + UniParticle.of(Particle.HEART).play(entity.getEyeLocation(), 0.25, 0.1, 5); } return true; } diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/DarknessArrowsEnchant.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/DarknessArrowsEnchant.java index 9570c2f..9910666 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/DarknessArrowsEnchant.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/DarknessArrowsEnchant.java @@ -12,7 +12,7 @@ import org.bukkit.event.entity.ProjectileHitEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; -import su.nexmedia.engine.api.particle.SimpleParticle; +import su.nexmedia.engine.utils.values.UniParticle; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.Placeholders; import su.nightexpress.excellentenchants.api.enchantment.meta.Arrowed; @@ -44,7 +44,7 @@ public class DarknessArrowsEnchant extends ExcellentEnchant implements Chanced, @Override public void loadSettings() { super.loadSettings(); - this.arrowImplementation = ArrowImplementation.create(this, SimpleParticle.of(Particle.ASH)); + this.arrowImplementation = ArrowImplementation.create(this, UniParticle.of(Particle.ASH)); this.chanceImplementation = ChanceImplementation.create(this, "25.0 + " + Placeholders.ENCHANTMENT_LEVEL + " * 5.0"); this.potionImplementation = PotionImplementation.create(this, PotionEffectType.DARKNESS, false, diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/EnchantConfusingArrows.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/EnchantConfusingArrows.java index ef4fd4a..0480ecc 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/EnchantConfusingArrows.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/EnchantConfusingArrows.java @@ -12,18 +12,18 @@ import org.bukkit.event.entity.ProjectileHitEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; -import su.nexmedia.engine.api.particle.SimpleParticle; +import su.nexmedia.engine.utils.values.UniParticle; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.Placeholders; -import su.nightexpress.excellentenchants.enchantment.impl.ExcellentEnchant; import su.nightexpress.excellentenchants.api.enchantment.meta.Arrowed; import su.nightexpress.excellentenchants.api.enchantment.meta.Chanced; import su.nightexpress.excellentenchants.api.enchantment.meta.Potioned; import su.nightexpress.excellentenchants.api.enchantment.type.BowEnchant; -import su.nightexpress.excellentenchants.enchantment.util.EnchantPriority; +import su.nightexpress.excellentenchants.enchantment.impl.ExcellentEnchant; import su.nightexpress.excellentenchants.enchantment.impl.meta.ArrowImplementation; import su.nightexpress.excellentenchants.enchantment.impl.meta.ChanceImplementation; import su.nightexpress.excellentenchants.enchantment.impl.meta.PotionImplementation; +import su.nightexpress.excellentenchants.enchantment.util.EnchantPriority; public class EnchantConfusingArrows extends ExcellentEnchant implements Chanced, Arrowed, Potioned, BowEnchant { @@ -44,7 +44,7 @@ public class EnchantConfusingArrows extends ExcellentEnchant implements Chanced, @Override public void loadSettings() { super.loadSettings(); - this.arrowImplementation = ArrowImplementation.create(this, SimpleParticle.of(Particle.SPELL_MOB)); + this.arrowImplementation = ArrowImplementation.create(this, UniParticle.of(Particle.SPELL_MOB)); this.chanceImplementation = ChanceImplementation.create(this, "20.0 + " + Placeholders.ENCHANTMENT_LEVEL + " * 5.0"); this.potionImplementation = PotionImplementation.create(this, PotionEffectType.CONFUSION, false, diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/EnchantDragonfireArrows.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/EnchantDragonfireArrows.java index c21f35d..1ea26f0 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/EnchantDragonfireArrows.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/EnchantDragonfireArrows.java @@ -19,9 +19,9 @@ import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.bukkit.projectiles.ProjectileSource; import org.jetbrains.annotations.NotNull; -import su.nexmedia.engine.api.particle.SimpleParticle; import su.nexmedia.engine.utils.ItemUtil; import su.nexmedia.engine.utils.NumberUtil; +import su.nexmedia.engine.utils.values.UniParticle; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.Placeholders; import su.nightexpress.excellentenchants.api.enchantment.meta.Arrowed; @@ -57,7 +57,7 @@ public class EnchantDragonfireArrows extends ExcellentEnchant implements Chanced @Override public void loadSettings() { super.loadSettings(); - this.arrowImplementation = ArrowImplementation.create(this, SimpleParticle.of(Particle.DRAGON_BREATH)); + this.arrowImplementation = ArrowImplementation.create(this, UniParticle.of(Particle.DRAGON_BREATH)); this.chanceImplementation = ChanceImplementation.create(this, "10.0 + " + Placeholders.ENCHANTMENT_LEVEL + " * 5"); this.fireDuration = EnchantScaler.read(this, "Settings.Fire.Duration", diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/EnchantElectrifiedArrows.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/EnchantElectrifiedArrows.java index 274541a..292f32d 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/EnchantElectrifiedArrows.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/EnchantElectrifiedArrows.java @@ -16,8 +16,8 @@ import org.bukkit.event.entity.ProjectileHitEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.metadata.FixedMetadataValue; import org.jetbrains.annotations.NotNull; -import su.nexmedia.engine.api.particle.SimpleParticle; import su.nexmedia.engine.utils.LocationUtil; +import su.nexmedia.engine.utils.values.UniParticle; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.Placeholders; import su.nightexpress.excellentenchants.api.enchantment.meta.Arrowed; @@ -48,7 +48,7 @@ public class EnchantElectrifiedArrows extends ExcellentEnchant implements Chance @Override public void loadSettings() { super.loadSettings(); - this.arrowImplementation = ArrowImplementation.create(this, SimpleParticle.of(Particle.FIREWORKS_SPARK)); + this.arrowImplementation = ArrowImplementation.create(this, UniParticle.of(Particle.FIREWORKS_SPARK)); this.chanceImplementation = ChanceImplementation.create(this, "10.0 + " + Placeholders.ENCHANTMENT_LEVEL + " * 5"); } @@ -87,8 +87,8 @@ public class EnchantElectrifiedArrows extends ExcellentEnchant implements Chance block.getWorld().strikeLightning(block.getLocation()).setMetadata(META_NO_ITEM_DAMAGE, new FixedMetadataValue(plugin, true)); if (this.hasVisualEffects()) { Location center = LocationUtil.getCenter(block.getLocation()); - SimpleParticle.of(Particle.BLOCK_CRACK, block.getType().createBlockData()).play(center, 1, 0.05, 120); - SimpleParticle.of(Particle.FIREWORKS_SPARK).play(center, 1, 0.05, 120); + UniParticle.blockCrack(block.getType()).play(center, 1, 0.05, 120); + UniParticle.of(Particle.FIREWORKS_SPARK).play(center, 1, 0.05, 120); } return true; } diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/EnchantExplosiveArrows.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/EnchantExplosiveArrows.java index e61bd74..29bfbf4 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/EnchantExplosiveArrows.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/EnchantExplosiveArrows.java @@ -14,8 +14,8 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.metadata.FixedMetadataValue; import org.jetbrains.annotations.NotNull; import su.nexmedia.engine.api.config.JOption; -import su.nexmedia.engine.api.particle.SimpleParticle; import su.nexmedia.engine.utils.NumberUtil; +import su.nexmedia.engine.utils.values.UniParticle; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.Placeholders; import su.nightexpress.excellentenchants.api.enchantment.meta.Arrowed; @@ -53,7 +53,7 @@ public class EnchantExplosiveArrows extends ExcellentEnchant implements Chanced, @Override public void loadSettings() { super.loadSettings(); - this.arrowImplementation = ArrowImplementation.create(this, SimpleParticle.of(Particle.SMOKE_NORMAL)); + this.arrowImplementation = ArrowImplementation.create(this, UniParticle.of(Particle.SMOKE_NORMAL)); this.chanceImplementation = ChanceImplementation.create(this, "10.0 + " + Placeholders.ENCHANTMENT_LEVEL + " * 5"); this.explosionFireSpread = JOption.create("Settings.Explosion.Fire_Spread", true, diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/EnchantHover.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/EnchantHover.java index 08f8683..f2dba34 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/EnchantHover.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/EnchantHover.java @@ -12,18 +12,18 @@ import org.bukkit.event.entity.ProjectileHitEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; -import su.nexmedia.engine.api.particle.SimpleParticle; +import su.nexmedia.engine.utils.values.UniParticle; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.Placeholders; -import su.nightexpress.excellentenchants.enchantment.impl.ExcellentEnchant; import su.nightexpress.excellentenchants.api.enchantment.meta.Arrowed; import su.nightexpress.excellentenchants.api.enchantment.meta.Chanced; import su.nightexpress.excellentenchants.api.enchantment.meta.Potioned; import su.nightexpress.excellentenchants.api.enchantment.type.BowEnchant; -import su.nightexpress.excellentenchants.enchantment.util.EnchantPriority; +import su.nightexpress.excellentenchants.enchantment.impl.ExcellentEnchant; import su.nightexpress.excellentenchants.enchantment.impl.meta.ArrowImplementation; import su.nightexpress.excellentenchants.enchantment.impl.meta.ChanceImplementation; import su.nightexpress.excellentenchants.enchantment.impl.meta.PotionImplementation; +import su.nightexpress.excellentenchants.enchantment.util.EnchantPriority; public class EnchantHover extends ExcellentEnchant implements Chanced, Arrowed, Potioned, BowEnchant { @@ -44,7 +44,7 @@ public class EnchantHover extends ExcellentEnchant implements Chanced, Arrowed, @Override public void loadSettings() { super.loadSettings(); - this.arrowImplementation = ArrowImplementation.create(this, SimpleParticle.of(Particle.BUBBLE_POP)); + this.arrowImplementation = ArrowImplementation.create(this, UniParticle.of(Particle.BUBBLE_POP)); this.chanceImplementation = ChanceImplementation.create(this, "10.0 + " + Placeholders.ENCHANTMENT_LEVEL + " * 5"); this.potionImplementation = PotionImplementation.create(this, PotionEffectType.LEVITATION, false, diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/EnchantPoisonedArrows.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/EnchantPoisonedArrows.java index 52b1822..430634e 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/EnchantPoisonedArrows.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/EnchantPoisonedArrows.java @@ -12,18 +12,18 @@ import org.bukkit.event.entity.ProjectileHitEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; -import su.nexmedia.engine.api.particle.SimpleParticle; +import su.nexmedia.engine.utils.values.UniParticle; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.Placeholders; -import su.nightexpress.excellentenchants.enchantment.impl.ExcellentEnchant; import su.nightexpress.excellentenchants.api.enchantment.meta.Arrowed; import su.nightexpress.excellentenchants.api.enchantment.meta.Chanced; import su.nightexpress.excellentenchants.api.enchantment.meta.Potioned; import su.nightexpress.excellentenchants.api.enchantment.type.BowEnchant; -import su.nightexpress.excellentenchants.enchantment.util.EnchantPriority; +import su.nightexpress.excellentenchants.enchantment.impl.ExcellentEnchant; import su.nightexpress.excellentenchants.enchantment.impl.meta.ArrowImplementation; import su.nightexpress.excellentenchants.enchantment.impl.meta.ChanceImplementation; import su.nightexpress.excellentenchants.enchantment.impl.meta.PotionImplementation; +import su.nightexpress.excellentenchants.enchantment.util.EnchantPriority; public class EnchantPoisonedArrows extends ExcellentEnchant implements Chanced, Arrowed, Potioned, BowEnchant { @@ -44,7 +44,7 @@ public class EnchantPoisonedArrows extends ExcellentEnchant implements Chanced, @Override public void loadSettings() { super.loadSettings(); - this.arrowImplementation = ArrowImplementation.create(this, SimpleParticle.of(Particle.SLIME)); + this.arrowImplementation = ArrowImplementation.create(this, UniParticle.of(Particle.SLIME)); this.chanceImplementation = ChanceImplementation.create(this, "25.0 + " + Placeholders.ENCHANTMENT_LEVEL + " * 5"); this.potionImplementation = PotionImplementation.create(this, PotionEffectType.POISON, false, diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/EnchantWitheredArrows.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/EnchantWitheredArrows.java index 70472fc..65de8eb 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/EnchantWitheredArrows.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/EnchantWitheredArrows.java @@ -12,18 +12,18 @@ import org.bukkit.event.entity.ProjectileHitEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; -import su.nexmedia.engine.api.particle.SimpleParticle; +import su.nexmedia.engine.utils.values.UniParticle; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.Placeholders; -import su.nightexpress.excellentenchants.enchantment.impl.ExcellentEnchant; import su.nightexpress.excellentenchants.api.enchantment.meta.Arrowed; import su.nightexpress.excellentenchants.api.enchantment.meta.Chanced; import su.nightexpress.excellentenchants.api.enchantment.meta.Potioned; import su.nightexpress.excellentenchants.api.enchantment.type.BowEnchant; -import su.nightexpress.excellentenchants.enchantment.util.EnchantPriority; +import su.nightexpress.excellentenchants.enchantment.impl.ExcellentEnchant; import su.nightexpress.excellentenchants.enchantment.impl.meta.ArrowImplementation; import su.nightexpress.excellentenchants.enchantment.impl.meta.ChanceImplementation; import su.nightexpress.excellentenchants.enchantment.impl.meta.PotionImplementation; +import su.nightexpress.excellentenchants.enchantment.util.EnchantPriority; public class EnchantWitheredArrows extends ExcellentEnchant implements Chanced, Arrowed, Potioned, BowEnchant { @@ -44,7 +44,7 @@ public class EnchantWitheredArrows extends ExcellentEnchant implements Chanced, @Override public void loadSettings() { super.loadSettings(); - this.arrowImplementation = ArrowImplementation.create(this, SimpleParticle.of(Particle.SPELL_WITCH)); + this.arrowImplementation = ArrowImplementation.create(this, UniParticle.of(Particle.SPELL_WITCH)); this.chanceImplementation = ChanceImplementation.create(this, "15.0 + " + Placeholders.ENCHANTMENT_LEVEL + " * 5.0"); this.potionImplementation = PotionImplementation.create(this, PotionEffectType.WITHER, false, diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/FlareEnchant.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/FlareEnchant.java index ec6bc95..3d110a6 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/FlareEnchant.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/bow/FlareEnchant.java @@ -17,7 +17,7 @@ import org.bukkit.event.entity.ProjectileHitEvent; import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; import org.jetbrains.annotations.NotNull; -import su.nexmedia.engine.api.particle.SimpleParticle; +import su.nexmedia.engine.utils.values.UniParticle; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.Placeholders; import su.nightexpress.excellentenchants.api.enchantment.meta.Arrowed; @@ -47,7 +47,7 @@ public class FlareEnchant extends ExcellentEnchant implements Chanced, Arrowed, public void loadSettings() { super.loadSettings(); this.chanceImplementation = ChanceImplementation.create(this, "100.0"); - this.arrowImplementation = ArrowImplementation.create(this, SimpleParticle.of(Particle.FIREWORKS_SPARK)); + this.arrowImplementation = ArrowImplementation.create(this, UniParticle.of(Particle.FIREWORKS_SPARK)); } @NotNull diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/fishing/CurseOfDrownedEnchant.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/fishing/CurseOfDrownedEnchant.java index cf526ee..5486825 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/fishing/CurseOfDrownedEnchant.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/fishing/CurseOfDrownedEnchant.java @@ -8,8 +8,8 @@ import org.bukkit.entity.FishHook; import org.bukkit.event.player.PlayerFishEvent; import org.bukkit.inventory.ItemStack; import org.jetbrains.annotations.NotNull; -import su.nexmedia.engine.api.particle.SimpleParticle; -import su.nexmedia.engine.utils.PlayerUtil; +import su.nexmedia.engine.utils.values.UniParticle; +import su.nexmedia.engine.utils.values.UniSound; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.Placeholders; import su.nightexpress.excellentenchants.api.enchantment.meta.Chanced; @@ -64,8 +64,8 @@ public class CurseOfDrownedEnchant extends ExcellentEnchant implements FishingEn event.setCancelled(true); if (this.hasVisualEffects()) { - SimpleParticle.of(Particle.WATER_SPLASH).play(hook.getLocation(), 0.5, 0.1, 50); - PlayerUtil.sound(event.getPlayer(), Sound.ENTITY_DROWNED_AMBIENT); + UniParticle.of(Particle.WATER_SPLASH).play(hook.getLocation(), 0.5, 0.1, 50); + UniSound.of(Sound.ENTITY_DROWNED_AMBIENT).play(event.getPlayer()); } return true; } diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/meta/ArrowImplementation.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/meta/ArrowImplementation.java index dbdca1b..c4aaf56 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/meta/ArrowImplementation.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/meta/ArrowImplementation.java @@ -7,11 +7,11 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import su.nexmedia.engine.api.config.JOption; import su.nexmedia.engine.api.config.JYML; -import su.nexmedia.engine.api.particle.SimpleParticle; import su.nexmedia.engine.utils.PDCUtil; +import su.nexmedia.engine.utils.values.UniParticle; import su.nightexpress.excellentenchants.ExcellentEnchantsAPI; -import su.nightexpress.excellentenchants.enchantment.impl.ExcellentEnchant; import su.nightexpress.excellentenchants.api.enchantment.meta.Arrowed; +import su.nightexpress.excellentenchants.enchantment.impl.ExcellentEnchant; import su.nightexpress.excellentenchants.enchantment.task.ArrowTrailsTask; import java.util.Optional; @@ -21,9 +21,9 @@ public final class ArrowImplementation implements Arrowed { private final ExcellentEnchant enchant; private final NamespacedKey projectileKey; - private final SimpleParticle trailParticle; + private final UniParticle trailParticle; - private ArrowImplementation(@NotNull ExcellentEnchant enchant, @Nullable SimpleParticle trailParticle) { + private ArrowImplementation(@NotNull ExcellentEnchant enchant, @Nullable UniParticle trailParticle) { this.enchant = enchant; this.projectileKey = new NamespacedKey(ExcellentEnchantsAPI.PLUGIN, "arrow.enchant_id"); this.trailParticle = trailParticle; @@ -31,15 +31,15 @@ public final class ArrowImplementation implements Arrowed { @NotNull public static ArrowImplementation create(@NotNull ExcellentEnchant enchant) { - return create(enchant, SimpleParticle.of(Particle.REDSTONE)); + return create(enchant, UniParticle.of(Particle.REDSTONE)); } @NotNull - public static ArrowImplementation create(@NotNull ExcellentEnchant enchant, @NotNull SimpleParticle particle) { + public static ArrowImplementation create(@NotNull ExcellentEnchant enchant, @NotNull UniParticle particle) { JYML cfg = enchant.getConfig(); - SimpleParticle effect = new JOption<>("Settings.Arrow.Trail_Effect", - (cfg1, path, def) -> SimpleParticle.read(cfg1, path), + UniParticle effect = new JOption<>("Settings.Arrow.Trail_Effect", + (cfg1, path, def) -> UniParticle.read(cfg1, path), particle, "Sets particle effect for the arrow trail of this enchantment." ).setWriter((cfg1, path, particle1) -> particle1.write(cfg1, path)).read(cfg); @@ -65,7 +65,7 @@ public final class ArrowImplementation implements Arrowed { @NotNull @Override - public Optional getTrailParticle() { + public Optional getTrailParticle() { return trailParticle == null ? Optional.empty() : Optional.of(trailParticle); } diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/tool/EnchantDivineTouch.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/tool/EnchantDivineTouch.java index 316142e..d9871c2 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/tool/EnchantDivineTouch.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/tool/EnchantDivineTouch.java @@ -19,10 +19,10 @@ import org.bukkit.inventory.meta.BlockStateMeta; import org.bukkit.metadata.FixedMetadataValue; import org.jetbrains.annotations.NotNull; import su.nexmedia.engine.api.config.JOption; -import su.nexmedia.engine.api.particle.SimpleParticle; import su.nexmedia.engine.utils.Colorizer; import su.nexmedia.engine.utils.LocationUtil; import su.nexmedia.engine.utils.PDCUtil; +import su.nexmedia.engine.utils.values.UniParticle; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.Placeholders; import su.nightexpress.excellentenchants.api.enchantment.meta.Chanced; @@ -112,7 +112,7 @@ public class EnchantDivineTouch extends ExcellentEnchant implements Chanced, Blo if (this.hasVisualEffects()) { Location location = LocationUtil.getCenter(block.getLocation()); - SimpleParticle.of(Particle.VILLAGER_HAPPY).play(location, 0.3, 0.15, 30); + UniParticle.of(Particle.VILLAGER_HAPPY).play(location, 0.3, 0.15, 30); } block.removeMetadata(META_HANDLE, this.plugin); return true; diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/tool/EnchantReplanter.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/tool/EnchantReplanter.java index 1295971..54cf16b 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/tool/EnchantReplanter.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/tool/EnchantReplanter.java @@ -15,7 +15,7 @@ import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; import org.jetbrains.annotations.NotNull; import su.nexmedia.engine.api.config.JOption; -import su.nexmedia.engine.utils.PlayerUtil; +import su.nexmedia.engine.utils.values.UniSound; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.api.enchantment.meta.Chanced; import su.nightexpress.excellentenchants.api.enchantment.type.BlockBreakEnchant; @@ -147,7 +147,7 @@ public class EnchantReplanter extends ExcellentEnchant implements Chanced, Inter if (seed == Material.NETHER_WART && blockGround.getType() == Material.SOUL_SAND || seed != Material.NETHER_WART && blockGround.getType() == Material.FARMLAND) { if (this.takeSeeds(player, seed)) { - PlayerUtil.sound(player, seed == Material.NETHER_WART ? Sound.ITEM_NETHER_WART_PLANT : Sound.ITEM_CROP_PLANT); + UniSound.of(seed == Material.NETHER_WART ? Sound.ITEM_NETHER_WART_PLANT : Sound.ITEM_CROP_PLANT).play(player); plugin.getEnchantNMS().sendAttackPacket(player, 0); blockPlant.setType(this.fineSeedsToBlock(seed)); break; diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/tool/EnchantSmelter.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/tool/EnchantSmelter.java index 4572fed..1f771cb 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/tool/EnchantSmelter.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/tool/EnchantSmelter.java @@ -13,8 +13,9 @@ import org.bukkit.event.block.BlockDropItemEvent; import org.bukkit.inventory.ItemStack; import org.jetbrains.annotations.NotNull; import su.nexmedia.engine.api.config.JOption; -import su.nexmedia.engine.api.particle.SimpleParticle; import su.nexmedia.engine.utils.LocationUtil; +import su.nexmedia.engine.utils.values.UniParticle; +import su.nexmedia.engine.utils.values.UniSound; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.Placeholders; import su.nightexpress.excellentenchants.api.enchantment.meta.Chanced; @@ -30,7 +31,7 @@ public class EnchantSmelter extends ExcellentEnchant implements Chanced, BlockDr public static final String ID = "smelter"; - private Sound sound; + private UniSound sound; private Map smeltingTable; private ChanceImplementation chanceImplementation; @@ -51,7 +52,7 @@ public class EnchantSmelter extends ExcellentEnchant implements Chanced, BlockDr this.chanceImplementation = ChanceImplementation.create(this, "25.0 + " + Placeholders.ENCHANTMENT_LEVEL + " * 10"); - this.sound = JOption.create("Settings.Sound", Sound.class, Sound.BLOCK_LAVA_EXTINGUISH, + this.sound = JOption.create("Settings.Sound",UniSound.of(Sound.BLOCK_LAVA_EXTINGUISH), "Sound to play on smelting.", "https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html").read(cfg); @@ -108,8 +109,8 @@ public class EnchantSmelter extends ExcellentEnchant implements Chanced, BlockDr Block block = event.getBlockState().getBlock(); if (this.hasVisualEffects()) { Location location = LocationUtil.getCenter(block.getLocation(), true); - LocationUtil.sound(location, this.sound); - SimpleParticle.of(Particle.FLAME).play(location, 0.25, 0.05, 20); + UniParticle.of(Particle.FLAME).play(location, 0.25, 0.05, 20); + this.sound.play(location); } return true; } diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/tool/EnchantTreasures.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/tool/EnchantTreasures.java index 4ad2c34..6de1f92 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/tool/EnchantTreasures.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/tool/EnchantTreasures.java @@ -10,8 +10,8 @@ import org.bukkit.event.block.BlockDropItemEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.metadata.FixedMetadataValue; import org.jetbrains.annotations.NotNull; +import su.nexmedia.engine.utils.blocktracker.PlayerBlockTracker; import su.nexmedia.engine.utils.random.Rnd; -import su.nexmedia.playerblocktracker.PlayerBlockTracker; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.Placeholders; import su.nightexpress.excellentenchants.api.enchantment.Cleanable; @@ -30,7 +30,7 @@ import java.util.function.Predicate; public class EnchantTreasures extends ExcellentEnchant implements Chanced, BlockBreakEnchant, BlockDropEnchant, Cleanable { public static final String ID = "treasures"; - private static final String META = "wasted"; + @Deprecated private static final String META = "wasted"; private Map> treasures; private ChanceImplementation chanceImplementation; @@ -43,7 +43,7 @@ public class EnchantTreasures extends ExcellentEnchant implements Chanced, Block this.getDefaults().setLevelMax(5); this.getDefaults().setTier(0.1); - PlayerBlockTracker.initialize(plugin); + PlayerBlockTracker.initialize(); PlayerBlockTracker.BLOCK_FILTERS.add(this.blockTracker = (block) -> { return this.treasures.containsKey(block.getType()); }); @@ -106,7 +106,6 @@ public class EnchantTreasures extends ExcellentEnchant implements Chanced, Block @Override public void clear() { PlayerBlockTracker.BLOCK_FILTERS.remove(this.blockTracker); - PlayerBlockTracker.shutdown(); } @NotNull diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantBaneOfNetherspawn.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantBaneOfNetherspawn.java index 9e13639..a9f742d 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantBaneOfNetherspawn.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantBaneOfNetherspawn.java @@ -8,8 +8,8 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.inventory.ItemStack; import org.jetbrains.annotations.NotNull; import su.nexmedia.engine.api.config.JOption; -import su.nexmedia.engine.api.particle.SimpleParticle; import su.nexmedia.engine.utils.NumberUtil; +import su.nexmedia.engine.utils.values.UniParticle; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.Placeholders; import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant; @@ -73,7 +73,7 @@ public class EnchantBaneOfNetherspawn extends ExcellentEnchant implements Combat double damageAdd = this.getDamageModifier(level); event.setDamage(this.damageModifier ? damageEvent * damageAdd : damageEvent + damageAdd); if (this.hasVisualEffects()) { - SimpleParticle.of(Particle.SMOKE_NORMAL).play(victim.getEyeLocation(), 0.25, 0.1, 30); + UniParticle.of(Particle.SMOKE_NORMAL).play(victim.getEyeLocation(), 0.25, 0.1, 30); } return true; } diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantBlindness.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantBlindness.java index 78e7f7a..3342488 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantBlindness.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantBlindness.java @@ -7,7 +7,7 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; -import su.nexmedia.engine.api.particle.SimpleParticle; +import su.nexmedia.engine.utils.values.UniParticle; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.Placeholders; import su.nightexpress.excellentenchants.api.enchantment.meta.Chanced; @@ -67,7 +67,7 @@ public class EnchantBlindness extends ExcellentEnchant implements Chanced, Potio if (!this.addEffect(victim, level)) return false; if (this.hasVisualEffects()) { - SimpleParticle.of(Particle.SMOKE_NORMAL).play(victim.getEyeLocation(), 0.25, 0.1, 30); + UniParticle.of(Particle.SMOKE_NORMAL).play(victim.getEyeLocation(), 0.25, 0.1, 30); } return true; } diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantConfusion.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantConfusion.java index a534885..5b8acec 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantConfusion.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantConfusion.java @@ -1,14 +1,13 @@ package su.nightexpress.excellentenchants.enchantment.impl.weapon; import org.bukkit.Material; -import org.bukkit.Particle; import org.bukkit.enchantments.EnchantmentTarget; import org.bukkit.entity.LivingEntity; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; -import su.nexmedia.engine.api.particle.SimpleParticle; +import su.nexmedia.engine.utils.values.UniParticle; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.Placeholders; import su.nightexpress.excellentenchants.api.enchantment.meta.Chanced; @@ -68,8 +67,7 @@ public class EnchantConfusion extends ExcellentEnchant implements Chanced, Potio if (!this.addEffect(victim, level)) return false; if (this.hasVisualEffects()) { - SimpleParticle.of(Particle.ITEM_CRACK, new ItemStack(Material.ROTTEN_FLESH)) - .play(victim.getEyeLocation(), 0.25, 0.1, 30); + UniParticle.itemCrack(Material.ROTTEN_FLESH).play(victim.getEyeLocation(), 0.25, 0.1, 30); } return true; } diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantCure.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantCure.java index 78ecc8a..55e1d9e 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantCure.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantCure.java @@ -7,7 +7,7 @@ import org.bukkit.entity.*; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.inventory.ItemStack; import org.jetbrains.annotations.NotNull; -import su.nexmedia.engine.api.particle.SimpleParticle; +import su.nexmedia.engine.utils.values.UniParticle; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.Placeholders; import su.nightexpress.excellentenchants.api.enchantment.meta.Chanced; @@ -62,7 +62,7 @@ public class EnchantCure extends ExcellentEnchant implements Chanced, CombatEnch event.setCancelled(true); if (this.hasVisualEffects()) { - SimpleParticle.of(Particle.CLOUD).play(victim.getEyeLocation(), 0.25, 0.1, 30); + UniParticle.of(Particle.CLOUD).play(victim.getEyeLocation(), 0.25, 0.1, 30); } if (victim instanceof PigZombie pigZombie) { diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantCutter.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantCutter.java index e98b170..bf87080 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantCutter.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantCutter.java @@ -1,6 +1,5 @@ package su.nightexpress.excellentenchants.enchantment.impl.weapon; -import org.bukkit.Particle; import org.bukkit.Sound; import org.bukkit.enchantments.EnchantmentTarget; import org.bukkit.entity.Item; @@ -13,10 +12,10 @@ import org.bukkit.inventory.meta.Damageable; import org.bukkit.inventory.meta.ItemMeta; import org.jetbrains.annotations.NotNull; import su.nexmedia.engine.api.config.JOption; -import su.nexmedia.engine.api.particle.SimpleParticle; -import su.nexmedia.engine.utils.LocationUtil; import su.nexmedia.engine.utils.NumberUtil; import su.nexmedia.engine.utils.random.Rnd; +import su.nexmedia.engine.utils.values.UniParticle; +import su.nexmedia.engine.utils.values.UniSound; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.Placeholders; import su.nightexpress.excellentenchants.api.enchantment.meta.Chanced; @@ -110,8 +109,8 @@ public class EnchantCutter extends ExcellentEnchant implements Chanced, CombatEn drop.getVelocity().multiply(3D); if (this.hasVisualEffects()) { - SimpleParticle.of(Particle.ITEM_CRACK, itemCut).play(victim.getEyeLocation(), 0.25, 0.15, 30); - LocationUtil.sound(victim.getLocation(), Sound.ENTITY_ITEM_BREAK); + UniParticle.itemCrack(itemCut).play(victim.getEyeLocation(), 0.25, 0.15, 30); + UniSound.of(Sound.ENTITY_ITEM_BREAK).play(victim.getLocation()); } return true; } diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantDecapitator.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantDecapitator.java index 387b2ab..44201c6 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantDecapitator.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantDecapitator.java @@ -3,7 +3,6 @@ package su.nightexpress.excellentenchants.enchantment.impl.weapon; import org.bukkit.Material; import org.bukkit.NamespacedKey; -import org.bukkit.Particle; import org.bukkit.block.Skull; import org.bukkit.enchantments.EnchantmentTarget; import org.bukkit.entity.EntityType; @@ -18,12 +17,12 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.SkullMeta; import org.jetbrains.annotations.NotNull; import su.nexmedia.engine.api.config.JOption; -import su.nexmedia.engine.api.particle.SimpleParticle; import su.nexmedia.engine.lang.LangManager; import su.nexmedia.engine.utils.Colorizer; import su.nexmedia.engine.utils.ItemUtil; import su.nexmedia.engine.utils.PDCUtil; import su.nexmedia.engine.utils.StringUtil; +import su.nexmedia.engine.utils.values.UniParticle; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.Placeholders; import su.nightexpress.excellentenchants.api.enchantment.meta.Chanced; @@ -235,7 +234,7 @@ public class EnchantDecapitator extends ExcellentEnchant implements Chanced, Dea entity.getWorld().dropItemNaturally(entity.getLocation(), item); if (this.hasVisualEffects()) { - SimpleParticle.of(Particle.BLOCK_CRACK, Material.REDSTONE_BLOCK.createBlockData()).play(entity.getEyeLocation(), 0.25, 0.15, 30); + UniParticle.blockCrack(Material.REDSTONE_BLOCK).play(entity.getEyeLocation(), 0.25, 0.15, 30); } return true; } diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantDoubleStrike.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantDoubleStrike.java index 546f820..7e26d9f 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantDoubleStrike.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantDoubleStrike.java @@ -7,8 +7,8 @@ import org.bukkit.entity.LivingEntity; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.inventory.ItemStack; import org.jetbrains.annotations.NotNull; -import su.nexmedia.engine.api.particle.SimpleParticle; -import su.nexmedia.engine.utils.LocationUtil; +import su.nexmedia.engine.utils.values.UniParticle; +import su.nexmedia.engine.utils.values.UniSound; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.Placeholders; import su.nightexpress.excellentenchants.api.enchantment.meta.Chanced; @@ -57,8 +57,8 @@ public class EnchantDoubleStrike extends ExcellentEnchant implements Chanced, Co event.setDamage(event.getDamage() * 2D); if (this.hasVisualEffects()) { - SimpleParticle.of(Particle.EXPLOSION_NORMAL).play(victim.getEyeLocation(), 0.25, 0.15, 15); - LocationUtil.sound(victim.getLocation(), Sound.ENTITY_GENERIC_EXPLODE); + UniParticle.of(Particle.EXPLOSION_NORMAL).play(victim.getEyeLocation(), 0.25, 0.15, 15); + UniSound.of(Sound.ENTITY_GENERIC_EXPLODE).play(victim.getLocation()); } return true; } diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantExhaust.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantExhaust.java index 339b37c..e538f56 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantExhaust.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantExhaust.java @@ -1,14 +1,13 @@ package su.nightexpress.excellentenchants.enchantment.impl.weapon; import org.bukkit.Material; -import org.bukkit.Particle; import org.bukkit.enchantments.EnchantmentTarget; import org.bukkit.entity.LivingEntity; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; -import su.nexmedia.engine.api.particle.SimpleParticle; +import su.nexmedia.engine.utils.values.UniParticle; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.Placeholders; import su.nightexpress.excellentenchants.api.enchantment.meta.Chanced; @@ -68,7 +67,7 @@ public class EnchantExhaust extends ExcellentEnchant implements Chanced, Potione if (!this.addEffect(victim, level)) return false; if (this.hasVisualEffects()) { - SimpleParticle.of(Particle.ITEM_CRACK, new ItemStack(Material.ROTTEN_FLESH)).play(victim.getEyeLocation(), 0.25, 0.1, 30); + UniParticle.itemCrack(Material.ROTTEN_FLESH).play(victim.getEyeLocation(), 0.25, 0.1, 30); } return true; } diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantIceAspect.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantIceAspect.java index 11c5ba5..df2354c 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantIceAspect.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantIceAspect.java @@ -1,14 +1,13 @@ package su.nightexpress.excellentenchants.enchantment.impl.weapon; import org.bukkit.Material; -import org.bukkit.Particle; import org.bukkit.enchantments.EnchantmentTarget; import org.bukkit.entity.LivingEntity; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; -import su.nexmedia.engine.api.particle.SimpleParticle; +import su.nexmedia.engine.utils.values.UniParticle; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.Placeholders; import su.nightexpress.excellentenchants.api.enchantment.meta.Chanced; @@ -69,7 +68,7 @@ public class EnchantIceAspect extends ExcellentEnchant implements Chanced, Potio victim.setFreezeTicks(victim.getMaxFreezeTicks()); if (this.hasVisualEffects()) { - SimpleParticle.of(Particle.BLOCK_CRACK, Material.ICE.createBlockData()).play(victim.getEyeLocation(), 0.25, 0.15, 30); + UniParticle.blockCrack(Material.ICE).play(victim.getEyeLocation(), 0.25, 0.15, 30); } return true; } diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantParalyze.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantParalyze.java index 58d9def..fd55183 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantParalyze.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantParalyze.java @@ -7,7 +7,7 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; -import su.nexmedia.engine.api.particle.SimpleParticle; +import su.nexmedia.engine.utils.values.UniParticle; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.Placeholders; import su.nightexpress.excellentenchants.api.enchantment.meta.Chanced; @@ -67,7 +67,7 @@ public class EnchantParalyze extends ExcellentEnchant implements Chanced, Potion if (!this.addEffect(victim, level)) return false; if (this.hasVisualEffects()) { - SimpleParticle.of(Particle.CRIT_MAGIC).play(victim.getEyeLocation(), 0.25, 0.1, 30); + UniParticle.of(Particle.CRIT_MAGIC).play(victim.getEyeLocation(), 0.25, 0.1, 30); } return true; } diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantRage.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantRage.java index d42899a..312c288 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantRage.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantRage.java @@ -7,7 +7,7 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; -import su.nexmedia.engine.api.particle.SimpleParticle; +import su.nexmedia.engine.utils.values.UniParticle; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.Placeholders; import su.nightexpress.excellentenchants.api.enchantment.meta.Chanced; @@ -67,7 +67,7 @@ public class EnchantRage extends ExcellentEnchant implements Chanced, Potioned, if (!this.addEffect(damager, level)) return false; if (this.hasVisualEffects()) { - SimpleParticle.of(Particle.LAVA).play(damager.getEyeLocation(), 0.25, 0.1, 30); + UniParticle.of(Particle.LAVA).play(damager.getEyeLocation(), 0.25, 0.1, 30); } return true; } diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantRocket.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantRocket.java index e8b3c8a..d928f75 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantRocket.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantRocket.java @@ -9,8 +9,8 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.FireworkMeta; import org.jetbrains.annotations.NotNull; -import su.nexmedia.engine.utils.LocationUtil; import su.nexmedia.engine.utils.random.Rnd; +import su.nexmedia.engine.utils.values.UniSound; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.Placeholders; import su.nightexpress.excellentenchants.api.enchantment.meta.Chanced; @@ -72,7 +72,7 @@ public class EnchantRocket extends ExcellentEnchant implements Chanced, CombatEn Firework firework = this.createRocket(victim.getLocation(), level); firework.addPassenger(victim); - LocationUtil.sound(victim.getLocation(), Sound.ENTITY_FIREWORK_ROCKET_LAUNCH); + UniSound.of(Sound.ENTITY_FIREWORK_ROCKET_LAUNCH).play(victim.getLocation()); return true; } diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantSurprise.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantSurprise.java index 407b000..ab646a7 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantSurprise.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantSurprise.java @@ -9,17 +9,17 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; -import su.nexmedia.engine.api.particle.SimpleParticle; import su.nexmedia.engine.utils.random.Rnd; +import su.nexmedia.engine.utils.values.UniParticle; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.Placeholders; -import su.nightexpress.excellentenchants.enchantment.impl.ExcellentEnchant; import su.nightexpress.excellentenchants.api.enchantment.meta.Chanced; import su.nightexpress.excellentenchants.api.enchantment.meta.Potioned; import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant; -import su.nightexpress.excellentenchants.enchantment.util.EnchantPriority; +import su.nightexpress.excellentenchants.enchantment.impl.ExcellentEnchant; import su.nightexpress.excellentenchants.enchantment.impl.meta.ChanceImplementation; import su.nightexpress.excellentenchants.enchantment.impl.meta.PotionImplementation; +import su.nightexpress.excellentenchants.enchantment.util.EnchantPriority; public class EnchantSurprise extends ExcellentEnchant implements Chanced, Potioned, CombatEnchant { @@ -74,7 +74,7 @@ public class EnchantSurprise extends ExcellentEnchant implements Chanced, Potion if (this.hasVisualEffects()) { Color color = Color.fromRGB(Rnd.nextInt(256), Rnd.nextInt(256), Rnd.nextInt(256)); Particle.DustOptions dustOptions = new Particle.DustOptions(color, 2f); - SimpleParticle.of(Particle.REDSTONE, dustOptions).play(victim.getEyeLocation(), 0.25, 0.1, 25); + UniParticle.of(Particle.REDSTONE, dustOptions).play(victim.getEyeLocation(), 0.25, 0.1, 25); } return true; } diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantVampire.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantVampire.java index 073b116..c2fb76e 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantVampire.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantVampire.java @@ -9,9 +9,9 @@ import org.bukkit.event.entity.EntityRegainHealthEvent; import org.bukkit.inventory.ItemStack; import org.jetbrains.annotations.NotNull; import su.nexmedia.engine.api.config.JOption; -import su.nexmedia.engine.api.particle.SimpleParticle; import su.nexmedia.engine.utils.EntityUtil; import su.nexmedia.engine.utils.NumberUtil; +import su.nexmedia.engine.utils.values.UniParticle; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.Placeholders; import su.nightexpress.excellentenchants.api.enchantment.meta.Chanced; @@ -92,7 +92,7 @@ public class EnchantVampire extends ExcellentEnchant implements Chanced, CombatE damager.setHealth(Math.min(healthMax, healthHas + healthEvent.getAmount())); if (this.hasVisualEffects()) { - SimpleParticle.of(Particle.HEART).play(damager.getEyeLocation(), 0.25, 0.15, 5); + UniParticle.of(Particle.HEART).play(damager.getEyeLocation(), 0.25, 0.15, 5); } return true; } diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantVenom.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantVenom.java index 9feda0b..2703ad1 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantVenom.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantVenom.java @@ -7,7 +7,7 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; -import su.nexmedia.engine.api.particle.SimpleParticle; +import su.nexmedia.engine.utils.values.UniParticle; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.Placeholders; import su.nightexpress.excellentenchants.api.enchantment.meta.Chanced; @@ -67,7 +67,7 @@ public class EnchantVenom extends ExcellentEnchant implements Chanced, Potioned, if (!this.addEffect(victim, level)) return false; if (this.hasVisualEffects()) { - SimpleParticle.of(Particle.SLIME).play(victim.getEyeLocation(), 0.25, 0.1, 30); + UniParticle.of(Particle.SLIME).play(victim.getEyeLocation(), 0.25, 0.1, 30); } return true; } diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantVillageDefender.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantVillageDefender.java index f7692ac..c79c404 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantVillageDefender.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantVillageDefender.java @@ -8,8 +8,8 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.inventory.ItemStack; import org.jetbrains.annotations.NotNull; import su.nexmedia.engine.api.config.JOption; -import su.nexmedia.engine.api.particle.SimpleParticle; import su.nexmedia.engine.utils.NumberUtil; +import su.nexmedia.engine.utils.values.UniParticle; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.Placeholders; import su.nightexpress.excellentenchants.api.enchantment.type.CombatEnchant; @@ -72,7 +72,7 @@ public class EnchantVillageDefender extends ExcellentEnchant implements CombatEn event.setDamage(damageFinal); if (this.hasVisualEffects()) { - SimpleParticle.of(Particle.VILLAGER_ANGRY).play(victim.getEyeLocation(), 0.25, 0.1, 30); + UniParticle.of(Particle.VILLAGER_ANGRY).play(victim.getEyeLocation(), 0.25, 0.1, 30); } return true; } diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantWither.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantWither.java index 6460a6f..f229498 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantWither.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/weapon/EnchantWither.java @@ -7,7 +7,7 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; -import su.nexmedia.engine.api.particle.SimpleParticle; +import su.nexmedia.engine.utils.values.UniParticle; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.Placeholders; import su.nightexpress.excellentenchants.api.enchantment.meta.Chanced; @@ -67,7 +67,7 @@ public class EnchantWither extends ExcellentEnchant implements Chanced, Potioned if (!this.addEffect(victim, level)) return false; if (this.hasVisualEffects()) { - SimpleParticle.of(Particle.ASH).play(victim.getEyeLocation(), 0.25, 0.1, 30); + UniParticle.of(Particle.ASH).play(victim.getEyeLocation(), 0.25, 0.1, 30); } return true; } diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/listener/EnchantAnvilListener.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/listener/EnchantAnvilListener.java index 75968f9..14c2d0c 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/listener/EnchantAnvilListener.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/listener/EnchantAnvilListener.java @@ -13,7 +13,7 @@ import org.bukkit.inventory.ItemStack; import org.jetbrains.annotations.NotNull; import su.nexmedia.engine.api.manager.AbstractListener; import su.nexmedia.engine.utils.PDCUtil; -import su.nexmedia.engine.utils.PlayerUtil; +import su.nexmedia.engine.utils.values.UniSound; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.ExcellentEnchantsAPI; import su.nightexpress.excellentenchants.enchantment.impl.ExcellentEnchant; @@ -151,7 +151,7 @@ public class EnchantAnvilListener extends AbstractListener { e.getView().setCursor(item); e.setCancelled(false); - PlayerUtil.sound(player, Sound.BLOCK_ENCHANTMENT_TABLE_USE); + UniSound.of(Sound.BLOCK_ENCHANTMENT_TABLE_USE).play(player); ItemStack second = inventory.getItem(1); if (second != null && !second.getType().isAir()) { diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/task/ArrowTrailsTask.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/task/ArrowTrailsTask.java index 44bdf5e..e5b8705 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/task/ArrowTrailsTask.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/task/ArrowTrailsTask.java @@ -2,8 +2,8 @@ package su.nightexpress.excellentenchants.enchantment.task; import org.bukkit.entity.Projectile; import org.jetbrains.annotations.NotNull; -import su.nexmedia.engine.api.particle.SimpleParticle; import su.nexmedia.engine.api.server.AbstractTask; +import su.nexmedia.engine.utils.values.UniParticle; import su.nightexpress.excellentenchants.ExcellentEnchants; import su.nightexpress.excellentenchants.config.Config; @@ -14,7 +14,7 @@ import java.util.concurrent.ConcurrentHashMap; public class ArrowTrailsTask extends AbstractTask { - private static final Map> TRAILS_MAP = new ConcurrentHashMap<>(); + private static final Map> TRAILS_MAP = new ConcurrentHashMap<>(); public ArrowTrailsTask(@NotNull ExcellentEnchants plugin) { super(plugin, Config.TASKS_ARROW_TRAIL_TICKS_INTERVAL.get(), true); @@ -32,7 +32,7 @@ public class ArrowTrailsTask extends AbstractTask { }); } - public static void add(@NotNull Projectile projectile, @NotNull SimpleParticle particle) { + public static void add(@NotNull Projectile projectile, @NotNull UniParticle particle) { TRAILS_MAP.computeIfAbsent(projectile, list -> new HashSet<>()).add(particle); } } \ No newline at end of file diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/util/EnchantDropContainer.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/util/EnchantDropContainer.java deleted file mode 100644 index 723b5a9..0000000 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/util/EnchantDropContainer.java +++ /dev/null @@ -1,30 +0,0 @@ -package su.nightexpress.excellentenchants.enchantment.util; - -import org.bukkit.event.block.BlockDropItemEvent; -import org.bukkit.inventory.ItemStack; -import org.jetbrains.annotations.NotNull; - -import java.util.ArrayList; -import java.util.List; - -@Deprecated -public class EnchantDropContainer { - - private final BlockDropItemEvent parent; - private final List drop; - - public EnchantDropContainer(@NotNull BlockDropItemEvent parent) { - this.parent = parent; - this.drop = new ArrayList<>(); - } - - @NotNull - public BlockDropItemEvent getParent() { - return parent; - } - - @NotNull - public List getDrop() { - return drop; - } -} diff --git a/NMS/pom.xml b/NMS/pom.xml index 1d7f568..50c9ef7 100644 --- a/NMS/pom.xml +++ b/NMS/pom.xml @@ -5,7 +5,7 @@ ExcellentEnchants su.nightexpress.excellentenchants - 3.5.7 + 3.5.8 4.0.0 diff --git a/V1_17_R1/pom.xml b/V1_17_R1/pom.xml index e8ecc1c..e48bc89 100644 --- a/V1_17_R1/pom.xml +++ b/V1_17_R1/pom.xml @@ -5,7 +5,7 @@ ExcellentEnchants su.nightexpress.excellentenchants - 3.5.7 + 3.5.8 4.0.0 @@ -26,7 +26,7 @@ su.nightexpress.excellentenchants NMS - 3.5.7 + 3.5.8 diff --git a/V1_18_R2/pom.xml b/V1_18_R2/pom.xml index 81b4e3c..2a21e2c 100644 --- a/V1_18_R2/pom.xml +++ b/V1_18_R2/pom.xml @@ -5,7 +5,7 @@ ExcellentEnchants su.nightexpress.excellentenchants - 3.5.7 + 3.5.8 4.0.0 @@ -26,7 +26,7 @@ su.nightexpress.excellentenchants NMS - 3.5.7 + 3.5.8 diff --git a/V1_19_R3/pom.xml b/V1_19_R3/pom.xml index 83f488a..26bd766 100644 --- a/V1_19_R3/pom.xml +++ b/V1_19_R3/pom.xml @@ -5,7 +5,7 @@ ExcellentEnchants su.nightexpress.excellentenchants - 3.5.7 + 3.5.8 4.0.0 @@ -26,7 +26,7 @@ su.nightexpress.excellentenchants NMS - 3.5.7 + 3.5.8 diff --git a/V1_20_R1/pom.xml b/V1_20_R1/pom.xml index d2cec44..5813cfc 100644 --- a/V1_20_R1/pom.xml +++ b/V1_20_R1/pom.xml @@ -5,15 +5,15 @@ ExcellentEnchants su.nightexpress.excellentenchants - 3.5.7 + 3.5.8 4.0.0 V1_20_R1 - 16 - 16 + 17 + 17 @@ -26,7 +26,7 @@ su.nightexpress.excellentenchants NMS - 3.5.7 + 3.5.8 diff --git a/V1_20_R2/pom.xml b/V1_20_R2/pom.xml new file mode 100644 index 0000000..a3ffdf1 --- /dev/null +++ b/V1_20_R2/pom.xml @@ -0,0 +1,71 @@ + + + + ExcellentEnchants + su.nightexpress.excellentenchants + 3.5.8 + + 4.0.0 + + V1_20_R2 + + + 17 + 17 + + + + + org.spigotmc + spigot + 1.20.2-R0.1-SNAPSHOT + remapped-mojang + + + su.nightexpress.excellentenchants + NMS + 3.5.8 + + + + + + + net.md-5 + specialsource-maven-plugin + 1.2.4 + + + package + + remap + + remap-obf + + org.spigotmc:minecraft-server:1.20.2-R0.1-SNAPSHOT:txt:maps-mojang + true + org.spigotmc:spigot:1.20.2-R0.1-SNAPSHOT:jar:remapped-mojang + true + remapped-obf + + + + package + + remap + + remap-spigot + + ${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar + org.spigotmc:minecraft-server:1.20.2-R0.1-SNAPSHOT:csrg:maps-spigot + org.spigotmc:spigot:1.20.2-R0.1-SNAPSHOT:jar:remapped-obf + + + + + + + + \ No newline at end of file diff --git a/V1_20_R2/src/main/java/su/nightexpress/excellentenchants/nms/V1_20_R2.java b/V1_20_R2/src/main/java/su/nightexpress/excellentenchants/nms/V1_20_R2.java new file mode 100644 index 0000000..333b2e4 --- /dev/null +++ b/V1_20_R2/src/main/java/su/nightexpress/excellentenchants/nms/V1_20_R2.java @@ -0,0 +1,116 @@ +package su.nightexpress.excellentenchants.nms; + +import net.minecraft.core.BlockPos; +import net.minecraft.network.protocol.game.ClientboundAnimatePacket; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.util.Mth; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.item.ItemEntity; +import net.minecraft.world.entity.projectile.FishingHook; +import net.minecraft.world.item.SpawnEggItem; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.LiquidBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.phys.shapes.CollisionContext; +import org.bukkit.Location; +import org.bukkit.block.Block; +import org.bukkit.craftbukkit.v1_20_R2.CraftWorld; +import org.bukkit.craftbukkit.v1_20_R2.block.CraftBlock; +import org.bukkit.craftbukkit.v1_20_R2.entity.CraftFishHook; +import org.bukkit.craftbukkit.v1_20_R2.entity.CraftLivingEntity; +import org.bukkit.craftbukkit.v1_20_R2.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_20_R2.event.CraftEventFactory; +import org.bukkit.craftbukkit.v1_20_R2.inventory.CraftItemStack; +import org.bukkit.entity.FishHook; +import org.bukkit.entity.Item; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.HashSet; +import java.util.Set; + +public class V1_20_R2 implements EnchantNMS { + + @Override + public void sendAttackPacket(@NotNull Player player, int id) { + CraftPlayer craftPlayer = (CraftPlayer) player; + ServerPlayer entity = craftPlayer.getHandle(); + ClientboundAnimatePacket packet = new ClientboundAnimatePacket(entity, id); + craftPlayer.getHandle().connection.send(packet); + } + + @Override + public void retrieveHook(@NotNull FishHook hook, @NotNull ItemStack item) { + CraftFishHook craftFishHook = (CraftFishHook) hook; + FishingHook handle = craftFishHook.getHandle(); + handle.retrieve(CraftItemStack.asNMSCopy(item)); + } + + @Override + @Nullable + public ItemStack getSpawnEgg(@NotNull LivingEntity entity) { + CraftLivingEntity craftLivingEntity = (CraftLivingEntity) entity; + net.minecraft.world.entity.LivingEntity livingEntity = craftLivingEntity.getHandle(); + + SpawnEggItem eggItem = SpawnEggItem.byId(livingEntity.getType()); + if (eggItem == null) return null; + + return CraftItemStack.asBukkitCopy(eggItem.getDefaultInstance()); + } + + @Override + @NotNull + public Set handleFlameWalker(@NotNull LivingEntity bukkitEntity, @NotNull Location location, int level) { + Entity entity = ((CraftLivingEntity) bukkitEntity).getHandle(); + BlockPos pos = new BlockPos(location.getBlockX(), location.getBlockY(), location.getBlockZ()); + ServerLevel world = ((CraftWorld) bukkitEntity.getWorld()).getHandle(); + + int radius = Math.min(16, 2 + level); + BlockState bStone = Blocks.MAGMA_BLOCK.defaultBlockState(); + BlockPos.MutableBlockPos posAbove = new BlockPos.MutableBlockPos(); + + Set blocks = new HashSet<>(); + for (BlockPos posNear : BlockPos.betweenClosed(pos.offset(-radius, -1, -radius), pos.offset(radius, -1, radius))) { + if (!posNear.closerThan(entity.blockPosition(), radius)) continue; + + posAbove.set(posNear.getX(), posNear.getY() + 1, posNear.getZ()); + + BlockState bLavaAbove = world.getBlockState(posAbove); + BlockState bLava = world.getBlockState(posNear); + + if (!bLavaAbove.isAir()) continue; + if (!bLava.getBlock().equals(Blocks.LAVA)) continue; + if (bLava.getValue(LiquidBlock.LEVEL) != 0) continue; + if (!bStone.canSurvive(world, posNear)) continue; + if (!world.isUnobstructed(bStone, posNear, CollisionContext.empty())) continue; + if (!CraftEventFactory.handleBlockFormEvent(world, posNear, bStone, entity)) continue; + //world.scheduleTick(posNear, Blocks.STONE, Rnd.get(60, 120)); + + Location bukkitLoc = new Location(world.getWorld(), posNear.getX(), posNear.getY(), posNear.getZ()); + blocks.add(bukkitLoc.getBlock()); + } + return blocks; + } + + @NotNull + public Item popResource(@NotNull Block block, @NotNull ItemStack item) { + Level world = ((CraftWorld)block.getWorld()).getHandle(); + BlockPos pos = ((CraftBlock)block).getPosition(); + net.minecraft.world.item.ItemStack itemstack = CraftItemStack.asNMSCopy(item); + + float yMod = EntityType.ITEM.getHeight() / 2.0F; + double x = (pos.getX() + 0.5F) + Mth.nextDouble(world.random, -0.25D, 0.25D); + double y = (pos.getY() + 0.5F) + Mth.nextDouble(world.random, -0.25D, 0.25D) - yMod; + double z = (pos.getZ() + 0.5F) + Mth.nextDouble(world.random, -0.25D, 0.25D); + + ItemEntity itemEntity = new ItemEntity(world, x, y, z, itemstack); + itemEntity.setDefaultPickUpDelay(); + return (Item) itemEntity.getBukkitEntity(); + } +} diff --git a/pom.xml b/pom.xml index 1c9ab8d..965af82 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ su.nightexpress.excellentenchants ExcellentEnchants pom - 3.5.7 + 3.5.8 Core NMS @@ -15,6 +15,7 @@ V1_18_R2 V1_19_R3 V1_20_R1 + V1_20_R2 @@ -28,7 +29,7 @@ su.nexmedia NexEngine - 2.2.11 + 2.2.12