firework proj velocity option

This commit is contained in:
ShermansWorld committed 2024-01-14 13:02:32 -05:00
1 parent e2acbabf94
commit adbd512c30
4 files changed
+5 -2

No files matched your search

@@ -172,6 +172,7 @@ public class Config {
} else {
fireworkProjectile.delayedFire = true;
}
fireworkProjectile.velocityFactor = (float) config.getDouble("Projectiles." + projectileName + ".VelocityFactor");
projectileMap.put(projectileName, fireworkProjectile);
break;
default:
@@ -70,7 +70,7 @@ public class ClickHandler implements Listener {
@EventHandler
public void onHit(ProjectileHitEvent event) {
if ((event.getEntity() instanceof org.bukkit.entity.Projectile)
if ((event.getEntity() instanceof Projectile)
&& projectiles.containsKey(event.getEntity().getUniqueId())) {
ExplosiveProjectile proj = projectiles.get(event.getEntity().getUniqueId());
Entity snowball = event.getEntity();
@@ -25,6 +25,7 @@ public class FireworkProjectile extends SiegeEngineProjectile {
public float inaccuracy = 0.125f;
public Particle particleType = Particle.EXPLOSION_NORMAL;
public Sound soundType = Sound.ENTITY_FIREWORK_ROCKET_BLAST_FAR;
public float velocityFactor = 0.5f;
private boolean playSound = true;
@@ -51,7 +52,7 @@ public class FireworkProjectile extends SiegeEngineProjectile {
if (delayedFire) {
baseDelay += delayTime;
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(SiegeEngines.getInstance(), () -> {
CreateEntity(entity, FireLocation, velocity, player);
CreateEntity(entity, FireLocation, velocity*velocityFactor, player);
}, (long) baseDelay);
} else {
CreateEntity(entity, FireLocation, velocity, player);
+1
View File
@@ -66,6 +66,7 @@ Projectiles:
ProjectileType: FIREWORK
Inaccuracy: 0.125
EntityCount: 1
VelocityFactor: 0.5
Delay: 6
SiegeEngines: