mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-27 08:14:45 +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,25 @@
|
||||
package com.volmit.service;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/** Marks an interface as a service: a capability modules provide and the host looks up, such as finding a module's
|
||||
* structures, instead of knowing the feature behind it. Modules register providers with
|
||||
* {@link com.volmit.FeatureRegistry#registerService}; the host gets them from the pack's catalog.
|
||||
*
|
||||
* <p>Providers hold no state of their own: a provider is shared by every world, and the host may call it from any
|
||||
* thread, also from several at once. A provider keeps what it needs in the world's state store
|
||||
* ({@link com.volmit.world.PackWorld#state}), which is why service methods take the world. Services compute answers;
|
||||
* they never act on the platform themselves: what should happen in the world comes back as a value the host carries out
|
||||
* on the right thread.
|
||||
*/
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
public @interface Service {
|
||||
/** How the host treats several modules providing this service. */
|
||||
Providers value();
|
||||
}
|
||||
Reference in new issue
Block a user