diff --git a/main/pom.xml b/main/pom.xml index 719247aea..253ddf376 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -1,12 +1,13 @@ - 4.0.0 - net.citizensnpcs - citizens-parent - 2.0.25-SNAPSHOT + net.citizensnpcs + citizens-parent + 2.0.25-SNAPSHOT citizens-main @@ -162,17 +163,24 @@ - org.apache.maven.plugins - maven-javadoc-plugin - 3.0.1 - - false - none - - https://hub.spigotmc.org/javadocs/spigot - - - + org.apache.maven.plugins + maven-javadoc-plugin + 3.0.1 + + true + + + net.citizensnpcs.api:* + + + 8 + false + none + + https://hub.spigotmc.org/javadocs/spigot + + + diff --git a/main/src/main/java/net/citizensnpcs/util/XORShiftRNG.java b/main/src/main/java/net/citizensnpcs/util/XORShiftRNG.java index ebfd9ba99..b0a02b6ff 100644 --- a/main/src/main/java/net/citizensnpcs/util/XORShiftRNG.java +++ b/main/src/main/java/net/citizensnpcs/util/XORShiftRNG.java @@ -22,24 +22,21 @@ *

* Very fast pseudo random number generator. See * this page for a - * description. This RNG has a period of about 2^160, which is not as long as the {@link MersenneTwisterRNG} but it is - * faster. + * description. This RNG has a period of about 2^160, which is not as long as the MersenneTwisterRNG but it is faster. *

- * + * *

- * NOTE: Because instances of this class require 160-bit seeds, it is not - * possible to seed this RNG using the {@link #setSeed(long)} method inherited - * from {@link Random}. Calls to this method will have no effect. - * Instead the seed must be set by a constructor. + * NOTE: Because instances of this class require 160-bit seeds, it is not possible to seed this RNG using the + * {@link #setSeed(long)} method inherited from {@link Random}. Calls to this method will have no effect. Instead the + * seed must be set by a constructor. *

- * + * * @author Daniel Dyer * @since 1.2 */ public class XORShiftRNG extends Random { // Lock to prevent concurrent modification of the RNG's internal state. private final ReentrantLock lock = new ReentrantLock(); - private final byte[] seed; // Previously used an array for state but using separate fields proved to be @@ -52,9 +49,7 @@ public class XORShiftRNG extends Random { /** * Creates an RNG and seeds it with the specified seed data. - * - * @param seed - * The seed data used to initialise the RNG. + * */ public XORShiftRNG() { this.seed = new byte[SEED_SIZE_BYTES]; @@ -67,16 +62,10 @@ public XORShiftRNG() { this.state5 = state[4]; } - /** - * {@inheritDoc} - */ public byte[] getSeed() { return seed.clone(); } - /** - * {@inheritDoc} - */ @Override protected int next(int bits) { try { @@ -94,18 +83,10 @@ protected int next(int bits) { } } - // Mask for casting a byte to an int, bit-by-bit (with - // bitwise AND) with no special consideration for the sign bit. - private static final int BITWISE_BYTE_TO_INT = 0x000000FF; - - private static Random SEED_GENERATOR = new Random(); - private static final int SEED_SIZE_BYTES = 20; // Needs 5 32-bit integers. - private static final long serialVersionUID = -1843001897066722618L; - /** * Take four bytes from the specified position in the specified block and convert them into a 32-bit int, using the * big-endian convention. - * + * * @param bytes * The data to read from. * @param offset @@ -120,7 +101,7 @@ public static int convertBytesToInt(byte[] bytes, int offset) { /** * Convert an array of bytes into an array of ints. 4 bytes from the input data map to a single int in the output * data. - * + * * @param bytes * The data to read from. * @return An array of 32-bit integers constructed from the data. @@ -136,4 +117,11 @@ public static int[] convertBytesToInts(byte[] bytes) { } return ints; } + + // Mask for casting a byte to an int, bit-by-bit (with + // bitwise AND) with no special consideration for the sign bit. + private static final int BITWISE_BYTE_TO_INT = 0x000000FF; + private static Random SEED_GENERATOR = new Random(); + private static final int SEED_SIZE_BYTES = 20; // Needs 5 32-bit integers. + private static final long serialVersionUID = -1843001897066722618L; } \ No newline at end of file