Hi!
Bear with me, as I am incredibly new to this, and could be wrong about everything.
Are you inheriting from
net.minecraft.world.gen.structure.StructureComponent
for your structure components? If so,
getMetadataWithOffset
seems to do what you want, provided you're keeping track of your
coordBaseMode
, I think.
Furthermore,
generateStructureChestContents
appears like a nice method for generating chests with items in it.
As for your second issue, could you post a snippet of where and how you are spawning structures?