com.yungnickyoung.minecraft.yungsapi.module.CriteriaModuleFabric Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of YungsApi-1.21-Fabric Show documentation
Show all versions of YungsApi-1.21-Fabric Show documentation
A common API for YUNG's Minecraft mods
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();
}
}