Search in sources :

Example 1 with Instance

use of mods.railcraft.common.advancements.criterion.UseTrackKitTrigger.Instance in project Railcraft by Railcraft.

the class UseTrackKitTrigger method deserializeInstance.

@Override
public Instance deserializeInstance(JsonObject json, JsonDeserializationContext context) {
    NBTPredicate nbt = JsonTools.whenPresent(json, "data", NBTPredicate::deserialize, NBTPredicate.ANY);
    ItemPredicate used = JsonTools.whenPresent(json, "used", ItemPredicate::deserialize, ItemPredicate.ANY);
    LocationPredicate location = JsonTools.whenPresent(json, "location", LocationPredicate::deserialize, LocationPredicate.ANY);
    return new Instance(nbt, used, location);
}
Also used : ItemPredicate(net.minecraft.advancements.critereon.ItemPredicate) Instance(mods.railcraft.common.advancements.criterion.UseTrackKitTrigger.Instance) ICriterionInstance(net.minecraft.advancements.ICriterionInstance) NBTPredicate(net.minecraft.advancements.critereon.NBTPredicate) LocationPredicate(net.minecraft.advancements.critereon.LocationPredicate)

Aggregations

Instance (mods.railcraft.common.advancements.criterion.UseTrackKitTrigger.Instance)1 ICriterionInstance (net.minecraft.advancements.ICriterionInstance)1 ItemPredicate (net.minecraft.advancements.critereon.ItemPredicate)1 LocationPredicate (net.minecraft.advancements.critereon.LocationPredicate)1 NBTPredicate (net.minecraft.advancements.critereon.NBTPredicate)1