mirror of
https://github.com/darksaid98/SiegeEngines.git
synced 2026-12-01 14:38:55 +00:00
fix: World bug in near siege engine listener
This commit is contained in:
1 parent
0cac8cbbf9
commit
c49d45e395
2 files changed
+10
-7
No files matched your search
@@ -284,7 +284,7 @@ public class Config {
|
||||
Material.getMaterial(config.getString("Projectiles." + projectileName + ".AmmoItem"))));
|
||||
entityProjectile.inaccuracy = (float) config
|
||||
.getDouble("Projectiles." + projectileName + ".Inaccuracy");
|
||||
entityProjectile.projectileCount = config.getInt("Projectiles." + projectileName + ".EntityCount");
|
||||
entityProjectile.projectileCount = config.getInt("Projectiles." + projectileName + ".ProjectileCount");
|
||||
entityProjectile.entityType = EntityType
|
||||
.valueOf(config.getString("Projectiles." + projectileName + ".EntityType"));
|
||||
entityProjectile.soundType = Sound
|
||||
@@ -301,8 +301,8 @@ public class Config {
|
||||
FireworkProjectile fireworkProjectile = new FireworkProjectile(SiegeEnginesUtil.DEFAULT_ROCKET);
|
||||
fireworkProjectile.inaccuracy = (float) config
|
||||
.getDouble("Projectiles." + projectileName + ".Inaccuracy");
|
||||
fireworkProjectile.projectileCount = config.getInt("Projectiles." + projectileName + ".EntityCount");
|
||||
fireworkProjectile.delayTime = config.getInt("Projectiles." + projectileName + ".EntityCount");
|
||||
fireworkProjectile.projectileCount = config.getInt("Projectiles." + projectileName + ".ProjectileCount");
|
||||
fireworkProjectile.delayTime = config.getInt("Projectiles." + projectileName + ".ProjectileCount");
|
||||
if (fireworkProjectile.delayTime <= 0) {
|
||||
fireworkProjectile.delayedFire = false;
|
||||
} else {
|
||||
@@ -317,8 +317,8 @@ public class Config {
|
||||
Material.getMaterial(config.getString("Projectiles." + projectileName + ".AmmoItem"))));
|
||||
potionProjectile.inaccuracy = (float) config
|
||||
.getDouble("Projectiles." + projectileName + ".Inaccuracy");
|
||||
potionProjectile.projectileCount = config.getInt("Projectiles." + projectileName + ".EntityCount");
|
||||
potionProjectile.delayTime = config.getInt("Projectiles." + projectileName + ".EntityCount");
|
||||
potionProjectile.projectileCount = config.getInt("Projectiles." + projectileName + ".ProjectileCount");
|
||||
potionProjectile.delayTime = config.getInt("Projectiles." + projectileName + ".ProjectileCount");
|
||||
if (potionProjectile.delayTime <= 0) {
|
||||
potionProjectile.delayedFire = false;
|
||||
} else {
|
||||
|
||||
+5
-2
@@ -195,10 +195,13 @@ public class SiegeEngineInteractListener implements Listener {
|
||||
if (siegeEngine.getEntity() == null) {
|
||||
continue;
|
||||
}
|
||||
if (siegeEngine.getEntity().getWorld() != player.getWorld()) {
|
||||
continue;
|
||||
}
|
||||
Location siegeEngineLocation = siegeEngine.getEntity().getLocation();
|
||||
ItemStack stack = siegeEngine.getFuelItem();
|
||||
// If location is less than 2 blocks away
|
||||
if (eventLocation.distance(siegeEngineLocation) < 2.0) {
|
||||
// If location is less than 2.5 blocks away
|
||||
if (eventLocation.distance(siegeEngineLocation) < 2.5) {
|
||||
if (itemInHand.getType() == stack.getType()) {
|
||||
if (siegeEngine.canLoadFuel()) {
|
||||
siegeEngine.getAmmoHolder().setLoadedFuel(siegeEngine.getAmmoHolder().getLoadedFuel() + 1);
|
||||
|
||||
Reference in new issue
Block a user