mirror of
https://github.com/darksaid98/SiegeEngines.git
synced 2026-12-01 14:38:55 +00:00
fix: EntityCount -> ProjectileCount
This commit is contained in:
1 parent
ade7852210
commit
63d6e722b5
7 files changed
+44
-27
No files matched your search
@@ -135,7 +135,7 @@ public class SiegeEngine implements Cloneable {
|
||||
nextShotTime = System.currentTimeMillis();
|
||||
// PLACEHOLDER. SHOULD BE WE-WRITTEN
|
||||
EntityProjectile defaultProj = new EntityProjectile(new ItemStack(Material.GRASS_BLOCK));
|
||||
defaultProj.entityCount = 2;
|
||||
defaultProj.projectileCount = 2;
|
||||
defaultProj.entityType = EntityType.SNOWBALL;
|
||||
defaultProj.particleType = Particle.WHITE_ASH;
|
||||
defaultProj.soundType = Sound.ENTITY_BLAZE_SHOOT;
|
||||
|
||||
@@ -97,11 +97,13 @@ public class SiegeEnginesCommand {
|
||||
definedSiegeEngines.clear();
|
||||
addDefaults();
|
||||
for (SiegeEngine i : definedSiegeEngines.values()) {
|
||||
sender.sendMessage(ColorParser.of("<yellow>Enabled SiegeEngine : %s".formatted(i.getEngineName())).build());
|
||||
sender.sendMessage(ColorParser.of("<yellow>SiegeEngine Propellant/\"Fuel\" ItemStacks : %s".formatted(i.getFuelItem())).build());
|
||||
for (ItemStack proj : i.getProjectiles().keySet()) {
|
||||
sender.sendMessage(ColorParser.of("<yellow>SiegeEngine Projectile ItemStacks : %s".formatted(proj)).build());
|
||||
}
|
||||
if (Config.doDebug) {
|
||||
sender.sendMessage(ColorParser.of("<yellow>Enabled SiegeEngine : %s".formatted(i.getEngineName())).build());
|
||||
sender.sendMessage(ColorParser.of("<yellow>SiegeEngine Propellant/\"Fuel\" ItemStacks : %s".formatted(i.getFuelItem())).build());
|
||||
for (ItemStack proj : i.getProjectiles().keySet()) {
|
||||
sender.sendMessage(ColorParser.of("<yellow>SiegeEngine Projectile ItemStacks : %s".formatted(proj)).build());
|
||||
}
|
||||
}
|
||||
}
|
||||
sender.sendMessage(ColorParser.of("<yellow>SiegeEngine configs reloaded").build());
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@ public class Config {
|
||||
Material.getMaterial(config.getString("Projectiles." + projectileName + ".AmmoItem"))));
|
||||
entityProjectile.inaccuracy = (float) config
|
||||
.getDouble("Projectiles." + projectileName + ".Inaccuracy");
|
||||
entityProjectile.entityCount = config.getInt("Projectiles." + projectileName + ".EntityCount");
|
||||
entityProjectile.projectileCount = config.getInt("Projectiles." + projectileName + ".EntityCount");
|
||||
entityProjectile.entityType = EntityType
|
||||
.valueOf(config.getString("Projectiles." + projectileName + ".EntityType"));
|
||||
entityProjectile.soundType = Sound
|
||||
@@ -301,7 +301,7 @@ public class Config {
|
||||
FireworkProjectile fireworkProjectile = new FireworkProjectile(SiegeEnginesUtil.DEFAULT_ROCKET);
|
||||
fireworkProjectile.inaccuracy = (float) config
|
||||
.getDouble("Projectiles." + projectileName + ".Inaccuracy");
|
||||
fireworkProjectile.entityCount = config.getInt("Projectiles." + projectileName + ".EntityCount");
|
||||
fireworkProjectile.projectileCount = config.getInt("Projectiles." + projectileName + ".EntityCount");
|
||||
fireworkProjectile.delayTime = config.getInt("Projectiles." + projectileName + ".EntityCount");
|
||||
if (fireworkProjectile.delayTime <= 0) {
|
||||
fireworkProjectile.delayedFire = false;
|
||||
@@ -317,7 +317,7 @@ public class Config {
|
||||
Material.getMaterial(config.getString("Projectiles." + projectileName + ".AmmoItem"))));
|
||||
potionProjectile.inaccuracy = (float) config
|
||||
.getDouble("Projectiles." + projectileName + ".Inaccuracy");
|
||||
potionProjectile.entityCount = config.getInt("Projectiles." + projectileName + ".EntityCount");
|
||||
potionProjectile.projectileCount = config.getInt("Projectiles." + projectileName + ".EntityCount");
|
||||
potionProjectile.delayTime = config.getInt("Projectiles." + projectileName + ".EntityCount");
|
||||
if (potionProjectile.delayTime <= 0) {
|
||||
potionProjectile.delayedFire = false;
|
||||
|
||||
@@ -17,7 +17,7 @@ import org.bukkit.util.Vector;
|
||||
public class EntityProjectile extends SiegeEngineProjectile {
|
||||
|
||||
// Defaults
|
||||
public int entityCount = 20;
|
||||
public int projectileCount = 20;
|
||||
public int arrowOnlyDamage = 6;
|
||||
public Boolean delayedFire = false;
|
||||
public int delayTime = 6;
|
||||
@@ -40,7 +40,7 @@ public class EntityProjectile extends SiegeEngineProjectile {
|
||||
public void Shoot(Entity player, Entity entity, Location FireLocation, Float velocity) {
|
||||
playSound = true;
|
||||
int baseDelay = 0;
|
||||
for (int i = 0; i < entityCount; i++) {
|
||||
for (int i = 0; i < projectileCount; i++) {
|
||||
if (delayedFire) {
|
||||
baseDelay += delayTime;
|
||||
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(SiegeEngines.getInstance(), () -> {
|
||||
|
||||
@@ -18,7 +18,7 @@ import org.bukkit.util.Vector;
|
||||
public class FireworkProjectile extends SiegeEngineProjectile {
|
||||
|
||||
// Defaults
|
||||
public int entityCount = 1;
|
||||
public int projectileCount = 1;
|
||||
public Boolean delayedFire = true;
|
||||
public int delayTime = 6;
|
||||
public EntityType entityType = EntityType.FIREWORK;
|
||||
@@ -36,7 +36,7 @@ public class FireworkProjectile extends SiegeEngineProjectile {
|
||||
|
||||
public static FireworkProjectile getDefaultRocketShot(ItemStack rocketItem) {
|
||||
FireworkProjectile fireProj = new FireworkProjectile(rocketItem);
|
||||
fireProj.entityCount = 1;
|
||||
fireProj.projectileCount = 1;
|
||||
fireProj.entityType = EntityType.FIREWORK;
|
||||
fireProj.particleType = Particle.WHITE_ASH;
|
||||
fireProj.soundType = Sound.ENTITY_FIREWORK_ROCKET_BLAST_FAR;
|
||||
@@ -48,7 +48,7 @@ public class FireworkProjectile extends SiegeEngineProjectile {
|
||||
public void Shoot(Entity player, Entity entity, Location FireLocation, Float velocity) {
|
||||
playSound = true;
|
||||
int baseDelay = 0;
|
||||
for (int i = 0; i < entityCount; i++) {
|
||||
for (int i = 0; i < projectileCount; i++) {
|
||||
if (delayedFire) {
|
||||
baseDelay += delayTime;
|
||||
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(SiegeEngines.getInstance(), () -> {
|
||||
|
||||
@@ -5,7 +5,6 @@ import com.github.alathra.siegeengines.Util.SiegeEnginesUtil;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.World;
|
||||
@@ -14,13 +13,11 @@ import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.ThrownPotion;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.PotionMeta;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class PotionProjectile extends SiegeEngineProjectile {
|
||||
|
||||
public int entityCount = 3;
|
||||
public int projectileCount = 3;
|
||||
public Boolean delayedFire = false;
|
||||
public int delayTime = 6;
|
||||
public float inaccuracy = 0.1f;
|
||||
@@ -36,7 +33,7 @@ public class PotionProjectile extends SiegeEngineProjectile {
|
||||
public void Shoot(Entity player, Entity entity, Location loc, Float velocity) {
|
||||
//TODO Auto-generated method stub
|
||||
int baseDelay = 0;
|
||||
for (int i = 0; i < entityCount; i++) {
|
||||
for (int i = 0; i < projectileCount; i++) {
|
||||
if (delayedFire) {
|
||||
baseDelay += delayTime;
|
||||
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(SiegeEngines.getInstance(), () -> {
|
||||
|
||||
Reference in new issue
Block a user