Recipe config check
This commit is contained in:
parent
8472ad3c1d
commit
a00c1f749c
3 changed files with 23 additions and 0 deletions
|
@ -10,6 +10,7 @@ import net.minecraft.world.item.crafting.SmeltingRecipe;
|
|||
import net.minecraft.world.item.crafting.SmokingRecipe;
|
||||
import net.minecraft.world.level.ItemLike;
|
||||
import ru.bclib.BCLib;
|
||||
import ru.bclib.config.PathConfig;
|
||||
|
||||
public class FurnaceRecipe {
|
||||
private static final FurnaceRecipe INSTANCE = new FurnaceRecipe();
|
||||
|
@ -37,6 +38,11 @@ public class FurnaceRecipe {
|
|||
return INSTANCE;
|
||||
}
|
||||
|
||||
public FurnaceRecipe checkConfig(PathConfig config) {
|
||||
exist = config.getBoolean("furnace", id.getPath(), true);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FurnaceRecipe setGroup(String group) {
|
||||
this.group = group;
|
||||
return this;
|
||||
|
|
|
@ -17,6 +17,7 @@ import net.minecraft.world.item.crafting.ShapedRecipe;
|
|||
import net.minecraft.world.item.crafting.ShapelessRecipe;
|
||||
import net.minecraft.world.level.ItemLike;
|
||||
import ru.bclib.BCLib;
|
||||
import ru.bclib.config.PathConfig;
|
||||
|
||||
public class GridRecipe {
|
||||
private static final GridRecipe INSTANCE = new GridRecipe();
|
||||
|
@ -49,6 +50,11 @@ public class GridRecipe {
|
|||
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
public GridRecipe checkConfig(PathConfig config) {
|
||||
exist = config.getBoolean("grid", id.getPath(), true);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GridRecipe setGroup(String group) {
|
||||
this.group = group;
|
||||
|
|
|
@ -9,6 +9,7 @@ import net.minecraft.world.item.crafting.RecipeType;
|
|||
import net.minecraft.world.item.crafting.UpgradeRecipe;
|
||||
import net.minecraft.world.level.ItemLike;
|
||||
import ru.bclib.BCLib;
|
||||
import ru.bclib.config.PathConfig;
|
||||
|
||||
public class SmithingTableRecipe {
|
||||
|
||||
|
@ -34,9 +35,15 @@ public class SmithingTableRecipe {
|
|||
private Ingredient addition;
|
||||
private ItemStack result;
|
||||
private boolean alright;
|
||||
private boolean exist;
|
||||
|
||||
private SmithingTableRecipe() {}
|
||||
|
||||
public SmithingTableRecipe checkConfig(PathConfig config) {
|
||||
exist = config.getBoolean("smithing", id.getPath(), true);
|
||||
return this;
|
||||
}
|
||||
|
||||
public SmithingTableRecipe setResult(ItemLike item) {
|
||||
return this.setResult(item, 1);
|
||||
}
|
||||
|
@ -70,6 +77,10 @@ public class SmithingTableRecipe {
|
|||
}
|
||||
|
||||
public void build() {
|
||||
if (!exist) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (base == null) {
|
||||
BCLib.LOGGER.warning("Base input for Smithing recipe can't be 'null', recipe {} will be ignored!", id);
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue