use of net.minecraft.advancements.critereon.ItemPredicate 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);
}
use of net.minecraft.advancements.critereon.ItemPredicate in project Railcraft by Railcraft.
the class SpikeMaulUseTrigger method deserializeInstance.
@Override
public Instance deserializeInstance(JsonObject json, JsonDeserializationContext context) {
NBTPredicate nbt = JsonTools.whenPresent(json, "nbt", NBTPredicate::deserialize, NBTPredicate.ANY);
ItemPredicate tool = JsonTools.whenPresent(json, "tool", ItemPredicate::deserialize, ItemPredicate.ANY);
LocationPredicate locationPredicate = JsonTools.whenPresent(json, "location", LocationPredicate::deserialize, LocationPredicate.ANY);
return new Instance(nbt, tool, locationPredicate);
}
use of net.minecraft.advancements.critereon.ItemPredicate in project MinecraftForge by MinecraftForge.
the class ForgeLootTableProvider method checkMatchTool.
private boolean checkMatchTool(MatchTool lootCondition, Item expected) {
ItemPredicate predicate = ObfuscationReflectionHelper.getPrivateValue(MatchTool.class, lootCondition, "f_8199" + "3_");
Set<Item> items = ObfuscationReflectionHelper.getPrivateValue(ItemPredicate.class, predicate, "f_15142" + "7_");
return items != null && items.contains(expected);
}
Aggregations