mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-25 15:35:11 +01:00
Improved Codestyle (11/?)
This commit is contained in:
parent
931d35495a
commit
bb27dd38ea
@ -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. -->
|
||||
|
@ -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"));
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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());
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public interface TridentStackProxy extends AbstractProxy {
|
||||
|
||||
/**
|
||||
* Get a trident's ItemStack.
|
||||
*
|
||||
|
@ -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());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user