<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.mutigeraffe.com/index.php?action=history&amp;feed=atom&amp;title=UtilityBiome%3AStructures</id>
	<title>UtilityBiome:Structures - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.mutigeraffe.com/index.php?action=history&amp;feed=atom&amp;title=UtilityBiome%3AStructures"/>
	<link rel="alternate" type="text/html" href="https://wiki.mutigeraffe.com/index.php?title=UtilityBiome:Structures&amp;action=history"/>
	<updated>2026-10-20T03:36:08Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.mutigeraffe.com/index.php?title=UtilityBiome:Structures&amp;diff=499&amp;oldid=prev</id>
		<title>Maintenance script: UtilityBiome wiki</title>
		<link rel="alternate" type="text/html" href="https://wiki.mutigeraffe.com/index.php?title=UtilityBiome:Structures&amp;diff=499&amp;oldid=prev"/>
		<updated>2026-10-19T07:06:59Z</updated>

		<summary type="html">&lt;p&gt;UtilityBiome wiki&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The package &amp;lt;code&amp;gt;com.cyberpiratepenguin.utilitybiome.api.structure&amp;lt;/code&amp;gt; places small buildings and shapes with [[UtilityBiome:Chunk Features|chunk features]], without writing a placer from scratch.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;Blueprint&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;: a building described as text.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;StructureFeature&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;: turns a blueprint into a chunk feature. Finding a site, rotation and foundation are handled for you.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;Structures&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;Shapes&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;Terrain&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039;: the building blocks, for your own placers.&lt;br /&gt;
