first commit for mg_villages (which is derived directly from my mg-fork)
commit
8ee366feea
|
@ -0,0 +1,3 @@
|
|||
This is a continuation of my (Sokomines) fork of Nores mg mapgen.
|
||||
The fork can be found under https://github.com/Sokomine/mg
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
|
||||
handle_schematics = {}
|
||||
|
||||
-- taken from https://github.com/MirceaKitsune/minetest_mods_structures/blob/master/structures_io.lua (Taokis Sructures I/O mod)
|
||||
-- gets the size of a structure file
|
||||
-- nodenames: contains all the node names that are used in the schematic
|
||||
-- on_constr: lists all the node names for which on_construct has to be called after placement of the schematic
|
||||
handle_schematics.analyze_mts_file = function( path )
|
||||
local size = { x = 0, y = 0, z = 0, version = 0 }
|
||||
local version = 0;
|
||||
|
||||
local file = io.open(path..'.mts', "r")
|
||||
if (file == nil) then
|
||||
return nil
|
||||
end
|
||||
|
||||
-- thanks to sfan5 for this advanced code that reads the size from schematic files
|
||||
local read_s16 = function(fi)
|
||||
return string.byte(fi:read(1)) * 256 + string.byte(fi:read(1))
|
||||
end
|
||||
|
||||
local function get_schematic_size(f)
|
||||
-- make sure those are the first 4 characters, otherwise this might be a corrupt file
|
||||
if f:read(4) ~= "MTSM" then
|
||||
return nil
|
||||
end
|
||||
-- advance 2 more characters
|
||||
local version = read_s16(f); --f:read(2)
|
||||
-- the next characters here are our size, read them
|
||||
return read_s16(f), read_s16(f), read_s16(f), version
|
||||
end
|
||||
|
||||
size.x, size.y, size.z, size.version = get_schematic_size(file)
|
||||
|
||||
-- read the slice probability for each y value that was introduced in version 3
|
||||
if( size.version >= 3 ) then
|
||||
-- the probability is not very intresting for buildings so we just skip it
|
||||
file:read( size.y );
|
||||
end
|
||||
|
||||
|
||||
-- this list is not yet used for anything
|
||||
local nodenames = {};
|
||||
-- this list is needed for calling on_construct after place_schematic
|
||||
local on_constr = {};
|
||||
-- nodes that require after_place_node to be called
|
||||
local after_place_node = {};
|
||||
|
||||
-- after that: read_s16 (2 bytes) to find out how many diffrent nodenames (node_name_count) are present in the file
|
||||
local node_name_count = read_s16( file );
|
||||
|
||||
for i = 1, node_name_count do
|
||||
|
||||
-- the length of the next name
|
||||
local name_length = read_s16( file );
|
||||
-- the text of the next name
|
||||
local name_text = file:read( name_length );
|
||||
|
||||
table.insert( nodenames, name_text );
|
||||
-- in order to get this information, the node has to be defined and loaded
|
||||
if( minetest.registered_nodes[ name_text ] and minetest.registered_nodes[ name_text ].on_construct) then
|
||||
table.insert( on_constr, name_text );
|
||||
end
|
||||
-- some nodes need after_place_node to be called for initialization
|
||||
if( minetest.registered_nodes[ name_text ] and minetest.registered_nodes[ name_text ].after_place_node) then
|
||||
table.insert( after_place_node, name_text );
|
||||
end
|
||||
end
|
||||
|
||||
file.close(file)
|
||||
|
||||
local rotated = 0;
|
||||
local burried = 0;
|
||||
local parts = path:split('_');
|
||||
if( parts and #parts > 2 ) then
|
||||
if( parts[#parts]=="0" or parts[#parts]=="90" or parts[#parts]=="180" or parts[#parts]=="270" ) then
|
||||
rotated = tonumber( parts[#parts] );
|
||||
burried = tonumber( parts[ #parts-1 ] );
|
||||
if( not( burried ) or burried>20 or burried<0) then
|
||||
burried = 0;
|
||||
end
|
||||
end
|
||||
end
|
||||
return { size = { x=size.x, y=size.y, z=size.z}, nodenames = nodenames, on_constr = on_constr, after_place_node = after_place_node, rotated=rotated, burried=burried };
|
||||
end
|
||||
|
|
@ -0,0 +1,402 @@
|
|||
|
||||
--village_types = { 'nore', 'logcabin', 'grasshut', 'medieval', 'charachoal', 'taoki'};
|
||||
|
||||
mg_villages.village_sizes = {
|
||||
nore = { min = 20, max = 40, texture = 'default_stone_brick.png'},
|
||||
taoki = { min = 30, max = 70, texture = 'default_brick.png' },
|
||||
-- medieval = { min = 25, max = 60, texture = 'cottages_darkage_straw.png'}, -- they often have straw roofs
|
||||
medieval = { min = 50, max = 60, texture = 'cottages_darkage_straw.png'}, -- TODO: increased for easier testing
|
||||
charachoal = { min = 10, max = 15, texture = 'default_coal_block.png'},
|
||||
lumberjack = { min = 10, max = 30, texture = 'default_tree.png'},
|
||||
claytrader = { min = 10, max = 20, texture = 'default_clay.png'},
|
||||
logcabin = { min = 15, max = 30, texture = 'default_wood.png'},
|
||||
canadian = { min = 40, max = 110, texture = 'wool_white.png'},
|
||||
}
|
||||
|
||||
-- if set to true, the outer buildings in medieval villages will be fields; this is not very convincing yet
|
||||
mg_villages.medieval_subtype = false;
|
||||
|
||||
buildings = {
|
||||
|
||||
-- the houses the mod came with
|
||||
{sizex= 7, sizez= 7, yoff= 0, ysize= 9, scm="house", orients={2}, weight={nore=1 }},
|
||||
{sizex= 9, sizez= 9, yoff= 0, ysize= 2, scm="wheat_field", weight={nore=1 }},
|
||||
{sizex= 9, sizez= 9, yoff= 0, ysize= 2, scm="cotton_field", weight={nore=1 }},
|
||||
{sizex= 3, sizez= 3, yoff= 1, ysize= 4, scm="lamp", no_rotate=true, weight={nore=1/5 }},
|
||||
{sizex= 4, sizez= 4, yoff=-5, ysize=11, scm="well", no_rotate=true, pervillage=1, weight={nore=1 }},
|
||||
{sizex= 7, sizez= 7, yoff= 0, ysize=11, scm="fountain", pervillage=3, weight={nore=1/4 }},
|
||||
{sizex= 5, sizez= 5, yoff= 0, ysize= 6, scm="small_house", orients={3}, weight={nore=1 }},
|
||||
{sizex= 6, sizez=12, yoff= 0, ysize= 7, scm="house_with_garden", orients={1}, weight={nore=1 }},
|
||||
{sizex=16, sizez=17, yoff= 0, ysize=12, scm="church", orients={3}, pervillage=1, weight={nore=1 }},
|
||||
{sizex= 5, sizez= 5, yoff= 0, ysize=16, scm="tower", orients={0}, weight={nore=1/7 }},
|
||||
{sizex= 8, sizez= 9, yoff= 0, ysize= 6, scm="forge", orients={0}, pervillage=2, weight={nore=1 }},
|
||||
{sizex=11, sizez=12, yoff= 0, ysize= 6, scm="library", orients={1}, pervillage=2, weight={nore=1 }},
|
||||
{sizex=15, sizez= 7, yoff= 0, ysize=12, scm="inn", orients={1}, pervillage=4, weight={nore=1/2 }},
|
||||
{sizex=22, sizez=17, yoff= 0, ysize= 7, scm="pub", orients={3}, pervillage=2, weight={nore=1/3 }},
|
||||
|
||||
|
||||
-- log cabins by Sokomine (requiring cottages, glasspanes)
|
||||
{sizex= 6, sizez= 4, yoff= 0, ysize= 5, scm="logcabin1", orients={1}, weight={logcabin=1}},
|
||||
{sizex= 6, sizez= 6, yoff= 0, ysize= 6, scm="logcabin2", orients={1}, weight={logcabin=1}},
|
||||
{sizex= 6, sizez= 6, yoff= 0, ysize= 6, scm="logcabin3", orients={1}, weight={logcabin=1}},
|
||||
{sizex= 5, sizez= 7, yoff= 0, ysize= 7, scm="logcabin4", orients={1}, weight={logcabin=1}},
|
||||
{sizex= 5, sizez= 5, yoff= 0, ysize= 5, scm="logcabin5", orients={1}, weight={logcabin=1}},
|
||||
{sizex= 5, sizez= 7, yoff= 0, ysize= 5, scm="logcabin6", orients={1}, weight={logcabin=1}},
|
||||
{sizex= 7, sizez= 7, yoff= 0, ysize= 7, scm="logcabin7", orients={1}, weight={logcabin=1}},
|
||||
{sizex= 5, sizez= 6, yoff= 0, ysize= 5, scm="logcabin8", orients={1}, weight={logcabin=1}},
|
||||
{sizex= 5, sizez= 5, yoff= 0, ysize= 6, scm="logcabin9", orients={1}, weight={logcabin=1}},
|
||||
{sizex= 5, sizez= 8, yoff= 0, ysize= 7, scm="logcabin10", orients={1}, weight={logcabin=1}},
|
||||
{sizex= 7, sizez= 10, yoff= 0, ysize= 7, scm="logcabin11", orients={1}, weight={logcabin=1}},
|
||||
{sizex= 7, sizez= 7, yoff= 0, ysize= 5, scm="logcabin12rot", orients={2}, weight={logcabin=1}},
|
||||
{sizex= 7, sizez= 8, yoff= 0, ysize= 7, scm="logcabin13rot", orients={2}, weight={logcabin=1}},
|
||||
|
||||
-- grass huts (requiring cottages, dryplants, cavestuff/undergrowth, plantlife)
|
||||
{sizex= 6, sizez= 6, yoff= 0, ysize= 5, scm="grasshut1", orients={2}, weight={grasshut=1}},
|
||||
{sizex= 9, sizez= 9, yoff= 0, ysize= 8, scm="grasshut2", orients={2}, weight={grasshut=1}},
|
||||
{sizex= 7, sizez= 7, yoff= 0, ysize= 7, scm="grasshut3", orients={2}, weight={grasshut=1}},
|
||||
{sizex= 7, sizez= 7, yoff= 0, ysize= 7, scm="grasshut4", orients={2}, weight={grasshut=1}},
|
||||
{sizex= 5, sizez= 5, yoff= 0, ysize= 6, scm="grasshut5", orients={2}, weight={grasshut=1}},
|
||||
{sizex= 5, sizez= 5, yoff= 0, ysize= 6, scm="grasshut6", orients={2}, weight={grasshut=1}},
|
||||
{sizex= 7, sizez= 7, yoff= 0, ysize= 2, scm="grasshutcenter", orients={2}, pervillage=1, weight={grasshut=2}},
|
||||
|
||||
-- for the buildings below, sizex, sizez and ysize are read from the file directly;
|
||||
|
||||
-- schematics from Sokomines villages mod (requires cottages)
|
||||
{scm="church_1", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='church', weight={medieval=4}, pervillage=1},
|
||||
-- {scm="church_2_twoelk", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='church', weight={medieval=4}, pervillage=1},
|
||||
{scm="forge_1", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='forge', weight={medieval=2}, pervillage=1},
|
||||
{scm="mill_1", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='mill', weight={medieval=2}, pervillage=1},
|
||||
{scm="hut_1", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='hut', weight={medieval=1}},
|
||||
{scm="farm_full_1", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='farm_full', weight={medieval=1/4}},
|
||||
{scm="farm_full_2", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='farm_full', weight={medieval=1/4}},
|
||||
{scm="farm_full_3", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='farm_full', weight={medieval=1/4}},
|
||||
{scm="farm_full_4", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='farm_full', weight={medieval=1/4}},
|
||||
{scm="farm_full_5", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='farm_full', weight={medieval=1/4}},
|
||||
{scm="farm_full_6", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='farm_full', weight={medieval=1/4}},
|
||||
{scm="farm_tiny_1", yoff= 0, orients={0}, farming_plus=1, avoid='', typ='farm_tiny', weight={medieval=1}},
|
||||
{scm="farm_tiny_2", yoff= 0, orients={0}, farming_plus=1, avoid='', typ='farm_tiny', weight={medieval=1}},
|
||||
{scm="farm_tiny_3", yoff= 0, orients={0}, farming_plus=1, avoid='', typ='farm_tiny', weight={medieval=1}},
|
||||
{scm="farm_tiny_4", yoff= 0, orients={0}, farming_plus=1, avoid='', typ='farm_tiny', weight={medieval=1}},
|
||||
{scm="farm_tiny_5", yoff= 0, orients={0}, farming_plus=1, avoid='', typ='farm_tiny', weight={medieval=1}},
|
||||
{scm="farm_tiny_6", yoff= 0, orients={0}, farming_plus=1, avoid='', typ='farm_tiny', weight={medieval=1}},
|
||||
{scm="farm_tiny_7", yoff= 0, orients={0}, farming_plus=1, avoid='', typ='farm_tiny', weight={medieval=1}},
|
||||
{scm="taverne_1", yoff= 0, orients={0}, farming_plus=1, avoid='', typ='tavern', weight={medieval=1/2}, pervillage=1},
|
||||
{scm="taverne_2", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='tavern', weight={medieval=1/2}, pervillage=1},
|
||||
{scm="taverne_3", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='tavern', weight={medieval=1/2}, pervillage=1},
|
||||
{scm="taverne_4", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='tavern', weight={medieval=1/2}, pervillage=1},
|
||||
|
||||
{scm="well_1", yoff= 0, orients={0}, farming_plus=0, avoid='well', typ='well', weight={medieval=1/12}, pervillage=4},
|
||||
{scm="well_2", yoff= 0, orients={0}, farming_plus=0, avoid='well', typ='well', weight={medieval=1/12}, pervillage=4},
|
||||
{scm="well_3", yoff= 0, orients={0}, farming_plus=0, avoid='well', typ='well', weight={medieval=1/12}, pervillage=4},
|
||||
{scm="well_4", yoff= 0, orients={0}, farming_plus=0, avoid='well', typ='well', weight={medieval=1/12}, pervillage=4},
|
||||
{scm="well_5", yoff= 0, orients={0}, farming_plus=0, avoid='well', typ='well', weight={medieval=1/12}, pervillage=4},
|
||||
{scm="well_6", yoff= 0, orients={0}, farming_plus=0, avoid='well', typ='well', weight={medieval=1/12}, pervillage=4},
|
||||
{scm="well_7", yoff= -1, orients={0}, farming_plus=0, avoid='well', typ='well', weight={medieval=1/12}, pervillage=4},
|
||||
{scm="well_8", yoff= -1, orients={0}, farming_plus=0, avoid='well', typ='well', weight={medieval=1/12}, pervillage=4},
|
||||
|
||||
{scm="tree_place_1", yoff= 1, orients={0}, farming_plus=0, avoid='', typ='village_square', weight={medieval=1/12}, pervillage=1},
|
||||
{scm="tree_place_2", yoff= 1, orients={0}, farming_plus=0, avoid='', typ='village_square', weight={medieval=1/12}, pervillage=1},
|
||||
{scm="tree_place_3", yoff= 1, orients={0}, farming_plus=0, avoid='', typ='village_square', weight={medieval=1/12}, pervillage=1},
|
||||
{scm="tree_place_4", yoff= 1, orients={0}, farming_plus=0, avoid='', typ='village_square', weight={medieval=1/12}, pervillage=1},
|
||||
{scm="tree_place_5", yoff= 1, orients={0}, farming_plus=0, avoid='', typ='village_square', weight={medieval=1/12}, pervillage=1},
|
||||
{scm="tree_place_6", yoff= 1, orients={0}, farming_plus=0, avoid='', typ='village_square', weight={medieval=1/12}, pervillage=1},
|
||||
{scm="tree_place_7", yoff= 1, orients={0}, farming_plus=0, avoid='', typ='village_square', weight={medieval=1/12}, pervillage=1},
|
||||
{scm="tree_place_8", yoff= 1, orients={0}, farming_plus=0, avoid='', typ='village_square', weight={medieval=1/12}, pervillage=1},
|
||||
{scm="tree_place_9", yoff= 1, orients={0}, farming_plus=0, avoid='', typ='village_square', weight={medieval=1/12}, pervillage=1},
|
||||
{scm="tree_place_10", yoff= 1, orients={0}, farming_plus=0, avoid='', typ='village_square', weight={medieval=1/12}, pervillage=1},
|
||||
|
||||
{scm="wagon_1", yoff= 0, orients={0,1,2,3}, farming_plus=0, avoid='', typ='wagon', weight={medieval=1/12}},
|
||||
{scm="wagon_2", yoff= 0, orients={0,1,2,3}, farming_plus=0, avoid='', typ='wagon', weight={medieval=1/12}},
|
||||
{scm="wagon_3", yoff= 0, orients={0,1,2,3}, farming_plus=0, avoid='', typ='wagon', weight={medieval=1/12}},
|
||||
{scm="wagon_4", yoff= 0, orients={0,1,2,3}, farming_plus=0, avoid='', typ='wagon', weight={medieval=1/12}},
|
||||
{scm="wagon_5", yoff= 0, orients={0,1,2,3}, farming_plus=0, avoid='', typ='wagon', weight={medieval=1/12}},
|
||||
{scm="wagon_6", yoff= 0, orients={0,1,2,3}, farming_plus=0, avoid='', typ='wagon', weight={medieval=1/12}},
|
||||
{scm="wagon_7", yoff= 0, orients={0,1,2,3}, farming_plus=0, avoid='', typ='wagon', weight={medieval=1/12}},
|
||||
{scm="wagon_8", yoff= 0, orients={0,1,2,3}, farming_plus=0, avoid='', typ='wagon', weight={medieval=1/12}},
|
||||
{scm="wagon_9", yoff= 0, orients={0,1,2,3}, farming_plus=0, avoid='', typ='wagon', weight={medieval=1/12}},
|
||||
{scm="wagon_10", yoff= 0, orients={0,1,2,3}, farming_plus=0, avoid='', typ='wagon', weight={medieval=1/12}},
|
||||
{scm="wagon_11", yoff= 0, orients={0,1,2,3}, farming_plus=0, avoid='', typ='wagon', weight={medieval=1/12}},
|
||||
{scm="wagon_12", yoff= 0, orients={0,1,2,3}, farming_plus=0, avoid='', typ='wagon', weight={medieval=1/12}},
|
||||
|
||||
{scm="bench_1", yoff= 0, orients={0,1,2}, farming_plus=0, avoid='', typ='bench', weight={medieval=1/12}},
|
||||
{scm="bench_2", yoff= 0, orients={0,1,2}, farming_plus=0, avoid='', typ='bench', weight={medieval=1/12}},
|
||||
{scm="bench_3", yoff= 0, orients={0,1,2}, farming_plus=0, avoid='', typ='bench', weight={medieval=1/12}},
|
||||
{scm="bench_4", yoff= 0, orients={0,1,2}, farming_plus=0, avoid='', typ='bench', weight={medieval=1/12}},
|
||||
|
||||
{scm="shed_1", yoff= 0, orients={0,1,2}, farming_plus=0, avoid='', typ='shed', weight={medieval=1/10}},
|
||||
{scm="shed_2", yoff= 0, orients={0,1,2}, farming_plus=0, avoid='', typ='shed', weight={medieval=1/10}},
|
||||
{scm="shed_3", yoff= 0, orients={0,1,2}, farming_plus=0, avoid='', typ='shed', weight={medieval=1/10}},
|
||||
{scm="shed_5", yoff= 0, orients={0,1,2}, farming_plus=0, avoid='', typ='shed', weight={medieval=1/10}},
|
||||
{scm="shed_6", yoff= 0, orients={0,1,2}, farming_plus=0, avoid='', typ='shed', weight={medieval=1/10}},
|
||||
{scm="shed_7", yoff= 0, orients={0,1,2}, farming_plus=0, avoid='', typ='shed', weight={medieval=1/10}},
|
||||
{scm="shed_8", yoff= 0, orients={0,1,2}, farming_plus=0, avoid='', typ='shed', weight={medieval=1/10}},
|
||||
{scm="shed_9", yoff= 0, orients={0,1,2}, farming_plus=0, avoid='', typ='shed', weight={medieval=1/10}},
|
||||
{scm="shed_10", yoff= 0, orients={0,1,2}, farming_plus=0, avoid='', typ='shed', weight={medieval=1/10}},
|
||||
{scm="shed_11", yoff= 0, orients={0,1,2}, farming_plus=0, avoid='', typ='shed', weight={medieval=1/10}},
|
||||
{scm="shed_12", yoff= 0, orients={0,1,2}, farming_plus=0, avoid='', typ='shed', weight={medieval=1/10}},
|
||||
|
||||
{scm="weide_1", yoff= 0, orients={0,1,2,3}, farming_plus=0, avoid='pasture', typ='pasture', weight={medieval=1/6}, pervillage=8},
|
||||
{scm="weide_2", yoff= 0, orients={0,1,2,3}, farming_plus=0, avoid='pasture', typ='pasture', weight={medieval=1/6}, pervillage=8},
|
||||
{scm="weide_3", yoff= 0, orients={0,1,2,3}, farming_plus=0, avoid='pasture', typ='pasture', weight={medieval=1/6}, pervillage=8},
|
||||
{scm="weide_4", yoff= 0, orients={0,1,2,3}, farming_plus=0, avoid='pasture', typ='pasture', weight={medieval=1/6}, pervillage=8},
|
||||
{scm="weide_5", yoff= 0, orients={0,1,2,3}, farming_plus=0, avoid='pasture', typ='pasture', weight={medieval=1/6}, pervillage=8},
|
||||
{scm="weide_6", yoff= 0, orients={0,1,2,3}, farming_plus=0, avoid='pasture', typ='pasture', weight={medieval=1/6}, pervillage=8},
|
||||
|
||||
{scm="field_1", yoff=-2, orients={0,1,2,3}, farming_plus=0, avoid='field', typ='field', weight={medieval=1/6}, pervillage=8},
|
||||
{scm="field_2", yoff=-2, orients={0,1,2,3}, farming_plus=0, avoid='field', typ='field', weight={medieval=1/6}, pervillage=8},
|
||||
{scm="field_3", yoff=-2, orients={0,1,2,3}, farming_plus=0, avoid='field', typ='field', weight={medieval=1/6}, pervillage=8},
|
||||
{scm="field_4", yoff=-2, orients={0,1,2,3}, farming_plus=0, avoid='field', typ='field', weight={medieval=1/6}, pervillage=8},
|
||||
|
||||
-- hut and hills for charachoal burners; perhaps they could live together with lumberjacks?
|
||||
{scm="charachoal_hut", yoff= 0, orients={0,1,2}, farming_plus=0, avoid='', typ='hut', weight={charachoal=1}},
|
||||
{scm="charachoal_hill", yoff= 0, orients={0,1,2,3}, farming_plus=0, avoid='', typ='hut', weight={charachoal=2}},
|
||||
|
||||
-- lumberjacks; they require the cottages mod
|
||||
{scm="lumberjack_1", yoff= 1, orients={1}, avoid='', typ='lumberjack', weight={lumberjack=1}},
|
||||
{scm="lumberjack_2", yoff= 1, orients={1}, avoid='', typ='lumberjack', weight={lumberjack=1}},
|
||||
{scm="lumberjack_3", yoff= 1, orients={0}, avoid='', typ='lumberjack', weight={lumberjack=1}},
|
||||
{scm="lumberjack_4", yoff= 1, orients={1}, avoid='', typ='lumberjack', weight={lumberjack=1}},
|
||||
{scm="lumberjack_5", yoff= 1, orients={1}, avoid='', typ='lumberjack', weight={lumberjack=1}},
|
||||
{scm="lumberjack_6", yoff= 1, orients={1}, avoid='', typ='lumberjack', weight={lumberjack=1}},
|
||||
{scm="lumberjack_7", yoff= 1, orients={1}, avoid='', typ='lumberjack', weight={lumberjack=1}},
|
||||
{scm="lumberjack_8", yoff= 1, orients={1}, avoid='', typ='lumberjack', weight={lumberjack=1}},
|
||||
{scm="lumberjack_pub_1", yoff= 1, orients={1}, avoid='', typ='tavern', weight={lumberjack=3}, pervillage=1},
|
||||
{scm="lumberjack_church_1", yoff= 1, orients={1}, avoid='', typ='church', weight={lumberjack=3}, pervillage=1},
|
||||
{scm="lumberjack_hotel_1", yoff= 1, orients={1}, avoid='', typ='house', weight={lumberjack=1},},
|
||||
{scm="lumberjack_shop_1", yoff= 1, orients={1}, avoid='', typ='shop', weight={lumberjack=1}, pervillage=1},
|
||||
|
||||
|
||||
-- {scm="cow_trader_1", yoff= 0, orients={4}, avoid='', typ='trader', weight={lumberjack=1}},
|
||||
|
||||
-- clay traders depend on cottages as well
|
||||
{scm="trader_clay_1", yoff= 1, orients={1}, avoid='', typ='trader', weight={claytrader=3}},
|
||||
{scm="trader_clay_2", yoff= 1, orients={3}, avoid='', typ='trader', weight={claytrader=3}},
|
||||
{scm="trader_clay_3", yoff= 1, orients={0}, avoid='', typ='trader', weight={claytrader=3}},
|
||||
{scm="trader_clay_4", yoff= 1, orients={2}, avoid='', typ='trader', weight={claytrader=3}},
|
||||
{scm="trader_clay_5", yoff= 1, orients={1}, avoid='', typ='trader', weight={claytrader=3}},
|
||||
|
||||
{scm="clay_pit_1", yoff=-3, orients={0,1,2,3}, avoid='', typ='pit', weight={claytrader=1}},
|
||||
{scm="clay_pit_2", yoff=-2, orients={0,1,2,3}, avoid='', typ='pit', weight={claytrader=1}},
|
||||
{scm="clay_pit_3", yoff=-7, orients={0,1,2,3}, avoid='', typ='pit', weight={claytrader=1}},
|
||||
{scm="clay_pit_4", yoff= 0, orients={0,1,2,3}, avoid='', typ='pit', weight={claytrader=1}},
|
||||
{scm="clay_pit_5", yoff= 1, orients={0,1,2,3}, avoid='', typ='pit', weight={claytrader=1}},
|
||||
|
||||
|
||||
-- Houses from Taokis Structure I/O Mod (see https://forum.minetest.net/viewtopic.php?id=5524)
|
||||
|
||||
{scm="default_town_farm", yoff= -1, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1}},
|
||||
{scm="default_town_house_large_1", yoff= -4, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1/4}},
|
||||
{scm="default_town_house_large_2", yoff= -4, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1/4}},
|
||||
{scm="default_town_house_medium", yoff= -4, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1/2}},
|
||||
{scm="default_town_house_small", yoff= -4, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1}},
|
||||
{scm="default_town_house_tiny_1", yoff= 1, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1}},
|
||||
{scm="default_town_house_tiny_2", yoff= 1, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1}},
|
||||
{scm="default_town_house_tiny_3", yoff= 1, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1}},
|
||||
{scm="default_town_park", yoff= 1, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1}},
|
||||
{scm="default_town_tower", yoff= 1, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1/6}},
|
||||
{scm="default_town_well", yoff= -6, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1/4}},
|
||||
{scm="default_town_fountain", yoff= 1, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1/4}},
|
||||
-- the hotel seems to be only the middle section of the building; it's build for another spawning algorithm
|
||||
-- {scm="default_town_hotel", yoff= -1, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1/5}},
|
||||
|
||||
-- include houses from LadyMacBeth, originally created for Mauvebics mm2 modpack; the houses seem to be in canadian village style
|
||||
{scm="c_bank", yoff= 1, orients={2}, farming_plus=0, avoid='', typ='ladymacbeth', weight={canadian=1}},
|
||||
{scm="c_bank2", yoff= 1, orients={0}, farming_plus=0, avoid='', typ='ladymacbeth', weight={canadian=1}},
|
||||
{scm="c_bar", yoff= 1, orients={0}, farming_plus=0, avoid='', typ='ladymacbeth', weight={canadian=1}},
|
||||
{scm="c_hotel", yoff= 1, orients={0}, farming_plus=0, avoid='', typ='ladymacbeth', weight={canadian=1}},
|
||||
{scm="c_postoffice", yoff= 1, orients={0}, farming_plus=0, avoid='', typ='ladymacbeth', weight={canadian=1}, pervillage=1},
|
||||
{scm="c_bordello", yoff= 1, orients={0}, farming_plus=0, avoid='', typ='ladymacbeth', weight={canadian=1}, pervillage=1},
|
||||
{scm="c_library", yoff= 1, orients={0}, farming_plus=0, avoid='', typ='ladymacbeth', weight={canadian=1}, pervillage=1},
|
||||
|
||||
{scm="g_observatory", yoff= 1, orients={0}, farming_plus=0, avoid='', typ='ladymacbeth', weight={canadian=1}, pervillage=1},
|
||||
{scm="g_court", yoff= 1, orients={0}, farming_plus=0, avoid='', typ='ladymacbeth', weight={canadian=1}, pervillage=1},
|
||||
{scm="g_prefecture", yoff= 1, orients={0}, farming_plus=0, avoid='', typ='ladymacbeth', weight={canadian=1}, pervillage=1},
|
||||
{scm="g_townhall", yoff= 1, orients={0}, farming_plus=0, avoid='', typ='ladymacbeth', weight={canadian=1}, pervillage=1},
|
||||
{scm="g_park2", yoff= -1, orients={0}, farming_plus=0, avoid='', typ='ladymacbeth', weight={canadian=2},},
|
||||
|
||||
{scm="r_apartments", yoff= 1, orients={0}, farming_plus=0, avoid='', typ='ladymacbeth', weight={canadian=4},},
|
||||
{scm="r_rowhouses", yoff= 1, orients={2}, farming_plus=0, avoid='', typ='ladymacbeth', weight={canadian=4},},
|
||||
{scm="r_manorhouse", yoff= 1, orients={0}, farming_plus=0, avoid='', typ='ladymacbeth', weight={canadian=3},},
|
||||
{scm="r_triplex", yoff= 1, orients={0}, farming_plus=0, avoid='', typ='ladymacbeth', weight={canadian=3},},
|
||||
|
||||
{scm="field_1", yoff=-2, orients={0,1,2,3}, farming_plus=0, avoid='', typ='field', weight={fields=1}},
|
||||
{scm="field_2", yoff=-2, orients={0,1,2,3}, farming_plus=0, avoid='', typ='field', weight={fields=1}},
|
||||
{scm="field_3", yoff=-2, orients={0,1,2,3}, farming_plus=0, avoid='', typ='field', weight={fields=1}},
|
||||
{scm="field_4", yoff=-2, orients={0,1,2,3}, farming_plus=0, avoid='', typ='field', weight={fields=1}},
|
||||
|
||||
}
|
||||
|
||||
|
||||
-- the schematics for buildings of type 'farm_tiny' grow cotton; the farming_plus fruits would be far more fitting
|
||||
mg_villages.fruit_list = {'carrot','potatoe','orange','rhubarb','strawberry','tomato','cotton'};
|
||||
-- is farming_plus available? If not, we can't use this
|
||||
if( not( minetest.get_modpath("farming_plus"))) then
|
||||
mg_villages.fruit_list = nil;
|
||||
end
|
||||
|
||||
-- 'nore' and 'taoki' do not require any other mods; thus, they can be used in all worlds
|
||||
mg_villages.village_types = { 'nore', 'taoki'};
|
||||
|
||||
if( minetest.get_modpath("cottages")) then
|
||||
table.insert( mg_villages.village_types, 'medieval' );
|
||||
table.insert( mg_villages.village_types, 'charachoal' );
|
||||
table.insert( mg_villages.village_types, 'lumberjack' );
|
||||
table.insert( mg_villages.village_types, 'claytrader' );
|
||||
|
||||
if( minetest.get_modpath("glasspanes")) then
|
||||
table.insert( mg_villages.village_types, 'logcabin' );
|
||||
end
|
||||
end
|
||||
|
||||
if( minetest.get_modpath( 'hdb' ) and minetest.get_modpath( 'nbu' )) then
|
||||
table.insert( mg_villages.village_types, 'canadian' );
|
||||
end
|
||||
|
||||
--mg_villages.village_types = {'lumberjack'};
|
||||
--mg_villages.village_types = {'medieval'};
|
||||
--mg_villages.village_types = {'claytrader'};
|
||||
--mg_villages.village_types = {'grasshut'};
|
||||
-- TODO: handle grasshut
|
||||
|
||||
-- read the data files and fill in information like size and nodes that need on_construct to be called after placing
|
||||
mg_villages.buildings_init = function()
|
||||
|
||||
local mts_path = mg_villages.modpath.."/schems/";
|
||||
-- determine the size of the given houses
|
||||
for i,v in ipairs( buildings ) do
|
||||
|
||||
|
||||
-- read the size of the building
|
||||
local res = handle_schematics.analyze_mts_file( mts_path..buildings[ i ].scm );
|
||||
-- alternatively, read the mts file
|
||||
if( not( res )) then
|
||||
res = mg_villages.import_scm( buildings[ i ].scm );
|
||||
end
|
||||
|
||||
-- provided the file could be analyzed successfully
|
||||
if( res and res.size and res.size.x ) then
|
||||
-- the file has to be placed with minetest.place_schematic(...)
|
||||
buildings[ i ].is_mts = 1;
|
||||
|
||||
buildings[ i ].sizex = res.size.x;
|
||||
buildings[ i ].sizez = res.size.z;
|
||||
buildings[ i ].ysize = res.size.y;
|
||||
|
||||
-- some buildings may be rotated
|
||||
if( res.rotated == 90
|
||||
or res.rotated == 270 ) then
|
||||
|
||||
buildings[ i ].sizex = res.size.z;
|
||||
buildings[ i ].sizez = res.size.x;
|
||||
end
|
||||
|
||||
if( not( buildings[ i ].yoff ) or buildings[ i ].yoff == 0 ) then
|
||||
buildings[ i ].yoff = res.burried;
|
||||
end
|
||||
|
||||
-- we do need at least the list of nodenames which will need on_constr later on
|
||||
buildings[ i ].rotated = res.rotated;
|
||||
buildings[ i ].nodenames = res.nodenames;
|
||||
buildings[ i ].on_constr = res.on_constr;
|
||||
buildings[ i ].after_place_node = res.after_place_node;
|
||||
|
||||
-- determine size of worldedit schematics
|
||||
elseif( res and #res and #res>0 and #res[1] and #res[1][1]) then
|
||||
|
||||
-- scm has the following structure: scm[y][x][z]
|
||||
buildings[ i ].ysize = #res;
|
||||
buildings[ i ].sizex = #res[1];
|
||||
buildings[ i ].sizez = #res[1][1];
|
||||
|
||||
buildings[ i ].is_mts = 0;
|
||||
|
||||
-- deep copy the schematics data here so that the file does not have to be read again
|
||||
-- caching cannot be done here as not all nodes from other mods have been registered yet!
|
||||
--buildings[ i ].scm_data_cache = minetest.serialize( res );
|
||||
|
||||
-- missing data regarding building size - do not use this building for anything
|
||||
elseif( not( buildings[ i ].sizex ) or not( buildings[ i ].sizez )
|
||||
or buildings[ i ].sizex == 0 or buildings[ i ].sizez==0) then
|
||||
|
||||
-- no village will use it
|
||||
print('[mg_villages] INFO: No schematic found for building \''..tostring( buildings[ i ].scm )..'\'. Will not use that building.');
|
||||
buildings[ i ].weight = {};
|
||||
|
||||
else
|
||||
-- the file has to be handled by worldedit; it is no .mts file
|
||||
buildings[ i ].is_mts = 0;
|
||||
end
|
||||
-- print it for debugging usage
|
||||
--print( v.scm .. ': '..tostring(buildings[i].sizex)..' x '..tostring(buildings[i].sizez)..' x '..tostring(buildings[i].ysize)..' h');
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- call the initialization function above
|
||||
mg_villages.buildings_init();
|
||||
|
||||
|
||||
--local gravel = minetest.get_content_id("default:gravel")
|
||||
local gravel = minetest.get_content_id("default:gravel")
|
||||
local c_air = minetest.get_content_id("air");
|
||||
local rgravel = {}
|
||||
for i = 1, 2000 do
|
||||
rgravel[i] = gravel
|
||||
end
|
||||
local rgravel2 = {}
|
||||
for i = 1, 2000 do
|
||||
rgravel2[i] = rgravel
|
||||
end
|
||||
local rair = {}
|
||||
for i = 1, 2000 do
|
||||
rair[i] = c_air
|
||||
end
|
||||
local rair2 = {}
|
||||
for i = 1, 2000 do
|
||||
rair2[i] = rair
|
||||
end
|
||||
local road_scm = {rgravel2, rair2}
|
||||
buildings["road"] = {yoff = 0, ysize = 2, scm = road_scm}
|
||||
|
||||
local rwall = {{minetest.get_content_id("default:stonebrick")}}
|
||||
local wall = {}
|
||||
for i = 1, 6 do
|
||||
wall[i] = rwall
|
||||
end
|
||||
buildings["wall"] = {yoff = 1, ysize = 6, scm = wall}
|
||||
|
||||
|
||||
--local total_weight = 0
|
||||
--for _, i in ipairs(buildings) do
|
||||
-- if i.weight == nil then i.weight = 1 end
|
||||
-- total_weight = total_weight+i.weight
|
||||
-- i.max_weight = total_weight
|
||||
--end
|
||||
--local multiplier = 3000/total_weight
|
||||
--for _,i in ipairs(buildings) do
|
||||
-- i.max_weight = i.max_weight*multiplier
|
||||
--end
|
||||
|
||||
|
||||
mg_villages.village_types[ #mg_villages.village_types ] = 'fields';
|
||||
for j,v in ipairs( mg_villages.village_types ) do
|
||||
|
||||
local total_weight = 0
|
||||
for _, i in ipairs(buildings) do
|
||||
if( not( i.max_weight )) then
|
||||
i.max_weight = {};
|
||||
end
|
||||
if( i.weight and i.weight[ v ] and i.weight[ v ]>0 ) then
|
||||
total_weight = total_weight+i.weight[ v ]
|
||||
i.max_weight[v] = total_weight
|
||||
end
|
||||
end
|
||||
local multiplier = 3000/total_weight
|
||||
for _,i in ipairs(buildings) do
|
||||
if( i.weight and i.weight[ v ] and i.weight[ v ]>0 ) then
|
||||
i.max_weight[v] = i.max_weight[ v ]*multiplier
|
||||
end
|
||||
end
|
||||
end
|
||||
-- the fields do not exist as an independent type
|
||||
mg_villages.village_types[ #mg_villages.village_types ] = nil;
|
|
@ -0,0 +1,102 @@
|
|||
|
||||
minetest.register_privilege("mg_villages", { description = "Allows to teleport to villages via /vist <nr>", give_to_singleplayer = false});
|
||||
|
||||
-- this function is only used for the chat command currently
|
||||
mg_villages.list_villages_formspec = function( player, formname, fields )
|
||||
|
||||
if( not( player ) or fields.quit) then
|
||||
return
|
||||
end
|
||||
local pname = player:get_player_name();
|
||||
local ppos = player:getpos();
|
||||
|
||||
|
||||
local radius = 1000000;
|
||||
-- without the special priv, players can only obtain informatoin about villages which are very close by
|
||||
if( not( minetest.check_player_privs( pname, {mg_villages=true}))) then
|
||||
radius = 100;
|
||||
end
|
||||
|
||||
local formspec = 'size[12,12]'..
|
||||
'button_exit[4.0,1.5;2,0.5;quit;Quit]'..
|
||||
'tablecolumns[' ..
|
||||
'text,align=right;'.. -- village number
|
||||
'text,align=right;'.. -- distance from player
|
||||
'text,align=center;'.. -- name of village
|
||||
'text,align=center;'.. -- typ of village
|
||||
'text,align=right;'.. -- x
|
||||
'text,align=right;'.. -- y
|
||||
'text,align=right;'.. -- z
|
||||
'text,align=right;'.. -- size
|
||||
'text,align=right]'.. -- #houses
|
||||
'table[0.1,2.7;11.4,8.8;'..formname..';';
|
||||
|
||||
for k,v in pairs( mg_villages.all_villages ) do
|
||||
|
||||
local dx = math.abs( v.vx - ppos.x );
|
||||
local dz = math.abs( v.vz - ppos.z );
|
||||
-- distance in y direction is less relevant here and may be ignored
|
||||
if( dx + dz < radius ) then
|
||||
local dist = math.sqrt( dx * dx + dz * dz );
|
||||
formspec = formspec..
|
||||
v.nr..','..
|
||||
tostring( math.floor( dist ))..','..
|
||||
tostring( k )..','.. -- TODO: use real village name
|
||||
v.village_type..','..
|
||||
tostring( v.vx )..','..
|
||||
tostring( v.vh )..','..
|
||||
tostring( v.vz )..','..
|
||||
tostring( v.vsize )..','..
|
||||
tostring( v.bpos )..','; -- TODO
|
||||
end
|
||||
end
|
||||
|
||||
formspec = formspec..';]'..
|
||||
'tabheader[0.1,2.2;spalte;N,Dist,Name,Typ,X,H,Z,Size,Buildings;;true;true]';
|
||||
|
||||
minetest.show_formspec( pname, formname, formspec );
|
||||
end
|
||||
|
||||
|
||||
minetest.register_chatcommand( 'villages', {
|
||||
description = "Shows a list of all known villages.",
|
||||
privs = {},
|
||||
func = function(name, param)
|
||||
mg_villages.list_villages_formspec( minetest.get_player_by_name( name ), "mg:village_list", {});
|
||||
end
|
||||
});
|
||||
|
||||
|
||||
minetest.register_chatcommand( 'visit', {
|
||||
description = "Teleports you to a known village.",
|
||||
params = "<village number>",
|
||||
privs = {},
|
||||
func = function(name, param)
|
||||
|
||||
|
||||
if( not( minetest.check_player_privs( name, {mg_villages=true}))) then
|
||||
minetest.chat_send_player( name, "You need the 'mg_villages' priv in order to teleport to villages using this command.");
|
||||
return;
|
||||
end
|
||||
|
||||
if( not( param ) or param == "" ) then
|
||||
minetest.chat_send_player( name, "Which village do you want to visit? Please provide the village number!");
|
||||
return;
|
||||
end
|
||||
|
||||
local nr = tonumber( param );
|
||||
for id, v in pairs( mg_villages.all_villages ) do
|
||||
-- we have found the village
|
||||
if( v and v.nr == nr ) then
|
||||
|
||||
-- TODO: print village name here (once they got one...)
|
||||
minetest.chat_send_player( name, "Initiating transfer to village no. "..tostring( v.nr )..", called "..( tostring( id ))..".");
|
||||
local player = minetest.get_player_by_name( name );
|
||||
player:moveto( { x=v.vx, y=(v.vh+1), z=v.vz }, false);
|
||||
return;
|
||||
end
|
||||
end
|
||||
-- no village found
|
||||
minetest.chat_send_player( name, "There is no village with the number "..tostring( param ).." (yet?).");
|
||||
end
|
||||
});
|
|
@ -0,0 +1,6 @@
|
|||
default
|
||||
farming
|
||||
wool
|
||||
stairs
|
||||
moretrees?
|
||||
moresnow?
|
|
@ -0,0 +1,35 @@
|
|||
|
||||
-- reserve namespace for the villages
|
||||
mg_villages = {}
|
||||
|
||||
mg_villages.all_villages = {}
|
||||
mg_villages.mg_generated_map = {}
|
||||
mg_villages.anz_villages = 0;
|
||||
|
||||
mg_villages.modpath = minetest.get_modpath( "mg_villages");
|
||||
|
||||
dofile(mg_villages.modpath.."/save_restore.lua")
|
||||
mg_villages.all_villages = save_restore.restore_data( 'mg_all_villages.data' ); -- read mg_villages.all_villages data saved for this world from previous runs
|
||||
mg_villages.mg_generated_map = save_restore.restore_data( 'mg_generated_map.data' );
|
||||
|
||||
dofile(mg_villages.modpath.."/we.lua")
|
||||
dofile(mg_villages.modpath.."/rotate.lua")
|
||||
|
||||
-- read size from schematics files directly
|
||||
-- analyze_mts_file.lua uses handle_schematics.* namespace
|
||||
dofile(mg_villages.modpath.."/analyze_mts_file.lua")
|
||||
|
||||
-- Note: the "buildings" talbe is not in the mg_villages.* namespace
|
||||
dofile(mg_villages.modpath.."/buildings.lua")
|
||||
|
||||
-- replace some materials for entire villages randomly
|
||||
dofile(mg_villages.modpath.."/replacements.lua")
|
||||
|
||||
dofile(mg_villages.modpath.."/villages.lua")
|
||||
|
||||
-- adds a command that allows to teleport to a known village
|
||||
dofile(mg_villages.modpath.."/chat_commands.lua")
|
||||
-- protect villages from griefing
|
||||
dofile(mg_villages.modpath.."/protection.lua")
|
||||
-- create and show a map of the world
|
||||
dofile(mg_villages.modpath.."/map_of_world.lua")
|
|
@ -0,0 +1,185 @@
|
|||
|
||||
|
||||
-- villages up to this many nodes in each direction are shown on the map
|
||||
mg_villages.MAP_RANGE = 1000;
|
||||
|
||||
|
||||
mg_villages.draw_tile = function( content_id, image, x, z, dx, dz )
|
||||
if( not( image )) then
|
||||
local node_name = minetest.get_name_from_content_id( content_id );
|
||||
if( not( node_name )) then
|
||||
return '';
|
||||
end
|
||||
local node_def = minetest.registered_nodes[ node_name ];
|
||||
if( not( node_def )) then
|
||||
return '';
|
||||
end
|
||||
local tiles = node_def.tiles;
|
||||
local tile = nil;
|
||||
if( tiles ~= nil ) then
|
||||
tile = tiles[1];
|
||||
end
|
||||
if type(tile)=="table" then
|
||||
tile=tile["name"]
|
||||
end
|
||||
image = tile;
|
||||
end
|
||||
return "image["..tostring(x)..",".. tostring(z) ..";"..dx..','..dz..";" .. image .."]";
|
||||
end
|
||||
|
||||
|
||||
mg_villages.map_of_world = function( pname )
|
||||
|
||||
local player = minetest.get_player_by_name( pname );
|
||||
if( not( player )) then
|
||||
return '';
|
||||
end
|
||||
local ppos = player:getpos();
|
||||
|
||||
-- also usable: diamond_block, sand, water
|
||||
local formspec = "size[14.4,10]"..
|
||||
"background[0,0;10,10;default_grass.png]"..
|
||||
"label[10,10;x axis]"..
|
||||
"label[0,0;z axis]"..
|
||||
"label[0,10;|]"..
|
||||
"label[0.2,10;->]";
|
||||
|
||||
|
||||
local r = mg_villages.MAP_RANGE;
|
||||
local f1 = 10/(2*r);
|
||||
|
||||
local map_tiles_shown = math.floor( mg_villages.MAP_RANGE/80 );
|
||||
local center_x = math.floor( ppos.x/80 );
|
||||
local center_z = math.floor( ppos.z/80 );
|
||||
for x = center_x - map_tiles_shown, center_x + map_tiles_shown do
|
||||
for z = center_z - map_tiles_shown, center_z + map_tiles_shown do
|
||||
if( mg_villages.mg_generated_map[ x ] and mg_villages.mg_generated_map[ x ][ z ] ) then
|
||||
local surface_types = mg_villages.mg_generated_map[ x ][ z ];
|
||||
local content_id = 0;
|
||||
if( type( surface_types )=='table' ) then
|
||||
content_id = surface_types[ 26 ];
|
||||
else
|
||||
content_id = surface_types;
|
||||
end
|
||||
|
||||
local x1 = f1 * ((x*80) - ppos.x +r);
|
||||
local z1 = f1 * ( (2*r) - ((z*80) - ppos.z + r));
|
||||
local dx = f1 * 80;
|
||||
local dz = f1 * 80;
|
||||
|
||||
formspec = formspec..mg_villages.draw_tile( content_id, nil, x1+0.5, z1-0.5, dx*1.25, dz*1.25 );
|
||||
|
||||
-- if more detailed information is available, draw those tiles that differ from the most common tile
|
||||
if( type( surface_types )=='table' and false) then -- TODO: disabled for now
|
||||
dx = dx/5;
|
||||
dz = dz/5;
|
||||
for i,v in ipairs( surface_types ) do
|
||||
if( v ~= content_id ) then
|
||||
local x2 = x1+( math.floor( (i-1)/5 )*dx);
|
||||
local z2 = z1+( math.floor( (i-1)%5 )*dz);
|
||||
formspec = formspec..mg_villages.draw_tile( v, nil, x2+0.5, z2-0.5, dx*1.3, dz*1.3);
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local shown_villages = {};
|
||||
|
||||
r = mg_villages.MAP_RANGE;
|
||||
f1 = 10/(2*r);
|
||||
for name,v in pairs( mg_villages.all_villages ) do
|
||||
|
||||
local data = v; --minetest.deserialize( v );
|
||||
local x = data.vx - ppos.x;
|
||||
local z = data.vz - ppos.z;
|
||||
|
||||
-- show only villages which are at max mg_villages.MAP_RANGE away from player
|
||||
if( x and z
|
||||
and mg_villages.village_sizes[ data.village_type ]
|
||||
and mg_villages.village_sizes[ data.village_type ].texture
|
||||
and math.abs( x ) < r
|
||||
and math.abs( z ) < r ) then
|
||||
|
||||
-- the village size determines the texture size
|
||||
local dx = f1 * (data.vs*2) *1.25;
|
||||
local dz = f1 * (data.vs*2) *1.0;
|
||||
|
||||
-- center the village texture
|
||||
x = x - (data.vs/2);
|
||||
z = z + (data.vs/2);
|
||||
|
||||
-- calculate the position for the village texture
|
||||
x = f1 * (x+r);
|
||||
z = f1 * ( (2*r) -(z+r));
|
||||
|
||||
formspec = formspec..
|
||||
"label["..x..",".. z ..";"..tostring( data.nr ).."]"..mg_villages.draw_tile( nil, mg_villages.village_sizes[ data.village_type ].texture, x, z, dx, dz );
|
||||
|
||||
shown_villages[ #shown_villages+1 ] = tostring( data.nr )..". "..tostring( name ).."]"; -- TODO: use real village name
|
||||
end
|
||||
end
|
||||
|
||||
-- code and arrows taken from mapp mod
|
||||
local yaw = player:get_look_yaw()
|
||||
local rotate = 0;
|
||||
if yaw ~= nil then
|
||||
-- Find rotation and texture based on yaw.
|
||||
yaw = math.deg(yaw)
|
||||
yaw = math.fmod (yaw, 360)
|
||||
if yaw<0 then yaw = 360 + yaw end
|
||||
if yaw>360 then yaw = yaw - 360 end
|
||||
if yaw < 90 then
|
||||
rotate = 90
|
||||
elseif yaw < 180 then
|
||||
rotate = 180
|
||||
elseif yaw < 270 then
|
||||
rotate = 270
|
||||
else
|
||||
rotate = 0
|
||||
end
|
||||
yaw = math.fmod(yaw, 90)
|
||||
yaw = math.floor(yaw / 10) * 10
|
||||
|
||||
end
|
||||
|
||||
-- show the players yaw
|
||||
if rotate ~= 0 then
|
||||
formspec = formspec.."image[".. 4.95 ..",".. 4.85 ..";0.4,0.4;d" .. yaw .. ".png^[transformFYR".. rotate .."]"
|
||||
else
|
||||
formspec = formspec.."image[".. 4.95 ..",".. 4.85 ..";0.4,0.4;d" .. yaw .. ".png^[transformFY]"
|
||||
end
|
||||
|
||||
local i = 0.05;
|
||||
formspec = formspec.."label[10,-0.4;Village types:]";
|
||||
-- explain the meaning of the textures
|
||||
for typ,data in pairs(mg_villages.village_sizes) do
|
||||
formspec = formspec.."label[10.5,"..tostring(i)..";"..tostring( typ ).."]"..
|
||||
"image[10.0,"..tostring(i+0.1)..";0.4,0.4;"..tostring( data.texture ).."]";
|
||||
i = i+0.45;
|
||||
end
|
||||
|
||||
i = i+0.45;
|
||||
formspec = formspec.."label[10.0,"..tostring(i)..";Villages shown on this map:]";
|
||||
i = i+0.45;
|
||||
local j = 1;
|
||||
while (i<10.5 and j<=#shown_villages) do
|
||||
|
||||
formspec = formspec.."label[10.0,"..tostring(i)..";"..tostring( shown_villages[ j ] ).."]";
|
||||
i = i+0.45;
|
||||
j = j+1;
|
||||
end
|
||||
|
||||
return formspec;
|
||||
end
|
||||
|
||||
|
||||
minetest.register_chatcommand( 'vmap', {
|
||||
description = "Shows a map of all known villages withhin "..tostring( mg_villages.MAP_RANGE ).." blocks.",
|
||||
privs = {},
|
||||
func = function(name, param)
|
||||
minetest.show_formspec( name, 'mg:world_map', mg_villages.map_of_world( name ));
|
||||
end
|
||||
});
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
|
||||
-- get the id of the village pos lies in (or nil if outside of villages)
|
||||
mg_villages.get_town_id_at_pos = function( pos )
|
||||
for id, v in pairs( mg_villages.all_villages ) do
|
||||
if( ( math.abs( pos.x - v.vx ) < v.vs )
|
||||
and ( math.abs( pos.z - v.vz ) < v.vs )
|
||||
and ( math.abs( pos.y - v.vh ) < 40 )) then
|
||||
return id;
|
||||
end
|
||||
end
|
||||
return nil;
|
||||
end
|
||||
|
||||
local old_is_protected = minetest.is_protected
|
||||
minetest.is_protected = function(pos, name)
|
||||
|
||||
if( mg_villages.get_town_id_at_pos( pos )) then
|
||||
return true;
|
||||
end
|
||||
return old_is_protected(pos, name);
|
||||
end
|
||||
|
||||
minetest.register_on_protection_violation( function(pos, name)
|
||||
local found = mg_villages.get_town_id_at_pos( pos );
|
||||
if( not( found ) or not( mg_villages.all_villages[ found ])) then
|
||||
minetest.chat_send_player( name, 'Error: This area does not belong to a village.');
|
||||
return;
|
||||
end
|
||||
-- TODO: use real village name
|
||||
minetest.chat_send_player( name, "You are inside of the area of village \'"..tostring( found ).."\'. The inhabitants do not allow you any modifications.");
|
||||
end );
|
||||
|
||||
-- TODO: add a limited griefing liscence/buying of houses or plots for players
|
|
@ -0,0 +1,429 @@
|
|||
|
||||
|
||||
-- only the function mg_villages.get_replacement_table(..) is called from outside this file
|
||||
|
||||
mg_villages.replace_materials = function( replacements, pr, original_materials, prefixes, materials, old_material )
|
||||
|
||||
local known_materials = {};
|
||||
local wood_found = false;
|
||||
-- for all alternate materials
|
||||
for i,m in ipairs( materials ) do
|
||||
-- check if that material exists for each supplied prefix
|
||||
for j,p in ipairs( prefixes ) do
|
||||
if( minetest.registered_nodes[ p..m ] ) then
|
||||
table.insert( known_materials, m );
|
||||
-- if wood is present, later on try moretrees wood as well
|
||||
if( 'default:wood' == m ) then
|
||||
wood_found = true;
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- nothing found which could be used
|
||||
if( #known_materials < 1 ) then
|
||||
return;
|
||||
end
|
||||
|
||||
-- support wooden planks from moretrees
|
||||
if( wood_found and moretrees and moretrees.treelist ) then
|
||||
for _,v in ipairs( moretrees.treelist ) do
|
||||
if( minetest.registered_nodes[ "moretrees:"..v[1].."_planks"] ) then
|
||||
table.insert( known_materials, "moretrees:"..v[1].."_planks" );
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local new_material = known_materials[ pr:next( 1, #known_materials )];
|
||||
|
||||
-- no replacement necessary if we did choose the same material as before
|
||||
if( new_material == old_material or old_material == (prefixes[1]..new_material)) then
|
||||
return old_material;
|
||||
end
|
||||
|
||||
for i,v in ipairs( prefixes ) do
|
||||
table.insert( replacements, { original_materials[ i ], v..new_material } );
|
||||
end
|
||||
return new_material;
|
||||
end
|
||||
|
||||
-- replace the tree trunk as well so that it fits to the wood type
|
||||
mg_villages.replace_tree_trunk = function( replacements, wood_type )
|
||||
if( wood_type == 'default:junglewood' ) then
|
||||
table.insert( replacements, {'default:tree', 'default:jungletree'});
|
||||
elseif( wood_type == 'mg:savannawood' ) then
|
||||
table.insert( replacements, {'default:tree', 'mg:savannatree'});
|
||||
elseif( wood_type == 'mg:pinewood' ) then
|
||||
table.insert( replacements, {'default:tree', 'mg:pinetree'});
|
||||
elseif( moretrees and moretrees.treelist ) then
|
||||
for _,v in ipairs( moretrees.treelist ) do
|
||||
if( wood_type == "moretrees:"..v[1].."_planks" ) then
|
||||
table.insert( replacements, {'default:tree', "moretrees:"..v[1].."_trunk"});
|
||||
end
|
||||
end
|
||||
end
|
||||
-- TODO if minetest.get_modpath("moreblocks") and moretrees.enable_stairsplus the
|
||||
end
|
||||
|
||||
|
||||
-- Note: This function is taken from the villages mod (by Sokomine)
|
||||
-- at least the cottages may come in a variety of building materials
|
||||
-- IMPORTANT: don't add any nodes which have on_construct here UNLESS they where in the original file already
|
||||
-- on_construct will only be called for known nodes that need that treatment (see villages.analyze_mts_file and on_constr)
|
||||
mg_villages.get_replacement_list = function( housetype, pr )
|
||||
|
||||
local replacements = {};
|
||||
|
||||
-- else some grass would never (re)grow (if it's below a roof)
|
||||
-- table.insert( replacements, {'default:dirt', dirt_with_grass_replacement });
|
||||
-- table.insert( replacements, {'default:dirt_with_grass', dirt_with_grass_replacement });
|
||||
table.insert( replacements, {'default:dirt', 'default:dirt_with_grass' });
|
||||
|
||||
-- Taokis houses from structure i/o
|
||||
if( housetype == 'taoki' ) then
|
||||
|
||||
-- the main body of the houses in the .mts files is made out of wood
|
||||
local wood_type = mg_villages.replace_materials( replacements, pr,
|
||||
{'default:wood'},
|
||||
{''},
|
||||
{'default:wood', 'default:junglewood', 'mg:pinewood', 'mg:savannawood',
|
||||
'default:clay', 'default:brick', 'default:sandstone',
|
||||
'default:stonebrick', 'default:desert_stonebrick','default:sandstonebrick', 'default:sandstone','default:stone','default:desert_stone',
|
||||
'default:coalblock','default:steelblock','default:goldblock', 'default:bronzeblock', 'default:copperblock', 'wool:white'},
|
||||
'default:wood');
|
||||
-- tree trunks are seldom used in these houses; let's change them anyway
|
||||
mg_villages.replace_tree_trunk( replacements, wood_type );
|
||||
|
||||
-- all this comes in variants for stairs and slabs as well
|
||||
mg_villages.replace_materials( replacements, pr,
|
||||
{'stairs:stair_stonebrick', 'stairs:slab_stonebrick', 'default:stonebrick'},
|
||||
{'stairs:stair_', 'stairs:slab_', 'default:' },
|
||||
{ 'stonebrick', 'stone', 'sandstone', 'cobble'},
|
||||
'stonebrick');
|
||||
|
||||
-- decorative slabs above doors etc.
|
||||
mg_villages.replace_materials( replacements, pr,
|
||||
{'stairs:stair_wood'},
|
||||
{'stairs:stair_'},
|
||||
{'stonebrick', 'stone', 'sandstone', 'cobble', 'wood', 'junglewood' },
|
||||
'wood');
|
||||
|
||||
-- brick roofs are a bit odd; but then...
|
||||
-- all three shapes of roof parts have to fit together
|
||||
mg_villages.replace_materials( replacements, pr,
|
||||
{'stairs:stair_brick', 'stairs:slab_brick', 'default:brick'},
|
||||
{'stairs:stair_', 'stairs:slab_', 'default:' },
|
||||
{ 'brick', 'stone', 'cobble', 'stonebrick', 'wood', 'junglewood', 'sandstone' },
|
||||
'brick' );
|
||||
|
||||
return replacements;
|
||||
end
|
||||
|
||||
|
||||
if( housetype == 'nore' ) then
|
||||
|
||||
mg_villages.replace_materials( replacements, pr,
|
||||
{'stonebrick'},
|
||||
{'default:'},
|
||||
{'stonebrick', 'desert_stonebrick','sandstonebrick', 'sandstone','stone','desert_stone'},
|
||||
'stonebrick');
|
||||
|
||||
-- replace the wood as well
|
||||
local wood_type = mg_villages.replace_materials( replacements, pr,
|
||||
{'default:wood'},
|
||||
{''},
|
||||
{ 'default:wood', 'default:junglewood', 'mg:savannawood', 'mg:pinewood' },
|
||||
'default:wood');
|
||||
mg_villages.replace_tree_trunk( replacements, wood_type );
|
||||
|
||||
if( pr:next(1,3)==1 ) then
|
||||
table.insert( replacements, {'default:glass', 'default:obsidian_glass'});
|
||||
end
|
||||
|
||||
return replacements;
|
||||
end
|
||||
|
||||
|
||||
if( housetype == 'lumberjack' ) then
|
||||
|
||||
-- replace the wood - those are lumberjacks after all
|
||||
local wood_type = mg_villages.replace_materials( replacements, pr,
|
||||
{'default:wood'},
|
||||
{''},
|
||||
{ 'default:wood', 'default:junglewood', 'mg:savannawood', 'mg:pinewood' },
|
||||
'default:wood');
|
||||
mg_villages.replace_tree_trunk( replacements, wood_type );
|
||||
|
||||
return replacements;
|
||||
end
|
||||
|
||||
|
||||
if( housetype == 'canadian' ) then
|
||||
|
||||
table.insert( replacements, {'4seasons:slimtree_wood', 'default:fence_wood'});
|
||||
if( true) then return replacements; end -- TODO
|
||||
-- remove inner corners, wallpapers etc.
|
||||
local to_air = { 38, 36, 68, 66, 69, 67, 77, 47, 44, 43, 37, 75, 45, 65, 71, 76, 46 };
|
||||
for _,v in ipairs( to_air ) do
|
||||
table.insert( replacements, {'hdb:'..tostring( v )..'_ic', 'air' });
|
||||
end
|
||||
|
||||
to_air = { 49, 50, 52, 72, 73, 74 };
|
||||
for _,v in ipairs( to_air ) do
|
||||
table.insert( replacements, {'hdb:'..tostring( v )..'_edge', 'air' });
|
||||
end
|
||||
|
||||
to_air = { 49, 50, 52, 72, 73, 74 };
|
||||
for _,v in ipairs( to_air ) do
|
||||
table.insert( replacements, {'hdb:'..tostring( v )..'_edgeic', 'air' });
|
||||
end
|
||||
|
||||
-- thin slabs for covering walls
|
||||
to_air = { 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 65, 66, 67, 68, 69, 71, 72, 73, 74, 75, 76, 77 };
|
||||
for _,v in ipairs( to_air ) do
|
||||
table.insert( replacements, {'hdb:'..tostring( v ), 'air' });
|
||||
end
|
||||
|
||||
-- these contain the majority of nodes used (junglewood is too dark)
|
||||
local materials = {'default:wood', 'mg:pinewood', 'mg:savannawood',
|
||||
'default:clay', 'default:brick', 'default:sandstone',
|
||||
'default:stonebrick', 'default:desert_stonebrick','default:sandstonebrick', 'default:sandstone','default:stone','default:desert_stone',
|
||||
'default:coalblock','default:steelblock'};
|
||||
|
||||
-- local change_groups = { {49, 16, 29, 33, 82, 8}, {19, 4, 83, 2}, { 5, 80, 35, 36, 3}, {10, 31}, {28, 78}, { 6, 52, 1}, {7}};
|
||||
local change_groups = { {16, 29, 33, 82, 8}, {19, 4, 83, 2}, { 5, 80, 35, 3}, {10, 31}, {28, 78, 27}, { 6, 1}, {7}, {30,25,81,79},{64}};
|
||||
for _,cg in ipairs( change_groups ) do
|
||||
|
||||
local m1 = materials[ pr:next( 1, #materials )];
|
||||
for j,v in ipairs( cg ) do
|
||||
table.insert( replacements, {'hdb:'..tostring( v ), m1 });
|
||||
end
|
||||
end
|
||||
|
||||
-- hdb:9_lh and hdb:86_lh are slabs
|
||||
local materials_slab = {'stonebrick', 'stone', 'sandstone', 'cobble' };
|
||||
local slab_group = {33,58};
|
||||
for _, c in ipairs( slab_group ) do
|
||||
local ms = materials_slab[ pr:next( 1, #materials_slab )];
|
||||
table.insert( replacements, { 'hdb:'..tostring(c)..'_lh', 'stairs:slab_'..ms });
|
||||
table.insert( replacements, { 'hdb:'..tostring(c), 'default:'..ms });
|
||||
end
|
||||
|
||||
return replacements;
|
||||
end
|
||||
|
||||
|
||||
if( housetype == 'logcabin' ) then
|
||||
|
||||
-- for logcabins, wood is the most likely type of roof material
|
||||
local roof_type = mg_villages.replace_materials( replacements, pr,
|
||||
{'stairs:stair_cobble', 'stairs:slab_cobble' },
|
||||
{'cottages:roof_connector_', 'cottages:roof_flat_' },
|
||||
{'straw', 'wood', 'wood', 'wood', 'reet', 'slate', 'red', 'brown', 'black'},
|
||||
'' );
|
||||
-- some houses have junglewood roofs
|
||||
if( roof_type ) then
|
||||
table.insert( replacements, {'stairs:stair_junglewood', 'cottages:roof_connector_'..roof_type });
|
||||
table.insert( replacements, {'stairs:slab_junglewood', 'cottages:roof_flat_'..roof_type });
|
||||
table.insert( replacements, {'cottages:roof_connector_wood', 'cottages:roof_connector_'..roof_type });
|
||||
table.insert( replacements, {'cottages:roof_flat_wood', 'cottages:roof_flat_'..roof_type });
|
||||
end
|
||||
return replacements;
|
||||
end
|
||||
|
||||
|
||||
if( housetype == 'grasshut' ) then
|
||||
|
||||
table.insert( replacements, {'moreblocks:fence_jungle_wood', 'default:fence' });
|
||||
table.insert( replacements, {'dryplants:reed_roof', 'cottages:roof_straw'});
|
||||
table.insert( replacements, {'dryplants:reed_slab', 'cottages:roof_flat_straw' });
|
||||
table.insert( replacements, {'dryplants:wetreed_roof', 'cottages:roof_reet' });
|
||||
table.insert( replacements, {'dryplants:wetreed_slab', 'cottages:roof_flat_reet' });
|
||||
table.insert( replacements, {'dryplants:wetreed_roof_corner', 'default:wood' });
|
||||
table.insert( replacements, {'dryplants:wetreed_roof_corner_2', 'default:junglewood' });
|
||||
table.insert( replacements, {'cavestuff:desert_pebble_2', 'default:slab_cobble' });
|
||||
|
||||
return replacements;
|
||||
end
|
||||
|
||||
|
||||
if( housetype == 'claytrader' ) then
|
||||
-- the walls of the clay trader houses are made out of brick
|
||||
mg_villages.replace_materials( replacements, pr,
|
||||
{ 'stairs:stair_brick', 'stairs:slab_brick', 'default:brick' }, -- default_materials
|
||||
{ 'stairs:stair_', 'stairs:slab_', 'default:' }, -- prefixes (for new materials)
|
||||
{ 'brick', 'stone', 'sandstone', 'sandstonebrick', 'desert_stone', 'desert_cobble', 'desert_stonebrick' }, -- new materials
|
||||
'brick' ); -- original material
|
||||
|
||||
-- material for the floor
|
||||
mg_villages.replace_materials( replacements, pr,
|
||||
{'default:stone'},
|
||||
{'default:'},
|
||||
{ 'brick', 'stone', 'sandstone', 'sandstonebrick', 'clay', 'desert_stone', 'desert_cobble', 'desert_stonebrick' },
|
||||
'stone');
|
||||
|
||||
-- the clay trader homes come with stone stair roofs; slabs are used in other places as well (but those replacements here are ok)
|
||||
mg_villages.replace_materials( replacements, pr,
|
||||
{'stairs:stair_stone', 'stairs:slab_stone' },
|
||||
{'cottages:roof_connector_', 'cottages:roof_flat_' },
|
||||
{'straw', 'straw', 'straw', 'straw', 'straw',
|
||||
'reet', 'reet', 'reet',
|
||||
'slate', 'slate',
|
||||
'wood', 'wood',
|
||||
'red',
|
||||
'brown',
|
||||
'black'},
|
||||
'');
|
||||
|
||||
-- hills and pits that contain the materials clay traders dig for
|
||||
mg_villages.replace_materials( replacements, pr,
|
||||
{'default:stone_with_coal'},
|
||||
{'default:'},
|
||||
{'sand', 'sandstone', 'clay'},
|
||||
'');
|
||||
|
||||
return replacements;
|
||||
end
|
||||
|
||||
|
||||
-- wells can get the same replacements as the sourrounding village; they'll get a fitting roof that way
|
||||
if( housetype ~= 'medieval' and housetype ~= 'well' and housetype ~= 'cottages') then
|
||||
return replacements;
|
||||
end
|
||||
|
||||
table.insert( replacements, {'bell:bell', 'default:goldblock' });
|
||||
|
||||
-- glass that served as a marker got copied accidently; there's usually no glass in cottages
|
||||
table.insert( replacements, {'default:glass', 'air'});
|
||||
|
||||
-- TODO: sometimes, half_door/half_door_inverted gets rotated wrong
|
||||
-- table.insert( replacements, {'cottages:half_door', 'cottages:half_door_inverted'});
|
||||
-- table.insert( replacements, {'cottages:half_door_inverted', 'cottages:half_door'});
|
||||
|
||||
-- some poor cottage owners cannot afford glass
|
||||
if( pr:next( 1, 2 ) == 2 ) then
|
||||
table.insert( replacements, {'cottages:glass_pane', 'default:fence_wood'});
|
||||
end
|
||||
|
||||
-- 'glass' is admittedly debatable; yet it may represent modernized old houses where only the tree-part was left standing
|
||||
-- loam and clay are mentioned multiple times because those are the most likely building materials in reality
|
||||
local materials = {'cottages:loam', 'cottages:loam', 'cottages:loam', 'cottages:loam', 'cottages:loam',
|
||||
'default:clay', 'default:clay', 'default:clay', 'default:clay', 'default:clay',
|
||||
'default:wood','default:junglewood','default:sandstone',
|
||||
'default:desert_stone','default:brick','default:cobble','default:stonebrick',
|
||||
'default:desert_stonebrick','default:sandstonebrick','default:stone',
|
||||
'mg:savannawood', 'mg:savannawood', 'mg:savannawood', 'mg:savannawood',
|
||||
'mg:pinewood', 'mg:pinewood', 'mg:pinewood', 'mg:pinewood' };
|
||||
|
||||
-- what is sandstone (the floor) may be turned into something else
|
||||
local mfs = mg_villages.replace_materials( replacements, pr,
|
||||
{'default:sandstone'},
|
||||
{''},
|
||||
materials,
|
||||
'default:sandstone');
|
||||
if( mfs and mfs ~= 'default:sandstone' ) then
|
||||
|
||||
if( mfs == 'cottages:loam' or mfs == 'default:clay' or mfs == 'mg:savannawood' or mfs == 'mg:pinewood') then
|
||||
mfs = 'default:wood';
|
||||
elseif( mfs =='default:sandstonebrick' or mfs == 'default:desert_stone' or mfs == 'default:desert_stonebrick'
|
||||
or not( minetest.registered_nodes[ 'stairs:slab_'..string.sub( mfs, 9 )] )) then
|
||||
mfs = '';
|
||||
end
|
||||
|
||||
if( mfs and mfs ~= '' ) then
|
||||
table.insert( replacements, {'stairs:slab_sandstone', 'stairs:slab_'..string.sub( mfs, 9 )});
|
||||
end
|
||||
end
|
||||
-- except for the floor, everything else may be glass
|
||||
table.insert( materials, 'default:glass' );
|
||||
|
||||
-- bottom part of the house (usually ground floor from outside)
|
||||
local replace_clay = mg_villages.replace_materials( replacements, pr,
|
||||
{'default:clay'},
|
||||
{''},
|
||||
materials,
|
||||
'default:clay');
|
||||
if( replace_clay and replace_clay ~= 'default:clay' ) then
|
||||
mg_villages.replace_tree_trunk( replacements, wood_type );
|
||||
end
|
||||
|
||||
-- upper part of the house (may be the same as the material for the lower part)
|
||||
mg_villages.replace_materials( replacements, pr,
|
||||
{'cottages:loam'},
|
||||
{''},
|
||||
materials,
|
||||
'cottages:loam');
|
||||
|
||||
|
||||
-- replace cobble; for these nodes, a stony material is needed (used in wells as well)
|
||||
-- mossycobble is fine here as well
|
||||
local mcs = mg_villages.replace_materials( replacements, pr,
|
||||
{'default:cobble'},
|
||||
{'default:'},
|
||||
{'sandstone', 'desert_stone', 'desert_cobble',
|
||||
'cobble', 'cobble',
|
||||
'stonebrick', 'stonebrick', 'stonebrick', -- more common than other materials
|
||||
'mossycobble', 'mossycobble','mossycobble',
|
||||
'stone', 'stone',
|
||||
'desert_stonebrick','sandstonebrick'},
|
||||
'cobble');
|
||||
-- set a fitting material for the slabs; mossycobble uses the default cobble slabs
|
||||
if( mcs ~= 'mossycobble' and mcs ~= 'cobble') then
|
||||
|
||||
-- if no slab exists, use sandstone slabs
|
||||
if( not( minetest.registered_nodes[ 'stairs:slab_'..mcs ])) then
|
||||
mcs = 'sandstone';
|
||||
end
|
||||
table.insert( replacements, {'stairs:slab_cobble', 'stairs:slab_'..mcs});
|
||||
end
|
||||
|
||||
|
||||
-- straw is the most likely building material for roofs for historical buildings
|
||||
mg_villages.replace_materials( replacements, pr,
|
||||
-- all three shapes of roof parts have to fit together
|
||||
{ 'cottages:roof_straw', 'cottages:roof_connector_straw', 'cottages:roof_flat_straw' },
|
||||
{ 'cottages:roof_', 'cottages:roof_connector_', 'cottages:roof_flat_'},
|
||||
{'straw', 'straw', 'straw', 'straw', 'straw',
|
||||
'reet', 'reet', 'reet',
|
||||
'slate', 'slate',
|
||||
'wood', 'wood',
|
||||
'red',
|
||||
'brown',
|
||||
'black'},
|
||||
'straw');
|
||||
|
||||
return replacements;
|
||||
end
|
||||
|
||||
|
||||
-- Translate replacement function from above (which aims at place_schematic) for the villages in Nores mapgen
|
||||
mg_villages.get_replacement_ids = function( housetype, pr )
|
||||
|
||||
local replace = {};
|
||||
local replacements = mg_villages.get_replacement_list( housetype, pr );
|
||||
for i,v in ipairs( replacements ) do
|
||||
if( v and #v == 2 ) then
|
||||
replace[ minetest.get_content_id( v[1] )] = minetest.get_content_id( v[2] );
|
||||
end
|
||||
end
|
||||
return replace;
|
||||
end
|
||||
|
||||
|
||||
|
||||
-- mapgen based replacements work best using a table, while minetest.place_schematic(..) based spawning needs a list
|
||||
mg_villages.get_replacement_table = function( housetype, pr, replacements )
|
||||
|
||||
local rtable = {};
|
||||
local ids = {};
|
||||
if( not( replacements )) then
|
||||
replacements = mg_villages.get_replacement_list( housetype, pr );
|
||||
end
|
||||
for i,v in ipairs( replacements ) do
|
||||
if( v and #v == 2 ) then
|
||||
rtable[ v[1] ] = v[2];
|
||||
ids[ minetest.get_content_id( v[1] )] = minetest.get_content_id( v[2] );
|
||||
end
|
||||
end
|
||||
return { table = rtable, list = replacements, ids = ids };
|
||||
end
|
|
@ -0,0 +1,59 @@
|
|||
mg_villages.deepcopy = function(orig)
|
||||
return minetest.deserialize(minetest.serialize(orig))
|
||||
end
|
||||
|
||||
mg_villages.rotate_facedir = function(facedir)
|
||||
return ({1, 2, 3, 0,
|
||||
13, 14, 15, 12,
|
||||
17, 18, 19, 16,
|
||||
9, 10, 11, 8,
|
||||
5, 6, 7, 4,
|
||||
21, 22, 23, 20})[facedir+1]
|
||||
end
|
||||
|
||||
mg_villages.rotate_wallmounted = function(wallmounted)
|
||||
return ({0, 1, 5, 4, 2, 3})[wallmounted+1]
|
||||
end
|
||||
|
||||
mg_villages.rotate_scm_once = function(scm)
|
||||
local ysize = #scm
|
||||
local xsize = #scm[1]
|
||||
local zsize = #scm[1][1]
|
||||
new_scm = {}
|
||||
for i=1, ysize do
|
||||
new_scm[i] = {}
|
||||
for j=1, zsize do
|
||||
new_scm[i][j] = {}
|
||||
end
|
||||
end
|
||||
|
||||
for y = 1, ysize do
|
||||
for x = 1, xsize do
|
||||
for z = 1, zsize do
|
||||
local old = scm[y][x][z]
|
||||
local newx = z
|
||||
local newz = xsize-x+1
|
||||
if type(old) ~= "table" or old.rotation == nil then
|
||||
new_scm[y][newx][newz] = old
|
||||
elseif old.rotation == "wallmounted" then
|
||||
new = mg_villages.deepcopy(old)
|
||||
new.node.param2 = mg_villages.rotate_wallmounted(new.node.param2)
|
||||
new_scm[y][newx][newz] = new
|
||||
elseif old.rotation == "facedir" then
|
||||
new = mg_villages.deepcopy(old)
|
||||
new.node.param2 = mg_villages.rotate_facedir(new.node.param2)
|
||||
new_scm[y][newx][newz] = new
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return new_scm
|
||||
end
|
||||
|
||||
-- called from villages.lua
|
||||
mg_villages.rotate_scm = function(scm, times)
|
||||
for i=1, times do
|
||||
scm = mg_villages.rotate_scm_once(scm)
|
||||
end
|
||||
return scm
|
||||
end
|
|
@ -0,0 +1,35 @@
|
|||
|
||||
-- reserve the namespace
|
||||
save_restore = {}
|
||||
|
||||
-- TODO: if this gets more versatile, add sanity checks for filename
|
||||
|
||||
-- TODO: save and restore ought to be library functions and not implemented in each individual mod!
|
||||
save_restore.save_data = function( filename, data )
|
||||
|
||||
local path = minetest.get_worldpath()..'/'..filename;
|
||||
|
||||
local file = io.open( path, 'w' );
|
||||
if( file ) then
|
||||
file:write( minetest.serialize( data ));
|
||||
file:close();
|
||||
else
|
||||
print("[save_restore] Error: Savefile '"..tostring( path ).."' could not be written.");
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
save_restore.restore_data = function( filename )
|
||||
|
||||
local path = minetest.get_worldpath()..'/'..filename;
|
||||
|
||||
local file = io.open( path, 'r' );
|
||||
if( file ) then
|
||||
local data = file:read("*all");
|
||||
file:close();
|
||||
return minetest.deserialize( data );
|
||||
else
|
||||
print("[save_restore] Error: Savefile '"..tostring( path ).."' not found.");
|
||||
return {}; -- return empty table
|
||||
end
|
||||
end
|
|
@ -0,0 +1 @@
|
|||
return { { ["x"] = 0, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 0, ["name"] = "default:dirt_with_grass" }, { ["x"] = 0, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 1, ["name"] = "default:dirt_with_grass" }, { ["x"] = 0, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 2, ["name"] = "default:dirt_with_grass" }, { ["x"] = 0, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 18, ["y"] = 1, ["param1"] = 15, ["z"] = 1, ["name"] = "moreblocks:slab_cobble" }, { ["x"] = 1, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 0, ["name"] = "default:dirt_with_grass" }, { ["x"] = 1, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 1, ["name"] = "default:dirt_with_grass" }, { ["x"] = 1, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 2, ["name"] = "default:dirt_with_grass" }, { ["x"] = 1, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 1, ["param1"] = 13, ["z"] = 1, ["name"] = "cottages:bench" }, { ["x"] = 1, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 7, ["y"] = 1, ["param1"] = 15, ["z"] = 2, ["name"] = "moreblocks:slab_cobble" }, { ["x"] = 2, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 0, ["name"] = "default:dirt_with_grass" }, { ["x"] = 2, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 1, ["name"] = "default:dirt_with_grass" }, { ["x"] = 2, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 2, ["name"] = "default:dirt_with_grass" }, { ["x"] = 2, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 1, ["param1"] = 13, ["z"] = 1, ["name"] = "cottages:bench" }, { ["x"] = 2, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 7, ["y"] = 1, ["param1"] = 15, ["z"] = 2, ["name"] = "moreblocks:slab_cobble" }, { ["x"] = 3, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 0, ["name"] = "default:dirt_with_grass" }, { ["x"] = 3, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 1, ["name"] = "default:dirt_with_grass" }, { ["x"] = 3, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 2, ["name"] = "default:dirt_with_grass" }, { ["x"] = 3, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 12, ["y"] = 1, ["param1"] = 15, ["z"] = 1, ["name"] = "moreblocks:slab_cobble" } }
|
|
@ -0,0 +1 @@
|
|||
return { { ["x"] = 0, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 0, ["name"] = "default:dirt_with_grass" }, { ["x"] = 0, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 1, ["name"] = "default:dirt_with_grass" }, { ["x"] = 0, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 2, ["name"] = "default:dirt_with_grass" }, { ["x"] = 0, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 3, ["name"] = "default:dirt_with_grass" }, { ["x"] = 1, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 0, ["name"] = "default:dirt_with_grass" }, { ["x"] = 1, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 1, ["name"] = "default:dirt_with_grass" }, { ["x"] = 1, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 2, ["name"] = "default:dirt_with_grass" }, { ["x"] = 1, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 3, ["name"] = "default:dirt_with_grass" }, { ["x"] = 1, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 1, ["y"] = 1, ["param1"] = 13, ["z"] = 1, ["name"] = "cottages:bench" }, { ["x"] = 1, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 1, ["y"] = 1, ["param1"] = 13, ["z"] = 2, ["name"] = "cottages:bench" }, { ["x"] = 2, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 0, ["name"] = "default:dirt_with_grass" }, { ["x"] = 2, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 1, ["name"] = "default:dirt_with_grass" }, { ["x"] = 2, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 2, ["name"] = "default:dirt_with_grass" }, { ["x"] = 2, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 3, ["name"] = "default:dirt_with_grass" }, { ["x"] = 2, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 1, ["y"] = 1, ["param1"] = 13, ["z"] = 1, ["name"] = "cottages:table" }, { ["x"] = 2, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 1, ["y"] = 1, ["param1"] = 13, ["z"] = 2, ["name"] = "cottages:table" }, { ["x"] = 3, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 0, ["name"] = "default:dirt_with_grass" }, { ["x"] = 3, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 1, ["name"] = "default:dirt_with_grass" }, { ["x"] = 3, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 2, ["name"] = "default:dirt_with_grass" }, { ["x"] = 3, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 3, ["name"] = "default:dirt_with_grass" }, { ["x"] = 3, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 3, ["y"] = 1, ["param1"] = 13, ["z"] = 1, ["name"] = "cottages:bench" }, { ["x"] = 3, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 3, ["y"] = 1, ["param1"] = 13, ["z"] = 2, ["name"] = "cottages:bench" }, { ["x"] = 4, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 0, ["name"] = "default:dirt_with_grass" }, { ["x"] = 4, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 1, ["name"] = "default:dirt_with_grass" }, { ["x"] = 4, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 2, ["name"] = "default:dirt_with_grass" }, { ["x"] = 4, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 3, ["name"] = "default:dirt_with_grass" } }
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
|||
return { { ["x"] = 0, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 0, ["name"] = "default:dirt_with_grass" }, { ["x"] = 0, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 1, ["name"] = "default:dirt_with_grass" }, { ["x"] = 0, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 2, ["name"] = "default:dirt_with_grass" }, { ["x"] = 1, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 0, ["name"] = "default:dirt" }, { ["x"] = 1, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 1, ["name"] = "default:dirt" }, { ["x"] = 1, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 2, ["name"] = "default:dirt_with_grass" }, { ["x"] = 1, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 1, ["param1"] = 0, ["z"] = 1, ["name"] = "default:cobble" }, { ["x"] = 2, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 0, ["name"] = "default:dirt_with_grass" }, { ["x"] = 2, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 1, ["name"] = "default:dirt_with_grass" }, { ["x"] = 2, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 2, ["name"] = "default:dirt_with_grass" }, { ["x"] = 2, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 1, ["param1"] = 13, ["z"] = 1, ["name"] = "stairs:stair_wood" }, { ["x"] = 3, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 0, ["name"] = "default:dirt_with_grass" }, { ["x"] = 3, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 1, ["name"] = "default:dirt_with_grass" }, { ["x"] = 3, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 2, ["name"] = "default:dirt_with_grass" }, { ["x"] = 3, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 1, ["param1"] = 13, ["z"] = 1, ["name"] = "stairs:stair_wood" }, { ["x"] = 4, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 0, ["name"] = "default:dirt_with_grass" }, { ["x"] = 4, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 1, ["name"] = "default:dirt" }, { ["x"] = 4, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 2, ["name"] = "default:dirt_with_grass" }, { ["x"] = 4, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 1, ["param1"] = 0, ["z"] = 1, ["name"] = "default:cobble" }, { ["x"] = 5, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 0, ["name"] = "default:dirt_with_grass" }, { ["x"] = 5, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 1, ["name"] = "default:dirt_with_grass" }, { ["x"] = 5, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 2, ["name"] = "default:dirt_with_grass" }, { ["x"] = 5, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 1, ["param1"] = 15, ["z"] = 1, ["name"] = "default:sapling" }, { ["x"] = 6, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 0, ["name"] = "default:dirt_with_grass" }, { ["x"] = 6, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 1, ["name"] = "default:dirt_with_grass" }, { ["x"] = 6, ["meta"] = { ["fields"] = { }, ["inventory"] = { } }, ["param2"] = 0, ["y"] = 0, ["param1"] = 0, ["z"] = 2, ["name"] = "default:dirt_with_grass" } }
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,306 @@
|
|||
2 0 2 default:cobble 0 0
|
||||
2 0 3 default:cobble 0 0
|
||||
2 0 4 default:cobble 0 0
|
||||
2 0 5 default:cobble 0 0
|
||||
2 0 6 default:cobble 0 0
|
||||
2 0 7 default:cobble 0 0
|
||||
2 1 1 default:cobble 0 0
|
||||
2 1 2 default:cobble 0 0
|
||||
2 1 3 default:cobble 0 0
|
||||
2 1 4 default:cobble 0 0
|
||||
2 1 5 default:cobble 0 0
|
||||
2 1 6 default:cobble 0 0
|
||||
2 1 7 default:cobble 0 0
|
||||
2 3 3 default:torch 0 2
|
||||
2 3 5 default:torch 0 2
|
||||
2 6 3 default:torch 0 2
|
||||
2 6 5 default:torch 0 2
|
||||
3 0 2 default:cobble 0 0
|
||||
3 0 3 default:cobble 0 0
|
||||
3 0 4 default:cobble 0 0
|
||||
3 0 5 default:cobble 0 0
|
||||
3 0 6 default:cobble 0 0
|
||||
3 0 7 default:cobble 0 0
|
||||
3 1 1 default:cobble 0 0
|
||||
3 1 2 default:cobble 0 0
|
||||
3 1 3 default:cobble 0 0
|
||||
3 1 4 default:cobble 0 0
|
||||
3 1 5 default:cobble 0 0
|
||||
3 1 6 default:cobble 0 0
|
||||
3 1 7 default:tree 0 0
|
||||
3 2 1 default:tree 0 0
|
||||
3 2 2 default:wood 0 0
|
||||
3 2 3 default:wood 0 0
|
||||
3 2 4 doors:door_wood_b_2 172 2
|
||||
3 2 5 default:wood 0 0
|
||||
3 2 6 default:wood 0 0
|
||||
3 2 7 default:tree 0 0
|
||||
3 3 1 default:tree 0 0
|
||||
3 3 2 default:fence_wood 188 0
|
||||
3 3 3 default:wood 0 0
|
||||
3 3 4 doors:door_wood_t_2 188 2
|
||||
3 3 5 default:wood 0 0
|
||||
3 3 6 default:fence_wood 188 0
|
||||
3 3 7 default:tree 0 0
|
||||
3 4 1 default:tree 0 0
|
||||
3 4 2 default:wood 0 0
|
||||
3 4 3 default:wood 0 0
|
||||
3 4 4 default:wood 0 0
|
||||
3 4 5 default:wood 0 0
|
||||
3 4 6 default:wood 0 0
|
||||
3 4 7 default:tree 0 0
|
||||
3 5 2 default:wood 0 0
|
||||
3 5 3 default:wood 0 0
|
||||
3 5 4 default:wood 0 0
|
||||
3 5 5 default:wood 0 0
|
||||
3 5 6 default:wood 0 0
|
||||
3 6 3 default:wood 0 0
|
||||
3 6 4 default:fence_wood 188 0
|
||||
3 6 5 default:wood 0 0
|
||||
3 7 4 default:fence_wood 172 0
|
||||
4 0 2 default:cobble 0 0
|
||||
4 0 3 default:cobble 0 0
|
||||
4 0 4 default:cobble 0 0
|
||||
4 0 5 default:cobble 0 0
|
||||
4 0 6 default:cobble 0 0
|
||||
4 0 7 default:cobble 0 0
|
||||
4 1 1 default:cobble 0 0
|
||||
4 1 2 default:cobble 0 0
|
||||
4 1 3 default:cobble 0 0
|
||||
4 1 4 default:cobble 0 0
|
||||
4 1 5 default:cobble 0 0
|
||||
4 1 6 default:cobble 0 0
|
||||
4 1 7 default:cobble 0 0
|
||||
4 2 1 default:wood 0 0
|
||||
4 2 5 default:fence_wood 187 0
|
||||
4 2 7 default:wood 0 0
|
||||
4 2 8 default:fence_wood 205 0
|
||||
4 2 9 default:fence_wood 189 0
|
||||
4 2 10 default:fence_wood 205 0
|
||||
4 2 11 default:fence_wood 189 0
|
||||
4 2 12 default:fence_wood 205 0
|
||||
4 3 1 default:wood 0 0
|
||||
4 3 5 stairs:slab_wood 204 0
|
||||
4 3 7 default:wood 0 0
|
||||
4 3 8 default:torch 15 1
|
||||
4 3 10 default:torch 15 1
|
||||
4 3 12 default:torch 15 1
|
||||
4 4 1 default:wood 0 0
|
||||
4 4 2 default:torch 0 5
|
||||
4 4 3 default:torch 0 3
|
||||
4 4 5 default:torch 0 3
|
||||
4 4 7 default:wood 0 0
|
||||
5 0 2 default:cobble 0 0
|
||||
5 0 3 default:cobble 0 0
|
||||
5 0 4 default:cobble 0 0
|
||||
5 0 5 default:cobble 0 0
|
||||
5 0 6 default:cobble 0 0
|
||||
5 0 7 default:cobble 0 0
|
||||
5 1 1 default:cobble 0 0
|
||||
5 1 2 default:cobble 0 0
|
||||
5 1 3 default:cobble 0 0
|
||||
5 1 4 default:cobble 0 0
|
||||
5 1 5 default:cobble 0 0
|
||||
5 1 6 default:cobble 0 0
|
||||
5 1 7 default:cobble 0 0
|
||||
5 2 1 default:wood 0 0
|
||||
5 2 4 default:ladder 154 2
|
||||
5 2 7 default:wood 0 0
|
||||
5 2 12 default:fence_wood 189 0
|
||||
5 3 0 default:torch 15 4
|
||||
5 3 1 default:wood 0 0
|
||||
5 3 4 default:ladder 170 2
|
||||
5 3 7 default:fence_wood 189 0
|
||||
5 4 1 default:wood 0 0
|
||||
5 4 4 default:ladder 187 2
|
||||
5 4 7 default:wood 0 0
|
||||
5 5 4 default:ladder 170 2
|
||||
6 0 2 default:cobble 0 0
|
||||
6 0 3 default:cobble 0 0
|
||||
6 0 4 default:cobble 0 0
|
||||
6 0 5 default:cobble 0 0
|
||||
6 0 6 default:cobble 0 0
|
||||
6 0 7 default:cobble 0 0
|
||||
6 1 1 default:cobble 0 0
|
||||
6 1 2 default:cobble 0 0
|
||||
6 1 3 default:cobble 0 0
|
||||
6 1 4 default:cobble 0 0
|
||||
6 1 5 default:cobble 0 0
|
||||
6 1 6 default:cobble 0 0
|
||||
6 1 7 default:cobble 0 0
|
||||
6 2 1 default:wood 0 0
|
||||
6 2 3 default:fence_wood 170 0
|
||||
6 2 4 default:wood 0 0
|
||||
6 2 5 default:chest 0 1
|
||||
6 2 6 default:wood 0 0
|
||||
6 2 7 default:wood 0 0
|
||||
6 2 12 default:fence_wood 205 0
|
||||
6 3 1 default:wood 0 0
|
||||
6 3 3 default:fence_wood 187 0
|
||||
6 3 4 default:wood 0 0
|
||||
6 3 5 default:wood 0 0
|
||||
6 3 6 default:wood 0 0
|
||||
6 3 7 default:wood 0 0
|
||||
6 3 12 default:torch 15 1
|
||||
6 4 1 default:wood 0 0
|
||||
6 4 2 default:torch 0 5
|
||||
6 4 3 default:wood 0 0
|
||||
6 4 4 default:wood 0 0
|
||||
6 4 5 default:wood 0 0
|
||||
6 4 6 default:wood 0 0
|
||||
6 4 7 default:wood 0 0
|
||||
6 5 2 default:wood 0 0
|
||||
6 5 3 default:wood 0 0
|
||||
6 5 4 default:wood 0 0
|
||||
6 5 5 default:wood 0 0
|
||||
6 5 6 default:wood 0 0
|
||||
6 6 3 default:fence_wood 153 0
|
||||
6 6 5 default:fence_wood 153 0
|
||||
7 0 2 default:cobble 0 0
|
||||
7 0 3 default:cobble 0 0
|
||||
7 0 4 default:cobble 0 0
|
||||
7 0 5 default:cobble 0 0
|
||||
7 0 6 default:cobble 0 0
|
||||
7 0 7 default:cobble 0 0
|
||||
7 1 1 default:cobble 0 0
|
||||
7 1 2 default:cobble 0 0
|
||||
7 1 3 default:cobble 0 0
|
||||
7 2 1 default:wood 0 0
|
||||
7 2 3 default:fence_wood 153 0
|
||||
7 2 8 default:wood 0 0
|
||||
7 2 12 default:fence_wood 189 0
|
||||
7 3 1 default:wood 0 0
|
||||
7 3 8 default:wood 0 0
|
||||
7 3 9 default:torch 15 5
|
||||
7 4 1 default:wood 0 0
|
||||
7 4 7 default:wood 0 0
|
||||
7 5 2 default:wood 0 0
|
||||
7 5 3 default:wood 0 0
|
||||
7 5 4 default:wood 0 0
|
||||
7 5 5 default:wood 0 0
|
||||
7 5 6 default:wood 0 0
|
||||
7 6 3 default:fence_wood 136 0
|
||||
8 0 2 default:cobble 0 0
|
||||
8 0 3 default:cobble 0 0
|
||||
8 0 4 default:cobble 0 0
|
||||
8 0 5 default:cobble 0 0
|
||||
8 0 6 default:cobble 0 0
|
||||
8 0 7 default:cobble 0 0
|
||||
8 1 1 default:cobble 0 0
|
||||
8 1 2 default:cobble 0 0
|
||||
8 1 3 default:cobble 0 0
|
||||
8 2 1 default:wood 0 0
|
||||
8 2 3 default:fence_wood 170 0
|
||||
8 2 8 default:fence_wood 173 0
|
||||
8 2 12 default:fence_wood 205 0
|
||||
8 3 1 default:wood 0 0
|
||||
8 3 12 default:torch 15 1
|
||||
8 4 1 default:wood 0 0
|
||||
8 4 2 default:torch 0 5
|
||||
8 4 7 default:wood 0 0
|
||||
8 5 2 default:wood 0 0
|
||||
8 5 3 default:wood 0 0
|
||||
8 5 4 default:wood 0 0
|
||||
8 5 5 default:wood 0 0
|
||||
8 5 6 default:wood 0 0
|
||||
8 6 3 default:fence_wood 120 0
|
||||
9 0 2 default:cobble 0 0
|
||||
9 0 3 default:cobble 0 0
|
||||
9 0 4 default:cobble 0 0
|
||||
9 0 5 default:cobble 0 0
|
||||
9 0 6 default:cobble 0 0
|
||||
9 0 7 default:cobble 0 0
|
||||
9 1 1 default:cobble 0 0
|
||||
9 1 2 default:cobble 0 0
|
||||
9 1 3 default:cobble 0 0
|
||||
9 2 1 default:wood 0 0
|
||||
9 2 3 default:fence_wood 154 0
|
||||
9 2 8 default:fence_wood 173 0
|
||||
9 2 12 default:fence_wood 189 0
|
||||
9 3 0 default:torch 15 4
|
||||
9 3 1 default:wood 0 0
|
||||
9 4 1 default:wood 0 0
|
||||
9 4 7 default:wood 0 0
|
||||
9 5 2 default:wood 0 0
|
||||
9 5 3 default:wood 0 0
|
||||
9 5 4 default:wood 0 0
|
||||
9 5 5 default:wood 0 0
|
||||
9 5 6 default:wood 0 0
|
||||
9 6 3 default:fence_wood 105 0
|
||||
10 0 2 default:cobble 0 0
|
||||
10 0 3 default:cobble 0 0
|
||||
10 0 4 default:cobble 0 0
|
||||
10 0 5 default:cobble 0 0
|
||||
10 0 6 default:cobble 0 0
|
||||
10 0 7 default:cobble 0 0
|
||||
10 1 1 default:cobble 0 0
|
||||
10 1 2 default:cobble 0 0
|
||||
10 1 3 default:cobble 0 0
|
||||
10 2 1 doors:door_wood_b_2 173 1
|
||||
10 2 3 default:fence_wood 171 0
|
||||
10 2 8 default:wood 0 0
|
||||
10 2 9 default:fence_wood 205 0
|
||||
10 2 10 default:fence_wood 205 0
|
||||
10 2 11 default:fence_wood 189 0
|
||||
10 2 12 default:fence_wood 205 0
|
||||
10 3 1 doors:door_wood_t_2 189 1
|
||||
10 3 3 default:fence_wood 187 0
|
||||
10 3 8 default:wood 0 0
|
||||
10 3 9 default:torch 15 5
|
||||
10 3 10 default:torch 15 1
|
||||
10 3 12 default:torch 15 1
|
||||
10 4 1 default:wood 0 0
|
||||
10 4 2 default:torch 0 5
|
||||
10 4 3 default:wood 0 0
|
||||
10 4 7 default:wood 0 0
|
||||
10 5 2 default:wood 0 0
|
||||
10 5 3 default:wood 0 0
|
||||
10 5 4 default:wood 0 0
|
||||
10 5 5 default:wood 0 0
|
||||
10 5 6 default:wood 0 0
|
||||
10 6 3 default:fence_wood 122 0
|
||||
11 0 2 default:cobble 0 0
|
||||
11 0 3 default:cobble 0 0
|
||||
11 0 4 default:cobble 0 0
|
||||
11 0 5 default:cobble 0 0
|
||||
11 0 6 default:cobble 0 0
|
||||
11 0 7 default:cobble 0 0
|
||||
11 1 1 default:cobble 0 0
|
||||
11 1 2 default:cobble 0 0
|
||||
11 1 3 default:cobble 0 0
|
||||
11 1 4 default:cobble 0 0
|
||||
11 1 5 default:cobble 0 0
|
||||
11 1 6 default:cobble 0 0
|
||||
11 1 7 default:tree 0 0
|
||||
11 2 1 default:tree 0 0
|
||||
11 2 2 default:wood 0 0
|
||||
11 2 3 default:wood 0 0
|
||||
11 2 4 default:wood 0 0
|
||||
11 2 5 default:wood 0 0
|
||||
11 2 6 default:wood 0 0
|
||||
11 2 7 default:tree 0 0
|
||||
11 3 1 default:tree 0 0
|
||||
11 3 2 default:wood 0 0
|
||||
11 3 3 default:wood 0 0
|
||||
11 3 4 default:wood 0 0
|
||||
11 3 5 default:fence_wood 188 0
|
||||
11 3 6 default:wood 0 0
|
||||
11 3 7 default:tree 0 0
|
||||
11 4 1 default:tree 0 0
|
||||
11 4 2 default:wood 0 0
|
||||
11 4 3 default:wood 0 0
|
||||
11 4 4 default:wood 0 0
|
||||
11 4 5 default:wood 0 0
|
||||
11 4 6 default:wood 0 0
|
||||
11 4 7 default:tree 0 0
|
||||
11 5 2 default:wood 0 0
|
||||
11 5 3 default:wood 0 0
|
||||
11 5 4 default:wood 0 0
|
||||
11 5 5 default:wood 0 0
|
||||
11 5 6 default:wood 0 0
|
||||
11 6 3 default:wood 0 0
|
||||
11 6 4 default:fence_wood 156 0
|
||||
11 6 5 default:wood 0 0
|
||||
11 7 4 default:fence_wood 140 0
|
||||
12 4 3 default:torch 0 3
|
||||
12 4 5 default:torch 0 3
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue