Unicopia/src/main/java/com/minelittlepony/unicopia/util/Registries.java

16 lines
567 B
Java
Raw Normal View History

2020-06-26 11:44:47 +02:00
package com.minelittlepony.unicopia.util;
import com.mojang.serialization.Lifecycle;
import net.fabricmc.fabric.api.event.registry.FabricRegistryBuilder;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
import net.minecraft.util.registry.RegistryKey;
import net.minecraft.util.registry.SimpleRegistry;
public interface Registries {
static <T> Registry<T> createSimple(Identifier id) {
return FabricRegistryBuilder.from(new SimpleRegistry<T>(RegistryKey.ofRegistry(id), Lifecycle.stable())).buildAndRegister();
}
}