API request: Insert item to pipe with colour
buttilda opened this issue ยท 13 comments
As it stands there's no easy way to insert an item into a pipe with an specific colour (unless I'm missing something really obvious).
It would be nice to have something like that to improve the interaction with other mods
I thought perhaps a method in IPipeTile somewhat like this:
int injectItem(ItemStack stack, boolean doAdd, ForgeDirection from, int colour);
The parameter "colour" would be the metadata of the dye (1 for black, 15 for white and so on)
As this would probably break the API for other mods, I think that now is right time to do it.
Do you have a specific mod in mind? In which case, I agree with CJ, no problem, and this is the right time. I'm closing this issue, though, as I'm not sure if anyone is planning to implement it at this stage, but feel free to submit a pull request!
I'd like to use it on my mods.
But I also think it would be a nice feature to have available for whoever wants it.
I could submit a PR but it will probably take a while because I haven't touched 1.7 code yet.
Understood. I'd like to keep the "nice to have" closed, so that we concentrate on things that can have a direct use. Don't hesitate to open a PR when you get to it. Even if you miss the 5.0.x train, there will be others API changes possible :-)
Question @SpaceToad
Should I add a new "injectItem" method or should I just add the colour parameter to the existing one?
Just change the existing one to have a colour parameter, and make a new
int injectItem(ItemStack stack, boolean doAdd, ForgeDirection from) {
injectItem(stack, doAdd, from, -1);
}
or something like that.
I agree with @psxlover.
And like any other interface it has to be implemented somewhere. You can't just change the interface you have to change it's implementations too.
Yes, so should I add another method to the interface or should I just add the colour parameter to the old one?
Which was my original question....