Allow being more flexible in registering

Signed-off-by: shedaniel <daniel@shedaniel.me>
This commit is contained in:
shedaniel
2021-05-12 15:05:04 +08:00
parent 2eef26f632
commit cfef5f28b7
4 changed files with 11 additions and 11 deletions

View File

@@ -34,7 +34,7 @@ public interface ClientLifecycleEvent {
*/
@Deprecated Event<ClientState> CLIENT_STARTED = EventFactory.createLoop();
/**
* Invoked when client is initialising, not available in forge.
* Invoked when client is stopping, not available in forge.
*/
@Deprecated Event<ClientState> CLIENT_STOPPING = EventFactory.createLoop();
/**

View File

@@ -35,11 +35,11 @@ public interface Registry<T> extends Iterable<T> {
RegistrySupplier<T> delegateSupplied(ResourceLocation id);
default Supplier<T> register(ResourceLocation id, Supplier<T> supplier) {
default <E extends T> Supplier<E> register(ResourceLocation id, Supplier<E> supplier) {
return registerSupplied(id, supplier);
}
RegistrySupplier<T> registerSupplied(ResourceLocation id, Supplier<T> supplier);
<E extends T> RegistrySupplier<E> registerSupplied(ResourceLocation id, Supplier<E> supplier);
@Nullable
ResourceLocation getId(T obj);