[Change] Recipe Handling moved to Datagen
This commit is contained in:
parent
f60fcd02d5
commit
809bfddd32
28 changed files with 1279 additions and 1121 deletions
|
@ -0,0 +1,35 @@
|
|||
package org.betterx.bclib.recipes;
|
||||
|
||||
import net.minecraft.advancements.CriterionTriggerInstance;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.tags.TagKey;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.level.ItemLike;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public abstract class AbstractUnlockableRecipeBuilder<T extends AbstractUnlockableRecipeBuilder> extends AbstractSimpleRecipeBuilder<T> {
|
||||
|
||||
protected AbstractUnlockableRecipeBuilder(ResourceLocation id, ItemLike output) {
|
||||
super(id, output);
|
||||
}
|
||||
|
||||
protected final Map<String, CriterionTriggerInstance> unlocks = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public T unlockedBy(ItemLike item) {
|
||||
return super.unlockedBy(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public T unlockedBy(TagKey<Item> tag) {
|
||||
return super.unlockedBy(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected T unlocks(String name, CriterionTriggerInstance trigger) {
|
||||
this.unlocks.put(name, trigger);
|
||||
return (T) this;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue