use of net.minecraft.advancements.critereon.EntityPredicate in project Railcraft by Railcraft.
the class CartPredicate method deserialize.
public static CartPredicate deserialize(@Nullable JsonElement element) {
if (element == null || element.isJsonNull()) {
return CartPredicate.ANY;
}
JsonObject object = JsonUtils.getJsonObject(element, "a cart predicate");
Boolean highSpeed = JsonTools.nullableBoolean(object, CartConstants.TAG_HIGH_SPEED);
Boolean launched = JsonTools.nullableBoolean(object, CartConstants.TAG_LAUNCHED);
Boolean elevator = JsonTools.nullableBoolean(object, CartConstants.TAG_ELEVATOR);
Boolean derail = JsonTools.nullableBoolean(object, CartConstants.TAG_DERAIL);
Boolean canMount = JsonTools.nullableBoolean(object, "canMount");
Boolean checksOwner = JsonTools.nullableBoolean(object, "check_owner");
MinMaxBounds speed = MinMaxBounds.deserialize(object.get("speed"));
EntityPredicate parent = EntityPredicate.deserialize(object);
return new CartPredicate(highSpeed, launched, elevator, derail, canMount, checksOwner, speed, parent);
}
Aggregations