This commit is contained in:
BuildTools 2023-09-28 18:45:22 +05:00
parent fe8108ca62
commit 1087e345a0
52 changed files with 328 additions and 187 deletions

8
.gitignore vendored
View File

@ -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
/V1_20_R1/pom.xml.versionsBackup
/V1_20_R2/target/
/V1_20_R2/pom.xml.versionsBackup

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>ExcellentEnchants</artifactId>
<groupId>su.nightexpress.excellentenchants</groupId>
<version>3.5.7</version>
<version>3.5.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -73,35 +73,35 @@
<version>2.11.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>su.nexmedia.playerblocktracker</groupId>
<artifactId>PlayerBlockTracker</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>su.nightexpress.excellentenchants</groupId>
<artifactId>NMS</artifactId>
<version>3.5.7</version>
<version>3.5.8</version>
</dependency>
<dependency>
<groupId>su.nightexpress.excellentenchants</groupId>
<artifactId>V1_17_R1</artifactId>
<version>3.5.7</version>
<version>3.5.8</version>
</dependency>
<dependency>
<groupId>su.nightexpress.excellentenchants</groupId>
<artifactId>V1_18_R2</artifactId>
<version>3.5.7</version>
<version>3.5.8</version>
</dependency>
<dependency>
<groupId>su.nightexpress.excellentenchants</groupId>
<artifactId>V1_19_R3</artifactId>
<version>3.5.7</version>
<version>3.5.8</version>
</dependency>
<dependency>
<groupId>su.nightexpress.excellentenchants</groupId>
<artifactId>V1_20_R1</artifactId>
<version>3.5.7</version>
<version>3.5.8</version>
</dependency>
<dependency>
<groupId>su.nightexpress.excellentenchants</groupId>
<artifactId>V1_20_R2</artifactId>
<version>3.5.8</version>
</dependency>
</dependencies>
@ -141,15 +141,8 @@
<artifactSet>
<includes>
<include>su.nightexpress.excellentenchants*</include>
<include>su.nexmedia.playerblocktracker:*</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>su.nexmedia.playerblocktracker.</pattern>
<shadedPattern>su.nightexpress.excellentenchants.playerblocktracker.</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>

View File

@ -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<ExcellentEnchants> {
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;
};
}

View File

@ -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<SimpleParticle> getTrailParticle() {
default Optional<UniParticle> getTrailParticle() {
return this.getArrowImplementation().getTrailParticle();
}

View File

@ -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.");

View File

@ -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;

View File

@ -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)) {

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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,

View File

@ -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,

View File

@ -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",

View File

@ -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;
}

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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

View File

@ -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;
}

View File

@ -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<SimpleParticle> getTrailParticle() {
public Optional<UniParticle> getTrailParticle() {
return trailParticle == null ? Optional.empty() : Optional.of(trailParticle);
}

View File

@ -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;

View File

@ -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;

View File

@ -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<Material, Material> 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;
}

View File

@ -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<Material, Map<Material, Double>> 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

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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) {

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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<ExcellentEnchants> {
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()) {

View File

@ -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<ExcellentEnchants> {
private static final Map<Projectile, Set<SimpleParticle>> TRAILS_MAP = new ConcurrentHashMap<>();
private static final Map<Projectile, Set<UniParticle>> 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<ExcellentEnchants> {
});
}
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);
}
}

View File

@ -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<ItemStack> drop;
public EnchantDropContainer(@NotNull BlockDropItemEvent parent) {
this.parent = parent;
this.drop = new ArrayList<>();
}
@NotNull
public BlockDropItemEvent getParent() {
return parent;
}
@NotNull
public List<ItemStack> getDrop() {
return drop;
}
}

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>ExcellentEnchants</artifactId>
<groupId>su.nightexpress.excellentenchants</groupId>
<version>3.5.7</version>
<version>3.5.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>ExcellentEnchants</artifactId>
<groupId>su.nightexpress.excellentenchants</groupId>
<version>3.5.7</version>
<version>3.5.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -26,7 +26,7 @@
<dependency>
<groupId>su.nightexpress.excellentenchants</groupId>
<artifactId>NMS</artifactId>
<version>3.5.7</version>
<version>3.5.8</version>
</dependency>
</dependencies>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>ExcellentEnchants</artifactId>
<groupId>su.nightexpress.excellentenchants</groupId>
<version>3.5.7</version>
<version>3.5.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -26,7 +26,7 @@
<dependency>
<groupId>su.nightexpress.excellentenchants</groupId>
<artifactId>NMS</artifactId>
<version>3.5.7</version>
<version>3.5.8</version>
</dependency>
</dependencies>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>ExcellentEnchants</artifactId>
<groupId>su.nightexpress.excellentenchants</groupId>
<version>3.5.7</version>
<version>3.5.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -26,7 +26,7 @@
<dependency>
<groupId>su.nightexpress.excellentenchants</groupId>
<artifactId>NMS</artifactId>
<version>3.5.7</version>
<version>3.5.8</version>
</dependency>
</dependencies>

View File

@ -5,15 +5,15 @@
<parent>
<artifactId>ExcellentEnchants</artifactId>
<groupId>su.nightexpress.excellentenchants</groupId>
<version>3.5.7</version>
<version>3.5.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>V1_20_R1</artifactId>
<properties>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>
<dependencies>
@ -26,7 +26,7 @@
<dependency>
<groupId>su.nightexpress.excellentenchants</groupId>
<artifactId>NMS</artifactId>
<version>3.5.7</version>
<version>3.5.8</version>
</dependency>
</dependencies>

71
V1_20_R2/pom.xml Normal file
View File

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ExcellentEnchants</artifactId>
<groupId>su.nightexpress.excellentenchants</groupId>
<version>3.5.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>V1_20_R2</artifactId>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.20.2-R0.1-SNAPSHOT</version>
<classifier>remapped-mojang</classifier>
</dependency>
<dependency>
<groupId>su.nightexpress.excellentenchants</groupId>
<artifactId>NMS</artifactId>
<version>3.5.8</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>net.md-5</groupId>
<artifactId>specialsource-maven-plugin</artifactId>
<version>1.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-obf</id>
<configuration>
<srgIn>org.spigotmc:minecraft-server:1.20.2-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
<reverse>true</reverse>
<remappedDependencies>org.spigotmc:spigot:1.20.2-R0.1-SNAPSHOT:jar:remapped-mojang</remappedDependencies>
<remappedArtifactAttached>true</remappedArtifactAttached>
<remappedClassifierName>remapped-obf</remappedClassifierName>
</configuration>
</execution>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-spigot</id>
<configuration>
<inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
<srgIn>org.spigotmc:minecraft-server:1.20.2-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
<remappedDependencies>org.spigotmc:spigot:1.20.2-R0.1-SNAPSHOT:jar:remapped-obf</remappedDependencies>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -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<Block> 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<Block> 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();
}
}

View File

@ -7,7 +7,7 @@
<groupId>su.nightexpress.excellentenchants</groupId>
<artifactId>ExcellentEnchants</artifactId>
<packaging>pom</packaging>
<version>3.5.7</version>
<version>3.5.8</version>
<modules>
<module>Core</module>
<module>NMS</module>
@ -15,6 +15,7 @@
<module>V1_18_R2</module>
<module>V1_19_R3</module>
<module>V1_20_R1</module>
<module>V1_20_R2</module>
</modules>
<properties>
@ -28,7 +29,7 @@
<dependency>
<groupId>su.nexmedia</groupId>
<artifactId>NexEngine</artifactId>
<version>2.2.11</version>
<version>2.2.12</version>
</dependency>
</dependencies>