From 797548f4b059c8e96b6e94bfe3dcd81894199717 Mon Sep 17 00:00:00 2001 From: Up Date: Sat, 20 Jan 2024 21:05:54 +0100 Subject: [PATCH] don't use java's random generator (fixes #22) --- .../common/entities/magic/PocketDimensionPortalEntity.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/dev/cammiescorner/arcanuscontinuum/common/entities/magic/PocketDimensionPortalEntity.java b/src/main/java/dev/cammiescorner/arcanuscontinuum/common/entities/magic/PocketDimensionPortalEntity.java index d331e20..499408d 100644 --- a/src/main/java/dev/cammiescorner/arcanuscontinuum/common/entities/magic/PocketDimensionPortalEntity.java +++ b/src/main/java/dev/cammiescorner/arcanuscontinuum/common/entities/magic/PocketDimensionPortalEntity.java @@ -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 TRUE_AGE = DataTracker.registerData(PocketDimensionPortalEntity.class, TrackedDataHandlerRegistry.INTEGER); - private final RandomGenerator rand = RandomGenerator.getDefault(); private UUID casterId = Util.NIL_UUID; private double pullStrength; @@ -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());