-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ShapedOreRecipe has ambiguous constructors #208
Comments
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 |
Um, that was example code. My actual code uses the oredict properly. |
Then don't give complete invalid pieces of demo code. |
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. |
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) |
Perhaps I should have been more specific.
and
are ambiguous. Here is code that, as per your request, actually uses an ore dictionary item:
|
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}) |
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). |
hmmmm interresting... I don'tthe compiler will take that 1st boolean.. will it? |
Must be doing something squicky, if he's getting ambiguity warnings about it. |
I seee...... /me reccomends a pull |
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... |
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. |
Can I get confirmation on how to develop Forge? It's fork the repo, git |
MinecraftForge/FML@d1ff196 Fixed FMLRelaunchLog's Newline Handling MinecraftForge/FML@591a257 Merge pull request #208 from jrtc27/patch-1
The constructor:
new ShapedOreRecipe(myBlock, false, "AAA", 'A', Block.glass)
whines about ambiguous constructors. I'd fix it, but I don't know what the best way to solve it is.
The text was updated successfully, but these errors were encountered: