Thread:LOTRMod/@comment-29101335-20160724200010/@comment-26888709-20160724224520

LOTRMod wrote: Sure! This is the code file for the new Hobbit Tavern design which is coming in the next update:

http://pastebin.com/QxyUhFVh

Note that at over 2000 lines of code this is by far the longest structure code in the mod currently. Here's a simpler structure to compare it to, the Dwarf Smithy.

Dwarf Smithy: http://pastebin.com/S1EsPUBW

(The base structure file is around 1000 lines of code, as GandalftheTurquoise said, and that handles things like setting up the structure, rotating it appropriately, working out how blocks should be rotated properly, and various utility methods like placing chests/mugs/barrels etc.)

Now it is true that I might be giving myself a little too much work here, by manually coding them all. The structures could just be scanned in using schematics or whatever. But then they wouldn't be able to have random block types and randomised chests/barrels/etc, and they wouldn't adapt to the terrain or detect where would be suitable to spawn, unless I did some extra work to make that possible - and at that point, I'd be manually coding much of the structure anyway. WOW! thats amazing how much code there is in a little structure! And i think mojang just "scans" in the structures like villages,igloos, etc. and that is why there are so many glitches in there structures when the generate.