mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-11-05 04:49:10 +01:00
stop using nextGaussian for PlantBoostEffect because it's cool but very slow
This commit is contained in:
parent
203d664291
commit
19cc8f4a52
1 changed files with 2 additions and 2 deletions
|
@ -61,8 +61,8 @@ public class PlantBoostEffect implements IDrainSpotEffect {
|
||||||
if (!this.calcValues(world, pos, spot))
|
if (!this.calcValues(world, pos, spot))
|
||||||
return;
|
return;
|
||||||
for (int i = this.amount / 2 + world.rand.nextInt(this.amount / 2); i >= 0; i--) {
|
for (int i = this.amount / 2 + world.rand.nextInt(this.amount / 2); i >= 0; i--) {
|
||||||
int x = MathHelper.floor(pos.getX() + world.rand.nextGaussian() * this.dist);
|
int x = MathHelper.floor(pos.getX() + (2 * world.rand.nextFloat() - 1) * this.dist);
|
||||||
int z = MathHelper.floor(pos.getZ() + world.rand.nextGaussian() * this.dist);
|
int z = MathHelper.floor(pos.getZ() + (2 * world.rand.nextFloat() - 1) * this.dist);
|
||||||
BlockPos plantPos = new BlockPos(x, world.getHeight(Heightmap.Type.WORLD_SURFACE, x, z), z).down();
|
BlockPos plantPos = new BlockPos(x, world.getHeight(Heightmap.Type.WORLD_SURFACE, x, z), z).down();
|
||||||
if (plantPos.distanceSq(pos) <= this.dist * this.dist && world.isBlockLoaded(plantPos)) {
|
if (plantPos.distanceSq(pos) <= this.dist * this.dist && world.isBlockLoaded(plantPos)) {
|
||||||
if (NaturesAuraAPI.instance().isEffectPowderActive(world, plantPos, NAME))
|
if (NaturesAuraAPI.instance().isEffectPowderActive(world, plantPos, NAME))
|
||||||
|
|
Loading…
Reference in a new issue