mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-26 15:45:12 +01:00
Fixed buckshot
This commit is contained in:
parent
7c59d5cfe8
commit
bfec9a26e6
@ -33,17 +33,13 @@ public class Buckshot extends EcoEnchant {
|
||||
((Player) shooter).playSound(shooter.getLocation(), Sound.ENTITY_ARROW_SHOOT, SoundCategory.PLAYERS, 1.0f, 1.0f);
|
||||
}
|
||||
|
||||
int numberPerLevel = this.getConfig().getInt(EcoEnchants.CONFIG_LOCATION + "amount-per-level");
|
||||
int number = numberPerLevel * level;
|
||||
double spread = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "spread-per-level");
|
||||
if (level < this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "maximum-level")) {
|
||||
spread *= level;
|
||||
} else {
|
||||
spread *= this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "maximum-level");
|
||||
}
|
||||
int number = this.getConfig().getInt(EcoEnchants.CONFIG_LOCATION + "amount-per-level");
|
||||
number *= level;
|
||||
|
||||
double spread = Math.abs(this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "spread-per-level"));
|
||||
spread *= level;
|
||||
|
||||
for (int i = 0; i < number; i += 1) {
|
||||
|
||||
Vector velocity = event.getProjectile().getVelocity().clone();
|
||||
|
||||
velocity.add(new Vector(NumberUtils.randFloat(-spread, spread), NumberUtils.randFloat(-spread, spread), NumberUtils.randFloat(-spread, spread)));
|
||||
|
Loading…
Reference in New Issue
Block a user