mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-28 00:34:19 +00:00
Batch 4 of the API review: api and host artifacts, ModuleLoadException
- Split into Gradle subprojects api (com.volmit:iris-api) and host (com.volmit:iris-host). ExposedPackages never exposes com.volmit.host. - One unchecked ModuleLoadException(moduleId, origin, message, cause) for every load error; messages unchanged. - PlacementAccess.set(x, y, z, state) next to set(PlacedBlock). - BlockState: precompiled patterns, withProperty copies once. - Mantle and layer views are made once per invocation. - Hunk getters are width(), height(), depth(). - Held types and host types are deprecated for removal at the cut-over. - Docs: artifacts, one-or-more modules per jar, no option shorthand.
This commit is contained in:
1 parent
3a307b5b8e
commit
b6c2992752
309 files changed
+547
-178
No files matched your search
@@ -0,0 +1,29 @@
|
||||
package com.volmit.service;
|
||||
|
||||
import com.volmit.world.BlockPosition;
|
||||
import java.util.Objects;
|
||||
|
||||
/** How a search for something in a world ended: found at a position, not there, or given up before covering the whole
|
||||
* area asked for.
|
||||
*/
|
||||
public sealed interface LocateResult {
|
||||
LocateResult NOT_FOUND = new NotFound();
|
||||
LocateResult SEARCH_LIMIT_REACHED = new SearchLimitReached();
|
||||
|
||||
static LocateResult found(BlockPosition position) {
|
||||
return new Found(position);
|
||||
}
|
||||
|
||||
/** Found at {@code position}: world X and Z, and Y the height above the dimension's bottom. */
|
||||
record Found(BlockPosition position) implements LocateResult {
|
||||
public Found {
|
||||
Objects.requireNonNull(position, "position");
|
||||
}
|
||||
}
|
||||
|
||||
/** The whole area was searched and holds none. */
|
||||
record NotFound() implements LocateResult {}
|
||||
|
||||
/** The search stopped before covering the area, such as after checking as many candidates as it allows itself. */
|
||||
record SearchLimitReached() implements LocateResult {}
|
||||
}
|
||||
Reference in new issue
Block a user