Interface ConditionJsonProvider
public interface ConditionJsonProvider
A resource condition and its parameters that can be serialized to JSON, meant for use in data generators.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the identifier of this condition.default JsonObject
toJson()
Serialize this condition and its parameters to a new JSON object.static void
write
(JsonObject conditionalObject, ConditionJsonProvider @Nullable ... conditions) Write the passed conditions to a JSON object in the "fabric:load_conditions" array.void
writeParameters
(JsonObject object) Write the condition parameters (everything except the"condition": ...
entry).
-
Method Details
-
write
Write the passed conditions to a JSON object in the "fabric:load_conditions" array.- Throws:
IllegalArgumentException
- if the JSON object already contains that array
-
toJson
Serialize this condition and its parameters to a new JSON object. -
getConditionId
Identifier getConditionId()Returns the identifier of this condition. This is only for use bytoJson()
to write it.- Returns:
- the identifier of this condition
-
writeParameters
Write the condition parameters (everything except the"condition": ...
entry). This is only for use bytoJson()
.
-