Skip to content

Commit

Permalink
don't use java's random generator (fixes #22)
Browse files Browse the repository at this point in the history
  • Loading branch information
UpcraftLP committed Jan 20, 2024
1 parent dd5560c commit 797548f
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@
import net.minecraft.world.World;

import java.util.UUID;
import java.util.random.RandomGenerator;

public class PocketDimensionPortalEntity extends Entity implements Targetable {
private static final TrackedData<Integer> TRUE_AGE = DataTracker.registerData(PocketDimensionPortalEntity.class, TrackedDataHandlerRegistry.INTEGER);
private final RandomGenerator rand = RandomGenerator.getDefault();
private UUID casterId = Util.NIL_UUID;
private double pullStrength;

Expand Down Expand Up @@ -64,9 +62,9 @@ public void tick() {
}

for(int i = 0; i < boxRadius * 2; ++i) {
double particleX = getPos().getX() + (rand.nextDouble(-boxRadius, boxRadius + 1));
double particleX = getPos().getX() + random.nextGaussian() * boxRadius;
double particleY = getPos().getY();
double particleZ = getPos().getZ() + (rand.nextDouble(-boxRadius, boxRadius + 1));
double particleZ = getPos().getZ() + random.nextGaussian() * boxRadius;
Vec3d particlePos = new Vec3d(particleX, particleY, particleZ);
Vec3d particleVelocity = particlePos.subtract(getPos());

Expand Down

0 comments on commit 797548f

Please sign in to comment.