package com.irtimaled.bbor.client.providers;
-import com.irtimaled.bbor.client.PlayerCoords;
+import com.irtimaled.bbor.client.Player;
import com.irtimaled.bbor.client.interop.SpawningSphereHelper;
import com.irtimaled.bbor.client.models.Point;
import com.irtimaled.bbor.common.MathHelper;
private static BoundingBoxSpawningSphere spawningSphere;
private static Integer dimensionId;
- public static void setSphere() {
- Coords coords = PlayerCoords.get();
- double xOffset = snapToNearestHalf(PlayerCoords.getX() -coords.getX());
- double yOffset = PlayerCoords.getY()- coords.getY();
- double zOffset = snapToNearestHalf(PlayerCoords.getZ()-coords.getZ());
+ public static void setSphere(double x, double y, double z) {
+ Coords coords = new Coords(x, y, z);
+ double xOffset = snapToNearestHalf(x -coords.getX());
+ double yOffset = y- coords.getY();
+ double zOffset = snapToNearestHalf(z-coords.getZ());
if(spawningSphere != null && spawningSphere.isCenter(coords, xOffset, yOffset, zOffset)) {
return;
}
clear();
- dimensionId = PlayerCoords.getDimensionId();
+ dimensionId = Player.getDimensionId();
spawningSphere = new BoundingBoxSpawningSphere(coords, xOffset, yOffset, zOffset);
}
return SpawningSphereHelper.findSpawnableSpaces(center, center.getCoords(), size, size, (x, y, z) -> true);
}
- private static Iterable<BoundingBoxSpawningSphere> iterable = Iterators.singleton(() -> spawningSphere);
+ private static final Iterable<BoundingBoxSpawningSphere> iterable = Iterators.singleton(() -> spawningSphere);
public Iterable<BoundingBoxSpawningSphere> get(int dimensionId) {
if(spawningSphere == null || SpawningSphereProvider.dimensionId != dimensionId) {
}
return iterable;
}
-}
\ No newline at end of file
+}