Jump to content

Recommended Posts

Posted

My block uses the texture of the planks used in the recipe. This requires the planks used to be the same ones.

I want to support mod added planks, and for the most part it already works well.

 

The issue I've ran into involves planks registered with OreDictionary.WILDCARD_VALUE as its damage.

 

If I use it as is, mixed planks can be used and I get several recipes with an output only uses the first plank texture.

If I use only the first plank I get rid of the extra recipes but still only have one of the many planks used.

Adding all 16 metadata results in many extra unused blocks getting a recipe.

 

What worked well (at first) was getting the sub items from the item. This worked perfectly..... until I launched a server and realized getSubItems is client side only :(

 

What I'm currently doing is checking the unlocalized name:

List<ItemStack> stackList = new ArrayList<ItemStack>();
if (dictionaryItemStack.getItemDamage() == OreDictionary.WILDCARD_VALUE) {
    List<String> stackNames = new ArrayList<String>();
    for (byte metadata = 0; metadata < 16; metadata++) {
        ItemStack singleItem = dictionaryItemStack.copy();
        singleItem.setItemDamage(metadata);
        String stackName = singleItem.getUnlocalizedName();
        if (!stackNames.contains(stackName)) {
            stackNames.add(stackName);
            stackList.add(singleItem);
        }
    }
} else {
    stackList.add(dictionaryItemStack);
}

 

This results in a few extra recipes if the metadata has a different name but is unused, and could result in missing ones due to having the same name.

 

I looked at using ItemCraftedEvent but I don't seem to be able to change the output until crafting is attempted, this results in the output icon not displaying changes and gives the appearance mixed planks can be used.

 

So basically is there a way to use the Ore Dictionary in recipes and flag blocks that must be the same? or is there a cleaner/better way to do what I'm doing now?

 

EDIT:

My other option is making a crafting block that would use only the one planks.

And the more I think about it this might be the better way to go, because adding many mods with several planks would result in a massive amount of recipes.

Posted

It's actually very simple.

 

OreDictionary.registerOre("toolShovel", new ItemStack(Items.diamond_shovel, 1, OreDictionary.WILDCARD_VALUE));

 

This registers any 'ore' of this type with any itemdamage to the common denominator "toolshovel".

 

you can use it simply by calling

"toolShovel"

 

for a particular slot.

Example:

GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Pruner, 1),
		"I I", " F ", "P P", 'P', new ItemStack(BasePlank, 1), 'I', "ingotIron", 'F', "gemDiamond"
		));

 

Once you load up minecraft and, for instance, use NEI to look at the recipes you'll see one with the iron and diamond changing with other items registered to the same denominator.

Technically you could use your planks with any itemdamage to create this item then but if they don't exist, you can't use them.

 

I hope this helps.

Posted

Looks like the wall of text caused the problem to be lost :)

 

Say I have a recipe that looks like this

 

Plank | Plank | Plank

Stick | Plank | Plank

 

With a normal recipe just using "plankWood" works perfectly, (in fact I make heavy use of it in my other recipes)

 

But what I'm trying to do is restrict mixing (because the planks used change the look of the block), the three planks on the top must be the same type, and the two on the bottom must be the same type. But what planks you use for each type are up to you.

 

I needed to register a recipe for every combo, and to do that and support mods I needed to grab the list of planks from the ore dictionary.

While getting "plankWood" from the OreDictionary does give me all of the planks, any registered using the wild card value are merged into one item.

 

The issue I was having was getting the separate planks from the merged item.

The method that worked the best was client only, and the alternatives had several flaws.

 

 

I did decide on making my own crafting block:

- it gets around my issue

- is simple to use

- doesn't register a ton of recipes.

Seriously with forestry in I was just over 1000 per block type and I had two. I don't know what Minecraft's limit is but a single mod adding over 2000 recipes sounds wrong :)

Posted

My apologies, it seems I misread your problem.

 

Another solution is a custom craftingHandler.

It does check everytime something is crafted but the impact is really negligible.

