diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml index 70e0d1b1..b07c9611 100644 --- a/config/checkstyle/checkstyle.xml +++ b/config/checkstyle/checkstyle.xml @@ -116,7 +116,7 @@ - + diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/display/EnchantmentCache.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/display/EnchantmentCache.java index a833f515..e7173f99 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/display/EnchantmentCache.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/display/EnchantmentCache.java @@ -69,7 +69,7 @@ public class EnchantmentCache implements Updatable { ); name = String.valueOf(Configs.LANG.getString("enchantments." + enchantment.getKey().getKey().toLowerCase() + ".name")); type = enchantment.isCursed() ? EnchantmentType.CURSE : EnchantmentType.NORMAL; - if(enchantment.isTreasure()) { + if (enchantment.isTreasure()) { rarity = EnchantmentRarity.getByName(Configs.CONFIG.getString("rarity.vanilla-treasure-rarity")); } else { rarity = EnchantmentRarity.getByName(Configs.CONFIG.getString("rarity.vanilla-rarity")); 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 438f65e8..5272b7b8 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 @@ -13,4 +13,4 @@ public class SnowArtifact extends Artifact { public Particle getParticle() { return Particle.SNOWBALL; } -} \ No newline at end of file +} 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 74cea25b..a8e63abe 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 @@ -16,4 +16,4 @@ public class TearArtifact extends Artifact { public Particle getParticle() { return Particle.DRIPPING_OBSIDIAN_TEAR; } -} \ No newline at end of file +} diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Ignite.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Ignite.java index 2134e995..ddc67d7d 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Ignite.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Ignite.java @@ -50,4 +50,4 @@ public class Ignite extends EcoEnchant { toIgnite.setType(Material.FIRE); } } -} \ No newline at end of file +} diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/LiquidShot.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/LiquidShot.java index e0d2a510..07065e2d 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/LiquidShot.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/LiquidShot.java @@ -34,4 +34,4 @@ public class LiquidShot extends EcoEnchant { event.setDamage(event.getDamage() * damageMultiplier); } -} \ No newline at end of file +} diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Optics.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Optics.java index 6a879fb8..cbbd8210 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Optics.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Optics.java @@ -33,4 +33,4 @@ public class Optics extends EcoEnchant { event.setDamage(event.getDamage() * damageMultiplier); } -} \ No newline at end of file +} diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Quadrilateralism.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Quadrilateralism.java index 5cba7fd4..414691ec 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Quadrilateralism.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Quadrilateralism.java @@ -32,4 +32,4 @@ public class Quadrilateralism extends EcoEnchant { event.setDamage(event.getDamage() * damageMultiplier); } -} \ No newline at end of file +} diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Radiance.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Radiance.java index 0dd34731..f2f969df 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Radiance.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Radiance.java @@ -44,4 +44,4 @@ public class Radiance extends EcoEnchant { entity.addPotionEffect(new PotionEffect(PotionEffectType.GLOWING, duration, 0, false, false, false)); } } -} \ No newline at end of file +} diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Reinforcement.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Reinforcement.java index 3fe36b6a..ad4bc6d8 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Reinforcement.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Reinforcement.java @@ -23,7 +23,7 @@ public class Reinforcement extends EcoEnchant { } double reduction = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "reduction-per-level"); - double multiplier = 1 - ((reduction/100) * level); + double multiplier = 1 - ((reduction / 100) * level); event.setDamage(event.getDamage() * multiplier); } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Spearfishing.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Spearfishing.java index 717955c0..cd959dca 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Spearfishing.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Spearfishing.java @@ -88,4 +88,4 @@ public class Spearfishing extends EcoEnchant { .push(); } } -} \ No newline at end of file +} diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/StoneSwitcher.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/StoneSwitcher.java index 84900daa..d64c2ed0 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/StoneSwitcher.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/StoneSwitcher.java @@ -42,8 +42,8 @@ public class StoneSwitcher extends EcoEnchant { Material material; double random = NumberUtils.randFloat(0, 1); - double band = 1/(double) this.getConfig().getStrings(EcoEnchants.CONFIG_LOCATION + "blocks").size(); - int selectedIndex = (int) Math.floor(random/band); + double band = 1 / (double) this.getConfig().getStrings(EcoEnchants.CONFIG_LOCATION + "blocks").size(); + int selectedIndex = (int) Math.floor(random / band); selectedIndex = NumberUtils.equalIfOver(selectedIndex, this.getConfig().getStrings(EcoEnchants.CONFIG_LOCATION + "blocks").size() - 1); String materialName = this.getConfig().getStrings(EcoEnchants.CONFIG_LOCATION + "blocks").get(selectedIndex); material = Material.getMaterial(materialName.toUpperCase()); 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 94713f9a..1ad41446 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 @@ -66,4 +66,4 @@ public class Vein extends EcoEnchant { AnticheatManager.unexemptPlayer(player); } -} \ No newline at end of file +} diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/WaterAspect.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/WaterAspect.java index 6a30492a..465811a3 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/WaterAspect.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/WaterAspect.java @@ -32,4 +32,4 @@ public class WaterAspect extends EcoEnchant { event.setDamage(event.getDamage() * damageMultiplier); } -} \ No newline at end of file +} diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Instability.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Instability.java index c112270b..e55e1f70 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Instability.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Instability.java @@ -61,4 +61,4 @@ public class Instability extends EcoEnchant { event.getEntity().remove(); } -} \ No newline at end of file +} diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Pentashot.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Pentashot.java index f1fad6c3..90cd0fbd 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Pentashot.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Pentashot.java @@ -35,7 +35,9 @@ public class Pentashot extends EcoEnchant { velocity.rotateAroundY(radians); Arrow arrow1 = shooter.launchProjectile(Arrow.class, velocity); - if(EnchantChecks.mainhand(shooter, Enchantment.ARROW_FIRE)) arrow1.setFireTicks(Integer.MAX_VALUE); + if (EnchantChecks.mainhand(shooter, Enchantment.ARROW_FIRE)) { + arrow1.setFireTicks(Integer.MAX_VALUE); + } arrow1.setPickupStatus(AbstractArrow.PickupStatus.DISALLOWED); } } diff --git a/eco-core/core-proxy/src/main/java/com/willfp/eco/core/proxy/proxies/TridentStackProxy.java b/eco-core/core-proxy/src/main/java/com/willfp/eco/core/proxy/proxies/TridentStackProxy.java index 282f7063..6b2ba5c2 100644 --- a/eco-core/core-proxy/src/main/java/com/willfp/eco/core/proxy/proxies/TridentStackProxy.java +++ b/eco-core/core-proxy/src/main/java/com/willfp/eco/core/proxy/proxies/TridentStackProxy.java @@ -7,7 +7,6 @@ import org.bukkit.inventory.ItemStack; import org.jetbrains.annotations.NotNull; public interface TridentStackProxy extends AbstractProxy { - /** * Get a trident's ItemStack. * diff --git a/eco-util/src/main/java/com/willfp/eco/util/updater/UpdateChecker.java b/eco-util/src/main/java/com/willfp/eco/util/updater/UpdateChecker.java index b3a57f58..f0341124 100644 --- a/eco-util/src/main/java/com/willfp/eco/util/updater/UpdateChecker.java +++ b/eco-util/src/main/java/com/willfp/eco/util/updater/UpdateChecker.java @@ -34,7 +34,10 @@ public class UpdateChecker { */ public void getVersion(@NotNull final Consumer consumer) { this.getPlugin().getScheduler().runAsync(() -> { - try (InputStream inputStream = new URL("https://api.spigotmc.org/legacy/update.php?resource=" + this.getPlugin().getResourceId()).openStream(); Scanner scanner = new Scanner(inputStream)) { + try ( + InputStream inputStream = new URL("https://api.spigotmc.org/legacy/update.php?resource=" + this.getPlugin().getResourceId()).openStream(); + Scanner scanner = new Scanner(inputStream) + ) { if (scanner.hasNext()) { consumer.accept(scanner.next()); }