Carpenter's Blocks

Carpenter's Blocks

24M Downloads

Custom Rendered Blocks - Compat

Soaryn opened this issue ยท 12 comments

commented

What considerations have you made in regard to adding an API layer for custom rendered blocks to provide the face information for blocks such as the wedges and such?

In my case, all of the icon layers are stripped as well as the coloring except for what I need to pass to vanilla (Vanilla does not support multi-layer rendering via BlockRender).

Not a requirement per se, but it would be nice to be able to add compatibility on the mod side.

2014-12-11_03 24 17

commented

Ok to rehash this since I actually have time now, the main problem is that the IWrappable assumes you have a color and an Icon, which is partially accurate, but in this case there are many colors, brightnesses, and icons. I'm not sure how to use your system to accomplish this.
If you assume there is only one icon, the picture kind of sums it up sans the color change.

commented

@Soaryn In that case, does a custom ICustomRenderableBlock interface sound sufficient?

commented

Possibly, what would that add or how would that be structured?

commented

From my earlier suggestion, just providing sets of IIcons and hex colors seems the best option. The difficulty is in passing these objects back for rendering purposes. We could always split it into two methods, where one grabs icons, the other grabs colors -- both as arrays. Ideas?

commented

However that will cause a few problems on its own as it isnt just a color icon pair. There are at minimum 3 components per layer on the blocks I render: Color, icon, brightness.
If only 2 of the three are present that will look very odd when combined with the normal block.

As for the arrays that is how we kind of have it now. The end result, we wound up with a LayerMap array as it is also being read in via json for the end user to decide how many layers and what are presented on the layer on load.

commented

Interesting. I'm a little rusty on my rendering code.. but I remember the brightness value being totally undocumented. The way I handle brightness is to multiply the color against a lightness value. And if the face should be radiant, I just tell it to use the brightness value of a torch.

commented

Ill think this over on how to properly handle other mod blocks with custom render.
For now, is there an easy way for me to disallow the placement ?

commented

Nope. You just have to resist the urge to place it.

commented

The details are up to @Mineshopper, but if I were writing it I would make it so that the actual draw call is passed to the block type, so that it can choose rendering based on the (given) 4 points of the quad.

commented

Which mod side were you thinking? If only a few of your blocks need special attention we could just provide a few ugly exceptions. Otherwise, I think the best way would be to implement some interface where I can grab an object of some sort that identifies [icon,hex] pairs for basic layering and coloring.

I'm open to suggestions.

EDIT: symbols were hidden.

commented

It could be worked this into IWrappableBlock, perhaps. If the required complexity goes beyond that, it may be better to make an ICustomRenderableBlock interface.

commented

I personally am interested in seeing some interopability between carpenter's blocks and the paint (cans, brushes, and mixers) from OpenBlocks. I think that and Chisel would be awesome. ChiselFacades might be a good resource for analysis.