Comments (15)
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.
Um, that was example code. My actual code uses the oredict properly.
from minecraftforge.
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.
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.
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.
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.
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.
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.
hmmmm interresting... I don'tthe compiler will take that 1st boolean.. will it?
from minecraftforge.
Must be doing something squicky, if he's getting ambiguity warnings about it.
from minecraftforge.
I seee...... /me reccomends a pull
from minecraftforge.
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.
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.
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.
from minecraftforge.
Related Issues (20)
- Crash on startup in a multiloader enviorment HOT 6
- "Cannot find symbol" and "invalid method reference" errors when compiling forge HOT 3
- Use Java8u51 or Java8u51- can't install Forge 49.0.1+
- SavedData broken since 1.20.2 HOT 2
- `ContainerScreenEvent$Render$Background` runs after renderables are drawn HOT 1
- Faild to include libs. HOT 1
- Compatibility Issues of Forge with Docker in IPv6 Environment HOT 2
- [1.20.4] Forge crashes loading the singleplayer world list screen with no mods installed HOT 5
- How can I runClient, runData without internet HOT 1
- [1.20.1] Config key correcting from default to default HOT 2
- Crash when starting game HOT 1
- [1.20.4] DatapackBuiltinEntriesProvider from #9848 causes issues with forge registries HOT 2
- minecraft crashing HOT 1
- Issue with SleepFinishedTimeEvent in 1.19.2 HOT 5
- Game crash in Chinese path HOT 4
- My forge modpack won't load the worlds HOT 1
- World gen stucks at 100% HOT 1
- [1.20.4] ClasspathLocator is no longer disabled in production env, causing OptiFine to crash while installing in the classpath HOT 3
- Shears on trapwire drops string instead of deactivating it HOT 1
- Item method shouldCauseBlockBreakReset does not work when itemStack::hurt HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minecraftforge.