&lt;br /&gt;
A chunk feature only sees and writes its own chunk (32 × 32 blocks), so a structure has to fit into one chunk. For ready-made prefab files placed as rare structures through world-generation files, use &amp;lt;code&amp;gt;ResourceSpec.prefabs&amp;lt;/code&amp;gt; on [[UtilityBiome:Build-Time Tools|Build-Time Tools]].&lt;br /&gt;
&lt;br /&gt;
== Blueprint ==&lt;br /&gt;
A blueprint is a stack of layers, bottom layer first. Each layer is a list of rows along z, each character in a row is one block along x, looked up in the palette.&lt;br /&gt;
* A &amp;#039;&amp;#039;&amp;#039;space&amp;#039;&amp;#039;&amp;#039; leaves the existing block unchanged.&lt;br /&gt;
* A &amp;#039;&amp;#039;&amp;#039;dot&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt; sets air, for example to clear the inside of a hut.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Blueprint hut = Blueprint.builder()&lt;br /&gt;
        .palette(&amp;#039;W&amp;#039;, &amp;quot;Wood_Softwood_Planks&amp;quot;)&lt;br /&gt;
        .palette(&amp;#039;R&amp;#039;, &amp;quot;Wood_Softwood_Roof&amp;quot;)&lt;br /&gt;
        .layer(&amp;quot;WWW&amp;quot;, &amp;quot;W.W&amp;quot;, &amp;quot;WWW&amp;quot;)&lt;br /&gt;
        .layer(&amp;quot;WWW&amp;quot;, &amp;quot;W.W&amp;quot;, &amp;quot;W W&amp;quot;)&lt;br /&gt;
        .layer(&amp;quot;RRR&amp;quot;, &amp;quot;RRR&amp;quot;, &amp;quot;RRR&amp;quot;)&lt;br /&gt;
        .build();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;width()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;height()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;depth()&amp;lt;/code&amp;gt;: size in x, y and z.&lt;br /&gt;
* &amp;lt;code&amp;gt;cells()&amp;lt;/code&amp;gt;: all blocks with their position relative to the corner (0, 0, 0).&lt;br /&gt;
* &amp;lt;code&amp;gt;rotated(quarterTurns)&amp;lt;/code&amp;gt;: rotated by 90° steps clockwise (seen from above), corner back at (0, 0). In 1.0.0 only the positions turn. A rotation in the block key (such as &amp;lt;code&amp;gt;Yaw=90&amp;lt;/code&amp;gt;) is not turned with them.&lt;br /&gt;
* A character that is not in the palette, or a blueprint without layers, throws when you call &amp;lt;code&amp;gt;build()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== StructureFeature ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
UtilityBiomeAPI.registerChunkFeature(&lt;br /&gt;
        StructureFeature.of(&amp;quot;mymod:hut&amp;quot;, hut)&lt;br /&gt;
                .inBiomes(&amp;quot;Zone1_Tier2/Tile.Plains_*&amp;quot;)&lt;br /&gt;
                .chance(0.02)&lt;br /&gt;
                .foundation(&amp;quot;Rock_Stone_Cobble&amp;quot;)&lt;br /&gt;
                .build());&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Setting !! Default !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;inBiomes(globs...)&amp;lt;/code&amp;gt; || all biomes || Same globs as for chunk features.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;chance(p)&amp;lt;/code&amp;gt; || 0.05 || Share of matching chunks that try to place the structure.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;order(n)&amp;lt;/code&amp;gt; || 10 || Run order among all chunk features.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;maxSlope(blocks)&amp;lt;/code&amp;gt; || 2 || Largest height difference allowed on the site.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;margin(blocks)&amp;lt;/code&amp;gt; || 3 || Distance to the chunk border and to anything built.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;sink(blocks)&amp;lt;/code&amp;gt; || 0 || How deep the structure is set into the ground.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;noRotation()&amp;lt;/code&amp;gt; || rotate || Turns off the random rotation.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;allowNearBuildings()&amp;lt;/code&amp;gt; || avoid || Also allow sites in or next to built things, for example for additions to ruins.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;airOnly()&amp;lt;/code&amp;gt; || off || Only place blocks into air, so the terrain stays (half-buried ruins).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;foundation(block)&amp;lt;/code&amp;gt; || natural || Fills below the bottom layer down to the ground with this block.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
What happens in each chunk:&lt;br /&gt;
# The blueprint is rotated at random (unless &amp;lt;code&amp;gt;noRotation()&amp;lt;/code&amp;gt;).&lt;br /&gt;
# A flat site is searched: natural ground, no water, the slope within &amp;lt;code&amp;gt;maxSlope&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;margin&amp;lt;/code&amp;gt; blocks away from the chunk border and, unless allowed, from anything built or a settlement biome. If there is none, nothing is placed.&lt;br /&gt;
# The blueprint is placed on the highest ground block of the site, lowered by &amp;lt;code&amp;gt;sink&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Below the bottom layer a foundation is filled down to the ground, at most 24 blocks: with the &amp;lt;code&amp;gt;foundation&amp;lt;/code&amp;gt; block if set, otherwise with the natural ground block of each column (grass becomes dirt). With &amp;lt;code&amp;gt;sink&amp;lt;/code&amp;gt; above 0 and no &amp;lt;code&amp;gt;foundation&amp;lt;/code&amp;gt; block, no foundation is added.&lt;br /&gt;
&lt;br /&gt;
== Structures ==&lt;br /&gt;
The steps above, for use in your own placer:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Method !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;findFlatSite(chunk, width, depth, maxSlope, margin, avoidBuildings, random)&amp;lt;/code&amp;gt; || A random suitable site (as &amp;lt;code&amp;gt;Site(x, y, z)&amp;lt;/code&amp;gt;, y = ground height), or empty.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;fits(blueprint, x, y, z)&amp;lt;/code&amp;gt; || Whether the blueprint fits into the chunk at that corner.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;place(chunk, blueprint, x, y, z, airOnly)&amp;lt;/code&amp;gt; || Places the blueprint. Throws if it does not fit, which in a chunk feature means nothing is applied.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;naturalFoundation(chunk, blueprint, x, y, z)&amp;lt;/code&amp;gt; || Foundation from the ground block of each column.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;foundation(chunk, blueprint, x, y, z, block)&amp;lt;/code&amp;gt; || Foundation from a given block.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Shapes ==&lt;br /&gt;
Basic shapes in chunk coordinates. Parts outside the chunk are skipped. With &amp;lt;code&amp;gt;airOnly&amp;lt;/code&amp;gt; only air is replaced. Each method returns the number of blocks set.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Method !! Shape&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;box(chunk, x0, y0, z0, x1, y1, z1, block, airOnly)&amp;lt;/code&amp;gt; || Solid box, corners included.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;hollowBox(chunk, x0, y0, z0, x1, y1, z1, block)&amp;lt;/code&amp;gt; || Walls, floor and ceiling of &amp;lt;code&amp;gt;block&amp;lt;/code&amp;gt;, air inside.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ellipsoid(chunk, cx, cy, cz, rx, ry, rz, block, airOnly)&amp;lt;/code&amp;gt; || Ellipsoid around a centre.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;cylinder(chunk, cx, y0, cz, y1, radius, block, airOnly)&amp;lt;/code&amp;gt; || Upright cylinder.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;foundation(chunk, x, fromY, z, block)&amp;lt;/code&amp;gt; || Fills downwards until the first solid block, at most 24 blocks.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;clearPlantAbove(chunk, x, y, z)&amp;lt;/code&amp;gt; || Removes a plant, grass or bush above a block, so it does not float after digging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;inside(x, y, z)&amp;lt;/code&amp;gt; || Whether a position lies inside the chunk.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Terrain ==&lt;br /&gt;
Hytale does not remember after generation where prefabs were placed, so Utility Biome recognises built things by their block names.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Method !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;isNatural(block)&amp;lt;/code&amp;gt; || Rock (except crystals) or soil, and nothing built.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;isBuilt(block)&amp;lt;/code&amp;gt; || The block name contains a part such as Brick, Cobble, Plank, Stairs, Roof, Fence, Lantern, Chest, Furniture and similar.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;isSettlementBiome(name)&amp;lt;/code&amp;gt; || The biome name contains Village, Town, City, Cities, Camp or Outpost.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ground(chunk, x, z)&amp;lt;/code&amp;gt; || Highest natural ground block of the column. Leaves, plants and built blocks do not count.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;nearBuilding(chunk, minX, minY, minZ, maxX, maxY, maxZ)&amp;lt;/code&amp;gt; || Whether anything built stands in the box, or a corner of it lies in a settlement biome.&lt;br /&gt;
|}&lt;br /&gt;
Built things just across the chunk border cannot be seen, which is why a margin to the border is useful.&lt;br /&gt;
&lt;br /&gt;
{{UtilityBiome Nav}}&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>