Improved Codestyle (11/?)

This commit is contained in:
Auxilor 2020-12-28 16:34:27 +00:00
parent 931d35495a
commit bb27dd38ea
18 changed files with 23 additions and 19 deletions

View File

@ -116,7 +116,7 @@
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
<module name="RedundantImport"/>
<module name="UnusedImports">
<property name="processJavadoc" value="false"/>
<property name="processJavadoc" value="true"/>
</module>
<!-- Checks for Size Violations. -->

View File

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

View File

@ -13,4 +13,4 @@ public class SnowArtifact extends Artifact {
public Particle getParticle() {
return Particle.SNOWBALL;
}
}
}

View File

@ -16,4 +16,4 @@ public class TearArtifact extends Artifact {
public Particle getParticle() {
return Particle.DRIPPING_OBSIDIAN_TEAR;
}
}
}

View File

@ -50,4 +50,4 @@ public class Ignite extends EcoEnchant {
toIgnite.setType(Material.FIRE);
}
}
}
}

View File

@ -34,4 +34,4 @@ public class LiquidShot extends EcoEnchant {
event.setDamage(event.getDamage() * damageMultiplier);
}
}
}

View File

@ -33,4 +33,4 @@ public class Optics extends EcoEnchant {
event.setDamage(event.getDamage() * damageMultiplier);
}
}
}

View File

@ -32,4 +32,4 @@ public class Quadrilateralism extends EcoEnchant {
event.setDamage(event.getDamage() * damageMultiplier);
}
}
}

View File

@ -44,4 +44,4 @@ public class Radiance extends EcoEnchant {
entity.addPotionEffect(new PotionEffect(PotionEffectType.GLOWING, duration, 0, false, false, false));
}
}
}
}

View File

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

View File

@ -88,4 +88,4 @@ public class Spearfishing extends EcoEnchant {
.push();
}
}
}
}

View File

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

View File

@ -66,4 +66,4 @@ public class Vein extends EcoEnchant {
AnticheatManager.unexemptPlayer(player);
}
}
}

View File

@ -32,4 +32,4 @@ public class WaterAspect extends EcoEnchant {
event.setDamage(event.getDamage() * damageMultiplier);
}
}
}

View File

@ -61,4 +61,4 @@ public class Instability extends EcoEnchant {
event.getEntity().remove();
}
}
}

View File

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

View File

@ -7,7 +7,6 @@ import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
public interface TridentStackProxy extends AbstractProxy {
/**
* Get a trident's ItemStack.
*

View File

@ -34,7 +34,10 @@ public class UpdateChecker {
*/
public void getVersion(@NotNull final Consumer<? super String> 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());
}