Expose raw id from registries

This commit is contained in:
shedaniel
2021-01-25 12:26:38 +08:00
parent 9deb0f8be4
commit c13620fc9c
4 changed files with 38 additions and 3 deletions

View File

@@ -43,7 +43,6 @@ public interface ClientLifecycleEvent {
Event<ClientWorldState> CLIENT_WORLD_LOAD = EventFactory.createLoop();
Event<ClientState> CLIENT_SETUP = EventFactory.createLoop();
@Deprecated
@Environment(EnvType.CLIENT)
interface ClientState extends LifecycleEvent.InstanceState<Minecraft> {}

View File

@@ -49,11 +49,16 @@ public interface Registry<T> extends Iterable<T> {
@Nullable
ResourceLocation getId(T obj);
int getRawId(T obj);
Optional<ResourceKey<T>> getKey(T obj);
@Nullable
T get(ResourceLocation id);
@Nullable
T byRawId(int rawId);
boolean contains(ResourceLocation id);
boolean containsValue(T obj);