Java 类net.minecraftforge.fml.common.registry.IForgeRegistryEntry.Impl 实例源码

项目:Alchemy    文件:Dump.java   
public static void dumpFile(RegistryNamespaced namespaced, String name) throws IOException {
    File output = new File(dump_dir, name + ".dump");
    Map<Impl, Integer> map = dumpId(namespaced);
    BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(output)));
    for (Entry<Impl, Integer> entry : map.entrySet()) {
        writer.write(entry.getValue() + " - " + entry.getKey().getRegistryName());
        writer.newLine();
    }
    writer.close();
}
项目:Alchemy    文件:Dump.java   
public static Map<Impl, Integer> dumpId(RegistryNamespaced<ResourceLocation, Impl> namespaced) {
    return StreamSupport.stream(namespaced.spliterator(), false).collect(Maps::newLinkedHashMap,
            (map, impl) -> map.put(impl, namespaced.getIDForObject(impl)), Map::putAll);
}