use of net.minecraft.advancements.criterion.ItemPredicate in project minecolonies by Minecolonies.
the class CitizenEatFoodCriterionInstance method serializeToJson.
@NotNull
@Override
public JsonObject serializeToJson(@NotNull final ConditionArraySerializer serializer) {
final JsonObject json = super.serializeToJson(serializer);
if (this.itemPredicates != null && this.itemPredicates.length > 0) {
final JsonArray outputItemPredicates = new JsonArray();
for (ItemPredicate predicate : this.itemPredicates) {
outputItemPredicates.add(predicate.serializeToJson());
}
json.add("items", outputItemPredicates);
}
return json;
}
use of net.minecraft.advancements.criterion.ItemPredicate in project minecolonies by ldtteam.
the class BuildingAddRecipeCriterionInstance method serializeToJson.
@NotNull
@Override
public JsonObject serializeToJson(@NotNull final ConditionArraySerializer serializer) {
final JsonObject json = super.serializeToJson(serializer);
if (this.outputItemPredicates != null && this.outputItemPredicates.length > 0) {
final JsonArray outputItemPredicates = new JsonArray();
for (ItemPredicate predicate : this.outputItemPredicates) {
outputItemPredicates.add(predicate.serializeToJson());
}
json.add("items", outputItemPredicates);
}
if (this.craftingSize >= 0) {
json.addProperty("crafting_size", this.craftingSize);
}
return json;
}
use of net.minecraft.advancements.criterion.ItemPredicate in project minecolonies by Minecolonies.
the class BuildingAddRecipeCriterionInstance method serializeToJson.
@NotNull
@Override
public JsonObject serializeToJson(@NotNull final ConditionArraySerializer serializer) {
final JsonObject json = super.serializeToJson(serializer);
if (this.outputItemPredicates != null && this.outputItemPredicates.length > 0) {
final JsonArray outputItemPredicates = new JsonArray();
for (ItemPredicate predicate : this.outputItemPredicates) {
outputItemPredicates.add(predicate.serializeToJson());
}
json.add("items", outputItemPredicates);
}
if (this.craftingSize >= 0) {
json.addProperty("crafting_size", this.craftingSize);
}
return json;
}
use of net.minecraft.advancements.criterion.ItemPredicate in project minecolonies by ldtteam.
the class CitizenEatFoodCriterionInstance method serializeToJson.
@NotNull
@Override
public JsonObject serializeToJson(@NotNull final ConditionArraySerializer serializer) {
final JsonObject json = super.serializeToJson(serializer);
if (this.itemPredicates != null && this.itemPredicates.length > 0) {
final JsonArray outputItemPredicates = new JsonArray();
for (ItemPredicate predicate : this.itemPredicates) {
outputItemPredicates.add(predicate.serializeToJson());
}
json.add("items", outputItemPredicates);
}
return json;
}
Aggregations