-
Notifications
You must be signed in to change notification settings - Fork 16
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
[WIP] Multiblock Display System #23
base: master
Are you sure you want to change the base?
Conversation
I don't dislike the PR, but I was always picturing people using templates for this, like I did on the Ender-Rift manual: https://github.com/gigaherz/Ender-Rift/blob/master/src/main/resources/assets/enderrift/xml/book.xml#L3 |
Interesting. I wanted to see if I could support more interactive features within the book such as spin, z-layer hiding via a slider, and an option to view both expanded and compacted. To do this, I was thinking of rendering in 3d and then translating to screen space via transforms. What do you think about these features? |
Working system Known issues: redstone connection, redstone color, grass color, everything marked TODO
And things and javadocs and comments
Oops never answered to this: Yeah I do like it. It's quite a lot more interesting than just a static template, even if it deviates from the "pseudo-html" that I originally had in mind. |
Features (Some Still WIP)
Adds the new
<multiblock>
tag which represents aMultiblockPanel
element and allows guidebook authors to display a multiblock structure:structure
attribute, an array of resource locations can be specified that point to*.nbt
structure files within the folderassets/<domain>/structures/
MultiblockComponent
s, each of which represents one object in one position within the multiblock structureBlockComponent
extensions can be registered via aFactory
system in order to correctly display non-standard blocks, such as fluids (as is done withBlockFluidComponent
) and tile-entitiestransformation
attribute, a translation, scale, and/or rotation/quaternion can be specified to offset, scale, and/or rotate the structuretransformation="t[-1,-1.35,-1] q[0,1,0,0] s[0.9]"
specifies:-x
by1
, down-y
by1.35
, and towards-z
by1
180°
about they-axis
0.9
height
attribute, authors specify the target height that the guidebook is rendered to. Note that this height is not used toGL_SCISSOR
or anything that creates a viewport; it exists only for spacing and it is up to the author to ensure the structure fits withinexpansion
andcollapsing
mode, allows users to view the multiblock structure in both an "exploded" and "condensed" state, as is shown in thegif
s belowMultiblockComponent
s, the component under the user's cursor becomes highlighted and a descriptive tooltip of the component's contents is displayed (as is shown in one of the images below)floor
attributeItemComponent
s. This behavior is specified via thepoles
attribute<multiblock>
tag, additional tags can be nested as follows:MultiblockComponent
,ParsableMultiblockComponent
provides a way to register parsing factories (calledParser
s) for custom multiblock components that are specified viaXML
, such asItemStack
sItemComponent
parses a<stack>
node similar to how normalStack
elements are parsed within guidebooks, except it includes two additional attributes:position
, which is an attribute for allParsableMultiblockComponent
s and specifys the component's position within the multiblock structuretransformation
, which allows authors to specify render transformations and is described aboveExample
Produces the following multiblock:
In addition, a mouseHover system is in the works, with the current iteration appearing as follows:
Tasks
Block
implementationClass
es to customBlockComponent
implementationsBlockComponent
s would be able to correctly parse theIBlockState
and render the correct models for connecting blocks (which for some reason doesn't happen)ItemStack
renderingMultiblockComponent
s from the child elements of the<multiblock>
nodeMultiblockComponent
type and the ray-tracing needed for itList<>
instead of anotherMultiblockComponent[][][]
matrix)javadoc
documentationoffset
andinitialRot
to aninitialTransform
attribute which parses aTRSRTransformation