Giter Site home page Giter Site logo

Comments (15)

celestefox avatar celestefox commented on May 20, 2024

Scratch that, why the hell are you using an oredic recipe for this? That's probably your problem right there, really. See: http://www.minecraftforge.net/wiki/How_to_use_the_ore_dictionary

from minecraftforge.

taralx avatar taralx commented on May 20, 2024

Um, that was example code. My actual code uses the oredict properly.

from minecraftforge.

celestefox avatar celestefox commented on May 20, 2024

Then don't give complete invalid pieces of demo code.
Here, let's look at this line from the wiki page I linked:
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(Item.bucketEmpty, true, new Object[]{"FF", Character.valueOf('F'), "ingotCopper"}));
First, it correctly get's the recipe list(I will assume you do this right). Then, the parameters of the recipe. The result, if it is mirrored, and an object array, which is the contents of the recipie. First, you want Character.valueOf('t') where t is the character used. You also use string used when registering the recipie if you want it to work with other mod items, usually in the form of OreOreBlockName of ingotNameOfIngot as shown here:
OreDictionary.registerOre("ingotCopper", new ItemStack(ingotCopper));

from minecraftforge.

taralx avatar taralx commented on May 20, 2024

The specific issue I'm talking about has to do with the use of the variadic constructors declared in ShapedOreRecipe. My example points out the issue just fine.

from minecraftforge.

celestefox avatar celestefox commented on May 20, 2024

No, I really think it's your code, and unless you can give a more specific example, I can't help you(especially as I believe the error is happening because there isn't a constructor that matches your demo code, as of the Forge rewrite[or earlier], see https://github.com/MinecraftForge/MinecraftForge/blob/master/common/net/minecraftforge/oredict/ShapedOreRecipe.java)

from minecraftforge.

taralx avatar taralx commented on May 20, 2024

Perhaps I should have been more specific.

public ShapedOreRecipe(ItemStack result, Object... recipe)

and

public ShapedOreRecipe(ItemStack result, boolean mirrior, Object... recipe)

are ambiguous. Here is code that, as per your request, actually uses an ore dictionary item:

        GameRegistry.addRecipe(new ShapedOreRecipe(routingPipe, false, "BGB", 'B', "ingotBronze", 'G', Block.glass));

from minecraftforge.

AbrarSyed avatar AbrarSyed commented on May 20, 2024

then you my freind.. don't understand just how awesome Object... recipe is.

you can use it either as...

public ShapedOreRecipe(ItemStack result, boolean mirrior, object1, object2, object3, object4)

or

public ShapedOreRecipe(ItemStack result, boolean mirrior, new Object[] {object1, object2, object3, object4})

from minecraftforge.

Myrathi avatar Myrathi commented on May 20, 2024

You're both missing his point: which is that of the parameters of the ShapedOreRecipe methods and not his example code, specifically.

The (Itemstack, Object...) version is ambiguous if the compiler is seeing (a) the first Object as accepting a Boolean, which could unbox to the boolean primitive (which would match the three-param version); or (b) the boolean as being boxable into a Boolean (which would satisfy the two-param version).

from minecraftforge.

AbrarSyed avatar AbrarSyed commented on May 20, 2024

hmmmm interresting... I don'tthe compiler will take that 1st boolean.. will it?

from minecraftforge.

Myrathi avatar Myrathi commented on May 20, 2024

Must be doing something squicky, if he's getting ambiguity warnings about it.

from minecraftforge.

AbrarSyed avatar AbrarSyed commented on May 20, 2024

I seee...... /me reccomends a pull

from minecraftforge.

celestefox avatar celestefox commented on May 20, 2024

Well, I've drafted several replies to this, and deleted each one. I see the problem now, and I believe the best solution is to remove the lines that add the mirrior variable, and check/set mirrior/mirriored only in the final constructor. This means removing the top three constuctors and checking if recipe[0] is a boolean and if so, set mirriored appropriately. Then, cut the first value from recipe with some sort of array building(guava lists?) and continue, or just set idx = 1 to start with. Not what should be done, just the problem and a solution idea. And I think this looks good enough to post, so...
EDIT: Apparently, Github doesn't show new comments when your'e writing one. Interesting...
EDIT 2: Myrathi, I finally got it after reading up on Variable numbers of objects, and yes, if your'e not using a Object[]{} the compiler isn't sure if the boolean is seperate or part of Object... recipie, which is the problem. I have written up a theoretical solution, but don't currently have time to try to code it(Damn classes).

from minecraftforge.

taralx avatar taralx commented on May 20, 2024

Yes, I considered that option. It's a shame to lose the self-documenting effect of the explicit boolean constructors, but at least that works. I'd love to hear lex weigh in on this one, since he has a good sense of API aesthetics.

from minecraftforge.

celestefox avatar celestefox commented on May 20, 2024

Can I get confirmation on how to develop Forge? It's fork the repo, git
clone to forge dir in mcp, run setup to get working mc in eclipse with
latest forge, and then what? Do I just change the java and generate the
patch somehow? With a script? Can't find documentation anywhere, which is
annoying.

from minecraftforge.

LexManos avatar LexManos commented on May 20, 2024

ad51183

from minecraftforge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.