mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-27 00:04:42 +00:00
PlatformStart gives the dimension's bottom; the catalog lists every provider of a service with its module
A shift rule written in world heights (a band of world Y) needs the bottom to convert the start's bounds, and the host asks each VanillaStructures provider in module order, naming the module when one fails. BlockAccess documents that a structure fit's access answers only the traits the platform's world can answer natively.
This commit is contained in:
1 parent
ee7bb11790
commit
4755e24407
4 files changed
+17
-1
No files matched your search
@@ -89,6 +89,14 @@ public final class FeatureCatalog {
|
||||
.toList();
|
||||
}
|
||||
|
||||
/** Every provider of {@code service} with the module that registered it, in the order of {@link #services}, so the host
|
||||
* can name the module whose provider failed.
|
||||
*/
|
||||
public List<ServiceRegistration> registrations(Class<?> service) {
|
||||
requireService(service);
|
||||
return services.stream().filter(registration -> registration.service() == service).toList();
|
||||
}
|
||||
|
||||
/** The one provider of {@code service}, a service whose providers are {@link Providers#ONE}, if a module provides it. */
|
||||
public <S> Optional<S> service(Class<S> service) {
|
||||
if (requireService(service).value() != Providers.ONE) {
|
||||
|
||||
@@ -26,6 +26,9 @@ public interface PlatformStart {
|
||||
*/
|
||||
boolean aligned();
|
||||
|
||||
/** The world height of the dimension's bottom, for rules written in world heights, such as a band of world Y. */
|
||||
int bottomY();
|
||||
|
||||
/** The height of the terrain's surface at a column, above the dimension's bottom: the highest block of the terrain
|
||||
* the host generated there, fluids ignored.
|
||||
*/
|
||||
|
||||
@@ -34,7 +34,9 @@ public interface BlockAccess {
|
||||
* {@link BlockTrait#SOLID} for what the platform counts as solid, {@link BlockTrait#FLUID} for a state holding any
|
||||
* fluid (a source, a flowing fluid, a waterlogged block), {@link BlockTrait#LOG} for logs, wood, stems and hyphae and
|
||||
* {@link BlockTrait#LEAVES} for leaves, by the platform's tags or names. These can differ in corner cases from
|
||||
* {@link com.volmit.block.BlockRegistry#hasTrait}, which describes blocks the way generation picks them.
|
||||
* {@link com.volmit.block.BlockRegistry#hasTrait}, which describes blocks the way generation picks them. Other
|
||||
* traits are not answered: the platform's world has no native question for them, so asking throws
|
||||
* {@link UnsupportedOperationException}.
|
||||
*/
|
||||
boolean is(BlockState state, BlockTrait trait);
|
||||
|
||||
|
||||
Reference in new issue
Block a user