IFacadeItem - API Suggestion
AlgorithmX2 opened this issue ยท 9 comments
There seems to be a variety of Facade Code in the wild and its becoming difficult to ge things to compile with all the variants handled.
so more or less, i'm suggesting IFacadeItem, which would have some variant of isFacade( ItemStack ) and getItemStack( ItemStack, Type )
If it was implementable by other mods that would be neat, but its not exactly what i'm looking for, just trying to get rid of my code that touches BC's internals as that can cause issues for all of us.
Ok - so you need basically the following services:
- is it a facade?
- is it a basic or a phased one?
- what's the texture?
- what is the facade for the following {Block, meta}
but as part of a stable API as opposed to a dependency in BC internals. That looks good to me. Scheduled for 6.1 (so one more interface change :P).
I'm definitely in favor of simplifying and standardizing things here. Could you share the part of the code that you have that are problematic, so that we understand better how this API should work?
its not necessarily that its problematic, its just that its changed a few times, which if it was an API wouldn't be a big deal, since it wouldn't be changing with minor refractors.
My only use case are to check if an item is a facade, and get the Texture for it, i'm not sure if anyone else would like to expand on that, I more or less check if the item is a BC facade, and if it is I can place it as a facade on my cables like my own.
Edit: Also forgot that a way to re-create a facade might be useful as well.
At the moment the methods i'm using to get this info resemble this: https://gist.github.com/AlgorithmX2/075d466d45585dfeb54c
Also the API should work in Both Directions.
That mean if another mod uses the class that also bc pipes can use that.
something that would also be handy (sorry if it already exists and i missed it) is specifying what side of a block to use a as a facede. With my new semi-automatic duster the front is always used on the south side but i would prefer the facade to always use the front texture
@Speiger I'd rather wait for actual use case before implementing features like this - very easy to get wrong if there's no use ;-)
@AEnterprise why not - but that's a separate issue ;-)
@SpaceToad As you can see in My Github thing that i have my own pipes. There are more Planed. And these other Pipes will use facades^^" I will need it or i need to make a workaround for that.
@Speiger it is not easy to make bc facades exposed to API, but there are things being made: like rendering is moved to fake block so it will be easy to expose render helpers to API without bringing the whole pipe block in. It still needs a way to wrap or move out from pipe states(especially client state) first. And it takes time to test around :)
@Itaros i know how Bc render his Pipes.
And i know how the Facades get Rendered.
The Facade Matrix is interesting. I would do it differend. So thats why it is not a problem.