All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.yungnickyoung.minecraft.yungsapi.module.CriteriaModuleFabric Maven / Gradle / Ivy

The newest version!
package com.yungnickyoung.minecraft.yungsapi.module;

import com.yungnickyoung.minecraft.yungsapi.autoregister.AutoRegisterField;
import com.yungnickyoung.minecraft.yungsapi.autoregister.AutoRegistrationManager;
import net.minecraft.class_179;
import net.minecraft.class_2378;
import net.minecraft.class_7923;

/**
 * Registration of custom criteria triggers for advancements.
 */
public class CriteriaModuleFabric {
    public static void processEntries() {
        AutoRegistrationManager.CRITERION_TRIGGERS.stream()
                .filter(data -> !data.processed())
                .forEach(CriteriaModuleFabric::register);
    }

    private static void register(AutoRegisterField data) {
        class_179 trigger = (class_179) data.object();
        class_2378.method_10230(class_7923.field_47496, data.name(), trigger);
        data.markProcessed();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy