Updated Default, Added Intersect, Added ABMs for grass spread and growth

master
NathanSalapat 2015-08-26 11:48:20 -05:00
parent ceb83c9144
commit 2709fd27c4
83 changed files with 1414 additions and 430 deletions

View File

@ -1,3 +1,8 @@
2015-08-26:
Updated Valley_Mapgen.
Added intersecting mod from paramat. Should be easier to find Goblins in underground caves with this.
Updated Default.
2015-08-12:
Well bottoms are now placable on any nodes that belong to the soil group, code also got a huge cleanup from that change.
Smokers are still very hacky, use at your own risk, they don't smoke anything yet, so there really is no point to use them.

View File

@ -24,7 +24,6 @@ Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
Cisoun's WTFPL texture pack:
default_jungletree.png
default_jungletree_top.png
default_lava.png
default_leaves.png
default_sapling.png
@ -57,11 +56,10 @@ VanessaE (WTFPL):
default_nc_front.png
default_nc_rb.png
default_nc_side.png
default_grass_*.png
default_desert_sand.png
default_desert_stone.png
default_desert_stone_brick.png
default_sand.png
default_jungletree_top.png
Calinou (CC BY-SA):
default_brick.png
@ -78,7 +76,6 @@ Jordach (CC BY-SA 3.0):
PilzAdam (WTFPL):
default_jungleleaves.png
default_junglesapling.png
default_junglewood.png
default_obsidian_glass.png
default_obsidian_shard.png
default_mineral_gold.png
@ -93,7 +90,6 @@ InfinityProject (WTFPL):
Splizard (CC BY-SA 3.0):
default_snow.png
default_snow_side.png
default_ice.png
default_pine_sapling.png
Zeg9 (CC BY-SA 3.0):
@ -104,7 +100,7 @@ Zeg9 (CC BY-SA 3.0):
default_gold_block.png
paramat (CC BY-SA 3.0):
wieldhand.png, based on character.png by Jordach (CC BY-SA 3.0)
wieldhand.png, derived from character.png by Jordach (CC BY-SA 3.0)
default_pinetree.png
default_pinetree_top.png
default_pinewood.png
@ -113,19 +109,30 @@ paramat (CC BY-SA 3.0):
default_river_water.png
default_river_water_source_animated.png
default_river_water_flowing_animated.png
default_acacia_leaves.png
default_acacia_sapling.png
default_acacia_tree.png
default_acacia_tree_top.png
default_acacia_wood.png
default_dry_grass.png
default_dry_grass_side.png
default_dry_grass_*.png
default_junglewood.png, derived from a texture by BlockMen (CC BY-SA 3.0)
default_grass.png, derived from a texture by Philipbenr (CC BY-SA 3.0)
default_grass_side.png, derived from a texture by Philipbenr (CC BY-SA 3.0)
default_stone_brick.png, derived from a texture by Cisoun (WTFPL)
default_desert_stone_brick.png, derived from a texture by VanessaE (WTFPL)
brunob.santos (CC BY-SA 4.0):
default_desert_cobble.png
BlockMen (CC BY-SA 3.0):
default_stone_brick.png
default_wood.png
default_clay_brick.png
default_iron_ingot.png
default_gold_ingot.png
default_tool_steelsword.png
default_diamond.png
default_diamond_block.png
default_book.png
default_tool_*.png
default_lava_source_animated.png
@ -148,9 +155,20 @@ Neuromancer (CC BY-SA 3.0):
default_dirt.png
default_furnace_*.png
Philipbenr (CC BY-SA 3.0):
default_grass.png
default_grass_side.png
Gambit (WTFPL):
default_bronze_ingot.png
default_copper_ingot.png
default_copper_lump.png
default_iron_lump.png
default_gold_lump.png
default_clay_lump.png
default_coal.png
default_grass_*.png
default_paper.png
default_diamond_block.png
asl97 (WTFPL):
default_ice.png
Glass breaking sounds (CC BY 3.0):
1: http://www.freesound.org/people/cmusounddesign/sounds/71947/
@ -191,14 +209,3 @@ Mito551 (sounds) (CC BY-SA):
default_dirt_footstep.1.ogg
default_dirt_footstep.2.ogg
default_glass_footstep.ogg
Gambit (WTFPL):
default_bronze_ingot.png
default_copper_ingot.png
default_copper_lump.png
default_iron_lump.png
default_gold_lump.png
default_clay_lump.png
default_coal.png
default_grass_*.png
default_paper.png

44
mods/default/abms.lua Normal file
View File

@ -0,0 +1,44 @@
local grass_table = {-- mature, child
{'default:grass_5', 'default:grass_4'},
{'default:grass_4', 'default:grass_3'},
{'default:grass_3', 'default:grass_2'},
{'default:grass_2', 'default:grass_1'},
{'default:grass_1', 'air'}
}
minetest.register_abm({ --grass spreading
nodenames = {'group:soil'},
neighbors = {'group:grass'},
interval = 20,
chance = 40,
action = function(pos, node)
local node_above = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z})
if node_above.name == 'air' then
minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z}, {name = 'default:grass_1'})
end
end
})
minetest.register_abm({ --grass growing
nodenames = {'group:grass'},
interval = 40,
chance = 20,
action = function(pos, node)
for i in ipairs (grass_table) do
local mature = grass_table[i][1]
local child = grass_table[i][2]
if node.name == child then
minetest.set_node(pos, {name=mature})
end
end
end
})
minetest.register_abm({ --Jungle grass growing
nodenames = {'default:grass_5'},
interval = 60,
chance = 60,
action = function(pos, node)
minetest.set_node(pos, {name='default:junglegrass'})
end
})

