Revert "Fix random"

This reverts commit 107d1fc8ff36dd963a23aede7a1ee9f52fbb29ed.
This commit is contained in:
CocoTheOwner 2021-10-01 13:10:07 +02:00 committed by cyberpwn
parent 2d0df240f4
commit 24f3176b1b
2 changed files with 3 additions and 7 deletions

View File

@ -783,7 +783,7 @@ public interface Engine extends DataProvider, Fallible, LootProvider, BlockUpdat
&& lb.matches(engine, chunk);
if (!regionKeys.isEmpty()) {
locator.find(player, Math.abs(distance), random);
locator.find(player, distance, random);
} else {
player.sendMessage(C.RED + biome.getName() + " is not in any defined regions!");
}

View File

@ -18,7 +18,6 @@
package com.volmit.iris.engine.framework;
import com.volmit.iris.Iris;
import com.volmit.iris.core.IrisSettings;
import com.volmit.iris.core.tools.IrisToolbelt;
import com.volmit.iris.engine.object.IrisBiome;
@ -106,11 +105,8 @@ public interface Locator<T> {
cancelSearch();
int fdistance = distance >> 4;
Position2 pos = random ? new Position2(M.irand(-29_000_000, 29_000_000) >> 4, M.irand(-29_000_000, 29_000_000) >> 4) : new Position2(location.getX(), location.getZ());
if (random) {
Iris.info("Randomly finding location from: " + pos);
}
return MultiBurst.burst.completeValue(() -> {
Position2 pos = random ? new Position2(M.irand(-29*10^6, 29*10^6), M.irand(-29*10^6, 29*10^6)) : new Position2(location.getX(), location.getZ());
int tc = IrisSettings.getThreadCount(IrisSettings.get().getConcurrency().getParallelism()) * 17;
MultiBurst burst = MultiBurst.burst;
AtomicBoolean found = new AtomicBoolean(false);
@ -120,7 +116,7 @@ public interface Locator<T> {
PrecisionStopwatch px = PrecisionStopwatch.start();
LocatorCanceller.cancel = () -> stop.set(true);
AtomicReference<Position2> next = new AtomicReference<>(pos);
Spiraler s = new Spiraler(50000, 50000, (x, z) -> next.set(new Position2(pos.getX() + (M.r(0.5) ? -1 : 1) * (x + fdistance), pos.getZ() + (M.r(0.5) ? -1 : 1) * (z + fdistance))));
Spiraler s = new Spiraler(50000, 50000, (x, z) -> next.set(new Position2((M.r(0.5) ? -1 : 1) * (x + fdistance), (M.r(0.5) ? -1 : 1) * (z + fdistance))));
s.setOffset(pos.getX(), pos.getZ());
s.next();