Fix HellsBells distribution
Dieser Commit ist enthalten in:
Ursprung
3ae18ab0b8
Commit
bd5fb0d7c7
@ -36,6 +36,7 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.logging.Level;
|
||||
|
||||
|
||||
public class HellsBells {
|
||||
@ -79,6 +80,7 @@ public class HellsBells {
|
||||
|
||||
AtomicInteger length = new AtomicInteger(20 + random.nextInt(direction.getLength(zLength, xLength) - 20));
|
||||
int width = 5 + random.nextInt(5);
|
||||
Bukkit.getLogger().log(Level.INFO, "Calculating Starts");
|
||||
int xOffset = getStart(direction.getLength(xLength, zLength), direction.getLength(length.get(), width));
|
||||
int zOffset = getStart(direction.getLength(zLength, xLength), direction.getLength(width, length.get()));
|
||||
int yOffset = getHeightStart();
|
||||
@ -114,6 +116,7 @@ public class HellsBells {
|
||||
|
||||
private int getStart(int regionSize, int length) {
|
||||
double randomNumber = (random.nextDouble() - random.nextDouble()) / 2 + 0.5;
|
||||
Bukkit.getLogger().log(Level.INFO, "Calculated Start: " + (int) (randomNumber * (regionSize - length)));
|
||||
return Math.max(Math.min((int) (randomNumber * (regionSize - length)), regionSize - length), 0);
|
||||
}
|
||||
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren