Interface IVariableFacadeHandler<F extends IVariableFacade>
- Type Parameters:
F
- The type of variable facade.
- All Known Subinterfaces:
IAspectRegistry
,IOperatorRegistry
,IValueTypeRegistry
- All Known Implementing Classes:
AspectRegistry
,DelayVariableFacadeHandler
,OperatorRegistry
,ProxyVariableFacadeHandler
,ValueTypeRegistry
public interface IVariableFacadeHandler<F extends IVariableFacade>
Handler for retrieving variable facades from items.
Must be registered in
IVariableFacadeHandlerRegistry
.-
Method Summary
Modifier and TypeMethodDescriptiondefault VariableFacadePredicate
deserializeVariableFacadePredicate
(ValueDeseralizationContext valueDeseralizationContext, com.google.gson.JsonObject element) Deserialize the given JSON element to a variable facade predicate.default VariablePredicate
deserializeVariablePredicate
(ValueDeseralizationContext valueDeseralizationContext, com.google.gson.JsonObject element, IValueType valueType, ValuePredicate valuePredicate) Deserialize the given JSON element to a variable predicate.net.minecraft.resources.ResourceLocation
getVariableFacade
(ValueDeseralizationContext valueDeseralizationContext, int id, net.minecraft.nbt.CompoundTag tagCompound) Get the variable facade for the given tag.void
setVariableFacade
(net.minecraft.nbt.CompoundTag tagCompound, F variableFacade) Set the variable facade for the given tag.
-
Method Details
-
getUniqueName
net.minecraft.resources.ResourceLocation getUniqueName()- Returns:
- The unique name of this type used to identity variables to this handler.
-
getVariableFacade
F getVariableFacade(ValueDeseralizationContext valueDeseralizationContext, int id, net.minecraft.nbt.CompoundTag tagCompound) Get the variable facade for the given tag.- Parameters:
valueDeseralizationContext
-id
- The id that was read and needs to be inserted into the variable facade.tagCompound
- The tag containing information that can be read and used to form a variable facade.- Returns:
- The variable facade
-
setVariableFacade
Set the variable facade for the given tag.- Parameters:
tagCompound
- The tag that is used to write variable facade information to.variableFacade
- The facade to write.
-
deserializeVariablePredicate
default VariablePredicate deserializeVariablePredicate(ValueDeseralizationContext valueDeseralizationContext, com.google.gson.JsonObject element, @Nullable IValueType valueType, ValuePredicate valuePredicate) Deserialize the given JSON element to a variable predicate.- Parameters:
valueDeseralizationContext
-element
- The JSON element.valueType
- The optional value type.valuePredicate
- The value predicate.- Returns:
- The variable predicate.
-
deserializeVariableFacadePredicate
default VariableFacadePredicate deserializeVariableFacadePredicate(ValueDeseralizationContext valueDeseralizationContext, com.google.gson.JsonObject element) Deserialize the given JSON element to a variable facade predicate.- Parameters:
valueDeseralizationContext
-element
- The JSON element.- Returns:
- The variable facade predicate.
-