It suffices that everytime something is crafted you check if the first slot contains a plank with an if and then look at the other matrixslots inside. Once you have checked that the planks are indeed the same, pass the metadata to the crafted item or if isn't the same, cancel the crafting.

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

    • Maximize Savings With [acu639380] T e m u Promo Code $100 Off 2025 brings you unbeatable savings on T e m u , one of the most popular online shopping destinations. With the exclusive T e m u  Promo code (acu639380), you can unlock incredible discounts, including $100 off for new and existing users. Whether you’re a first-time shopper or a loyal customer, T e m u  ensures a seamless shopping experience with fast delivery, free shipping in 67 countries, and up to 90% off on a wide range of products. Why Choose T e m u ? T e m u  is a treasure trove of trending items at unbeatable prices. From fashion and beauty to electronics and home essentials, T e m u ’s vast collection caters to all your shopping needs. Here are some key features that make T e m u  stand out: Free shipping: Available in 67 countries. Unbeatable prices: Discounts up to 90% off. Fast delivery: Ensures your items arrive promptly. Exclusive Benefits of T e m u  Promo Code (acu639380) Using the T e m u  Promo code (acu639380) in 2025 can help you save more than ever before. Here’s a breakdown of the benefits: $100 Off for New Users: New shoppers can enjoy a flat $100 discount with the T e m u  first-time user Promo. $100 Off for Existing Users: Loyal customers can also take advantage of this substantial discount with the same code. 40% Extra Off: Apply the T e m u  Promo code (acu639380) to receive an additional 40% discount on selected products. $100 Promo Bundle: Get a $100 Promo bundle to maximize savings across multiple purchases. Free Gifts for New Users: First-time shoppers are rewarded with exclusive gifts. How to Redeem T e m u  Promo Code (acu639380) Redeeming your T e m u  Promo code (acu639380) is simple and straightforward: Visit the T e m u  website or app. Add your favorite items to your shopping cart. Enter the promo code (acu639380) at checkout. Watch the savings apply instantly! T e m u  Promos for 2025 This month is packed with incredible offers tailored for both new and existing users: For New Users: T e m u  Promo code (acu639380) $100 off: Enjoy a significant discount on your first order. T e m u  first-time user Promo: Unlock exclusive savings and free gifts. T e m u  discount code (acu639380) for 2025: Enhance your shopping experience with additional discounts. For Existing Users: T e m u  Promo code (acu639380) $100 off: Loyal customers can continue to enjoy massive savings. T e m u  Promo code (acu639380) 40% off: Apply this code for extra discounts on selected items. T e m u  Promo bundle: A $100 Promo bundle available for repeated use. Country-Specific T e m u  Promo Codes T e m u  offers regional discounts to ensure everyone can benefit from their amazing deals. Here’s how the T e m u  Promo code (acu639380) can be used worldwide: North America USA: $100 off your next purchase with T e m u  Promo code (acu639380). Canada: Enjoy a $100 discount using the same code. South America Mexico: Save 40% on selected items with T e m u  Promo code (acu639380). Brazil: Get exclusive 40% discounts on your shopping. Europe UK: Apply the T e m u  Promo code (acu639380) for $100 off. Germany: Take advantage of the $100 Promo bundle. Asia Japan: First-time users can use T e m u  new user Promo for $100 off. India: Use the Promo bundle for multiple savings. T e m u ’s New Offers in 2025 This month, T e m u  has introduced fresh deals to elevate your shopping experience. Enjoy free shipping, trending items at up to 90% off, and exclusive discounts with the T e m u  promo code (acu639380). Benefits of T e m u  Promos T e m u  Promos are designed to enhance your shopping experience. Here are the standout advantages: $100 Off: Ideal for significant savings, whether you’re a new or existing user. 40% Extra Discount: Perfect for those looking to stock up on essentials. Free Gifts: Specially curated for first-time shoppers. $100 Promo Bundle: Offers flexibility across multiple purchases. How T e m u  Makes Shopping Easy T e m u ’s user-friendly platform ensures a hassle-free shopping experience. With options like fast delivery, detailed product descriptions, and seamless payment methods, T e m u  is a one-stop shop for all your needs. FAQs about T e m u  Promo Code (acu639380) Can I combine multiple T e m u  Promo codes? No, only one Promo code can be used per transaction. However, the $100 Promo bundle can be split across multiple orders.  Is the T e m u  Promo code (acu639380) valid on all items? The code applies to a wide range of products but July exclude certain categories.  How often can I use the T e m u  Promo code (acu639380)? The usage frequency depends on the specific terms and conditions of each code. Final Thoughts T e m u  is setting new standards in online shopping with its incredible deals and discounts. With the T e m u  Promo code (acu639380), you can maximize your savings and enjoy a premium shopping experience. Whether you’re new to T e m u  or a returning customer, these offers ensure that every purchase is a win. Don’t wait—use the T e m u  promo code (acu639380) today and start saving big!
    • Typically—at least in my case—the broken datapack thing always turns out to be a broken mod. Someone else here might have a better answer for you than I do, but when that happens, I go through all my mods, disabling them one by one until I locate the culprit. It’s a headache, but it’s the only way I know how to do it.
    • Is there any mod for creating world templates for 1.20.1 forge, I found a fabric mod for such as purpose but can't seem to find one for forge. I know connector and forgeified fabric api exist but i'd prefer a forge mod to adding like 50 mods to my 200 mod modpack. Does anyone know of such a mod or is my only option using the fabric mod with connector?  
    • Please read the FAQ (https://forums.minecraftforge.net/topic/125488-rules-and-frequently-asked-questions-faq/) and post logs as described there to a site such as https://mclo.gs and post the link here.
    • I'm trying to play with the origins mod but even after adding it to the mod folder it doesn't show up in minecraft forge. I'm using 1.20.2 because that is the last update from the origins and I'm using the same version of forge.
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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