mirror of
https://github.com/darksaid98/SiegeEngines.git
synced 2026-12-03 14:38:53 +00:00
added sound option to config
This commit is contained in:
1 parent
65650528b2
commit
d13738cb63
5 files changed
+16
-48
No files matched your search
@@ -126,7 +126,7 @@ public class SiegeEngines extends JavaPlugin {
|
|||||||
definedSiegeEngines.put(trebuchet.readyModelNumber, trebuchet);
|
definedSiegeEngines.put(trebuchet.readyModelNumber, trebuchet);
|
||||||
|
|
||||||
// Ballista
|
// Ballista
|
||||||
SiegeEngine ballista = new SiegeEngine("Ballista", Config.ballistaProjectiles, new ItemStack(Material.GUNPOWDER), 143);
|
SiegeEngine ballista = new SiegeEngine("Ballista", Config.ballistaProjectiles, new ItemStack(Material.GUNPOWDER), 145);
|
||||||
// config options
|
// config options
|
||||||
ballista.shotAmount = Config.ballistaShotAmount;
|
ballista.shotAmount = Config.ballistaShotAmount;
|
||||||
ballista.velocityPerFuel = Config.ballistaVelocityPerFuel;
|
ballista.velocityPerFuel = Config.ballistaVelocityPerFuel;
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import java.util.HashMap;
|
|||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
@@ -174,6 +175,7 @@ public class Config {
|
|||||||
explosiveProjectile.explodePower = (float) config.getDouble("Projectiles." + projectileName + ".ExplodePower");
|
explosiveProjectile.explodePower = (float) config.getDouble("Projectiles." + projectileName + ".ExplodePower");
|
||||||
explosiveProjectile.inaccuracy = (float) config.getDouble("Projectiles." + projectileName + ".Inaccuracy");
|
explosiveProjectile.inaccuracy = (float) config.getDouble("Projectiles." + projectileName + ".Inaccuracy");
|
||||||
explosiveProjectile.projectilesCount = config.getInt("Projectiles." + projectileName + ".ProjectileCount");
|
explosiveProjectile.projectilesCount = config.getInt("Projectiles." + projectileName + ".ProjectileCount");
|
||||||
|
explosiveProjectile.soundType = Sound.valueOf(config.getString("Projectiles." + projectileName + ".FireSound"));
|
||||||
projectileMap.put(projectileName, explosiveProjectile);
|
projectileMap.put(projectileName, explosiveProjectile);
|
||||||
break;
|
break;
|
||||||
case ENTITY:
|
case ENTITY:
|
||||||
@@ -181,7 +183,8 @@ public class Config {
|
|||||||
Material.getMaterial(config.getString("Projectiles." + projectileName + ".AmmoItem"))));
|
Material.getMaterial(config.getString("Projectiles." + projectileName + ".AmmoItem"))));
|
||||||
entityProjectile.inaccuracy = (float) config.getDouble("Projectiles." + projectileName + ".Inaccuracy");
|
entityProjectile.inaccuracy = (float) config.getDouble("Projectiles." + projectileName + ".Inaccuracy");
|
||||||
entityProjectile.entityCount = config.getInt("Projectiles." + projectileName + ".EntityCount");
|
entityProjectile.entityCount = config.getInt("Projectiles." + projectileName + ".EntityCount");
|
||||||
entityProjectile.entityType = EntityType.valueOf(config.getString("Projectiles." + projectileName + ".EntityShotType"));
|
entityProjectile.entityType = EntityType.valueOf(config.getString("Projectiles." + projectileName + ".EntityType"));
|
||||||
|
entityProjectile.soundType = Sound.valueOf(config.getString("Projectiles." + projectileName + ".FireSound"));
|
||||||
projectileMap.put(projectileName, entityProjectile);
|
projectileMap.put(projectileName, entityProjectile);
|
||||||
break;
|
break;
|
||||||
case FIREWORK:
|
case FIREWORK:
|
||||||
|
|||||||
@@ -35,26 +35,6 @@ public class EntityProjectile extends SiegeEngineProjectile {
|
|||||||
// Defaults
|
// Defaults
|
||||||
}
|
}
|
||||||
|
|
||||||
public static EntityProjectile getDefaultFireballShot() {
|
|
||||||
EntityProjectile fireProj = new EntityProjectile(new ItemStack(Material.MAGMA_BLOCK));
|
|
||||||
fireProj.entityCount = 4;
|
|
||||||
fireProj.entityType = EntityType.SMALL_FIREBALL;
|
|
||||||
fireProj.particleType = Particle.WHITE_ASH;
|
|
||||||
fireProj.soundType = Sound.ENTITY_BLAZE_SHOOT;
|
|
||||||
fireProj.inaccuracy = 0.75f;
|
|
||||||
return fireProj;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static EntityProjectile getDefaultScatterShot() {
|
|
||||||
EntityProjectile scatterProj = new EntityProjectile(new ItemStack(Material.GRAVEL));
|
|
||||||
scatterProj.inaccuracy = 0.325f;
|
|
||||||
scatterProj.entityCount = 24;
|
|
||||||
scatterProj.entityType = EntityType.ARROW;
|
|
||||||
scatterProj.particleType = Particle.ELECTRIC_SPARK;
|
|
||||||
scatterProj.soundType = Sound.ITEM_CROSSBOW_SHOOT;
|
|
||||||
return scatterProj;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Shoot(Entity player, Entity entity, Location FireLocation, Float velocity) {
|
public void Shoot(Entity player, Entity entity, Location FireLocation, Float velocity) {
|
||||||
playSound = true;
|
playSound = true;
|
||||||
|
|||||||
@@ -36,28 +36,6 @@ public class ExplosiveProjectile extends SiegeEngineProjectile {
|
|||||||
super(ProjectileType.EXPLOSIVE, ammunitionItem);
|
super(ProjectileType.EXPLOSIVE, ammunitionItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ExplosiveProjectile getDefaultStoneShot() {
|
|
||||||
ExplosiveProjectile stoneProj = new ExplosiveProjectile(new ItemStack(Material.COBBLESTONE));
|
|
||||||
stoneProj.explodePower = 1;
|
|
||||||
return stoneProj;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ExplosiveProjectile getDefaultRepeatingShot() {
|
|
||||||
ExplosiveProjectile repeatingProj = new ExplosiveProjectile(new ItemStack(Material.TNT));
|
|
||||||
repeatingProj.explodePower = 1.0f;
|
|
||||||
repeatingProj.projectilesCount = 5;
|
|
||||||
repeatingProj.delayedFire = true;
|
|
||||||
repeatingProj.inaccuracy = 0.45f;
|
|
||||||
return repeatingProj;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ExplosiveProjectile getDefaultBreachShot() {
|
|
||||||
ExplosiveProjectile breachProj = new ExplosiveProjectile(new ItemStack(Material.IRON_BLOCK));
|
|
||||||
breachProj.explodePower = 3;
|
|
||||||
breachProj.projectilesCount = 1;
|
|
||||||
return breachProj;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Shoot(Entity player, Entity entity, Location loc, Float velocity) {
|
public void Shoot(Entity player, Entity entity, Location loc, Float velocity) {
|
||||||
playSound = true;
|
playSound = true;
|
||||||
|
|||||||
@@ -38,42 +38,49 @@ Projectiles:
|
|||||||
Inaccuracy: 0.125
|
Inaccuracy: 0.125
|
||||||
ProjectileCount: 1
|
ProjectileCount: 1
|
||||||
AmmoItem: COBBLESTONE
|
AmmoItem: COBBLESTONE
|
||||||
|
FireSound: ENTITY_GENERIC_EXPLODE
|
||||||
BreachShot:
|
BreachShot:
|
||||||
ProjectileType: EXPLOSIVE
|
ProjectileType: EXPLOSIVE
|
||||||
ExplodePower: 3.75
|
ExplodePower: 3.75
|
||||||
Inaccuracy: 0.3
|
Inaccuracy: 0.3
|
||||||
ProjectileCount: 1
|
ProjectileCount: 1
|
||||||
AmmoItem: IRON_BLOCK
|
AmmoItem: IRON_BLOCK
|
||||||
|
FireSound: ENTITY_GENERIC_EXPLODE
|
||||||
RepeatingShot:
|
RepeatingShot:
|
||||||
ProjectileType: EXPLOSIVE
|
ProjectileType: EXPLOSIVE
|
||||||
ExplodePower: 1.0
|
ExplodePower: 1.0
|
||||||
Inaccuracy: 0.325
|
Inaccuracy: 0.325
|
||||||
ProjectileCount: 5
|
ProjectileCount: 5
|
||||||
AmmoItem: TNT
|
AmmoItem: TNT
|
||||||
|
FireSound: ENTITY_GENERIC_EXPLODE
|
||||||
ScatterShot:
|
ScatterShot:
|
||||||
ProjectileType: ENTITY
|
ProjectileType: ENTITY
|
||||||
Inaccuracy: 0.325
|
Inaccuracy: 0.325
|
||||||
EntityCount: 24
|
EntityCount: 24
|
||||||
EntityShotType: ARROW
|
EntityType: ARROW
|
||||||
AmmoItem: GRAVEL
|
AmmoItem: GRAVEL
|
||||||
|
FireSound: ENTITY_GENERIC_EXPLODE
|
||||||
BallistaBoltShot:
|
BallistaBoltShot:
|
||||||
ProjectileType: ENTITY
|
ProjectileType: ENTITY
|
||||||
Inaccuracy: 0.025
|
Inaccuracy: 0.025
|
||||||
EntityCount: 1
|
EntityCount: 1
|
||||||
EntityShotType: ARROW
|
EntityType: ARROW
|
||||||
AmmoItem: ARROW
|
AmmoItem: ARROW
|
||||||
|
FireSound: ITEM_CROSSBOW_SHOOT
|
||||||
DragonsBreath:
|
DragonsBreath:
|
||||||
ProjectileType: ENTITY
|
ProjectileType: ENTITY
|
||||||
Inaccuracy: 0.25
|
Inaccuracy: 0.25
|
||||||
EntityCount: 3
|
EntityCount: 3
|
||||||
EntityShotType: DRAGON_FIREBALL
|
EntityType: DRAGON_FIREBALL
|
||||||
AmmoItem: DRAGON_BREATH
|
AmmoItem: DRAGON_BREATH
|
||||||
|
FireSound: ENTITY_GENERIC_EXPLODE
|
||||||
FireShot:
|
FireShot:
|
||||||
ProjectileType: ENTITY
|
ProjectileType: ENTITY
|
||||||
Inaccuracy: 0.475
|
Inaccuracy: 0.475
|
||||||
EntityCount: 8
|
EntityCount: 8
|
||||||
EntityShotType: SMALL_FIREBALL
|
EntityType: SMALL_FIREBALL
|
||||||
AmmoItem: MAGMA_BLOCK
|
AmmoItem: MAGMA_BLOCK
|
||||||
|
FireSound: ENTITY_GENERIC_EXPLODE
|
||||||
FireworkShot:
|
FireworkShot:
|
||||||
ProjectileType: FIREWORK
|
ProjectileType: FIREWORK
|
||||||
Inaccuracy: 0.125
|
Inaccuracy: 0.125
|
||||||
|
|||||||
Reference in new issue
Block a user