Jump to content

Recommended Posts

Posted (edited)

I want conditional recipes, which only are registered if an item is present. (So that JEI won't show them). The recipes were already custom classes, because they're for my custom "crafting table". I need to implement this support via the json recipe system (so my options are limited to things I can do inside of Factory.parse, I believe.

 

What I tried so far:

1. Returning an output of ItemStack.EMPTY (just shows up as a recipe with no output in JEI)

2. Returning null instead of a valid IRecipe in the factory (crashes, which I kinda expected)
3. Setting a slot in the recipe to an IngredientNever (basically the same thing as Choonster's) (Just shows up as an empty slot in JEI)

 

The other options I can think of:
 

1. Throw a JsonSyntaxException. The game doesn't crash if I do this, and the recipe isn't registered, but it will spam the log.

2. Figure out some way of hiding the recipes in JEI. (I've looked into this a bit but haven't found anything yet)

3. Figure out a way to deregister recipes (potentially the same way that CraftTweaker does it? I haven't looked into this yet) 

 

I'm not really too fond of these other solutions. Is there a simple solution that I'm missing? If not, do you think it would be reasonable to suggest forge to allow Factory.parse to return null and silently skip the recipe it in that case?

Edited by Aarilight
Posted

Use the minecraft:item_exists recipe condition to prevent a recipe from being registered if an Item doesn't exist.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted (edited)

I'm not really too fond of that solution either because it requires adding additional information to the json, things which I just want to happen by default for this recipe type.

 

Also, I phrased the initial post wrong, I said "if an item is present", I should have said "if an item in a given ore dictionary is present"

 

My current recipe factory actually supports using the first ItemStack in an ore dictionary as it's result, and I'm combining that with an ore dictionary ingredient.

I guess I might as well post my current recipe:

{
	"type": "soulus:composer_shaped",
	"time": 16,
	"pattern": [
		"eee",
		"ede",
		"eee"
	],
	"key": {
		"d": {
			"type": "forge:ore_dict",
			"ore": "dustLead"
		},
		"e": {
			"item": "soulus:ingot_endersteel"
		}
	},
	"result": {
		"type": "forge:ore_dict",
		"ore": "ingotLead",
		"count": 8
	}
}

 

Everything is implemented and works except for the issues with not being able to fail it silently.

 

If there really is no other solution I'll add in that new condition, I guess.

Edited by Aarilight
Posted

If the recipe is for your custom crafting table, does that mean you're calling CraftingHelper.findFiles yourself to load the recipes? If so, you could check that the recipe's output is non-empty between loading and registering it.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted (edited)

No, I register them with the rest of the normal recipes (via _factories.json) ... the instances simply don't match unless they're used in my crafting table.

 

The reason I do it that way is my crafting table also supports all vanilla recipes. It's an autocrafting table =P

Edited by Aarilight
Posted

Then I think the least hackish way to handle this would probably be adding the condition to your recipes.

 

If you really don't want to do that, you could probably integrate with JEI to hide your uncraftable recipes.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted

I actually ended up just deregistering any recipes which were instances of my table's recipes and had an empty output. I realised that the major downside to this way was the advancement issues, and since the recipes are optional depending on mods anyway, having advancements relating to them (if I were to ever make them) wouldn't even really make sense. If I ever need to jump over that hurdle, I'll rewrite this then. Thanks for your help. =)

 

Out of curiosity, do you think a recipe factory returning null would make sense to fail silently? Cause I still think that would have been the most elegant solution... maybe I should make a forge issue/pr, but I feel like that would be a controversial change? If there would be people that disagree with a change like that I don't think my needs here are important enough to warrant it.

Posted
  On 1/21/2018 at 10:35 AM, Aarilight said:

Out of curiosity, do you think a recipe factory returning null would make sense to fail silently? Cause I still think that would have been the most elegant solution... maybe I should make a forge issue/pr, but I feel like that would be a controversial change? If there would be people that disagree with a change like that I don't think my needs here are important enough to warrant it.

Expand  

 

It could be useful in some circumstances, but I'm not sure how many people would actually need it.

 

It probably wouldn't hurt to open an issue/PR, the worst that can happen is that it's closed because Lex/mezz don't see a wide use for it.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted

Here's where I get the ItemStack:

private static ItemStack getOreDictItem (JsonObject result, JsonContext context) {
    if (JsonUtils.getString(result, "type", "").equals("forge:ore_dict")) {
        String ore = JsonUtils.getString(result, "ore");
        ItemStack stack = OreDictionary.getOres(ore).stream().findAny().orElse(ItemStack.EMPTY).copy();
        stack.setCount(JsonUtils.getInt(result, "count", 1));
        int data = JsonUtils.getInt(result, "data", -1);
        if (data > -1) stack.setItemDamage(data);
        return stack;

    } else {
        return CraftingHelper.getItemStack(result, context);
    }
}

 

Would this not work for it? Should I be looping through it manually to find a valid stack? As of now I've made 8 recipes that seem to work with it, but I guess if the list could include empty item stacks I should probably do that? I would think that would be a mod bug tho, if empty stacks are being added to an ore dictionary (and should probably be reported to those mods)?

 

Also, conditions were mentioned previously in this conversation. The reason I didn't want to go for them is afaik, it requires adding additional information to each json recipe. It would have to be a recipe condition, as it's based on whether the "result" property in the json is a valid ore dictionary item. So basically, what would happen is the condition would check if the result !isEmpty(), and if it is, it would pass the condition, and then this code would be run again when the recipe is actually built.

 

Since I'm doing this additional parsing as part of the recipe, to me it makes sense to allow failing during that.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Temu Coupon Code 40% Off is a fantastic opportunity to save big on a wide range of products from the popular online marketplace, Temu. With this exclusive code, you can enjoy significant discounts on electronics, clothing, home goods, and much more. The acu729640 Temu coupon code is specifically designed to provide maximum benefits for shoppers in the USA, Canada, and European nations. This code unlocks exclusive deals and offers that are not available elsewhere, making it a valuable asset for savvy shoppers. This article will guide you through everything you need to know about the Temu coupon code 2025 for existing customers, including how to redeem it and the amazing benefits it offers. We'll also explore the Temu 40% discount coupon for new users and how to maximize your savings on your next Temu purchase. What Is The Temu Coupon Code 40% Off? The Temu coupon 40% off is an exclusive offer that allows both new and existing customers to enjoy significant savings on their Temu purchases. By using this code, you can unlock a range of exciting benefits, including: acu729640 for a flat 40% discount for new users. acu729640 for 40% off for existing users. acu729640 for a $100 coupon pack for multiple uses. acu729640 for a $100 flat discount for new customers. acu729640 for an extra $100 off promo code for existing customers. acu729640 for a $100 coupon for new USA/Canada users. Temu Coupon Code 40% Off For New Users. New users can unlock the highest benefits by using our Temu coupon 40% off code on the Temu app. This code provides exclusive perks specifically designed for first-time shoppers, such as: acu729640 for a flat 40% discount for new users. acu729640 for a $100 coupon bundle for new customers. acu729640 for up to $100 coupon bundle for multiple uses. acu729640 for free shipping to 68 countries. acu729640 for an extra 30% off on any purchase for first-time users. How To Redeem The Temu 40% Off Coupon Code For New Customers? Create a Temu account: If you don't have one already, create a new account on the Temu app or website. Browse and select items: Add the items you wish to purchase to your cart. Apply the coupon code: During the checkout process, enter the Temu 40 off coupon code acu729640 in the designated field. Click "Apply": The discount will be automatically applied to your order. Complete your purchase: Proceed with the payment and complete your order. Temu Coupon Code 40% Off For Existing Users Existing users can also enjoy the benefits of our Temu 40 off coupon code. This code offers exclusive perks tailored to loyal customers, including: acu729640 for a 40% extra discount for existing Temu users. acu729640 for a $100 coupon bundle for multiple purchases. acu729640 for a free gift with express shipping all over the USA/Canada. acu729640 for an extra 30% off on top of the existing discount. acu729640 for free shipping to 68 countries. How To Use The Temu Coupon Code 40% Off For Existing Customers? Log in to your Temu account: Access your existing account on the Temu app or website. Browse and select items: Add the items you wish to purchase to your cart. Apply the coupon code: During the checkout process, enter the Temu discount code for existing users acu729640 in the designated field. Click "Apply": The discount will be automatically applied to your order. Complete your purchase: Proceed with the payment and complete your order. How To Find The Temu Coupon Code 40% Off? Finding verified and tested coupons is easy. You can: Sign up for the Temu newsletter: Subscribe to the Temu newsletter to receive exclusive offers and coupon codes directly to your inbox. Visit Temu’s social media pages: Follow Temu on social media platforms like Facebook, Instagram, and Twitter to get updates on the latest Temu coupons 40 off and other promotions. Visit trusted coupon sites: Our website is a reliable source for the latest and working Temu coupon codes 40% off first order. How Temu 40% Off coupons work? Temu 40% Off coupons work by providing a discount on eligible purchases made through the Temu platform. When you apply a valid Temu coupon code 40 percent off during the checkout process, the discount will be automatically deducted from the total amount of your order. This effectively reduces the price you pay for your desired items. How To Earn 40% Off Coupons In Temu As A New Customer? Earning 40% off coupons as a new Temu customer is straightforward: Create a new account: Sign up for a new account on the Temu app or website. Explore the "New User" section: Look for exclusive offers and coupons specifically designed for first-time shoppers. **Use the Temu coupon code 40% off first order acu729640 during checkout to unlock your discount. What Are The Advantages Of Using Temu 40% Off Coupons? Using Temu 40% off coupon code legit offers numerous advantages: 40% discount on the first order 40% discount for existing customers $100 coupon bundle for multiple uses 70% discount on popular items Extra 30% off for existing Temu customers Up to 90% off in selected items Free gift for new users Free delivery to 68 countries Temu Free Gift And Special Discount For New And Existing Users Using our Temu 40% off coupon code unlocks a world of benefits: acu729640 for a 40% discount for first order. acu729640 for 40% off for existing customers. acu729640 for an extra 30% off on any item. acu729640 for a free gift for new Temu users. acu729640 for up to 70% discount on any item on the Temu app. acu729640 for a free gift with free shipping in 68 countries including the USA and UK. Pros And Cons Of Using Temu Coupon Code 40% Off Pros: Significant savings: Enjoy substantial discounts on a wide range of products. Exclusive offers: Access exclusive deals and promotions not available elsewhere. Easy to use: Simple and straightforward application process. Suitable for everyone: Applicable to both new and existing customers. Free shipping options: Enjoy free shipping on eligible orders. Cons: August not be applicable to all products: Some exclusions August apply. Limited-time offers: Some coupons August have limited validity periods. August require minimum purchase amounts: Some coupons August have minimum purchase requirements. Terms And Conditions Of The Temu 40% Off Coupon Code In 2025 No expiration date: Our coupon code doesn't have any expiration date, and you can use it anytime you want. Valid for all users: Our coupon code is valid for both new and existing users in 68 countries worldwide. No minimum purchase requirements: There are no minimum purchase requirements for using our Temu coupon code. Final Note The Temu coupon code 40% off is an excellent opportunity to save money on your next Temu purchase. By utilizing this code, you can significantly reduce your spending and enjoy more for less. We encourage you to take advantage of this incredible offer and experience the joy of shopping with Temu. FAQs Of Temu 40% Off Coupon How can I get a Temu 40% off coupon?   You can find the Temu 40% off coupon on our website or by subscribing to the Temu newsletter. Is the Temu 40% off coupon valid for all products?   While the Temu 40% off coupon offers significant discounts, there August be some exclusions or limitations on certain products. Can I combine the Temu 40% off coupon with other offers?   In some cases, you August be able to combine the Temu 40% off coupon with other available offers. However, this August vary depending on the specific terms and conditions of each offer. How long is the Temu 40% off coupon valid for?   The validity period of the Temu 40% off coupon August vary. Some coupons August have limited-time offers, while others August be valid for an extended period. Can I use the Temu 40% off coupon more than once?   The number of times you can use the Temu 40% off coupon August depend on the specific terms and conditions of the offer. Some coupons August be restricted to single-use only, while others August allow multiple uses.  
    • Temu Coupon Code $100 Off is a fantastic opportunity to save big on your next purchase from Temu. This popular online marketplace offers a wide range of products at incredibly low prices, and with our exclusive coupon code, you can enjoy even more savings. The acu729640 Temu coupon code is designed to provide maximum benefits for shoppers in the USA, Canada, and various European nations. Whether you're looking for electronics, clothing, home goods, or anything in between, this code can help you get the best deals.   We understand that finding the right Temu coupon $100 off and Temu 100 off coupon code can be challenging. That's why we've compiled this comprehensive guide to help you maximize your savings on Temu.   What Is The Coupon Code For Temu $100 Off? Both new and existing customers can enjoy amazing benefits when they use our $100 off Temu coupon on the Temu app and website.   acu729640 for a flat $100 off your purchase.   acu729640 for a $100 coupon pack that can be used for multiple purchases.   acu729640 to receive a $100 flat discount as a new customer.   acu729640 to get an extra $100 promo code for existing customers.   acu729640 to enjoy a $100 coupon for users in the USA and Canada.   Temu Coupon Code $100 Off For New Users In 2025 New users can unlock the highest savings by using our coupon code on the Temu app.   acu729640 for a flat $100 discount for new users.   acu729640 to receive a $100 coupon bundle for new customers.   acu729640 to enjoy up to a $100 coupon bundle for multiple uses.   acu729640 to get free shipping to 68 countries worldwide.   acu729640 to receive an extra 30% off on any purchase for your first time using Temu.   How To Redeem The Temu Coupon $100 Off For New Customers? Create a Temu Account: If you're a new user, start by creating an account on the Temu app or website.   Browse and Shop: Explore the vast selection of products available on Temu and add your desired items to your cart.   Apply the Coupon Code: During the checkout process, enter the Temu $100 coupon code acu729640 in the designated field.   Confirm Your Order: Review your order summary, including the applied discount, and complete the checkout process.   Temu Coupon $100 Off For Existing Customers Existing customers can also benefit significantly from using our coupon code on the Temu app.   acu729640 to receive an extra $100 discount as an existing Temu user.   acu729640 to get a $100 coupon bundle for multiple purchases.   acu729640 to enjoy a free gift with express shipping all over the USA and Canada.   acu729640 to receive an extra 30% off on top of your existing discount.   acu729640 to get free shipping to 68 countries worldwide.   How To Use The Temu Coupon Code $100 Off For Existing Customers? Log In To Your Account: Log in to your existing Temu account.   Shop and Add To Cart: Browse the website, select your desired items, and add them to your cart.   Apply the Coupon Code: During checkout, enter the Temu coupon code $100 off acu729640 in the designated field.   Complete Your Purchase: Review your order summary, including the applied discount, and complete the checkout process.   Latest Temu Coupon $100 Off First Order Customers can unlock the highest savings by using our coupon code during their first order.   acu729640 for a flat $100 discount on your first order.   acu729640 to receive a $100 Temu coupon code for your first order.   acu729640 to enjoy up to a $100 coupon for multiple uses.   acu729640 to get free shipping to 68 countries worldwide.   acu729640 to receive an extra 30% off on any purchase during your first order.   How To Find The Temu Coupon Code $100 Off? We recommend signing up for the Temu newsletter to receive verified and tested coupons directly to your inbox.   You can also visit Temu's social media pages for the latest coupons and promotions.   Finally, remember to check reputable coupon websites like ours for the latest and working Temu coupon $100 off and Temu coupon $100 off Reddit codes.   Is Temu $100 Off Coupon Legit? Yes, our Temu $100 Off Coupon Legit and Temu 100 off coupon legit code acu729640 is absolutely legitimate.   Any customer can safely use our Temu coupon code to get $100 off on their first order and then on recurring orders.   Our code is not only legit but also regularly tested and verified.   Furthermore, our Temu coupon code is valid worldwide and doesn't have any expiration date.   How Does Temu $100 Off Coupon Work? The Temu coupon code $100 off first-time user and Temu coupons 100 off code acu729640 works by directly deducting $100 from your total purchase amount at checkout. This discount can be applied to a wide range of products across various categories on the Temu platform.   How To Earn Temu $100 Coupons As A New Customer? The easiest way to earn Temu coupon code $100 off and 100 off Temu coupon code as a new customer is by using our exclusive code acu729640 during your first purchase.   Additionally, you can explore other options such as:   Refer-a-friend programs: Invite your friends to join Temu and earn rewards, including potential $100 coupons.   Completing surveys and offers: Participate in surveys and complete offers within the Temu app to earn points that can be redeemed for discounts or coupons.   Following Temu on social media: Keep an eye on Temu's social media pages for exclusive deals, contests, and giveaways that August include $100 coupons.   What Are The Advantages Of Using The Temu Coupon $100 Off? $100 discount on your first order.   $100 coupon bundle for multiple uses.   70% discount on popular items.   Extra 30% off for existing Temu customers.   Up to 90% off in selected items.   Free gift for new users.   Free delivery to 68 countries.   Temu $100 Discount Code And Free Gift For New And Existing Customers There are multiple benefits to using our Temu $100 off coupon code and $100 off Temu coupon code acu729640:   acu729640 for a $100 discount for your first order.   acu729640 for an extra 30% off on any item.   acu729640 to receive a free gift for new Temu users.   acu729640 to enjoy up to a 70% discount on any item on the Temu app.   acu729640 to receive a free gift with free shipping in 68 countries, including the USA and UK.   Pros And Cons Of Using The Temu Coupon Code $100 Off This Month Pros:   Significant savings: The Temu coupon $100 off code and Temu 100 off coupon can lead to substantial savings on your Temu purchases.   Wide applicability: The code can be used on a wide range of products, from electronics and clothing to home goods and more.   Easy to use: Applying the code during checkout is simple and straightforward.   Valid for both new and existing users: Both new and existing customers can benefit from this exclusive offer.   No expiration date: Enjoy the flexibility of using the code at your convenience.   Cons:   August not be applicable to all products or categories.   Some exclusions or limitations August apply.   Terms And Conditions Of Using The Temu Coupon $100 Off In 2025 Our coupon code acu729640 doesn't have any expiration date.   Our coupon code is valid for both new and existing users in 68 countries worldwide.   There are no minimum purchase requirements for using our Temu coupon code acu729640. Final Note   The Temu coupon code 100% Off provides a fantastic opportunity to save money on your purchases at Temu.   By utilizing the Temu 100% off coupon and following the simple steps outlined in this article, you can easily redeem your discount and enjoy significant savings on a wide range of products. FAQs Of Temu $100 Off Coupon Q: Is the Temu $100 off coupon code valid for all products? A: While the coupon offers significant savings, it August not be applicable to all products or categories.   Q: Can I combine the Temu $100 off coupon with other offers? A: The possibility of combining this coupon with other offers August vary.   Q: How long is the Temu $100 off coupon valid?    A: Our Temu coupon code acu729640 does not have an expiration date.   Q: Is the Temu $100 off coupon applicable to international orders? A: Yes, our Temu coupon code acu729640 is valid for users in 68 countries worldwide, including the USA, Canada, and various European nations.   Q: Do I need a minimum purchase amount to use the Temu $100 off coupon?    A: No, there are no minimum purchase requirements for using our Temu coupon code acu729640.
    • I am Playing on a server with my friends, but for some reason there are a few random chunks that where if I go into them, all the visuals stop. The game runs in the background but I can only see the last frame I was on before the freeze. If I tab out of the game, it flashes fastly between a snapshot of the forge loading screen and a black screen. Here is my log. Is there any way to fix this?  https://mclo.gs/lXTTXMv
    • The crash directly points to an issue with Immersive Portals - start with removing this mod first
    • Make a test without crittersandcompanions
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.