mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-27 16:25:36 +00:00
- 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.
39 lines
1.8 KiB
Java
39 lines
1.8 KiB
Java
package com.volmit.service;
|
|
|
|
import com.volmit.resource.ResourceId;
|
|
import com.volmit.vanilla.DecorationStep;
|
|
import com.volmit.world.PackWorld;
|
|
|
|
import java.util.Optional;
|
|
|
|
/**
|
|
* A module's say over the platform's own placed features in the pack's worlds: the ores, trees, plants, springs and other
|
|
* decorations Minecraft, data packs and mods declare for a biome. By default the platform runs none of them over the pack's
|
|
* terrain. The host asks every provider, in module id order: it runs the platform's feature pass in a world when any
|
|
* provider turns it on with {@link #generates}, and then skips a decoration step or a feature that any provider refuses.
|
|
*
|
|
* <p>Every answer is decided from the world alone (its settings and resources), never from a position: the host asks once
|
|
* per world, and once per world and step or feature, and keeps the answer while the world runs. Every method may be
|
|
* called from any thread, concurrently.
|
|
*/
|
|
@Service(Providers.ALL)
|
|
public interface VanillaFeatures {
|
|
/** Whether the platform runs its placed features over the terrain of {@code world}. False when the module has no part in it. */
|
|
default boolean generates(PackWorld world) {
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
* Whether the platform places the features of decoration step {@code step} in {@code world}: empty for a step of a newer
|
|
* platform the API does not know yet. True when the module has no part in it.
|
|
*/
|
|
default boolean generatesStep(PackWorld world, Optional<DecorationStep> step) {
|
|
return true;
|
|
}
|
|
|
|
/** Whether the platform places the feature {@code feature}, such as {@code minecraft:ore_diamond}, in {@code world}. True when the module has no part in it. */
|
|
default boolean generatesFeature(PackWorld world, ResourceId feature) {
|
|
return true;
|
|
}
|
|
}
|