diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/event/HellsBells.java b/FightSystem_Main/src/de/steamwar/fightsystem/event/HellsBells.java index 6461d3e..a863b98 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/event/HellsBells.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/event/HellsBells.java @@ -79,8 +79,8 @@ public class HellsBells { AtomicInteger length = new AtomicInteger(10 + random.nextInt(direction.getLength(zLength, xLength) - 10)); int width = 5 + random.nextInt(5); - int xOffset = getWidthStart(direction.getLength(xLength, zLength), direction.getLength(length.get(), width)); - int zOffset = getLengthStart(direction.getLength(zLength, xLength), direction.getLength(width, length.get())); + 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(); Point redStart; @@ -112,12 +112,9 @@ public class HellsBells { }, 0L, 4L); } - private int getLengthStart(int regionSize, int length) { - return random.nextInt(regionSize - length); - } - - private int getWidthStart(int regionSize, int length) { - return random.nextInt(regionSize - length); + private int getStart(int regionSize, int length) { + double randomNumber = (random.nextDouble() - random.nextDouble()) / 2 + 0.5; + return (int) (randomNumber * (regionSize - length)); } private int getHeightStart() {