Hmm... There appears to be two ways you can do this - The first is to, as you've said, use the HarvestableBlockBehavior.
There is code inside of CollectibleBehaviorHandbookTextAndExtraInfo.cs that controls it being added to the handbook. Perhaps this will give you an idea as to why your previous code did not work?:
List<ItemStack> harvestedStacks = [];
if (stack.Block.GetBehavior<BlockBehaviorHarvestable>()?.harvestedStacks is BlockDropItemStack[] hStacks) harvestedStacks = [.. hStacks.Select(hStack => hStack?.ResolvedItemstack)];
if (harvestedStacks?.Count > 0)
{
bool haveText = components.Count > 0;
AddHeading(components, capi, "handbook-dropswhen-harvested", ref haveText);
components.Add(new ClearFloatTextComponent(capi, TinyPadding));
while (harvestedStacks.Count > 0)
{
ItemStack hstack = harvestedStacks[0];
harvestedStacks.RemoveAt(0);
if (hstack == null) continue;
SlideshowItemstackTextComponent comp = new SlideshowItemstackTextComponent(capi, hstack, harvestedStacks, 40, EnumFloat.Inline, (cs) => openDetailPageFor(GuiHandbookItemStackPage.PageCodeForStack(cs)));
components.Add(comp);
}
components.Add(new ClearFloatTextComponent(capi, TinyPadding));
}
The second option appears to be to use the 'ICustomHandbookPageContent' interface on your collectible. I haven't personally used it, but it appears to be able to do what you need it to do. It contains a single function 'OnHandbookPageComposed' that is called by the CollectibleBehaviorHandbookTextAndExtraInfo.cs. It appears you may be able to edit the components of the harvested stacks to add in what you need. Take a look at BlockFruitTreeBranch.cs for an example.
Good luck!
You certainly can do this.
First, you'll want to create some lines. You can use the LineMeshUtil class to generate a 3D mesh for your lines.
You can position and/or rotate the mesh if desired, but you need to upload it to the graphics card using 'capi.Render.UploadMesh(...)'.
Then, you can render the mesh using the render API. You will want to use the 'EnumShaderProgram.Wireframe' shader, and you'll likely want to use one of the predefined render functions, e.g. 'OnRenderFrame'.
For an actual example, see https://github.com/anegostudios/vsapi/blob/a2e2ca074c351d9154101107c704fd4d63161d51/Client/Render/WireframeCube.cs#L9.
Hope this helps!
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.