Skip to content

Commit

Permalink
change spawn strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
ReinWD committed Oct 10, 2019
1 parent 9b25024 commit 3ac4050
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/java/think/rpgitems/power/impl/PowerBeam.java
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ private Vector homingCorrect(Vector towards, Location lastLocation, Entity targe
return clone;
}

private boolean spawnInWorld = false;
private double spawnInWorld = 0;

private void spawnParticle(Entity from, World world, Location lastLocation, int i) {
Location eyeLocation;
Expand All @@ -638,12 +638,13 @@ private void spawnParticle(Entity from, World world, Location lastLocation, int
if ((lastLocation.distance(eyeLocation) < 1)) {
return;
}
if (spawnedLength.get() > 32 && spawnInWorld) {
if (spawnedLength.get() > 32 && spawnInWorld >=3) {
((Player) from).spawnParticle(this.particle, lastLocation, i, offsetX, offsetY, offsetZ, particleSpeed, extraData);
spawnInWorld = 0;
} else {
world.spawnParticle(this.particle, lastLocation, i, offsetX, offsetY, offsetZ, particleSpeed, extraData, false);
}
spawnInWorld = !spawnInWorld;
spawnInWorld++;
} else {
world.spawnParticle(this.particle, lastLocation, i, offsetX, offsetY, offsetZ, particleSpeed, extraData, false);
}
Expand Down

0 comments on commit 3ac4050

Please sign in to comment.