![Changed Addon Plus](https://media.forgecdn.net/avatars/thumbnails/949/783/256/256/638438127646487503.png)
[Suggestion]: Add the ability to disable the potions/tipped arrows that give the Untransfur effect.
Hidden44 opened this issue · 5 comments
I'm trying to make a modpack that focuses on you eventually getting the cure "Syringe with Litix-Camonia" but I can't seem to figure out how to remove the brewing stand recipes via datapacks. Can you make a config option to disable/enable those potions?
Please re-read, I meant the untransfur potions that you brew in the brewing stand. Is it possible to have a config to turn those potions off? All 3 potions; the normal, splash, and lingering potions.
Well Is not possible by normal ways but i gonna see if i can do something..
Please re-read, I meant the untransfur potions that you brew in the brewing stand. Is it possible to have a config to turn those potions off? All 3 potions; the normal, splash, and lingering potions.
Maybe it's okay?
import net.minecraftforge.common.brewing.BrewingRecipeRegistry;
public class ModBrewingRecipes {
public static void registerBrewingRecipes() {
if (ModConfig.CONFIG.enableCustomBrewingRecipe.get()) {
BrewingRecipeRegistry.addRecipe(new CustomBrewingRecipe(
new ItemStack(Items.POTION),
new ItemStack(Items.GHAST_TEAR),
new ItemStack(Items.POTION)
));
}
}
}
请重读一遍,我是说你在酿造台上酿造的 untransfur 药水。是否可以有一个配置来关闭这些药水?所有 3 种药水;普通药水、喷溅药水和滞留药水。
嗯,正常方式是不可能的,但我要看看我能不能做些什么..
I found a way. If I stop registering, wouldn't that be a disguised way of closing the recipe?
public static class Common {
public final ForgeConfigSpec.ConfigValue<Boolean> PotionSynthesis;
public Common(ForgeConfigSpec.Builder builder){
builder.comment("Turning this on will disable registration of potions for this mod. If you are not the modpack author, please turn this off.");
PotionSynthesis= builder.define("PotionSynthesis",false);
}
}
public static class Client {
public Client(ForgeConfigSpec.Builder builder){
}
}
public static class Server {
public Server(ForgeConfigSpec.Builder builder){
}
}
private final Pair<Common, ForgeConfigSpec> commonPair;
private final Pair<Client, ForgeConfigSpec> clientPair;
private final Pair<Server, ForgeConfigSpec> serverPair;
public final Common common;
public final Client client;
public final Server server;
public ChangedAddonModConfig(ModLoadingContext context) {
commonPair = new ForgeConfigSpec.Builder()
.configure(Common::new);
clientPair = new ForgeConfigSpec.Builder()
.configure(Client::new);
serverPair = new ForgeConfigSpec.Builder()
.configure(Server::new);
context.registerConfig(ModConfig.Type.COMMON, commonPair.getRight());
context.registerConfig(ModConfig.Type.CLIENT, clientPair.getRight());
context.registerConfig(ModConfig.Type.SERVER, serverPair.getRight());
common = commonPair.getLeft();
client = clientPair.getLeft();
server = serverPair.getLeft();
}
@SubscribeEvent
public static void init(FMLCommonSetupEvent event) {
if(!ChangedAddonMod.config.common.PotionSynthesis.get()) {
event.enqueueWork(() -> BrewingRecipeRegistry.addRecipe(new UntransfurPotionRecipeBrewingRecipe()));
}
}