From 6c47f38cb7350c50c0771d6b62596c9388364d51 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Mon, 28 Dec 2020 17:27:48 +0000 Subject: [PATCH] Javadoc (1/?) --- config/checkstyle/checkstyle.xml | 8 ++-- config/checkstyle/suppression.xml | 10 +++++ .../command/commands/CommandEcodebug.java | 5 +++ .../command/commands/CommandEcoreload.java | 5 +++ .../command/commands/CommandEnchantinfo.java | 5 +++ .../display/options/DescriptionOptions.java | 32 ++++++++------ .../ecoenchants/enchantments/EcoEnchant.java | 2 +- .../ecoenchants/artifact/AshArtifact.java | 3 +- .../ecoenchants/artifact/CloudsArtifact.java | 4 +- .../ecoenchants/artifact/CrimsonArtifact.java | 3 +- .../ecoenchants/artifact/DamageArtifact.java | 4 +- .../ecoenchants/artifact/DragonArtifact.java | 4 +- .../ecoenchants/artifact/DustArtifact.java | 4 +- .../ecoenchants/artifact/EmeraldArtifact.java | 4 +- .../artifact/EnchantmentArtifact.java | 4 +- .../ecoenchants/artifact/EndArtifact.java | 4 +- .../ecoenchants/artifact/FireArtifact.java | 4 +- .../ecoenchants/artifact/HeartArtifact.java | 4 +- .../ecoenchants/artifact/HoneyArtifact.java | 4 +- .../ecoenchants/artifact/InkArtifact.java | 4 +- .../ecoenchants/artifact/LavaArtifact.java | 4 +- .../ecoenchants/artifact/LimeArtifact.java | 3 +- .../ecoenchants/artifact/MagicArtifact.java | 4 +- .../ecoenchants/artifact/MagmaArtifact.java | 4 +- .../ecoenchants/artifact/MusicArtifact.java | 4 +- .../ecoenchants/artifact/NetherArtifact.java | 4 +- .../artifact/RedstoneArtifact.java | 4 +- .../ecoenchants/artifact/SmokeArtifact.java | 4 +- .../ecoenchants/artifact/SnowArtifact.java | 4 +- .../ecoenchants/artifact/SoulArtifact.java | 3 +- .../artifact/SoulFireArtifact.java | 3 +- .../ecoenchants/artifact/SparkleArtifact.java | 4 +- .../ecoenchants/artifact/TearArtifact.java | 3 +- .../ecoenchants/artifact/TotemArtifact.java | 4 +- .../ecoenchants/artifact/WarpedArtifact.java | 3 +- .../ecoenchants/artifact/WaterArtifact.java | 4 +- .../ecoenchants/artifact/WitchArtifact.java | 4 +- .../ecoenchants/artifact/ZapArtifact.java | 4 +- .../ecoenchants/normal/Abattoir.java | 1 + .../ecoenchants/normal/Aerial.java | 1 - .../ecoenchants/normal/BlastMining.java | 1 - .../ecoenchants/normal/Cleave.java | 1 - .../ecoenchants/normal/Drill.java | 1 - .../ecoenchants/normal/Lumberjack.java | 1 - .../ecoenchants/normal/Marking.java | 1 - .../ecoenchants/normal/Shockwave.java | 1 - .../enchantments/ecoenchants/normal/Vein.java | 1 - .../ecoenchants/normal/Weakening.java | 1 - .../ecoenchants/special/Carve.java | 1 - .../ecoenchants/spell/Dynamite.java | 1 - .../enchantments/itemtypes/Artifact.java | 43 +++++++++++++++++++ .../support/merging/anvil/AnvilListeners.java | 17 ++++++++ .../support/merging/anvil/AnvilMerge.java | 18 ++++---- .../obtaining/EnchantingListeners.java | 1 - 54 files changed, 206 insertions(+), 69 deletions(-) create mode 100644 config/checkstyle/suppression.xml diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml index b07c9611..1e777eee 100644 --- a/config/checkstyle/checkstyle.xml +++ b/config/checkstyle/checkstyle.xml @@ -32,6 +32,10 @@ --> + + + + - @@ -166,7 +168,7 @@ - + diff --git a/config/checkstyle/suppression.xml b/config/checkstyle/suppression.xml new file mode 100644 index 00000000..a6f64c54 --- /dev/null +++ b/config/checkstyle/suppression.xml @@ -0,0 +1,10 @@ + + + + + + + + \ No newline at end of file diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/command/commands/CommandEcodebug.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/command/commands/CommandEcodebug.java index 715c801d..9123f85e 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/command/commands/CommandEcodebug.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/command/commands/CommandEcodebug.java @@ -26,6 +26,11 @@ import java.util.stream.Collectors; @SuppressWarnings("unchecked") public class CommandEcodebug extends AbstractCommand { + /** + * Instantiate a new /ecodebug command handler. + * + * @param plugin The plugin for the commands to listen for. + */ public CommandEcodebug(@NotNull final AbstractEcoPlugin plugin) { super(plugin, "ecodebug", "ecoenchants.ecodebug", false); } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/command/commands/CommandEcoreload.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/command/commands/CommandEcoreload.java index dcb51437..05aa99e2 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/command/commands/CommandEcoreload.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/command/commands/CommandEcoreload.java @@ -9,6 +9,11 @@ import org.jetbrains.annotations.NotNull; import java.util.List; public class CommandEcoreload extends AbstractCommand { + /** + * Instantiate a new /ecoreload command handler. + * + * @param plugin The plugin for the commands to listen for. + */ public CommandEcoreload(@NotNull final AbstractEcoPlugin plugin) { super(plugin, "ecoreload", "ecoenchants.reload", false); } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/command/commands/CommandEnchantinfo.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/command/commands/CommandEnchantinfo.java index 75977f13..f8075960 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/command/commands/CommandEnchantinfo.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/command/commands/CommandEnchantinfo.java @@ -21,6 +21,11 @@ import java.util.List; import java.util.Set; public class CommandEnchantinfo extends AbstractCommand { + /** + * Instantiate a new /enchantinfo command handler. + * + * @param plugin The plugin for the commands to listen for. + */ public CommandEnchantinfo(@NotNull final AbstractEcoPlugin plugin) { super(plugin, "enchantinfo", "ecoenchants.enchantinfo", false); } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/display/options/DescriptionOptions.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/display/options/DescriptionOptions.java index 2146df5b..f7795411 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/display/options/DescriptionOptions.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/display/options/DescriptionOptions.java @@ -5,30 +5,34 @@ import com.willfp.eco.util.config.Configs; import com.willfp.ecoenchants.display.options.interfaces.ThresholdedOption; import com.willfp.ecoenchants.display.options.interfaces.ToggleableOption; import com.willfp.ecoenchants.display.options.interfaces.UpdateableOption; +import lombok.Getter; public class DescriptionOptions implements ThresholdedOption, ToggleableOption, UpdateableOption { + /** + * The threshold below which to describe enchantments. + */ + @Getter private int threshold; + + /** + * If the options are enabled. + */ + @Getter private boolean enabled; + + /** + * The description lines color. + */ + @Getter private String color; - @Override - public int getThreshold() { - return threshold; - } - - @Override - public boolean isEnabled() { - return enabled; - } - + /** + * Update the options. + */ @Override public void update() { threshold = Configs.CONFIG.getInt("lore.describe.before-lines"); enabled = Configs.CONFIG.getBool("lore.describe.enabled"); color = StringUtils.translate(Configs.LANG.getString("description-color")); } - - public String getColor() { - return color; - } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/EcoEnchant.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/EcoEnchant.java index 5ccf3575..298ef60d 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/EcoEnchant.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/EcoEnchant.java @@ -64,7 +64,7 @@ public abstract class EcoEnchant extends Enchantment implements Listener, Regist private boolean enabled; /** - * Create a new EcoEnchant + * Create a new EcoEnchant. * * @param key The key name of the enchantment * @param type The type of the enchantment diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/AshArtifact.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/AshArtifact.java index 10cdaabd..cd4f37cb 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/AshArtifact.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/AshArtifact.java @@ -3,6 +3,7 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; import com.willfp.eco.util.optional.Prerequisite; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import org.bukkit.Particle; +import org.jetbrains.annotations.NotNull; public class AshArtifact extends Artifact { public AshArtifact() { @@ -13,7 +14,7 @@ public class AshArtifact extends Artifact { } @Override - public Particle getParticle() { + public @NotNull Particle getParticle() { return Particle.WHITE_ASH; } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/CloudsArtifact.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/CloudsArtifact.java index 25df5201..1811d272 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/CloudsArtifact.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/CloudsArtifact.java @@ -3,6 +3,8 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import org.bukkit.Color; import org.bukkit.Particle; +import org.jetbrains.annotations.NotNull; + public class CloudsArtifact extends Artifact { public CloudsArtifact() { super( @@ -11,7 +13,7 @@ public class CloudsArtifact extends Artifact { } @Override - public Particle getParticle() { + public @NotNull Particle getParticle() { return Particle.REDSTONE; } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/CrimsonArtifact.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/CrimsonArtifact.java index 63acae3e..e954a8e2 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/CrimsonArtifact.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/CrimsonArtifact.java @@ -3,6 +3,7 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; import com.willfp.eco.util.optional.Prerequisite; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import org.bukkit.Particle; +import org.jetbrains.annotations.NotNull; public class CrimsonArtifact extends Artifact { public CrimsonArtifact() { @@ -13,7 +14,7 @@ public class CrimsonArtifact extends Artifact { } @Override - public Particle getParticle() { + public @NotNull Particle getParticle() { return Particle.CRIMSON_SPORE; } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/DamageArtifact.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/DamageArtifact.java index 5f88fa6c..dbc80da2 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/DamageArtifact.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/DamageArtifact.java @@ -2,6 +2,8 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import org.bukkit.Particle; +import org.jetbrains.annotations.NotNull; + public class DamageArtifact extends Artifact { public DamageArtifact() { super( @@ -10,7 +12,7 @@ public class DamageArtifact extends Artifact { } @Override - public Particle getParticle() { + public @NotNull Particle getParticle() { return Particle.DAMAGE_INDICATOR; } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/DragonArtifact.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/DragonArtifact.java index e5f2d42f..fa9e0cdd 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/DragonArtifact.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/DragonArtifact.java @@ -2,6 +2,8 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import org.bukkit.Particle; +import org.jetbrains.annotations.NotNull; + public class DragonArtifact extends Artifact { public DragonArtifact() { super( @@ -10,7 +12,7 @@ public class DragonArtifact extends Artifact { } @Override - public Particle getParticle() { + public @NotNull Particle getParticle() { return Particle.DRAGON_BREATH; } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/DustArtifact.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/DustArtifact.java index bf854bea..ab491a79 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/DustArtifact.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/DustArtifact.java @@ -2,6 +2,8 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import org.bukkit.Particle; +import org.jetbrains.annotations.NotNull; + public class DustArtifact extends Artifact { public DustArtifact() { super( @@ -10,7 +12,7 @@ public class DustArtifact extends Artifact { } @Override - public Particle getParticle() { + public @NotNull Particle getParticle() { return Particle.CRIT; } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/EmeraldArtifact.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/EmeraldArtifact.java index 07545ce8..15299ee9 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/EmeraldArtifact.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/EmeraldArtifact.java @@ -2,6 +2,8 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import org.bukkit.Particle; +import org.jetbrains.annotations.NotNull; + public class EmeraldArtifact extends Artifact { public EmeraldArtifact() { super( @@ -10,7 +12,7 @@ public class EmeraldArtifact extends Artifact { } @Override - public Particle getParticle() { + public @NotNull Particle getParticle() { return Particle.COMPOSTER; } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/EnchantmentArtifact.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/EnchantmentArtifact.java index 72c63b4f..57695a44 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/EnchantmentArtifact.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/EnchantmentArtifact.java @@ -2,6 +2,8 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import org.bukkit.Particle; +import org.jetbrains.annotations.NotNull; + public class EnchantmentArtifact extends Artifact { public EnchantmentArtifact() { super( @@ -10,7 +12,7 @@ public class EnchantmentArtifact extends Artifact { } @Override - public Particle getParticle() { + public @NotNull Particle getParticle() { return Particle.ENCHANTMENT_TABLE; } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/EndArtifact.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/EndArtifact.java index aa13f46e..7f279b4c 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/EndArtifact.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/EndArtifact.java @@ -2,6 +2,8 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import org.bukkit.Particle; +import org.jetbrains.annotations.NotNull; + public class EndArtifact extends Artifact { public EndArtifact() { super( @@ -10,7 +12,7 @@ public class EndArtifact extends Artifact { } @Override - public Particle getParticle() { + public @NotNull Particle getParticle() { return Particle.END_ROD; } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/FireArtifact.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/FireArtifact.java index c3138f03..13fb98c5 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/FireArtifact.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/FireArtifact.java @@ -2,6 +2,8 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import org.bukkit.Particle; +import org.jetbrains.annotations.NotNull; + public class FireArtifact extends Artifact { public FireArtifact() { super( @@ -10,7 +12,7 @@ public class FireArtifact extends Artifact { } @Override - public Particle getParticle() { + public @NotNull Particle getParticle() { return Particle.FLAME; } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/HeartArtifact.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/HeartArtifact.java index fe60987e..105575c9 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/HeartArtifact.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/HeartArtifact.java @@ -2,6 +2,8 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import org.bukkit.Particle; +import org.jetbrains.annotations.NotNull; + public class HeartArtifact extends Artifact { public HeartArtifact() { super( @@ -10,7 +12,7 @@ public class HeartArtifact extends Artifact { } @Override - public Particle getParticle() { + public @NotNull Particle getParticle() { return Particle.HEART; } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/HoneyArtifact.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/HoneyArtifact.java index 2a399264..227d2e3b 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/HoneyArtifact.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/HoneyArtifact.java @@ -2,6 +2,8 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import org.bukkit.Particle; +import org.jetbrains.annotations.NotNull; + public class HoneyArtifact extends Artifact { public HoneyArtifact() { super( @@ -10,7 +12,7 @@ public class HoneyArtifact extends Artifact { } @Override - public Particle getParticle() { + public @NotNull Particle getParticle() { return Particle.FALLING_HONEY; } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/InkArtifact.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/InkArtifact.java index 779cdefc..6fea17dc 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/InkArtifact.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/InkArtifact.java @@ -2,6 +2,8 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import org.bukkit.Particle; +import org.jetbrains.annotations.NotNull; + public class InkArtifact extends Artifact { public InkArtifact() { super( @@ -10,7 +12,7 @@ public class InkArtifact extends Artifact { } @Override - public Particle getParticle() { + public @NotNull Particle getParticle() { return Particle.SQUID_INK; } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/LavaArtifact.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/LavaArtifact.java index ebae8bcd..89bb94c6 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/LavaArtifact.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/LavaArtifact.java @@ -2,6 +2,8 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import org.bukkit.Particle; +import org.jetbrains.annotations.NotNull; + public class LavaArtifact extends Artifact { public LavaArtifact() { super( @@ -10,7 +12,7 @@ public class LavaArtifact extends Artifact { } @Override - public Particle getParticle() { + public @NotNull Particle getParticle() { return Particle.DRIP_LAVA; } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/LimeArtifact.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/LimeArtifact.java index 9bd0fcd3..452f9819 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/LimeArtifact.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/LimeArtifact.java @@ -3,6 +3,7 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import org.bukkit.Color; import org.bukkit.Particle; +import org.jetbrains.annotations.NotNull; public class LimeArtifact extends Artifact { public LimeArtifact() { @@ -12,7 +13,7 @@ public class LimeArtifact extends Artifact { } @Override - public Particle getParticle() { + public @NotNull Particle getParticle() { return Particle.REDSTONE; } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/MagicArtifact.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/MagicArtifact.java index fda78187..0de89a98 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/MagicArtifact.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/MagicArtifact.java @@ -2,6 +2,8 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import org.bukkit.Particle; +import org.jetbrains.annotations.NotNull; + public class MagicArtifact extends Artifact { public MagicArtifact() { super( @@ -10,7 +12,7 @@ public class MagicArtifact extends Artifact { } @Override - public Particle getParticle() { + public @NotNull Particle getParticle() { return Particle.CRIT_MAGIC; } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/MagmaArtifact.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/MagmaArtifact.java index 3a31cd7e..520c1cba 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/MagmaArtifact.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/MagmaArtifact.java @@ -2,6 +2,8 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import org.bukkit.Particle; +import org.jetbrains.annotations.NotNull; + public class MagmaArtifact extends Artifact { public MagmaArtifact() { super( @@ -10,7 +12,7 @@ public class MagmaArtifact extends Artifact { } @Override - public Particle getParticle() { + public @NotNull Particle getParticle() { return Particle.LAVA; } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/MusicArtifact.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/MusicArtifact.java index f48a974f..4e1984ca 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/MusicArtifact.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/MusicArtifact.java @@ -2,6 +2,8 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import org.bukkit.Particle; +import org.jetbrains.annotations.NotNull; + public class MusicArtifact extends Artifact { public MusicArtifact() { super( @@ -10,7 +12,7 @@ public class MusicArtifact extends Artifact { } @Override - public Particle getParticle() { + public @NotNull Particle getParticle() { return Particle.NOTE; } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/NetherArtifact.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/NetherArtifact.java index bbaf0183..b7e6a836 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/NetherArtifact.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/NetherArtifact.java @@ -2,6 +2,8 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import org.bukkit.Particle; +import org.jetbrains.annotations.NotNull; + public class NetherArtifact extends Artifact { public NetherArtifact() { super( @@ -10,7 +12,7 @@ public class NetherArtifact extends Artifact { } @Override - public Particle getParticle() { + public @NotNull Particle getParticle() { return Particle.PORTAL; } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/RedstoneArtifact.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/RedstoneArtifact.java index 2e8b1661..75f143b4 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/RedstoneArtifact.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/RedstoneArtifact.java @@ -3,6 +3,8 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import org.bukkit.Color; import org.bukkit.Particle; +import org.jetbrains.annotations.NotNull; + public class RedstoneArtifact extends Artifact { public RedstoneArtifact() { super( @@ -11,7 +13,7 @@ public class RedstoneArtifact extends Artifact { } @Override - public Particle getParticle() { + public @NotNull Particle getParticle() { return Particle.REDSTONE; } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/SmokeArtifact.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/SmokeArtifact.java index 5daffb07..1bb67824 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/SmokeArtifact.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/SmokeArtifact.java @@ -2,6 +2,8 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import org.bukkit.Particle; +import org.jetbrains.annotations.NotNull; + public class SmokeArtifact extends Artifact { public SmokeArtifact() { super( @@ -10,7 +12,7 @@ public class SmokeArtifact extends Artifact { } @Override - public Particle getParticle() { + public @NotNull Particle getParticle() { return Particle.CAMPFIRE_COSY_SMOKE; } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/SnowArtifact.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/SnowArtifact.java index 5272b7b8..009f400f 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/SnowArtifact.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/SnowArtifact.java @@ -2,6 +2,8 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import org.bukkit.Particle; +import org.jetbrains.annotations.NotNull; + public class SnowArtifact extends Artifact { public SnowArtifact() { super( @@ -10,7 +12,7 @@ public class SnowArtifact extends Artifact { } @Override - public Particle getParticle() { + public @NotNull Particle getParticle() { return Particle.SNOWBALL; } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/SoulArtifact.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/SoulArtifact.java index 0db4975b..c0739d5e 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/SoulArtifact.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/SoulArtifact.java @@ -3,6 +3,7 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; import com.willfp.eco.util.optional.Prerequisite; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import org.bukkit.Particle; +import org.jetbrains.annotations.NotNull; public class SoulArtifact extends Artifact { public SoulArtifact() { @@ -13,7 +14,7 @@ public class SoulArtifact extends Artifact { } @Override - public Particle getParticle() { + public @NotNull Particle getParticle() { return Particle.SOUL; } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/SoulFireArtifact.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/SoulFireArtifact.java index dc6a5af2..25d92765 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/SoulFireArtifact.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/SoulFireArtifact.java @@ -3,6 +3,7 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; import com.willfp.eco.util.optional.Prerequisite; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import org.bukkit.Particle; +import org.jetbrains.annotations.NotNull; public class SoulFireArtifact extends Artifact { public SoulFireArtifact() { @@ -13,7 +14,7 @@ public class SoulFireArtifact extends Artifact { } @Override - public Particle getParticle() { + public @NotNull Particle getParticle() { return Particle.SOUL_FIRE_FLAME; } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/SparkleArtifact.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/SparkleArtifact.java index faf8d825..917f04da 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/SparkleArtifact.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/SparkleArtifact.java @@ -2,6 +2,8 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import org.bukkit.Particle; +import org.jetbrains.annotations.NotNull; + public class SparkleArtifact extends Artifact { public SparkleArtifact() { super( @@ -10,7 +12,7 @@ public class SparkleArtifact extends Artifact { } @Override - public Particle getParticle() { + public @NotNull Particle getParticle() { return Particle.FIREWORKS_SPARK; } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/TearArtifact.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/TearArtifact.java index a8e63abe..d43fed9e 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/TearArtifact.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/TearArtifact.java @@ -3,6 +3,7 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; import com.willfp.eco.util.optional.Prerequisite; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import org.bukkit.Particle; +import org.jetbrains.annotations.NotNull; public class TearArtifact extends Artifact { public TearArtifact() { @@ -13,7 +14,7 @@ public class TearArtifact extends Artifact { } @Override - public Particle getParticle() { + public @NotNull Particle getParticle() { return Particle.DRIPPING_OBSIDIAN_TEAR; } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/TotemArtifact.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/TotemArtifact.java index 7d70809d..f0a656b6 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/TotemArtifact.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/TotemArtifact.java @@ -2,6 +2,8 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import org.bukkit.Particle; +import org.jetbrains.annotations.NotNull; + public class TotemArtifact extends Artifact { public TotemArtifact() { super( @@ -10,7 +12,7 @@ public class TotemArtifact extends Artifact { } @Override - public Particle getParticle() { + public @NotNull Particle getParticle() { return Particle.TOTEM; } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/WarpedArtifact.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/WarpedArtifact.java index ab6367c5..8f0f369f 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/WarpedArtifact.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/WarpedArtifact.java @@ -3,6 +3,7 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; import com.willfp.eco.util.optional.Prerequisite; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import org.bukkit.Particle; +import org.jetbrains.annotations.NotNull; public class WarpedArtifact extends Artifact { public WarpedArtifact() { @@ -13,7 +14,7 @@ public class WarpedArtifact extends Artifact { } @Override - public Particle getParticle() { + public @NotNull Particle getParticle() { return Particle.WARPED_SPORE; } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/WaterArtifact.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/WaterArtifact.java index a82dce6b..770e34a0 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/WaterArtifact.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/WaterArtifact.java @@ -2,6 +2,8 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import org.bukkit.Particle; +import org.jetbrains.annotations.NotNull; + public class WaterArtifact extends Artifact { public WaterArtifact() { super( @@ -10,7 +12,7 @@ public class WaterArtifact extends Artifact { } @Override - public Particle getParticle() { + public @NotNull Particle getParticle() { return Particle.DRIP_WATER; } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/WitchArtifact.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/WitchArtifact.java index 11058963..6095fae5 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/WitchArtifact.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/WitchArtifact.java @@ -2,6 +2,8 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import org.bukkit.Particle; +import org.jetbrains.annotations.NotNull; + public class WitchArtifact extends Artifact { public WitchArtifact() { super( @@ -10,7 +12,7 @@ public class WitchArtifact extends Artifact { } @Override - public Particle getParticle() { + public @NotNull Particle getParticle() { return Particle.SPELL_WITCH; } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/ZapArtifact.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/ZapArtifact.java index ee4a7112..81d8654e 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/ZapArtifact.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/artifact/ZapArtifact.java @@ -3,6 +3,8 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.artifact; import com.willfp.ecoenchants.enchantments.itemtypes.Artifact; import org.bukkit.Color; import org.bukkit.Particle; +import org.jetbrains.annotations.NotNull; + public class ZapArtifact extends Artifact { public ZapArtifact() { super( @@ -11,7 +13,7 @@ public class ZapArtifact extends Artifact { } @Override - public Particle getParticle() { + public @NotNull Particle getParticle() { return Particle.REDSTONE; } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Abattoir.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Abattoir.java index d5cdcef2..0a75f0f7 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Abattoir.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Abattoir.java @@ -15,6 +15,7 @@ public class Abattoir extends EcoEnchant { "abattoir", EnchantmentType.NORMAL ); } + @Override public void onTridentDamage(@NotNull final LivingEntity attacker, @NotNull final LivingEntity victim, diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Aerial.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Aerial.java index ac3a85de..503a7855 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Aerial.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Aerial.java @@ -7,7 +7,6 @@ import org.bukkit.entity.Arrow; import org.bukkit.entity.LivingEntity; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityShootBowEvent; -import org.bukkit.metadata.FixedMetadataValue; import org.jetbrains.annotations.NotNull; public class Aerial extends EcoEnchant { diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/BlastMining.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/BlastMining.java index e5db54e9..a4675fa1 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/BlastMining.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/BlastMining.java @@ -11,7 +11,6 @@ import org.bukkit.Particle; import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.event.block.BlockBreakEvent; -import org.bukkit.metadata.FixedMetadataValue; import org.jetbrains.annotations.NotNull; import java.util.HashSet; diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Cleave.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Cleave.java index 9cf24178..0065a4f6 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Cleave.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Cleave.java @@ -8,7 +8,6 @@ import com.willfp.ecoenchants.enchantments.meta.EnchantmentType; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.event.entity.EntityDamageByEntityEvent; -import org.bukkit.metadata.FixedMetadataValue; import org.jetbrains.annotations.NotNull; public class Cleave extends EcoEnchant { diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Drill.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Drill.java index 464e5b0c..3120a21e 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Drill.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Drill.java @@ -11,7 +11,6 @@ import com.willfp.ecoenchants.enchantments.meta.EnchantmentType; import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.event.block.BlockBreakEvent; -import org.bukkit.metadata.FixedMetadataValue; import org.bukkit.util.Vector; import org.jetbrains.annotations.NotNull; diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Lumberjack.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Lumberjack.java index 44edddaa..586771a0 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Lumberjack.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Lumberjack.java @@ -12,7 +12,6 @@ import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.event.block.BlockBreakEvent; -import org.bukkit.metadata.FixedMetadataValue; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Marking.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Marking.java index 7fe8a448..b56d0f41 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Marking.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Marking.java @@ -8,7 +8,6 @@ import org.bukkit.entity.LivingEntity; import org.bukkit.event.EventHandler; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDamageEvent; -import org.bukkit.metadata.FixedMetadataValue; import org.jetbrains.annotations.NotNull; public class Marking extends EcoEnchant { diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Shockwave.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Shockwave.java index 05c3f449..2d1ced92 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Shockwave.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Shockwave.java @@ -13,7 +13,6 @@ import org.bukkit.entity.Trident; import org.bukkit.event.EventHandler; import org.bukkit.event.entity.ProjectileLaunchEvent; import org.bukkit.inventory.ItemStack; -import org.bukkit.metadata.FixedMetadataValue; import org.jetbrains.annotations.NotNull; public class Shockwave extends EcoEnchant { diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Vein.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Vein.java index b738fff2..1f75f0a4 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Vein.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Vein.java @@ -12,7 +12,6 @@ import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.event.block.BlockBreakEvent; -import org.bukkit.metadata.FixedMetadataValue; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Weakening.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Weakening.java index a19bc081..99e44249 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Weakening.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Weakening.java @@ -7,7 +7,6 @@ import org.bukkit.entity.LivingEntity; import org.bukkit.event.EventHandler; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDamageEvent; -import org.bukkit.metadata.FixedMetadataValue; import org.jetbrains.annotations.NotNull; public class Weakening extends EcoEnchant { diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Carve.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Carve.java index 2a3243b9..b2e9378f 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Carve.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Carve.java @@ -8,7 +8,6 @@ import com.willfp.ecoenchants.enchantments.meta.EnchantmentType; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.event.entity.EntityDamageByEntityEvent; -import org.bukkit.metadata.FixedMetadataValue; import org.jetbrains.annotations.NotNull; public class Carve extends EcoEnchant { diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/spell/Dynamite.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/spell/Dynamite.java index 901eec55..22774042 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/spell/Dynamite.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/spell/Dynamite.java @@ -11,7 +11,6 @@ import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.event.block.Action; import org.bukkit.event.player.PlayerInteractEvent; -import org.bukkit.metadata.FixedMetadataValue; import org.jetbrains.annotations.NotNull; import java.util.HashSet; diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/itemtypes/Artifact.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/itemtypes/Artifact.java index 0ce5d711..f4c9fbfe 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/itemtypes/Artifact.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/itemtypes/Artifact.java @@ -25,13 +25,24 @@ import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.util.Vector; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * Wrapper for Artifact enchantments * in order to reduce copying existing code between artifacts. */ public abstract class Artifact extends EcoEnchant { + /** + * The artifact particle. + */ private Particle particle; + + /** + * The extra particle dust options. + *

+ * Used for redstone particles. + */ + @Nullable private Particle.DustOptions extra; protected Artifact(@NotNull final String key, @@ -47,12 +58,29 @@ public abstract class Artifact extends EcoEnchant { this.extra = this.getDustOptions(); } + /** + * Get the artifact particle. + * + * @return The artifact particle. + */ + @NotNull public abstract Particle getParticle(); + /** + * The extra particle dust options. + * + * @return The dust options. + */ + @Nullable public Particle.DustOptions getDustOptions() { return null; } + /** + * Called on block break. + * + * @param event The event to listen for. + */ @EventHandler public void onBreak(@NotNull final BlockBreakEvent event) { Player player = event.getPlayer(); @@ -70,6 +98,11 @@ public abstract class Artifact extends EcoEnchant { block.getWorld().spawnParticle(particle, block.getLocation().add(0.5, 0.5, 0.5), amount, 0.4, 0.4, 0.4, 0, extra, false); } + /** + * Called on player fly while wearing an elytra. + * + * @param event The event to listen for. + */ @EventHandler public void onElytra(@NotNull final PlayerMoveEvent event) { Player player = event.getPlayer(); @@ -96,6 +129,11 @@ public abstract class Artifact extends EcoEnchant { player.getWorld().spawnParticle(particle, location2, 1, 0, 0, 0, 0, extra, true); } + /** + * Called when a player hits an entity. + * + * @param event The event to listen for. + */ @EventHandler public void onHit(@NotNull final EntityDamageByEntityEvent event) { if (!(event.getDamager() instanceof Player)) { @@ -136,6 +174,11 @@ public abstract class Artifact extends EcoEnchant { }).runTaskTimer(0, 1); } + /** + * Called on projectile launch. + * + * @param event The event to listen for. + */ @EventHandler public void onShoot(@NotNull final ProjectileLaunchEvent event) { if (!(event.getEntity() instanceof AbstractArrow)) { diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/support/merging/anvil/AnvilListeners.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/support/merging/anvil/AnvilListeners.java index 28d91526..9d80fadf 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/support/merging/anvil/AnvilListeners.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/support/merging/anvil/AnvilListeners.java @@ -23,13 +23,30 @@ import java.util.Objects; import java.util.UUID; public class AnvilListeners extends PluginDependent implements Listener { + /** + * Map to prevent incrementing cost several times as inventory events are fired 3 times. + */ private static final HashMap ANTI_REPEAT = new HashMap<>(); + + /** + * Class for AnvilGUI wrappers to ignore them. + */ private static final String ANVIL_GUI_CLASS = "net.wesjd.anvilgui.version.Wrapper" + ProxyConstants.NMS_VERSION.substring(1) + "$AnvilContainer"; + /** + * Instantiate anvil listeners and link them to a specific plugin. + * + * @param plugin The plugin to link to. + */ public AnvilListeners(@NotNull final AbstractEcoPlugin plugin) { super(plugin); } + /** + * Called when items are placed into an anvil. + * + * @param event The event to listen to. + */ @EventHandler(priority = EventPriority.HIGHEST) public void onAnvilPrepare(@NotNull final PrepareAnvilEvent event) { ItemStack left = event.getInventory().getItem(0); diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/support/merging/anvil/AnvilMerge.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/support/merging/anvil/AnvilMerge.java index a775759f..fbd65b82 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/support/merging/anvil/AnvilMerge.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/support/merging/anvil/AnvilMerge.java @@ -23,17 +23,19 @@ import java.util.concurrent.atomic.AtomicInteger; @UtilityClass public class AnvilMerge { + /** + * Config key for allowing unsafe levels. + */ private static final String ALLOW_UNSAFE_KEY = "anvil.allow-unsafe-levels"; /** - * Merge items in anvil - * - * @param left The {@link ItemStack} on the left of the anvil - * @param right The {@link ItemStack} in the middle of the anvil - * @param old The previous {@link ItemStack} result - * @param name The anvil display name - * @param player The player merging (for permissions) + * Merge items in anvil. * + * @param left The {@link ItemStack} on the left of the anvil. + * @param right The {@link ItemStack} in the middle of the anvil. + * @param old The previous {@link ItemStack} result. + * @param name The anvil display name. + * @param player The player merging (for permissions). * @return The result, stored as a {@link Pair} of {@link ItemStack} and {@link Integer}. */ public Pair doMerge(@Nullable final ItemStack left, @@ -127,7 +129,7 @@ public class AnvilMerge { && (rightLevel > enchantment.getMaxLevel() && Configs.CONFIG.getBool("anvil.allow-combining-unsafe")) || ((rightLevel + 1) <= enchantment.getMaxLevel() || Configs.CONFIG.getBool(ALLOW_UNSAFE_KEY))) { - level++; + level++; } rightEnchants.remove(enchantment); } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/support/obtaining/EnchantingListeners.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/support/obtaining/EnchantingListeners.java index b309416c..a445dd0f 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/support/obtaining/EnchantingListeners.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/support/obtaining/EnchantingListeners.java @@ -22,7 +22,6 @@ import org.bukkit.inventory.meta.EnchantmentStorageMeta; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.Map;