mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-27 00:04:42 +00:00
Give modules per-world state, lifecycle hooks and services: PackWorld with its state store, InvocationContext.world(), ModuleLifecycle, @Service with Providers ALL, FIRST and ONE, ObjectsAt and StructureLocator, and the host's WorldStates, LifecycleRunner and catalog lookups
This commit is contained in:
1 parent
ef4b640867
commit
b20a3cf719
29 files changed
+1286
-17
No files matched your search
@@ -0,0 +1,39 @@
|
||||
package com.volmit.support;
|
||||
|
||||
import com.volmit.block.BlockRegistry;
|
||||
import com.volmit.resource.PackResources;
|
||||
import com.volmit.resource.ResourceId;
|
||||
import com.volmit.resource.ResourceKey;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
/** A pack {@code test:pack} without resources. */
|
||||
public final class EmptyResources implements PackResources {
|
||||
private final UUID snapshot = UUID.randomUUID();
|
||||
|
||||
@Override
|
||||
public ResourceId packId() {
|
||||
return new ResourceId("test", "pack");
|
||||
}
|
||||
|
||||
@Override
|
||||
public UUID snapshotId() {
|
||||
return snapshot;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockRegistry blocks() {
|
||||
throw new AssertionError("Unused blocks");
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> Optional<T> find(ResourceKey<T> key) {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ResourceId> ids(Class<?> type) {
|
||||
return List.of();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user