You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (((MinecraftServerExtended) this.server).setspawnmod$shouldModifySpawn()) {
@@ -54,8 +54,9 @@ private int setSpawn(Random random, int bounds, Operation<Integer> original, @Lo
54
54
55
55
if (xLocal >=0 && xLocal < spawnDiameter && result >= 0 && result < bounds) {
56
56
// we save the original result in case the set spawn is invalid, see fallbackOnInvalidSpawn
57
-
System.out.println("Setting spawn");
58
57
originalRandomResult.set(originalResult);
58
+
newRandomValue.set(result);
59
+
System.out.println("Setting spawn");
59
60
returnresult;
60
61
} else {
61
62
this.setSpawnError = "The X or Z coordinates given (" + seed.get().getX() + ", " + seed.get().getZ() + ") are more than the worlds spawn radius (" + spawnRadius + " blocks) away from the world spawn. Not overriding player spawnpoint.";
@@ -64,7 +65,7 @@ private int setSpawn(Random random, int bounds, Operation<Integer> original, @Lo
// checks if the for loop is on its second iteration (p == 1), meaning the setspawn given spawn was invalid
69
70
// and restores the original result of Random#nextInt
70
71
if (p == 1 && originalRandomResult.get() != null) {
@@ -74,6 +75,14 @@ private int fallbackOnInvalidSpawn(int p, @Local(ordinal = 4) LocalIntRef o, @Sh
74
75
75
76
this.setSpawnError = "There is no valid spawning location at the specified coordinates (" + seed.get().getX() + ", " + seed.get().getZ() + "). Not overriding player spawnpoint.";
76
77
}
78
+
// if we made it to the end of the loop after an obstructed spawn and didn't find another non-obstructed spawn
79
+
// redo the last iteration of the loop with the choice obstructed spawn
80
+
if (p == k && originalRandomResult.get() == null && newRandomValue.get() != null) {
if (((MinecraftServerExtended) this.server).setspawnmod$shouldModifySpawn()) {
@@ -53,8 +53,9 @@ private int setSpawn(Random random, int bounds, Operation<Integer> original, @Lo
53
53
54
54
if (xLocal >=0 && xLocal < spawnDiameter && result >= 0 && result < bounds) {
55
55
// we save the original result in case the set spawn is invalid, see fallbackOnInvalidSpawn
56
-
System.out.println("Setting spawn");
57
56
originalRandomResult.set(originalResult);
57
+
newRandomValue.set(result);
58
+
System.out.println("Setting spawn");
58
59
returnresult;
59
60
} else {
60
61
this.setSpawnError = "The X or Z coordinates given (" + seed.get().getX() + ", " + seed.get().getZ() + ") are more than the worlds spawn radius (" + spawnRadius + " blocks) away from the world spawn. Not overriding player spawnpoint.";
@@ -63,7 +64,7 @@ private int setSpawn(Random random, int bounds, Operation<Integer> original, @Lo
// checks if the for loop is on its second iteration (p == 1), meaning the setspawn given spawn was invalid
68
69
// and restores the original result of Random#nextInt
69
70
if (p == 1 && originalRandomResult.get() != null) {
@@ -73,6 +74,14 @@ private int fallbackOnInvalidSpawn(int p, @Local(ordinal = 4) LocalIntRef o, @Sh
73
74
74
75
this.setSpawnError = "There is no valid spawning location at the specified coordinates (" + seed.get().getX() + ", " + seed.get().getZ() + "). Not overriding player spawnpoint.";
75
76
}
77
+
// if we made it to the end of the loop after an obstructed spawn and didn't find another non-obstructed spawn
78
+
// redo the last iteration of the loop with the choice obstructed spawn
79
+
if (p == k && originalRandomResult.get() == null && newRandomValue.get() != null) {
// checks if the for loop is on its second iteration (p == 1), meaning the setspawn given spawn was invalid
72
73
// and restores the original result of Random#nextInt
73
74
if (p == 1 && originalRandomResult.get() != null) {
@@ -77,6 +78,14 @@ private int fallbackOnInvalidSpawn(int p, @Local(ordinal = 4) LocalIntRef o, @Sh
77
78
78
79
this.setSpawnError = "There is no valid spawning location at the specified coordinates (" + seed.get().getX() + ", " + seed.get().getZ() + "). Not overriding player spawnpoint.";
79
80
}
81
+
// if we made it to the end of the loop after an obstructed spawn and didn't find another non-obstructed spawn
82
+
// redo the last iteration of the loop with the choice obstructed spawn
83
+
if (p == k && originalRandomResult.get() == null && newRandomValue.get() != null) {
0 commit comments