Class SRuntimeRegistry
java.lang.Object
net.lcc.sollib.api.common.data.runtime.SRuntimeRegistry
- All Implemented Interfaces:
SEventListener
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.google.gson.Gsonstatic final SRuntimeRegistrystatic final SolLogger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddDefault(net.minecraft.resources.ResourceLocation target, String content) Dynamically adds the specified data if it doesn't exist already (on each reload)addDefault(net.minecraft.resources.ResourceLocation target, String content, Supplier<Boolean> activationRule) Dynamically adds the specified data if activationRule is met and it doesn't exist already (on each reload)addJson(net.minecraft.resources.ResourceLocation target, UnaryOperator<com.google.gson.JsonObject> function) Dynamically changes the specified data if activationRule is met (on each reload)
In case the targeted data doesn't exist, a null value will be passed to functionaddJson(net.minecraft.resources.ResourceLocation target, UnaryOperator<com.google.gson.JsonObject> function, Supplier<Boolean> activationRule) Dynamically changes the specified data if activationRule is met (on each reload)
Only applied if activationRule is met for that specific reload
In case the targeted data doesn't exist, a null value will be passed to functionaddRemoval(net.minecraft.resources.ResourceLocation target, Supplier<Boolean> activationRule) Dynamically removes the specified data if activationRule is met (on each reload)addText(net.minecraft.resources.ResourceLocation target, UnaryOperator<String> function) Dynamically changes the specified data if activationRule is met (on each reload)
In case the targeted data doesn't exist, a null value will be passed to functionaddText(net.minecraft.resources.ResourceLocation target, UnaryOperator<String> function, Supplier<Boolean> activationRule) Dynamically changes the specified data if activationRule is met (on each reload)
Only applied if activationRule is met for that specific reload
In case the targeted data doesn't exist, a null value will be passed to functionnet.minecraft.server.packs.resources.Resourceapply(net.minecraft.resources.ResourceLocation target, net.minecraft.server.packs.resources.Resource original) voidclean()List<net.minecraft.resources.ResourceLocation>findMatching(String startingPath, Predicate<net.minecraft.resources.ResourceLocation> allowedPathPredicate) voidCalled everytime aSolConfigis built.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.lcc.sollib.api.event.SEventListener
onPreload, onReload, registerEvents
-
Field Details
-
INSTANCE
-
LOG
-
GSON
public static final com.google.gson.Gson GSON
-
-
Constructor Details
-
SRuntimeRegistry
public SRuntimeRegistry()
-
-
Method Details
-
addRemoval
public RuntimeData addRemoval(net.minecraft.resources.ResourceLocation target, Supplier<Boolean> activationRule) Dynamically removes the specified data if activationRule is met (on each reload) -
addDefault
Dynamically adds the specified data if it doesn't exist already (on each reload) -
addDefault
public RuntimeData addDefault(net.minecraft.resources.ResourceLocation target, String content, Supplier<Boolean> activationRule) Dynamically adds the specified data if activationRule is met and it doesn't exist already (on each reload) -
addJson
public RuntimeData addJson(net.minecraft.resources.ResourceLocation target, UnaryOperator<com.google.gson.JsonObject> function) Dynamically changes the specified data if activationRule is met (on each reload)
In case the targeted data doesn't exist, a null value will be passed to function -
addJson
public RuntimeData addJson(net.minecraft.resources.ResourceLocation target, UnaryOperator<com.google.gson.JsonObject> function, Supplier<Boolean> activationRule) Dynamically changes the specified data if activationRule is met (on each reload)
Only applied if activationRule is met for that specific reload
In case the targeted data doesn't exist, a null value will be passed to function -
addText
public RuntimeData addText(net.minecraft.resources.ResourceLocation target, UnaryOperator<String> function) Dynamically changes the specified data if activationRule is met (on each reload)
In case the targeted data doesn't exist, a null value will be passed to function -
addText
public RuntimeData addText(net.minecraft.resources.ResourceLocation target, UnaryOperator<String> function, Supplier<Boolean> activationRule) Dynamically changes the specified data if activationRule is met (on each reload)
Only applied if activationRule is met for that specific reload
In case the targeted data doesn't exist, a null value will be passed to function -
apply
@Internal public net.minecraft.server.packs.resources.Resource apply(net.minecraft.resources.ResourceLocation target, net.minecraft.server.packs.resources.Resource original) -
findMatching
-
clean
@Internal public void clean() -
onConfigBuild
Description copied from interface:SEventListenerCalled everytime aSolConfigis built. Can be used to append extra fields to its end.- Specified by:
onConfigBuildin interfaceSEventListener
-