View File

@ -68,5 +68,9 @@ minetest.register_alias("steel_ingot", "default:steel_ingot")
minetest.register_alias("clay_brick", "default:clay_brick")
minetest.register_alias("snow", "default:snow")
-- Mese now comes in the form of blocks, ore, crystal and fragments
minetest.register_alias("default:mese", "default:mese_block")
-- 'mese_block' was used for a while for the block form of mese
minetest.register_alias("default:mese_block", "default:mese")
-- Aliases for corrected pine node names
minetest.register_alias("default:pinetree", "default:pine_tree")
minetest.register_alias("default:pinewood", "default:pine_wood")

View File

@ -15,9 +15,16 @@ minetest.register_craft({
})
minetest.register_craft({
output = 'default:pinewood 4',
output = 'default:pine_wood 4',
recipe = {
{'default:pinetree'},
{'default:pine_tree'},
}
})
minetest.register_craft({
output = 'default:acacia_wood 4',
recipe = {
{'default:acacia_tree'},
}
})
@ -796,7 +803,7 @@ minetest.register_craft({
minetest.register_craft({
type = "fuel",
recipe = "default:sapling",
recipe = "group:sapling",
burntime = 10,
})
@ -818,12 +825,6 @@ minetest.register_craft({
burntime = 370,
})
minetest.register_craft({
type = "fuel",
recipe = "default:junglesapling",
burntime = 10,
})
minetest.register_craft({
type = "fuel",
recipe = "default:grass_1",
@ -832,7 +833,7 @@ minetest.register_craft({
minetest.register_craft({
type = "fuel",
recipe = "default:pine_sapling",
burntime = 10,
recipe = "default:dry_grass_1",
burntime = 2,
})

View File

@ -3,7 +3,7 @@
minetest.register_craftitem("default:stick", {
description = "Stick",
inventory_image = "default_stick.png",
groups = {stick=1, kindling=1},
groups = {stick=1},
})
minetest.register_craftitem("default:paper", {

View File

@ -90,19 +90,21 @@ end
default.cool_lava_source = function(pos)
minetest.set_node(pos, {name = "default:obsidian"})
minetest.sound_play("default_cool_lava", {pos = pos, gain = 0.25})
minetest.sound_play("default_cool_lava",
{pos = pos, max_hear_distance = 16, gain = 0.25})
end
default.cool_lava_flowing = function(pos)
minetest.set_node(pos, {name = "default:stone"})
minetest.sound_play("default_cool_lava", {pos = pos, gain = 0.25})
minetest.sound_play("default_cool_lava",
{pos = pos, max_hear_distance = 16, gain = 0.25})
end
minetest.register_abm({
nodenames = {"default:lava_flowing"},
neighbors = {"group:water"},
interval = 1,
chance = 1,
chance = 2,
action = function(...)
default.cool_lava_flowing(...)
end,
@ -112,7 +114,7 @@ minetest.register_abm({
nodenames = {"default:lava_source"},
neighbors = {"group:water"},
interval = 1,
chance = 1,
chance = 2,
action = function(...)
default.cool_lava_source(...)
end,
@ -304,11 +306,31 @@ minetest.register_abm({
--
-- Grass murdering ;)
-- Grass growing
--
minetest.register_abm({
nodenames = {"default:dirt_with_grass"},
nodenames = {"default:dirt"},
interval = 2,
chance = 200,
action = function(pos, node)
local above = {x = pos.x, y = pos.y + 1, z = pos.z}
local name = minetest.get_node(above).name
local nodedef = minetest.registered_nodes[name]
if nodedef and (nodedef.sunlight_propagates or nodedef.paramtype == "light") and
nodedef.liquidtype == "none" and
(minetest.get_node_light(above) or 0) >= 13 then
if name == "default:snow" or name == "default:snowblock" then
minetest.set_node(pos, {name = "default:dirt_with_snow"})
else
minetest.set_node(pos, {name = "default:dirt_with_grass"})
end
end
end
})
minetest.register_abm({
nodenames = {"default:dirt_with_grass", "default:dirt_with_dry_grass"},
interval = 2,
chance = 20,
action = function(pos, node)

View File

@ -18,6 +18,10 @@ local function active_formspec(fuel_percent, item_percent)
"list[current_name;dst;4.75,0.96;2,2;]"..
"list[current_player;main;0,4.25;8,1;]"..
"list[current_player;main;0,5.5;8,3;8]"..
"listring[current_name;dst]"..
"listring[current_player;main]"..
"listring[current_name;src]"..
"listring[current_player;main]"..
default.get_hotbar_bg(0, 4.25)
return formspec
end
@ -34,6 +38,10 @@ local inactive_formspec =
"list[current_name;dst;4.75,0.96;2,2;]"..
"list[current_player;main;0,4.25;8,1;]"..
"list[current_player;main;0,5.5;8,3;8]"..
"listring[current_name;dst]"..
"listring[current_player;main]"..
"listring[current_name;src]"..
"listring[current_player;main]"..
default.get_hotbar_bg(0, 4.25)
--
@ -97,7 +105,6 @@ minetest.register_node("default:furnace", {
groups = {cracky=2},
legacy_facedir_simple = true,
is_ground_content = false,
drop = "default:cobble 3",
sounds = default.node_sound_stone_defaults(),
can_dig = can_dig,
@ -126,7 +133,7 @@ minetest.register_node("default:furnace_active", {
},
paramtype2 = "facedir",
light_source = 8,
drop = "default:cobble 3",
drop = "default:furnace",
groups = {cracky=2, not_in_creative_inventory=1},
legacy_facedir_simple = true,
is_ground_content = false,

View File

@ -30,6 +30,8 @@ default.gui_survival_form = "size[8,8.5]"..
"list[current_player;craft;1.75,0.5;3,3;]"..
"list[current_player;craftpreview;5.75,1.5;1,1;]"..
"image[4.75,1.5;1,1;gui_furnace_arrow_bg.png^[transformR270]"..
"listring[current_player;main]"..
"listring[current_player;craft]"..
default.get_hotbar_bg(0,4.25)
-- Load files
@ -44,3 +46,4 @@ dofile(minetest.get_modpath("default").."/player.lua")
dofile(minetest.get_modpath("default").."/trees.lua")
dofile(minetest.get_modpath("default").."/aliases.lua")
dofile(minetest.get_modpath("default").."/legacy.lua")
dofile(minetest.get_modpath('default')..'/abms.lua')

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,15 @@
-- mods/default/nodes.lua
--[[ Node name convention:
Although many node names are in combined-word form, the required form for new
node names is words separated by underscores. If both forms are used in written
language (for example pinewood and pine wood) the underscore form should be used.
--]]
--[[ Index:
Stone
@ -28,6 +38,7 @@ Soft / Non-Stone
default:dirt
default:dirt_with_grass
default:dirt_with_grass_footsteps
default:dirt_with_dry_grass
default:dirt_with_snow
default:sand
@ -57,11 +68,16 @@ default:junglewood
default:jungleleaves
default:junglesapling
default:pinetree
default:pinewood
default:pine_tree
default:pine_wood
default:pine_needles
default:pine_sapling
default:acacia_tree
default:acacia_wood
default:acacia_leaves
default:acacia_sapling
Ores
----
(1. In stone 2. Block)
@ -91,12 +107,19 @@ default:cactus
default:papyrus
default:dry_shrub
default:junglegrass
default:grass_1
default:grass_2
default:grass_3
default:grass_4
default:grass_5
default:dry_grass_1
default:dry_grass_2
default:dry_grass_3
default:dry_grass_4
default:dry_grass_5
Liquids
-------
(1. Source 2. Flowing)
@ -251,7 +274,9 @@ minetest.register_node("default:dirt", {
minetest.register_node("default:dirt_with_grass", {
description = "Dirt with Grass",
tiles = {"default_grass.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"},
tiles = {"default_grass.png", "default_dirt.png",
{name = "default_dirt.png^default_grass_side.png",
tileable_vertical = false}},
groups = {crumbly=3,soil=1},
drop = 'default:dirt',
sounds = default.node_sound_dirt_defaults({
@ -261,7 +286,9 @@ minetest.register_node("default:dirt_with_grass", {
minetest.register_node("default:dirt_with_grass_footsteps", {
description = "Dirt with Grass and Footsteps",
tiles = {"default_grass_footsteps.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"},
tiles = {"default_grass.png^default_footprint.png", "default_dirt.png",
{name = "default_dirt.png^default_grass_side.png",
tileable_vertical = false}},
groups = {crumbly=3,soil=1,not_in_creative_inventory=1},
drop = 'default:dirt',
sounds = default.node_sound_dirt_defaults({
@ -269,9 +296,24 @@ minetest.register_node("default:dirt_with_grass_footsteps", {
}),
})
minetest.register_node("default:dirt_with_dry_grass", {
description = "Dirt with Dry Grass",
tiles = {"default_dry_grass.png",
"default_dirt.png",
{name = "default_dirt.png^default_dry_grass_side.png",
tileable_vertical = false}},
groups = {crumbly = 3, soil = 1},
drop = 'default:dirt',
sounds = default.node_sound_dirt_defaults({
footstep = {name = "default_grass_footstep", gain = 0.4},
}),
})
minetest.register_node("default:dirt_with_snow", {
description = "Dirt with Snow",
tiles = {"default_snow.png", "default_dirt.png", "default_dirt.png^default_snow_side.png"},
tiles = {"default_snow.png", "default_dirt.png",
{name = "default_dirt.png^default_snow_side.png",
tileable_vertical = false}},
groups = {crumbly=3,soil=1},
drop = 'default:dirt',
sounds = default.node_sound_dirt_defaults({
@ -280,7 +322,6 @@ minetest.register_node("default:dirt_with_snow", {
})
minetest.register_node("default:sand", {
description = "Sand",
tiles = {"default_sand.png"},
@ -330,19 +371,19 @@ minetest.register_node("default:snow", {
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.5+2/16, 0.5},
{-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
},
},
groups = {crumbly=3,falling_node=1},
groups = {crumbly = 3, falling_node = 1, puts_out_fire = 1},
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_snow_footstep", gain=0.25},
dug = {name="default_snow_footstep", gain=0.75},
footstep = {name = "default_snow_footstep", gain = 0.25},
dug = {name = "default_snow_footstep", gain = 0.75},
}),
on_construct = function(pos)
pos.y = pos.y - 1
if minetest.get_node(pos).name == "default:dirt_with_grass" then
minetest.set_node(pos, {name="default:dirt_with_snow"})
minetest.set_node(pos, {name = "default:dirt_with_snow"})
end
end,
})
@ -351,10 +392,10 @@ minetest.register_node("default:snow", {
minetest.register_node("default:snowblock", {
description = "Snow Block",
tiles = {"default_snow.png"},
groups = {crumbly=3},
groups = {crumbly = 3, puts_out_fire = 1},
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_snow_footstep", gain=0.25},
dug = {name="default_snow_footstep", gain=0.75},
footstep = {name = "default_snow_footstep", gain = 0.25},
dug = {name = "default_snow_footstep", gain = 0.75},
}),
})
@ -365,7 +406,7 @@ minetest.register_node("default:ice", {
tiles = {"default_ice.png"},
is_ground_content = false,
paramtype = "light",
groups = {cracky=3},
groups = {cracky = 3, puts_out_fire = 1},
sounds = default.node_sound_glass_defaults(),
})
@ -416,6 +457,7 @@ minetest.register_node("default:leaves", {
waving = 1,
visual_scale = 1.3,
tiles = {"default_leaves.png"},
special_tiles = {"default_leaves_simple.png"},
paramtype = "light",
is_ground_content = false,
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
@ -491,6 +533,7 @@ minetest.register_node("default:jungleleaves", {
waving = 1,
visual_scale = 1.3,
tiles = {"default_jungleleaves.png"},
special_tiles = {"default_jungleleaves_simple.png"},
paramtype = "light",
is_ground_content = false,
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
@ -534,22 +577,23 @@ minetest.register_node("default:junglesapling", {
minetest.register_node("default:pinetree", {
minetest.register_node("default:pine_tree", {
description = "Pine Tree",
tiles = {"default_pinetree_top.png", "default_pinetree_top.png", "default_pinetree.png"},
tiles = {"default_pine_tree_top.png", "default_pine_tree_top.png",
"default_pine_tree.png"},
paramtype2 = "facedir",
is_ground_content = false,
groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node
})
minetest.register_node("default:pinewood", {
description = "Pinewood Planks",
tiles = {"default_pinewood.png"},
minetest.register_node("default:pine_wood", {
description = "Pine Wood Planks",
tiles = {"default_pine_wood.png"},
is_ground_content = false,
groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
sounds = default.node_sound_wood_defaults(),
})
@ -561,20 +605,12 @@ minetest.register_node("default:pine_needles",{
waving = 1,
paramtype = "light",
is_ground_content = false,
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
drop = {
max_items = 1,
items = {
{
-- player will get sapling with 1/20 chance
items = {"default:pine_sapling"},
rarity = 20,
},
{
-- player will get leaves only if he get no saplings,
-- this is because max_items is 1
items = {"default:pine_needles"},
}
{items = {"default:pine_sapling"}, rarity = 20},
{items = {"default:pine_needles"}}
}
},
sounds = default.node_sound_leaves_defaults(),
@ -590,12 +626,73 @@ minetest.register_node("default:pine_sapling", {
inventory_image = "default_pine_sapling.png",
wield_image = "default_pine_sapling.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
},
groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,sapling=1},
groups = {snappy = 2, dig_immediate = 3, flammable = 2,
attached_node = 1, sapling = 1},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("default:acacia_tree", {
description = "Acacia Tree",
tiles = {"default_acacia_tree_top.png", "default_acacia_tree_top.png",
"default_acacia_tree.png"},
paramtype2 = "facedir",
is_ground_content = false,
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node
})
minetest.register_node("default:acacia_wood", {
description = "Acacia Wood Planks",
tiles = {"default_acacia_wood.png"},
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("default:acacia_leaves", {
description = "Acacia Leaves",
drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"default_acacia_leaves.png"},
paramtype = "light",
is_ground_content = false,
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
drop = {
max_items = 1,
items = {
{items = {"default:acacia_sapling"}, rarity = 20},
{items = {"default:acacia_leaves"}}
}
},
sounds = default.node_sound_leaves_defaults(),
after_place_node = default.after_place_leaves,
})
minetest.register_node("default:acacia_sapling", {
description = "Acacia Tree Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"default_acacia_sapling.png"},
inventory_image = "default_acacia_sapling.png",
wield_image = "default_acacia_sapling.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
},
groups = {snappy = 2, dig_immediate = 3, flammable = 2,
attached_node = 1, sapling = 1},
sounds = default.node_sound_leaves_defaults(),
})
@ -791,19 +888,7 @@ minetest.register_node("default:junglegrass", {
sunlight_propagates = true,
walkable = false,
buildable_to = true,
drop = {
max_items = 2,
items = {
{
items = {'survival:cricket_raw'},
rarity = 15,
},
{
items = {'default:junglegrass_1'},
},
},
},
groups = {snappy=3,flammable=2,flora=1,attached_node=1},
groups = {snappy=3,flammable=2,flora=1,attached_node=1,grass=1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
@ -823,7 +908,7 @@ minetest.register_node("default:grass_1", {
sunlight_propagates = true,
walkable = false,
buildable_to = true,
groups = {snappy=3,flammable=3,flora=1,attached_node=1},
groups = {snappy=3,flammable=3,flora=1,attached_node=1,grass=1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
@ -850,19 +935,56 @@ for i=2,5 do
sunlight_propagates = true,
walkable = false,
buildable_to = true,
drop = {
max_items = 2,
items = {
{
items = {'survival:cricket_raw'},
rarity = 15,
},
{
items = {'default:grass_1'},
},
},
drop = "default:grass_1",
groups = {snappy=3,flammable=3,flora=1,attached_node=1,not_in_creative_inventory=1,grass=1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
},
})
end
minetest.register_node("default:dry_grass_1", {
description = "Dry Grass",
drawtype = "plantlike",
waving = 1,
tiles = {"default_dry_grass_1.png"},
inventory_image = "default_dry_grass_3.png",
wield_image = "default_dry_grass_3.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
groups = {snappy=3,flammable=3,flora=1,attached_node=1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
},
on_place = function(itemstack, placer, pointed_thing)
-- place a random dry grass node
local stack = ItemStack("default:dry_grass_"..math.random(1,5))
local ret = minetest.item_place(stack, placer, pointed_thing)
return ItemStack("default:dry_grass_1 "..itemstack:get_count()-(1-ret:get_count()))
end,
})
for i=2,5 do
minetest.register_node("default:dry_grass_"..i, {
description = "Dry Grass",
drawtype = "plantlike",
waving = 1,
tiles = {"default_dry_grass_"..i..".png"},
inventory_image = "default_dry_grass_"..i..".png",
wield_image = "default_dry_grass_"..i..".png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
groups = {snappy=3,flammable=3,flora=1,attached_node=1,not_in_creative_inventory=1},
drop = "default:dry_grass_1",
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
@ -1220,6 +1342,8 @@ local chest_formspec =
"list[current_name;main;0,0.3;8,4;]"..
"list[current_player;main;0,4.85;8,1;]"..
"list[current_player;main;0,6.08;8,3;8]"..
"listring[current_name;main]"..
"listring[current_player;main]"..
default.get_hotbar_bg(0,4.85)
local function get_locked_chest_formspec(pos)
@ -1232,6 +1356,8 @@ local function get_locked_chest_formspec(pos)
"list[nodemeta:".. spos .. ";main;0,0.3;8,4;]"..
"list[current_player;main;0,4.85;8,1;]"..
"list[current_player;main;0,6.08;8,3;8]"..
"listring[nodemeta:".. spos .. ";main]"..
"listring[current_player;main]"..
default.get_hotbar_bg(0,4.85)
return formspec
end
@ -1361,6 +1487,8 @@ local bookshelf_formspec =
"list[context;books;0,0.3;8,2;]"..
"list[current_player;main;0,2.85;8,1;]"..
"list[current_player;main;0,4.08;8,3;8]"..
"listring[context;books]"..
"listring[current_player;main]"..
default.get_hotbar_bg(0,2.85)
minetest.register_node("default:bookshelf", {

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.

After

Width:  |  Height:  |  Size: 444 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 359 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 682 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 731 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 249 B

After

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 572 B

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 466 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 263 B

After

Width:  |  Height:  |  Size: 777 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 B

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 153 B

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 211 B

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 B

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 B

After

Width:  |  Height:  |  Size: 490 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 254 B

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 430 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 811 B

After

Width:  |  Height:  |  Size: 834 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 230 B

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 817 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 574 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 B

After

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@ -1,7 +1,9 @@
--
-- Grow trees
-- Grow trees from saplings
--
-- 'Can grow' function
local random = math.random
local function can_grow(pos)
@ -17,10 +19,12 @@ local function can_grow(pos)
return true
end
-- Sapling ABMs
-- Sapling ABM
minetest.register_abm({
nodenames = {"default:sapling"},
nodenames = {"default:sapling", "default:junglesapling",
"default:pine_sapling", "default:acacia_sapling"},
interval = 10,
chance = 50,
action = function(pos, node)
@ -28,43 +32,45 @@ minetest.register_abm({
return
end
minetest.log("action", "A sapling grows into a tree at "..
local mapgen = minetest.get_mapgen_params().mgname
if node.name == "default:sapling" then
minetest.log("action", "A sapling grows into a tree at "..
minetest.pos_to_string(pos))
default.grow_tree(pos, random(1, 4) == 1)
end
})
minetest.register_abm({
nodenames = {"default:junglesapling"},
interval = 11,
chance = 50,
action = function(pos, node)
if not can_grow(pos) then
return
if mapgen == "v6" then
default.grow_tree(pos, random(1, 4) == 1)
else
default.grow_new_apple_tree(pos)
end
elseif node.name == "default:junglesapling" then
minetest.log("action", "A jungle sapling grows into a tree at "..
minetest.pos_to_string(pos))
if mapgen == "v6" then
default.grow_jungle_tree(pos)
else
default.grow_new_jungle_tree(pos)
end
elseif node.name == "default:pine_sapling" then
minetest.log("action", "A pine sapling grows into a tree at "..
minetest.pos_to_string(pos))
if mapgen == "v6" then
default.grow_pine_tree(pos)
else
default.grow_new_pine_tree(pos)
end
elseif node.name == "default:acacia_sapling" then
minetest.log("action", "An acacia sapling grows into a tree at "..
minetest.pos_to_string(pos))
default.grow_new_acacia_tree(pos)
end
minetest.log("action", "A jungle sapling grows into a tree at "..
minetest.pos_to_string(pos))
default.grow_jungle_tree(pos)
end
})
minetest.register_abm({
nodenames = {"default:pine_sapling"},
interval = 12,
chance = 50,
action = function(pos, node)
if not can_grow(pos) then
return
end
minetest.log("action", "A pine sapling grows into a tree at "..
minetest.pos_to_string(pos))
default.grow_pine_tree(pos)
end
})
--
-- Tree generation
--
-- Appletree, jungletree function
-- Apple tree and jungle tree trunk and leaves function
local function add_trunk_and_leaves(data, a, pos, tree_cid, leaves_cid,
height, size, iters, is_apple_tree)
@ -74,11 +80,11 @@ local function add_trunk_and_leaves(data, a, pos, tree_cid, leaves_cid,
local c_apple = minetest.get_content_id("food:apple")
-- Trunk
for y_dist = 0, height - 1 do
local vi = a:index(x, y + y_dist, z)
data[a:index(x, y, z)] = tree_cid -- Force-place lowest trunk node to replace sapling
for yy = y + 1, y + height - 1 do
local vi = a:index(x, yy, z)
local node_id = data[vi]
if y_dist == 0 or node_id == c_air or node_id == c_ignore
or node_id == leaves_cid then
if node_id == c_air or node_id == c_ignore or node_id == leaves_cid then
data[vi] = tree_cid
end
end
@ -123,7 +129,8 @@ local function add_trunk_and_leaves(data, a, pos, tree_cid, leaves_cid,
end
end
-- Appletree
-- Apple tree
function default.grow_tree(pos, is_apple_tree, bad)
--[[
@ -155,7 +162,8 @@ function default.grow_tree(pos, is_apple_tree, bad)
vm:update_map()
end
-- Jungletree
-- Jungle tree
function default.grow_jungle_tree(pos, bad)
--[[
@ -206,16 +214,19 @@ function default.grow_jungle_tree(pos, bad)
vm:update_map()
end
-- Pinetree from mg mapgen mod, design by sfan5, pointy top added by paramat
-- Pine tree from mg mapgen mod, design by sfan5, pointy top added by paramat
local function add_pine_needles(data, vi, c_air, c_ignore, c_snow, c_pine_needles)
if data[vi] == c_air or data[vi] == c_ignore or data[vi] == c_snow then
local node_id = data[vi]
if node_id == c_air or node_id == c_ignore or node_id == c_snow then
data[vi] = c_pine_needles
end
end
local function add_snow(data, vi, c_air, c_ignore, c_snow)
if data[vi] == c_air or data[vi] == c_ignore then
local node_id = data[vi]
if node_id == c_air or node_id == c_ignore then
data[vi] = c_snow
end
end
@ -226,7 +237,7 @@ function default.grow_pine_tree(pos)
local c_air = minetest.get_content_id("air")
local c_ignore = minetest.get_content_id("ignore")
local c_pinetree = minetest.get_content_id("default:pinetree")
local c_pine_tree = minetest.get_content_id("default:pine_tree")
local c_pine_needles = minetest.get_content_id("default:pine_needles")
local c_snow = minetest.get_content_id("default:snow")
local c_snowblock = minetest.get_content_id("default:snowblock")
@ -240,16 +251,14 @@ function default.grow_pine_tree(pos)
local a = VoxelArea:new({MinEdge = minp, MaxEdge = maxp})
local data = vm:get_data()
-- Scan for snow nodes near sapling
-- Scan for snow nodes near sapling to enable snow on branches
local snow = false
for yy = y - 1, y + 1 do
for zz = z - 1, z + 1 do
local vi = a:index(x - 1, yy, zz)
for xx = x - 1, x + 1 do
local nodid = data[vi]
if nodid == c_snow
or nodid == c_snowblock
or nodid == c_dirtsnow then
if nodid == c_snow or nodid == c_snowblock or nodid == c_dirtsnow then
snow = true
end
vi = vi + 1
@ -266,7 +275,7 @@ function default.grow_pine_tree(pos)
for xx = x - dev, x + dev do
if random() < 0.95 - dev * 0.05 then
add_pine_needles(data, vi, c_air, c_ignore, c_snow,
c_pine_needles)
c_pine_needles)
if snow then
add_snow(data, via, c_air, c_ignore, c_snow)
end
@ -280,9 +289,9 @@ function default.grow_pine_tree(pos)
-- Centre top nodes
add_pine_needles(data, a:index(x, maxy + 1, z), c_air, c_ignore, c_snow,
c_pine_needles)
c_pine_needles)
add_pine_needles(data, a:index(x, maxy + 2, z), c_air, c_ignore, c_snow,
c_pine_needles) -- Paramat added a pointy top node
c_pine_needles) -- Paramat added a pointy top node
if snow then
add_snow(data, a:index(x, maxy + 3, z), c_air, c_ignore, c_snow)
end
@ -301,7 +310,7 @@ function default.grow_pine_tree(pos)
local via = a:index(xi, yy + 1, zz)
for xx = xi, xi + 1 do
add_pine_needles(data, vi, c_air, c_ignore, c_snow,
c_pine_needles)
c_pine_needles)
if snow then
add_snow(data, via, c_air, c_ignore, c_snow)
end
@ -319,7 +328,7 @@ function default.grow_pine_tree(pos)
for xx = x - dev, x + dev do
if random() < 0.95 - dev * 0.05 then
add_pine_needles(data, vi, c_air, c_ignore, c_snow,
c_pine_needles)
c_pine_needles)
if snow then
add_snow(data, via, c_air, c_ignore, c_snow)
end
@ -332,9 +341,14 @@ function default.grow_pine_tree(pos)
end
-- Trunk
for yy = y, maxy do
data[a:index(x, y, z)] = c_pine_tree -- Force-place lowest trunk node to replace sapling
for yy = y + 1, maxy do
local vi = a:index(x, yy, z)
data[vi] = c_pinetree
local node_id = data[vi]
if node_id == c_air or node_id == c_ignore or
node_id == c_pine_needles or node_id == c_snow then
data[vi] = c_pine_tree
end
end
vm:set_data(data)
@ -342,3 +356,38 @@ function default.grow_pine_tree(pos)
vm:update_map()
end
-- New apple tree
function default.grow_new_apple_tree(pos)
local path = minetest.get_modpath("default") .. "/schematics/apple_tree.mts"
minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
path, 0, nil, false)
end
-- New jungle tree
function default.grow_new_jungle_tree(pos)
local path = minetest.get_modpath("default") .. "/schematics/jungle_tree.mts"
minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
path, 0, nil, false)
end
-- New pine tree
function default.grow_new_pine_tree(pos)
local path = minetest.get_modpath("default") .. "/schematics/pine_tree.mts"
minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
path, 0, nil, false)
end
-- New acacia tree
function default.grow_new_acacia_tree(pos)
local path = minetest.get_modpath("default") .. "/schematics/acacia_tree.mts"
minetest.place_schematic({x = pos.x - 4, y = pos.y - 1, z = pos.z - 4},
path, random, nil, false)
end

View File

@ -0,0 +1,10 @@
intersecting 0.4.0 by paramat
For Minetest 0.4.12 and later
Depends default
Licenses: Code WTFPL, textures CC BY-SA 3.0
Unlimited tunnel and magma tunnel networks created from 3D noise.
3D underground 'biomes', each with a differing mix of 2 intersecting tunnel systems, the biomes create a few dead ends.
Mostly separate from this is a larger scaled magma tunnel network, if these magma tunnels come to surface in water, default lavacooling creates obsidian tubes.
Optional glowing lux ore craftable with 8 glass nodes to 8 lights, lux ore also spawns in desert dungeon walls.
You can use this with or instead of normal caves, disabling normal caves removes the lava caves and some features in the landscape.

View File

@ -0,0 +1 @@
default

284
mods/intersecting/init.lua Normal file
View File

@ -0,0 +1,284 @@
-- Parameters
local TTUN = 0.02 -- Tunnel width
local TMAG = 0.01 -- Magma channel width
local LUX = true -- Enable luxore
local LUXCHA = 1 / 9 ^ 3 -- Luxore chance per stone node.
-- 3D noise a
local np_weba = {
offset = 0,
scale = 1,
spread = {x = 192, y = 192, z = 192},
seed = 5900033,
octaves = 3,
persist = 0.5
}
-- 3D noise b
local np_webb = {
offset = 0,
scale = 1,
spread = {x = 191, y = 191, z = 191},
seed = 33,
octaves = 3,
persist = 0.5
}
-- 3D noise c
local np_webc = {
offset = 0,
scale = 1,
spread = {x = 190, y = 190, z = 190},
seed = -18000001,
octaves = 3,
persist = 0.5
}
-- 3D noise d
local np_webd = {
offset = 0,
scale = 1,
spread = {x = 384, y = 384, z = 384},
seed = -181,
octaves = 3,
persist = 0.4
}
-- 3D noise e
local np_webe = {
offset = 0,
scale = 1,
spread = {x = 383, y = 383, z = 383},
seed = 1022081,
octaves = 3,
persist = 0.4
}
-- 3D noise for biomes
local np_biome = {
offset = 0,
scale = 1,
spread = {x = 384, y = 384, z = 384},
seed = 89114,
octaves = 1,
persist = 0
}
-- Nodes
minetest.register_node("intersecting:luxore", {
description = "Lux Ore",
tiles = {"intersecting_luxore.png"},
paramtype = "light",
light_source = 14,
groups = {cracky = 3},
sounds = default.node_sound_glass_defaults(),
})
minetest.register_node("intersecting:light", {
description = "Light",
tiles = {"intersecting_light.png"},
paramtype = "light",
light_source = 14,
groups = {cracky = 3, oddly_breakable_by_hand = 3},
sounds = default.node_sound_glass_defaults(),
})
-- Crafting.
minetest.register_craft({
output = "intersecting:light 8",
recipe = {
{"default:glass", "default:glass", "default:glass"},
{"default:glass", "intersecting:luxore", "default:glass"},
{"default:glass", "default:glass", "default:glass"},
},
})
minetest.register_craft({
output = "intersecting:light 8",
recipe = {
{"default:obsidian_glass", "default:obsidian_glass", "default:obsidian_glass"},
{"default:obsidian_glass", "intersecting:luxore", "default:obsidian_glass"},
{"default:obsidian_glass", "default:obsidian_glass", "default:obsidian_glass"},
},
})
-- Initialize noise objects to nil
local nobj_weba = nil
local nobj_webb = nil
local nobj_webc = nil
local nobj_webd = nil
local nobj_webe = nil
local nobj_biome = nil
-- On generated function
minetest.register_on_generated(function(minp, maxp, seed)
if minp.y > 48 then
return
end
local t1 = os.clock()
local x1 = maxp.x
local y1 = maxp.y
local z1 = maxp.z
local x0 = minp.x
local y0 = minp.y
local z0 = minp.z
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
local area = VoxelArea:new{MinEdge = emin, MaxEdge = emax}
local data = vm:get_data()
local c_air = minetest.get_content_id("air")
local c_water = minetest.get_content_id("default:water_source")
local c_dirt = minetest.get_content_id("default:dirt")
local c_sand = minetest.get_content_id("default:sand")
local c_lava = minetest.get_content_id("default:lava_source")
local c_grass = minetest.get_content_id("default:dirt_with_grass")
local c_tree = minetest.get_content_id("default:tree")
local c_jtree = minetest.get_content_id("default:jungletree")
local c_stone = minetest.get_content_id("default:stone")
local c_desertstone = minetest.get_content_id("default:desert_stone")
local c_sandstone = minetest.get_content_id("default:sandstone")
local c_luxore = minetest.get_content_id("intersecting:luxore")
local sidelen = x1 - x0 + 1
local emerlen = sidelen + 32
local emerarea = emerlen ^ 2
local chulens = {x = sidelen, y = sidelen, z = sidelen}
local minposxyz = {x = x0, y = y0, z = z0}
nobj_weba = nobj_weba or minetest.get_perlin_map(np_weba, chulens)
nobj_webb = nobj_webb or minetest.get_perlin_map(np_webb, chulens)
nobj_webc = nobj_webc or minetest.get_perlin_map(np_webc, chulens)
nobj_webd = nobj_webd or minetest.get_perlin_map(np_webd, chulens)
nobj_webe = nobj_webe or minetest.get_perlin_map(np_webe, chulens)
nobj_biome = nobj_biome or minetest.get_perlin_map(np_biome, chulens)
local nvals_weba = nobj_weba:get3dMap_flat(minposxyz)
local nvals_webb = nobj_webb:get3dMap_flat(minposxyz)
local nvals_webc = nobj_webc:get3dMap_flat(minposxyz)
local nvals_webd = nobj_webd:get3dMap_flat(minposxyz)
local nvals_webe = nobj_webe:get3dMap_flat(minposxyz)
local nvals_biome = nobj_biome:get3dMap_flat(minposxyz)
local cavbel = {}
--local stobel = {}
local nixyz = 1
for z = z0, z1 do -- for each xy plane progressing northwards
for y = y0, y1 do -- for each x row progressing upwards
local ti = 1
local vi = area:index(x0, y, z)
local via = vi + emerlen
local vin = vi + emerarea
local vis = vi - emerarea
local vie = vi + 1
local viw = vi - 1
for x = x0, x1 do -- for each node progressing eastwards
local nodid = data[vi]
local nodida = data[via]
local nodide = data[vie]
local nodidw = data[viw]
local nodidn = data[vin]
local nodids = data[vis]
-- water adjacent
local watadj = nodida == c_water
or nodidw == c_water or nodide == c_water
or nodidn == c_water or nodids == c_water
-- lakebed material
local surfmat = (nodid == c_sand or nodid == c_dirt
or nodid == c_grass) and y <= 2
if nodid ~= c_air then
local weba = math.abs(nvals_weba[nixyz]) < TTUN
local webb = math.abs(nvals_webb[nixyz]) < TTUN
local webc = math.abs(nvals_webc[nixyz]) < TTUN
local webd = math.abs(nvals_webd[nixyz]) < TMAG
local webe = math.abs(nvals_webe[nixyz]) < TMAG
local n_biome = nvals_biome[nixyz]
local void
local magma = webd and webe
if n_biome < -0.3 then
void = (weba and webb) or (webb and webc)
elseif n_biome < 0.3 then
void = (webb and webc) or (weba and webc)
else
void = (weba and webc) or (weba and webb)
end
if void or magma then
if magma then -- magma tunnel
if y <= 1 then
data[vi] = c_lava
else
data[vi] = c_air
end
cavbel[ti] = 1
--stobel[ti] = 0
elseif (nodid == c_water or watadj) and cavbel[ti] == 1 then
for j = -1, -16, -1 do -- water plug
local vip = area:index(x, y + j, z)
if data[vip] == c_air then
data[vip] = c_stone
end
end
cavbel[ti] = 0
--stobel[ti] = 0
elseif nodid ~= c_water and not surfmat and not watadj then
data[vi] = c_air -- tunnel
cavbel[ti] = 1
--stobel[ti] = 0
end
-- if trunk cut remove whole trunk
if nodid == c_tree or nodid == c_jtree then
for j = -12, 12 do
local vit = area:index(x, y + j, z)
if data[vit] == c_tree or data[vit] == c_jtree then
data[vit] = c_air
end
end
end
else -- solid or liquid
cavbel[ti] = 0
if nodid == c_stone or nodid == c_desertstone
or nodid == c_sandstone then
if LUX then
if math.random() < LUXCHA then
data[vi] = c_luxore
end
end
--stobel[ti] = 1
end
end
else -- nodid == c_air
cavbel[ti] = 0
--stobel[ti] = 0
end
nixyz = nixyz + 1
ti = ti + 1
vi = vi + 1
via = via + 1
vin = vin + 1
vis = vis + 1
vie = vie + 1
viw = viw + 1
end
end
end
vm:set_data(data)
vm:set_lighting({day = 0, night = 0})
vm:calc_lighting()
vm:write_to_map(data)
local chugent = math.ceil((os.clock() - t1) * 1000)
print ("[intersecting] " .. chugent .. " ms")
end)

View File

@ -0,0 +1,14 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 311 B