First commit!

This commit is contained in:
Amaz 2016-08-27 12:23:21 +01:00
commit 97aa096bf0
115 changed files with 84568 additions and 0 deletions

463
enhancing/defs.lua Normal file
View File

@ -0,0 +1,463 @@
function all_crafts(material, i)
crafts(material, "pick", i)
crafts(material, "axe", i)
crafts(material, "shovel", i)
end
function crafts(material, tool, i)
if i == 1 then
enhancing.add_craft("enhancing:" .. tool .. "_" .. material .. "_quick_1",
{[1] = "default:obsidian_shard", [2] = "default:obsidian_shard",
[3] = "default:obsidian_shard", [4] = "default:obsidian_shard",
[5] = "default:" .. tool .. "_" .. material, [6] = "default:obsidian_shard",
[7] = "default:obsidian_shard", [8] = "default:obsidian_shard",
[9] = "default:obsidian_shard", ["time"] = 3, ["texture"] = "default_obsidian_shard.png"}
)
enhancing.add_craft("enhancing:" .. tool .. "_" .. material .. "_durable_1",
{[1] = "default:mese_crystal_fragment", [2] = "default:mese_crystal_fragment",
[3] = "default:mese_crystal_fragment", [4] = "default:mese_crystal_fragment",
[5] = "default:" .. tool .. "_" .. material, [6] = "default:mese_crystal_fragment",
[7] = "default:mese_crystal_fragment", [8] = "default:mese_crystal_fragment",
[9] = "default:mese_crystal_fragment", ["time"] = 3, ["texture"] = "default_mese_crystal_fragment.png"}
)
enhancing.add_craft("enhancing:" .. tool .. "_" .. material .. "_lucky_1",
{[1] = "default:diamond", [2] = "default:diamond",
[3] = "default:diamond", [4] = "default:diamond",
[5] = "default:" .. tool .. "_" .. material, [6] = "default:diamond",
[7] = "default:diamond", [8] = "default:diamond",
[9] = "default:diamond", ["time"] = 3, ["texture"] = "default_diamond.png"}
)
else
enhancing.add_craft("enhancing:" .. tool .. "_" .. material .. "_quick_" .. i,
{[1] = "default:obsidian_shard", [2] = "default:obsidian_shard",
[3] = "default:obsidian_shard", [4] = "default:obsidian_shard",
[5] = "enhancing:" .. tool .. "_" .. material .. "_quick_" .. (i-1), [6] = "default:obsidian_shard",
[7] = "default:obsidian_shard", [8] = "default:obsidian_shard",
[9] = "default:obsidian_shard", ["time"] = 3*i, ["texture"] = "default_obsidian_shard.png"}
)
enhancing.add_craft("enhancing:" .. tool .. "_" .. material .. "_durable_" .. i,
{[1] = "default:mese_crystal_fragment", [2] = "default:mese_crystal_fragment",
[3] = "default:mese_crystal_fragment", [4] = "default:mese_crystal_fragment",
[5] = "enhancing:" .. tool .. "_" .. material .. "_durable_" .. (i-1), [6] = "default:mese_crystal_fragment",
[7] = "default:mese_crystal_fragment", [8] = "default:mese_crystal_fragment",
[9] = "default:mese_crystal_fragment", ["time"] = 3*i, ["texture"] = "default_mese_crystal_fragment.png"}
)
enhancing.add_craft("enhancing:" .. tool .. "_" .. material .. "_lucky_" .. i,
{[1] = "default:diamond", [2] = "default:diamond",
[3] = "default:diamond", [4] = "default:diamond",
[5] = "enhancing:" .. tool .. "_" .. material .. "_lucky_" .. (i-1), [6] = "default:diamond",
[7] = "default:diamond", [8] = "default:diamond",
[9] = "default:diamond", ["time"] = 3*i, ["texture"] = "default_diamond.png"}
)
end
end
for i = 1, 5 do
--Wood stuff
minetest.register_tool("enhancing:pick_wood_quick_" .. i, {
description = "Wooden Pickaxe\n" .. minetest.colorize("purple", "Fast: Level " .. i),
inventory_image = "default_tool_woodpick.png^[colorize:purple:" .. (40+(i*15)),
tool_capabilities = {
full_punch_interval = 1.2,
max_drop_level=0,
groupcaps={
cracky = {times={[3]=1.60-(i*0.2)}, uses=10, maxlevel=1},
},
damage_groups = {fleshy=2},
},
})
minetest.register_tool("enhancing:pick_wood_durable_" .. i, {
description = "Wooden Pickaxe\n" .. minetest.colorize("yellow", "Durable: Level " .. i),
inventory_image = "default_tool_woodpick.png^[colorize:yellow:" .. (40+(i*15)),
tool_capabilities = {
full_punch_interval = 1.2,
max_drop_level=0,
groupcaps={
cracky = {times={[3]=1.60}, uses=10+(i*4), maxlevel=1},
},
damage_groups = {fleshy=2},
},
})
minetest.register_tool("enhancing:pick_wood_lucky_" .. i, {
description = "Wooden Pickaxe\n" .. minetest.colorize("cyan", "Lucky: Level " .. i),
inventory_image = "default_tool_woodpick.png^[colorize:cyan:" .. (40+(i*15)),
tool_capabilities = {
full_punch_interval = 1.2,
max_drop_level=0,
groupcaps={
cracky = {times={[3]=1.60}, uses=10, maxlevel=1},
},
damage_groups = {fleshy=2},
},
})
minetest.register_tool("enhancing:axe_wood_fast_" .. i, {
description = "Wooden Axe\n" .. minetest.colorize("purple", "Durable: Level " .. i),
inventory_image = "default_tool_woodaxe.png^[colorize:purple:" .. (40+(i*15)),
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=0,
groupcaps={
choppy = {times={[2]=3.00-(i*0.3), [3]=1.60-(i*0.13)}, uses=10, maxlevel=1},
},
damage_groups = {fleshy=2},
},
})
minetest.register_tool("enhancing:axe_wood_durable_" .. i, {
description = "Wooden Axe\n" .. minetest.colorize("yellow", "Durable: Level " .. i),
inventory_image = "default_tool_woodaxe.png^[colorize:yellow:" .. (40+(i*15)),
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=0,
groupcaps={
choppy = {times={[2]=3.00, [3]=1.60}, uses=10+(i*4), maxlevel=1},
},
damage_groups = {fleshy=2},
},
})
minetest.register_tool("enhancing:axe_wood_lucky_" .. i, {
description = "Wooden Axe\n" .. minetest.colorize("cyan", "Lucky: Level " .. i),
inventory_image = "default_tool_woodaxe.png^[colorize:cyan:" .. (40+(i*15)),
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=0,
groupcaps={
choppy = {times={[2]=3.00, [3]=1.60}, uses=10, maxlevel=1},
},
damage_groups = {fleshy=2},
},
})
minetest.register_tool("enhancing:shovel_wood_quick_" .. i, {
description = "Wooden Shovel\n" .. minetest.colorize("purple", "Durable: Level " .. i),
inventory_image = "default_tool_woodshovel.png^[colorize:purple:" .. (40+(i*15)),
wield_image = "default_tool_woodshovel.png^[transformR90^[colorize:purple:" .. (40+(i*15)),
tool_capabilities = {
full_punch_interval = 1.2,
max_drop_level=0,
groupcaps={
crumbly = {times={[1]=3.00-(i*0.315), [2]=1.60-(i*0.16), [3]=0.60-(i*0.03)}, uses=10, maxlevel=1},
},
damage_groups = {fleshy=2},
},
})
minetest.register_tool("enhancing:shovel_wood_durable_" .. i, {
description = "Wooden Shovel\n" .. minetest.colorize("yellow", "Durable: Level " .. i),
inventory_image = "default_tool_woodshovel.png^[colorize:yellow:" .. (40+(i*15)),
wield_image = "default_tool_woodshovel.png^[transformR90^[colorize:yellow:" .. (40+(i*15)),
tool_capabilities = {
full_punch_interval = 1.2,
max_drop_level=0,
groupcaps={
crumbly = {times={[1]=3.00, [2]=1.60, [3]=0.60}, uses=10+(i*4), maxlevel=1},
},
damage_groups = {fleshy=2},
},
})
--Stone stuff
minetest.register_tool("enhancing:pick_stone_quick_" .. i, {
description = "Stone Pickaxe\n" .. minetest.colorize("purple", "Fast: Level " .. i),
inventory_image = "default_tool_stonepick.png^[colorize:purple:" .. (40+(i*15)),
tool_capabilities = {
full_punch_interval = 1.3,
max_drop_level=0,
groupcaps={
cracky = {times={[2]=2.0-(i*0.2), [3]=1.00-(i*0.15)}, uses=20, maxlevel=1},
},
damage_groups = {fleshy=3},
},
})
minetest.register_tool("enhancing:pick_stone_durable_" .. i, {
description = "Stone Pickaxe\n" .. minetest.colorize("yellow", "Durable: Level " .. i),
inventory_image = "default_tool_stonepick.png^[colorize:yellow:" .. (40+(i*15)),
tool_capabilities = {
full_punch_interval = 1.3,
max_drop_level=0,
groupcaps={
cracky = {times={[2]=2.0, [3]=1.00}, uses=20+(i*4), maxlevel=1},
},
damage_groups = {fleshy=3},
},
})
minetest.register_tool("enhancing:pick_stone_lucky_" .. i, {
description = "Stone Pickaxe\n" .. minetest.colorize("cyan", "Lucky: Level " .. i),
inventory_image = "default_tool_stonepick.png^[colorize:cyan:" .. (40+(i*15)),
tool_capabilities = {
full_punch_interval = 1.3,
max_drop_level=0,
groupcaps={
cracky = {times={[2]=2.0, [3]=1.00}, uses=20, maxlevel=1},
},
damage_groups = {fleshy=3},
},
})
minetest.register_tool("enhancing:axe_stone_quick_" .. i, {
description = "Stone Axe\n" .. minetest.colorize("purple", "Fast: Level " .. i),
inventory_image = "default_tool_stoneaxe.png^[colorize:purple:" .. (40+(i*15)),
tool_capabilities = {
full_punch_interval = 1.2,
max_drop_level=0,
groupcaps={
choppy={times={[1]=3.00-(i*0.4), [2]=2.00-(i*0.29), [3]=1.30-(i*0.18)}, uses=20, maxlevel=1},
},
damage_groups = {fleshy=3},
},
})
minetest.register_tool("enhancing:axe_stone_durable_" .. i, {
description = "Stone Axe\n" .. minetest.colorize("yellow", "Durable: Level " .. i),
inventory_image = "default_tool_stoneaxe.png^[colorize:yellow:" .. (40+(i*15)),
tool_capabilities = {
full_punch_interval = 1.2,
max_drop_level=0,
groupcaps={
choppy={times={[1]=3.00, [2]=2.00, [3]=1.30}, uses=20+(i*4), maxlevel=1},
},
damage_groups = {fleshy=3},
},
})
minetest.register_tool("enhancing:axe_stone_lucky_" .. i, {
description = "Stone Axe\n" .. minetest.colorize("cyan", "Lucky: Level " .. i),
inventory_image = "default_tool_stoneaxe.png^[colorize:cyan:" .. (40+(i*15)),
tool_capabilities = {
full_punch_interval = 1.2,
max_drop_level=0,
groupcaps={
choppy={times={[1]=3.00, [2]=2.00, [3]=1.30}, uses=20, maxlevel=1},
},
damage_groups = {fleshy=3},
},
})
minetest.register_tool("enhancing:shovel_stone_quick_" .. i, {
description = "Stone Shovel\n" .. minetest.colorize("purple", "Fast: Level " .. i),
inventory_image = "default_tool_stoneshovel.png^[colorize:purple:" .. (40+(i*15)),
wield_image = "default_tool_stoneshovel.png^[transformR90^[colorize:purple:" .. (40+(i*15)),
tool_capabilities = {
full_punch_interval = 1.4,
max_drop_level=0,
groupcaps={
crumbly = {times={[1]=1.80-(i*0.23), [2]=1.20-(i*0.15), [3]=0.50-(i*0.07)}, uses=20, maxlevel=1},
},
damage_groups = {fleshy=2},
},
})
minetest.register_tool("enhancing:shovel_stone_durable_" .. i, {
description = "Stone Shovel\n" .. minetest.colorize("yellow", "Durable: Level " .. i),
inventory_image = "default_tool_stoneshovel.png^[colorize:yellow:" .. (40+(i*15)),
wield_image = "default_tool_stoneshovel.png^[transformR90^[colorize:yellow:" .. (40+(i*15)),
tool_capabilities = {
full_punch_interval = 1.4,
max_drop_level=0,
groupcaps={
crumbly = {times={[1]=1.80, [2]=1.20, [3]=0.50}, uses=20+(i*4), maxlevel=1},
},
damage_groups = {fleshy=2},
},
})
--Steel stuff
minetest.register_tool("enhancing:pick_steel_quick_" .. i, {
description = "Steel Pickaxe\n" .. minetest.colorize("purple", "Fast: Level " .. i),
inventory_image = "default_tool_steelpick.png^[colorize:purple:" .. (40+(i*15)),
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
cracky = {times={[1]=4-(i*0.37), [2]=1.60-(i*0.2), [3]=0.60-(i*0.065)}, uses=20, maxlevel=2},
},
damage_groups = {fleshy=4},
},
})
minetest.register_tool("enhancing:pick_steel_durable_" .. i, {
description = "Steel Pickaxe\n" .. minetest.colorize("yellow", "Durable: Level " .. i),
inventory_image = "default_tool_steelpick.png^[colorize:yellow:" .. (40+(i*15)),
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
cracky = {times={[1]=4, [2]=1.60, [3]=0.60}, uses=20+(i*4), maxlevel=2},
},
damage_groups = {fleshy=4},
},
})
minetest.register_tool("enhancing:pick_steel_lucky_" .. i, {
description = "Steel Pickaxe\n" .. minetest.colorize("cyan", "Lucky: Level " .. i),
inventory_image = "default_tool_steelpick.png^[colorize:cyan:" .. (40+(i*15)),
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
cracky = {times={[1]=4, [2]=1.60, [3]=0.60}, uses=20, maxlevel=2},
},
damage_groups = {fleshy=4},
},
})
minetest.register_tool("enhancing:axe_steel_quick_" .. i, {
description = "Steel Axe\n" .. minetest.colorize("purple", "Fast: Level " .. i),
inventory_image = "default_tool_steelaxe.png^[colorize:purple:" .. (40+(i*15)),
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
choppy={times={[1]=2.50-(i*0.25), [2]=1.40-(i*0.17), [3]=1.00-(i*0.15)}, uses=20, maxlevel=2},
},
damage_groups = {fleshy=4},
},
})
minetest.register_tool("enhancing:axe_steel_durable_" .. i, {
description = "Steel Axe\n" .. minetest.colorize("yellow", "Durable: Level " .. i),
inventory_image = "default_tool_steelaxe.png^[colorize:yellow:" .. (40+(i*15)),
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
choppy={times={[1]=2.50, [2]=1.40, [3]=1.00}, uses=20+(i*4), maxlevel=2},
},
damage_groups = {fleshy=4},
},
})
minetest.register_tool("enhancing:axe_steel_lucky_" .. i, {
description = "Steel Axe\n" .. minetest.colorize("cyan", "Lucky: Level " .. i),
inventory_image = "default_tool_steelaxe.png^[colorize:cyan:" .. (40+(i*15)),
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
choppy={times={[1]=2.50, [2]=1.40, [3]=1.00}, uses=20, maxlevel=2},
},
damage_groups = {fleshy=4},
},
})
minetest.register_tool("enhancing:shovel_steel_quick_" .. i, {
description = "Steel Shovel\n" .. minetest.colorize("purple", "Fast: Level " .. i),
inventory_image = "default_tool_steelshovel.png^[colorize:purple:" .. (40+(i*15)),
wield_image = "default_tool_steelshovel.png^[transformR90^[colorize:purple:" .. (40+(i*15)),
tool_capabilities = {
full_punch_interval = 1.1,
max_drop_level=1,
groupcaps={
crumbly = {times={[1]=1.50-(i*0.2), [2]=0.90-(i*0.1), [3]=0.40-(i*0.04)}, uses=30, maxlevel=2},
},
damage_groups = {fleshy=3},
},
})
minetest.register_tool("enhancing:shovel_steel_durable_" .. i, {
description = "Steel Shovel\n" .. minetest.colorize("yellow", "Durable: Level " .. i),
inventory_image = "default_tool_steelshovel.png^[colorize:yellow:" .. (40+(i*15)),
wield_image = "default_tool_steelshovel.png^[transformR90^[colorize:yellow:" .. (40+(i*15)),
tool_capabilities = {
full_punch_interval = 1.1,
max_drop_level=1,
groupcaps={
crumbly = {times={[1]=1.50, [2]=0.90, [3]=0.40}, uses=30+(i*4), maxlevel=2},
},
damage_groups = {fleshy=3},
},
})
--Mese stuff
minetest.register_tool("enhancing:pick_mese_quick_" .. i, {
description = "Mese Pickaxe\n" .. minetest.colorize("purple", "Fast: Level " .. i),
inventory_image = "default_tool_mesepick.png^[colorize:purple:" .. (40+(i*15)),
tool_capabilities = {
full_punch_interval = 0.9,
max_drop_level=3,
groupcaps={
cracky = {times={[1]=2.4-(i*0.3), [2]=1.2-(i*0.12), [3]=0.60-(i*0.075)}, uses=20, maxlevel=3},
},
damage_groups = {fleshy=5},
},
})
minetest.register_tool("enhancing:pick_mese_durable_" .. i, {
description = "Mese Pickaxe\n" .. minetest.colorize("yellow", "Durable: Level " .. i),
inventory_image = "default_tool_mesepick.png^[colorize:yellow:" .. (40+(i*15)),
tool_capabilities = {
full_punch_interval = 0.9,
max_drop_level=3,
groupcaps={
cracky = {times={[1]=2.4, [2]=1.2, [3]=0.01}, uses=20+(i*4), maxlevel=3},
},
damage_groups = {fleshy=5},
},
})
minetest.register_tool("enhancing:pick_mese_lucky_" .. i, {
description = "Mese Pickaxe\n" .. minetest.colorize("cyan", "Lucky: Level " .. i),
inventory_image = "default_tool_mesepick.png^[colorize:cyan:" .. (40+(i*15)),
tool_capabilities = {
full_punch_interval = 0.9,
max_drop_level=3,
groupcaps={
cracky = {times={[1]=2.4, [2]=1.2, [3]=0.60}, uses=20, maxlevel=3},
},
damage_groups = {fleshy=5},
},
})
minetest.register_tool("enhancing:axe_mese_quick_" .. i, {
description = "Mese Axe\n" .. minetest.colorize("purple", "Fast: Level " .. i),
inventory_image = "default_tool_meseaxe.png^[colorize:purple:" .. (40+(i*15)),
tool_capabilities = {
full_punch_interval = 0.9,
max_drop_level=1,
groupcaps={
choppy={times={[1]=2.20-(i*0.25), [2]=1.00-(i*0.12), [3]=0.60-(i*0.05)}, uses=20, maxlevel=3},
},
damage_groups = {fleshy=6},
},
})
minetest.register_tool("enhancing:axe_mese_durable_" .. i, {
description = "Mese Axe\n" .. minetest.colorize("yellow", "Durable: Level " .. i),
inventory_image = "default_tool_meseaxe.png^[colorize:yellow:" .. (40+(i*15)),
tool_capabilities = {
full_punch_interval = 0.9,
max_drop_level=1,
groupcaps={
choppy={times={[1]=2.20, [2]=1.00, [3]=0.60}, uses=20+(i*4), maxlevel=3},
},
damage_groups = {fleshy=6},
},
})
minetest.register_tool("enhancing:axe_mese_lucky_" .. i, {
description = "Mese Axe\n" .. minetest.colorize("cyan", "Lucky: Level " .. i),
inventory_image = "default_tool_meseaxe.png^[colorize:cyan:" .. (40+(i*15)),
tool_capabilities = {
full_punch_interval = 0.9,
max_drop_level=1,
groupcaps={
choppy={times={[1]=2.20, [2]=1.00, [3]=0.60}, uses=20, maxlevel=3},
},
damage_groups = {fleshy=6},
},
})
minetest.register_tool("enhancing:shovel_mese_quick_" .. i, {
description = "Mese Shovel\n" .. minetest.colorize("purple", "Fast: Level " .. i),
inventory_image = "default_tool_meseshovel.png^[colorize:purple:" .. (40+(i*15)),
wield_image = "default_tool_meseshovel.png^[transformR90^[colorize:purple:" .. (40+(i*15)),
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=3,
groupcaps={
crumbly = {times={[1]=1.20-(i*0.17), [2]=0.60-(i*0.07), [3]=0.30-(i*0.05)}, uses=20, maxlevel=3},
},
damage_groups = {fleshy=4},
},
})
minetest.register_tool("enhancing:shovel_mese_durable_" .. i, {
description = "Mese Shovel\n" .. minetest.colorize("yellow", "Durable: Level " .. i),
inventory_image = "default_tool_meseshovel.png^[colorize:yellow:" .. (40+(i*15)),
wield_image = "default_tool_meseshovel.png^[transformR90^[colorize:yellow:" .. (40+(i*15)),
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=3,
groupcaps={
crumbly = {times={[1]=1.20, [2]=0.60, [3]=0.30}, uses=20+(i*4), maxlevel=3},
},
damage_groups = {fleshy=4},
},
})
all_crafts("wood", i)
all_crafts("stone", i)
all_crafts("steel", i)
all_crafts("mese", i)
end

1
enhancing/depends.txt Normal file
View File

@ -0,0 +1 @@
default

267
enhancing/init.lua Normal file
View File

@ -0,0 +1,267 @@
enhancing = {}
enhancing.crafts = {}
--
-- Formspecs
--
local formspec = "size[8,8]"..
default.gui_bg..
default.gui_bg_img..
default.gui_slots..
"list[current_player;main;0,3.75;8,1;]"..
"list[current_player;main;0,5;8,3;8]"..
"list[context;enhance;2,0.25;3,3;]"..
"list[context;fuel;5,2.25;1,1;]"..
"image[5,0.25;1,1;gui_furnace_arrow_bg.png^[lowpart:0"..
":gui_furnace_arrow_fg.png]"..
"image[5,1.25;1,1;default_furnace_fire_bg.png^[lowpart:"..
"0:default_furnace_fire_fg.png]"
local function tablematch(t1, t2)
for i=1,9 do
if t1[i] ~= t2[i] then return false end
end
return true
end
local function check_craft(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local x = {}
local wear = 0
for i,v in pairs(inv:get_list("enhance")) do
local w = v:get_name()
if w ~= "" then
x[i] = w
if i == 5 then
wear = v:get_wear()
end
end
end
for i,v in pairs(enhancing.crafts) do
if tablematch(x, v) then
return true, i, v.time, v.texture, wear
end
end
return false
end
local function crafted(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
for i = 1,9 do
local c = inv:get_stack("enhance", i):get_count() - 1
local n = inv:get_stack("enhance", i):get_name()
inv:set_stack("enhance", i, n .. " " .. c)
end
end
local function can_dig(pos, player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
return inv:is_empty("enhance") and inv:is_empty("fuel")
end
function enhancing.add_craft(output, recipe)
local output_name = string.gsub(output, ":", "_", 1)
enhancing.crafts[output_name] = recipe
end
local function furnace_node_timer(pos, elapsed)
--
-- Inizialize metadata
--
local meta = minetest.get_meta(pos)
local fuel_time = meta:get_float("fuel_time") or 0
local src_time = meta:get_float("src_time") or 0
local fuel_totaltime = meta:get_float("fuel_totaltime") or 0
local inv = meta:get_inventory()
local enhance = inv:get_list("enhance")
local fuel = inv:get_list("fuel")
--
-- Cooking
--
-- Check if we have cookable content
local cookable, output, time, material, wear = check_craft(pos)
-- Check if we have enough fuel to burn
if fuel_time < fuel_totaltime then
-- The furnace is currently active and has enough fuel
fuel_time = fuel_time + 1
-- If there is a cookable item then check if it is ready yet
if cookable then
src_time = src_time + 1
if src_time >= time then
-- Place result in dst list if possible
local item = minetest.add_item({x=pos.x, y=pos.y+1, z=pos.z},
string.gsub(output, "_", ":", 1) .. " 1 " .. wear)
item:setvelocity({x=0, y=10, z=0})
minetest.add_particlespawner({
amount = 30,
time = 1,
minpos = {x=pos.x, y=pos.y+1, z=pos.z},
maxpos = {x=pos.x, y=pos.y+1, z=pos.z},
minvel = {x=-2, y=3, z=-2},
maxvel = {x=2, y=6, z=2},
minacc = {x=-1, y=2, z=-1},
maxacc = {x=1, y=4, z=1},
minexptime = 1,
maxexptime = 2,
minsize = 1,
maxsize = 2,
texture = material,
})
src_time = 0
crafted(pos)
end
end
else
-- Furnace ran out of fuel
if cookable then
-- We need to get new fuel
local fuel, afterfuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuel})
if fuel.time == 0 then
-- No valid fuel in fuel list
fuel_totaltime = 0
fuel_time = 0
src_time = 0
else
-- Take fuel from fuel list
inv:set_stack("fuel", 1, afterfuel.items[1])
fuel_totaltime = fuel.time
fuel_time = 0
end
else
-- We don't need to get new fuel since there is no cookable item
fuel_totaltime = 0
fuel_time = 0
src_time = 0
end
end
--
-- Update formspec, infotext and node
--
local item_state = ""
local fuel_state = "Empty"
local active = "inactive "
local result = false
local item_percent = 0
local new_formspec = formspec
if time then
item_percent = math.floor(src_time / time * 100)
end
if fuel_time <= fuel_totaltime and fuel_totaltime ~= 0 then
result = true
local fuel_percent = math.floor(fuel_time / fuel_totaltime * 100)
new_formspec = new_formspec ..
"image[5,0.25;1,1;gui_furnace_arrow_bg.png^[lowpart:"..
(item_percent)..":gui_furnace_arrow_fg.png]"..
"image[5,1.25;1,1;default_furnace_fire_bg.png^[lowpart:"..
(100-fuel_percent)..":default_furnace_fire_fg.png]"
else
local timer = minetest.get_node_timer(pos)
timer:stop()
end
--
-- Set meta values
--
meta:set_float("fuel_totaltime", fuel_totaltime)
meta:set_float("fuel_time", fuel_time)
meta:set_float("src_time", src_time)
meta:set_string("formspec", new_formspec)
--print(time, item_percent, src_time)
return result
end
--
-- Node definitions
--
minetest.register_node("enhancing:workshop", {
description = "Enhancment Workshop",
tiles = {
"enhancing_table_top.png",
"enhancing_table_bottom.png",
"enhancing_table_side.png",
"enhancing_table_side.png",
"enhancing_table_side.png",
"enhancing_table_front.png"
},
paramtype2 = "facedir",
groups = {cracky=2},
legacy_facedir_simple = true,
is_ground_content = false,
drawtype = "nodebox",
paramtype = "light",
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, 0.375, -0.375, 0.5, 0.5}, -- NodeBox1
{0.375, -0.5, 0.375, 0.5, 0.5, 0.5}, -- NodeBox2
{-0.5, -0.5, -0.5, -0.375, 0.5, -0.375}, -- NodeBox3
{0.375, -0.5, -0.5, 0.5, 0.5, -0.375}, -- NodeBox4
{-0.5, 0.25, -0.5, 0.5, 0.5, 0.5}, -- NodeBox5
{-0.25, -0.5, -0.25, 0.25, 0.25, 0.25}, -- NodeBox6
}
},
can_dig = can_dig,
on_timer = furnace_node_timer,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
inv:set_size("enhance", 9)
inv:set_size("fuel", 1)
meta:set_string("infotext", "Enhancment Workshop")
meta:set_string("formspec", formspec)
end,
on_metadata_inventory_move = function(pos)
local timer = minetest.get_node_timer(pos)
timer:start(1.0)
end,
on_metadata_inventory_put = function(pos)
-- start timer function, it will sort out whether furnace can burn or not.
local timer = minetest.get_node_timer(pos)
timer:start(1.0)
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
if listname == "fuel" then
if minetest.get_craft_result({method="fuel", width=1, items={stack}}).time ~= 0 then
return stack:get_count()
else
return 0
end
else
return stack:get_count()
end
end,
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if to_list == "fuel" then
if minetest.get_craft_result({method="fuel", width=1,
items={inv:get_stack(from_list, from_index)}}).time ~= 0 then
return count
else
return 0
end
else
return count
end
end,
})
dofile(minetest.get_modpath("enhancing") .. "/defs.lua")
dofile(minetest.get_modpath("enhancing") .. "/overides.lua")

10
enhancing/license.txt Normal file
View File

@ -0,0 +1,10 @@
All Code: MIT
Copyright (c) 2016 Amaz
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Textures: CC BY-SA 3.0

70
enhancing/overides.lua Normal file
View File

@ -0,0 +1,70 @@
local old_handle_node_drops = minetest.handle_node_drops
function minetest.handle_node_drops(pos, drops, digger)
local item = digger:get_wielded_item():get_name()
-- are we holding Lava Pick?
if (item:sub(1, 13) .. item:sub(-8, -2)) ~= "enhancing:axe_lucky_" then
print(":")
return old_handle_node_drops(pos, drops, digger)
end
-- reset new smelted drops
local new_drops = {}
-- loop through current node drops
for _, drop in pairs(drops) do
-- get cooked output of current drops
local stack = ItemStack(drop)
if stack:get_name():find("tree") then
local output = minetest.get_craft_result({
method = "normal",
width = 3,
items = {drop}
})
-- if we have cooked result then add to new list
if output
and output.item
and not output.item:is_empty() then
table.insert(new_drops,
ItemStack({
name = output.item:get_name(),
count = output.item:to_table().count + math.random(0, math.ceil(tonumber(item:sub(-1)*1.5))),
})
)
else -- if not then return normal drops
table.insert(hot_drops, stack)
end
else
print(":(")
end
end
return old_handle_node_drops(pos, new_drops, digger)
end
local pick_drops = {
"default:stone_with_gold",
"default:stone_with_coal",
"default:stone_with_iron",
"default:stone_with_mese",
"default:stone_with_diamond",
}
for _, v in pairs(pick_drops) do
minetest.override_item(v, {
after_dig_node = function(pos, oldnode, oldmetadata, digger)
local pick = digger:get_wielded_item():get_name()
local inv = digger:get_inventory()
if (pick:sub(1, 14) .. pick:sub(-8, -2)) ~= "enhancing:pick_lucky_" then
print(":(")
return
end
local drops = minetest.get_node_drops(v, digger:get_wielded_item())
if inv:room_for_item("main", drops[1]) then
inv:add_item("main", drops[1] .. " " .. math.random(0, tonumber(pick:sub(-1))))
end
end
})
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 727 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 663 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 548 B

View File

@ -0,0 +1,34 @@
asteroid lvm/pm version 0.4.4 by paramat
For latest stable Minetest back to 0.4.8
Depends default
Licenses: code WTFPL, textures CC BY-SA
For use as a stacked realm in v6, indev or v7 mapgen
A realm of asteroids and comets is created in the volume chosen by parameters.
2 perlin noises of differing scales create interpenetrating large and small structures.
Asteroids have muliple layers, outer to inner: dust, gravel, cobble and stone with ores.
Asteroid stone is rich in iron, mese crystal, copper, gold and diamond.
By crafting, stone can be broken down into cobble, cobble into gravel and gravel into dust.
Asteroid stone can be crafted to bricks, stairs or slabs.
Comets have layers of snow and ice blended with asteroid structure depending on depth below surface.
Comets are surrounded by a misty atmosphere of water vapour which hides the nucleus from view.
The atmosphere has a smoother shape than the comet it surrounds.
Comet ice and snow can be crafted to default:water_source.
Both have weblike 'fissure' cave systems.
Craters have obsidian buried under the dust, formed by impact energy.
Crafting
--------
asteroid:stonebrick x 4
SS
SS
asteroid:stonebrickslab x 4
SS
S = asteroid:stone

View File

@ -0,0 +1,2 @@
default
stairs

296
realms/asteroid/init.lua Normal file
View File

@ -0,0 +1,296 @@
-- asteroid lvm/pm version 0.4.4 by paramat
-- For latest stable Minetest back to 0.4.8
-- Depends default
-- Licenses: code WTFPL, textures CC BY SA
-- For use as a stacked realm in v6, indev or v7 mapgen
-- TODO
-- Glass from dust, mese powered furnace?
-- Hydroponics in dust, nutrient liquid from leaves and water ice
-- Variables
local YMIN = 14000 -- Approximate realm limits.
local YMAX = 16000
local XMIN = -33000
local XMAX = 33000
local ZMIN = -33000
local ZMAX = 33000
local ASCOT = 1.0 -- -- Large asteroid / comet nucleus noise threshold.
local SASCOT = 1.0 -- -- Small asteroid / comet nucleus noise threshold.
local STOT = 0.125 -- -- Asteroid stone threshold.
local COBT = 0.05 -- -- Asteroid cobble threshold.
local GRAT = 0.02 -- -- Asteroid gravel threshold.
local ICET = 0.05 -- -- Comet ice threshold.
local ATMOT = -0.2 -- -- Comet atmosphere threshold.
local FISTS = 0.01 -- 0.01 -- Fissure noise threshold at surface. Controls size of fissures and amount / size of fissure entrances at surface.
local FISEXP = 0.3 -- 0.3 -- Fissure expansion rate under surface.
local ORECHA = 3*3*3 -- -- Ore 1/x chance per stone node (iron, mese ore, copper, gold, diamond).
local METBCHA = 1 / 16 ^ 3
local METCCHA = 1 / 5 ^ 3
local CPCHU = 0 -- Maximum craters per chunk.
local CRMIN = 5 -- Crater radius minimum, radius includes dust and obsidian layers.
local CRRAN = 8 -- Crater radius range.
-- 3D Perlin noise 1 for large structures
local np_large = {
offset = 0,
scale = 1,
spread = {x=256, y=128, z=256},
seed = -83928935,
octaves = 5,
persist = 0.6
}
-- 3D Perlin noise 3 for fissures
local np_fissure = {
offset = 0,
scale = 1,
spread = {x=64, y=64, z=64},
seed = -188881,
octaves = 4,
persist = 0.5
}
-- 3D Perlin noise 4 for small structures
local np_small = {
offset = 0,
scale = 1,
spread = {x=128, y=64, z=128},
seed = 1000760700090,
octaves = 4,
persist = 0.6
}
-- 3D Perlin noise 5 for ore selection
local np_ores = {
offset = 0,
scale = 1,
spread = {x=128, y=128, z=128},
seed = -70242,
octaves = 1,
persist = 0.5
}
-- 3D Perlin noise 6 for comet atmosphere
local np_latmos = {
offset = 0,
scale = 1,
spread = {x=256, y=128, z=256},
seed = -83928935,
octaves = 3,
persist = 0.6
}
-- 3D Perlin noise 7 for small comet atmosphere
local np_satmos = {
offset = 0,
scale = 1,
spread = {x=128, y=64, z=128},
seed = 1000760700090,
octaves = 2,
persist = 0.6
}
-- Stuff
asteroid = {}
dofile(minetest.get_modpath("asteroid").."/nodes.lua")
-- On dignode function. Atmosphere flows into a dug hole.
minetest.register_on_dignode(function(pos, oldnode, digger)
local x = pos.x
local y = pos.y
local z = pos.z
if y > YMIN and y < YMAX then
for i = -1,1 do
for j = -1,1 do
for k = -1,1 do
if not (i == 0 and j == 0 and k == 0) then
local nodename = minetest.get_node({x=x+i,y=y+j,z=z+k}).name
if nodename == "asteroid:atmos" then
minetest.add_node({x=x,y=y,z=z},{name="asteroid:atmos"})
return
end
end
end
end
end
end
end)
-- On generated function
minetest.register_on_generated(function(minp, maxp, seed)
if minp.x < XMIN or maxp.x > XMAX
or minp.y < YMIN or maxp.y > YMAX
or minp.z < ZMIN or maxp.z > ZMAX 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 sidelen = x1 - x0 + 1 -- chunk side length
--local vplanarea = sidelen ^ 2 -- vertical plane area, used if calculating noise index from x y z
local chulens = {x=sidelen, y=sidelen, z=sidelen}
local minpos = {x=x0, y=y0, z=z0}
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_obsidian = minetest.get_content_id("default:obsidian")
local c_stone = minetest.get_content_id("asteroid:stone")
local c_cobble = minetest.get_content_id("asteroid:cobble")
local c_gravel = minetest.get_content_id("asteroid:gravel")
local c_dust = minetest.get_content_id("asteroid:dust")
local c_ironore = minetest.get_content_id("asteroid:ironore")
local c_copperore = minetest.get_content_id("asteroid:copperore")
local c_waterice = minetest.get_content_id("default:ice")
local c_atmos = minetest.get_content_id("asteroid:atmos")
local c_snowblock = minetest.get_content_id("default:snowblock")
local c_metchunk = minetest.get_content_id("asteroid:meteorite_chunks_ore")
local c_metblock = minetest.get_content_id("asteroid:meteorite_block")
local nvals1 = minetest.get_perlin_map(np_large, chulens):get3dMap_flat(minpos)
local nvals3 = minetest.get_perlin_map(np_fissure, chulens):get3dMap_flat(minpos)
local nvals4 = minetest.get_perlin_map(np_small, chulens):get3dMap_flat(minpos)
local nvals5 = minetest.get_perlin_map(np_ores, chulens):get3dMap_flat(minpos)
local nvals6 = minetest.get_perlin_map(np_latmos, chulens):get3dMap_flat(minpos)
local nvals7 = minetest.get_perlin_map(np_satmos, chulens):get3dMap_flat(minpos)
local ni = 1
for z = z0, z1 do -- for each vertical plane do
for y = y0, y1 do -- for each horizontal row do
local vi = area:index(x0, y, z) -- LVM index for first node in x row
for x = x0, x1 do -- for each node do
local noise1abs = math.abs(nvals1[ni])
local noise4abs = math.abs(nvals4[ni])
local comet = false
if nvals6[ni] < -(ASCOT + ATMOT) or (nvals7[ni] < -(SASCOT + ATMOT) and nvals1[ni] < ASCOT) then
comet = true -- comet biome
end
if noise1abs > ASCOT or noise4abs > SASCOT then -- if below surface then
local noise1dep = noise1abs - ASCOT -- noise1dep zero at surface, positive beneath
if math.abs(nvals3[ni]) > FISTS + noise1dep * FISEXP then -- if no fissure then
local noise4dep = noise4abs - SASCOT -- noise4dep zero at surface, positive beneath
if not comet or (comet and (noise1dep > math.random() + ICET or noise4dep > math.random() + ICET)) then
-- asteroid or asteroid materials in comet
if noise1dep >= STOT or noise4dep >= STOT then
-- stone/ores
if math.random(ORECHA) == 2 then
if nvals5[ni] < -0.2 then
data[vi] = c_copperore
else
data[vi] = c_ironore
end
elseif math.random() < METBCHA then
data[vi] = c_metblock
elseif math.random() < METCCHA then
data[vi] = c_metchunk
else
data[vi] = c_stone
end
elseif noise1dep >= COBT or noise4dep >= COBT then
data[vi] = c_cobble
elseif noise1dep >= GRAT or noise4dep >= GRAT then
data[vi] = c_gravel
else
data[vi] = c_dust
end
else -- comet materials
if noise1dep >= ICET or noise4dep >= ICET then
data[vi] = c_waterice
else
data[vi] = c_snowblock
end
end
elseif comet then -- fissures, if comet then add comet atmosphere
data[vi] = c_atmos
end
elseif comet then -- if comet atmosphere then
data[vi] = c_atmos
end
ni = ni + 1
vi = vi + 1
end
end
end
-- craters
for ci = 1, CPCHU do -- iterate
local cr = CRMIN + math.floor(math.random() ^ 2 * CRRAN) -- exponential radius
local cx = math.random(minp.x + cr, maxp.x - cr) -- centre x
local cz = math.random(minp.z + cr, maxp.z - cr) -- centre z
local comet = false
local surfy = false
for y = y1, y0 + cr, -1 do
local vi = area:index(cx, y, cz) -- LVM index for node
local nodeid = data[vi]
if nodeid == c_dust
or nodeid == c_gravel
or nodeid == c_cobble then
surfy = y
break
elseif nodename == c_snowblock
or nodename == c_waterice then
comet = true
surfy = y
break
end
end
if surfy and y1 - surfy > 8 then -- if surface found and 8 node space above impact node then
for x = cx - cr, cx + cr do -- for each plane do
for z = cz - cr, cz + cr do -- for each column do
for y = surfy - cr, surfy + cr do -- for each node do
local vi = area:index(x, y, z) -- LVM index for node
local nr = ((x - cx) ^ 2 + (y - surfy) ^ 2 + (z - cz) ^ 2) ^ 0.5
if nr <= cr - 2 then
if comet then
data[vi] = c_atmos
else
data[vi] = c_air
end
elseif nr <= cr - 1 then
local nodeid = data[vi]
if nodeid == c_gravel
or nodeid == c_cobble
or nodeid == c_stone
or nodeid == c_diamondore
or nodeid == c_goldore
or nodeid == c_meseore
or nodeid == c_copperore
or nodeid == c_ironore then
data[vi] = c_dust
end
elseif nr <= cr then
local nodeid = data[vi]
if nodeid == c_cobble
or nodeid == c_stone then
data[vi] = c_obsidian -- obsidian buried under dust
end
end
end
end
end
end
end
vm:set_data(data)
vm:set_lighting({day=0, night=0})
vm:calc_lighting()
vm:write_to_map(data)
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.

128
realms/asteroid/nodes.lua Normal file
View File

@ -0,0 +1,128 @@
-- Nodes
minetest.register_node("asteroid:stone", {
description = "Asteroid Stone",
tiles = {"asteroid_stone.png"},
groups = {cracky=3},
drop = "asteroid:cobble",
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("asteroid:cobble", {
description = "Asteroid Cobble",
tiles = {"asteroid_cobble.png"},
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("asteroid:gravel", {
description = "Asteroid Gravel",
tiles = {"default_gravel.png"},
groups = {crumbly=2, not_in_creative_inventory=1},
drop = "default:gravel",
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_gravel_footstep", gain=0.2},
}),
})
minetest.register_node("asteroid:dust", {
description = "Asteroid Dust",
tiles = {"asteroid_dust.png"},
groups = {crumbly=3},
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_gravel_footstep", gain=0.1},
}),
})
minetest.register_node("asteroid:ironore", {
description = "Asteroid Iron Ore",
tiles = {"asteroid_stone.png^default_mineral_iron.png"},
groups = {cracky=2, not_in_creative_inventory=1},
drop = "default:iron_lump",
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("asteroid:copperore", {
description = "Asteroid Copper Ore",
tiles = {"asteroid_stone.png^default_mineral_copper.png"},
groups = {cracky=2, not_in_creative_inventory=1},
drop = "default:copper_lump",
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("asteroid:atmos", {
description = "Asteroid Atmosphere",
drawtype = "glasslike",
tiles = {"asteroid_atmos.png"},
alpha = 0, -- disable this line for opaque atmosphere and higher FPS
paramtype = "light",
sunlight_propagates = true,
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
post_effect_color = {a=23, r=241, g=248, b=255},
groups = {not_in_creative_inventory=1},
})
minetest.register_node("asteroid:stonebrick", {
description = "Asteriod Stone Brick",
tiles = {"asteroid_stonebricktop.png", "asteroid_stonebrickbot.png", "asteroid_stonebrick.png"},
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("asteroid:meteorite_chunks_ore", {
description = "Meteorite Chunks (Ore)",
tiles = {"asteroid_stone.png^asteroid_meteorite_chunks.png"},
groups = {cracky=3},
drop = "asteroid:meteorite_chunk",
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("asteroid:meteorite_chunk", {
description = "Meteorite Chunk",
tiles = {"asteroid_stone.png^asteroid_meteorite_chunks.png"},
groups = {cracky=3},
drop = "asteroid:meteorite_chunk",
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("asteroid:meteorite_block", {
description = "Meteorite Block",
tiles = {"asteroid_meteorite_block.png"},
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
stairs.register_stair_and_slab("asteroid_stone", "asteroid:stone",
{cracky=3},
{"asteroid_stone.png"},
"Asteroid Stone Stair",
"Asteroid Stone Slab",
default.node_sound_stone_defaults()
)
stairs.register_stair_and_slab("asteroid_stonebrick", "asteroid:stonebrick",
{cracky=3},
{"asteroid_stonebricktop.png", "asteroid_stonebrickbot.png", "asteroid_stonebrick.png"},
"Asteroid Stone Brick Stair",
"Asteroid Stone Brick Slab",
default.node_sound_stone_defaults()
)
-- Crafting
minetest.register_craft({
type = "cooking",
output = "asteroid:stone",
recipe = "asteroid:cobble",
})
minetest.register_craft({
output = "asteroid:stonebrick 4",
recipe = {
{"asteroid:stone", "asteroid:stone"},
{"asteroid:stone", "asteroid:stone"},
}
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 660 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 672 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 752 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 560 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 514 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B

1
realms/flexrealm Submodule

@ -0,0 +1 @@
Subproject commit 5c2844a8ac51d2582279a943346aa32edf586937

View File

@ -0,0 +1,4 @@
floatindev 0.3.1 by paramat
For latest stable Minetest back to 0.4.8
Depends default
Licenses: code WTFPL

View File

@ -0,0 +1,2 @@
default
glowtest

View File

@ -0,0 +1,94 @@
function glowtest_crystals(data, colour, vi)
local c_crystal_1 = minetest.get_content_id("glowtest:" .. colour .. "_crystal_1")
local c_crystal_2 = minetest.get_content_id("glowtest:" .. colour .. "_crystal_2")
local c_crystal_3 = minetest.get_content_id("glowtest:" .. colour .. "_crystal_3")
local c_crystal_4 = minetest.get_content_id("glowtest:" .. colour .. "_crystal_4")
local c_crystal_5 = minetest.get_content_id("glowtest:" .. colour .. "_crystal_5")
local c_crystal_6 = minetest.get_content_id("glowtest:" .. colour .. "_crystal_6")
local rand = math.random(6)
if rand == 1 then
data[vi] = c_crystal_1
elseif rand == 2 then
data[vi] = c_crystal_2
elseif rand == 3 then
data[vi] = c_crystal_3
elseif rand == 4 then
data[vi] = c_crystal_4
elseif rand == 5 then
data[vi] = c_crystal_5
else
data[vi] = c_crystal_6
end
end
function add_leaf(x, y, z, area, data, colour)
local c_tree = minetest.get_content_id("glowtest:tree")
local c_leaves = minetest.get_content_id("glowtest:" .. colour .. "leaf")
for i = math.floor(math.random(2)), -math.floor(math.random(2)), -1 do
for k = math.floor(math.random(2)), -math.floor(math.random(2)), -1 do
local vit = area:index(x,y,z)
data[vit] = c_tree
local vil = area:index(x+i, y, z+k)
data[vil] = c_leaves
local chance = math.abs(i+k)
if (chance < 1) then
local vila = area:index(x+i, y+1, z+k)
data[vila] = c_leaves
end
end
end
end
function glowtest_bigtree(x, y, z, area, data, colour)
local height = 15
local root_height = 3
local c_tree = minetest.get_content_id("glowtest:tree")
local c_leaves = minetest.get_content_id("glowtest:" .. colour .. "leaf")
add_leaf(x, y+height, z+3, area, data, colour)
add_leaf(x+3, y+height, z+1, area, data, colour)
add_leaf(x+1, y+height, z-2, area, data, colour)
add_leaf(x-2, y+height, z, area, data, colour)
add_leaf(x, y+height, z+2, area, data, colour)
add_leaf(x+2, y+height, z+1, area, data, colour)
add_leaf(x+1, y+height, z-1, area, data, colour)
add_leaf(x-1, y+height, z, area, data, colour)
add_leaf(x, y+height-5, z, area, data, colour)
for j = -1, height do
local vit = area:index(x , y + j, z)
data[vit] = c_tree
local vit = area:index(x+1 , y + j, z)
data[vit] = c_tree
local vit = area:index(x , y + j, z+1)
data[vit] = c_tree
local vit = area:index(x+1 , y + j, z+1)
data[vit] = c_tree
local vit = area:index(x, y+height, z+3)
data[vit] = c_tree
local vit = area:index(x+3, y+height, z+1)
data[vit] = c_tree
local vit = area:index(x+1, y+height, z-2)
data[vit] = c_tree
local vit = area:index(x-2, y+height, z)
data[vit] = c_tree
local vit = area:index(x, y+height, z+2)
data[vit] = c_tree
local vit = area:index(x+2, y+height, z+1)
data[vit] = c_tree
local vit = area:index(x+1, y+height, z-1)
data[vit] = c_tree
local vit = area:index(x-1, y+height, z)
data[vit] = c_tree
end
for j = -1, root_height do
local vit = area:index(x , y + j , z+2)
data[vit] = c_tree
local vit = area:index(x+2 , y + j , z+1)
data[vit] = c_tree
local vit = area:index(x+1 , y + j , z-1)
data[vit] = c_tree
local vit = area:index(x-1 , y + j , z)
data[vit] = c_tree
end
end

315
realms/floatindev/init.lua Normal file
View File

@ -0,0 +1,315 @@
-- floatindev 0.3.1 by paramat
-- For latest stable Minetest and back to 0.4.8
-- Depends default
-- License: code WTFPL
-- use voxelmanip for scanning chunk below
-- use sidelen, works with any chunksize
-- Parameters
dofile(minetest.get_modpath("floatindev").."/functions.lua")
local YMIN = 11000 -- Approximate realm limits
local YMAX = 12000
local XMIN = -33000
local XMAX = 33000
local ZMIN = -33000
local ZMAX = 33000
local CHUINT = 8 -- Chunk interval for floatland layers
local WAVAMP = 48 -- Structure wave amplitude
local HISCAL = 96 -- Upper structure vertical scale
local LOSCAL = 96 -- Lower structure vertical scale
local HIEXP = 0.33 -- Upper structure density gradient exponent
local LOEXP = 0.33 -- Lower structure density gradient exponent
local CLUSAV = 0 -- Large scale variation average
local CLUSAM = 0 -- Large scale variation amplitude
local TSTONE = 0.1 -- Stone density threshold
local TTUN = 0.03 -- Tunnel width
local TVOID = 0.6 -- Void threshold
local FLOCHA = 1 / 17 ^ 3 -- Floc chance per stone node
-- 3D noise for floatlands
local np_float = {
offset = 0,
scale = 1,
spread = {x=384, y=192, z=384},
seed = 277777979,
octaves = 5,
persist = 0.67
}
-- 3D noises for tunnels
local np_weba = {
offset = 0,
scale = 1,
spread = {x=128, y=128, z=128},
seed = -89000,
octaves = 3,
persist = 0.5
}
local np_webb = {
offset = 0,
scale = 1,
spread = {x=127, y=127, z=127},
seed = 85911,
octaves = 3,
persist = 0.5
}
-- 3D noise for large scale floatland size/density variation
local np_cluster = {
offset = 0,
scale = 1,
spread = {x=2048, y=2048, z=2048},
seed = 23,
octaves = 1,
persist = 0.5
}
--Biomes
local np_biome = {
offset = 0,
scale = 1,
spread = {x=512, y=512, z=512},
seed = -188900,
octaves = 3,
persist = 0.4
}
-- 3D noise for wave
local np_wave = {
offset = 0,
scale = 1,
spread = {x=512, y=512, z=512},
seed = -4000000089,
octaves = 3,
persist = 0.4
}
-- Stuff
floatindev = {}
-- Nodes
minetest.register_node("floatindev:floatstone", {
description = "Floatstone",
tiles = {"floatindev_floatstone.png"},
is_ground_content = false, -- stops cavegen removing this node
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("floatindev:floatsand", {
description = "Floatsand",
tiles = {"floatindev_floatsand.png"},
is_ground_content = false,
light_source = 1,
groups = {crumbly=3, falling_node=1, sand=1},
sounds = default.node_sound_sand_defaults(),
})
minetest.register_node("floatindev:yellow_floatsand", {
description = "Yellow Floatsand",
tiles = {"floatindev_yellow_floatsand.png"}, --^[colorize:#00b1b795"
is_ground_content = false,
light_source = 1,
groups = {crumbly=3, falling_node=1, sand=1},
sounds = default.node_sound_sand_defaults(),
})
minetest.register_node("floatindev:purple_floatsand", {
description = "Purple Floatsand",
tiles = {"floatindev_purple_floatsand.png"}, --^[colorize:#00b1b795"
is_ground_content = false,
light_source = 1,
groups = {crumbly=3, falling_node=1, sand=1},
sounds = default.node_sound_sand_defaults(),
})
minetest.register_node("floatindev:floc", {
description = "Float crystal block",
tiles = {"floatindev_floc.png"},
is_ground_content = false,
groups = {cracky=1},
sounds = default.node_sound_stone_defaults(),
})
-- On generated function
minetest.register_on_generated(function(minp, maxp, seed)
if minp.x < XMIN or maxp.x > XMAX
or minp.y < YMIN or maxp.y > YMAX
or minp.z < ZMIN or maxp.z > ZMAX 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_floatstone = minetest.get_content_id("floatindev:floatstone")
local c_floatsand = minetest.get_content_id("floatindev:floatsand")
local c_yfloatsand = minetest.get_content_id("floatindev:yellow_floatsand")
local c_pfloatsand = minetest.get_content_id("floatindev:purple_floatsand")
local c_floc = minetest.get_content_id("floatindev:floc")
local sidelen = x1 - x0 + 1
local chulens = {x=sidelen, y=sidelen, z=sidelen}
local minposxyz = {x=x0, y=y0, z=z0}
local nvals_float = minetest.get_perlin_map(np_float, chulens):get3dMap_flat(minposxyz)
local nvals_weba = minetest.get_perlin_map(np_weba, chulens):get3dMap_flat(minposxyz)
local nvals_webb = minetest.get_perlin_map(np_webb, chulens):get3dMap_flat(minposxyz)
local nvals_cluster = minetest.get_perlin_map(np_cluster, chulens):get3dMap_flat(minposxyz)
local nvals_biome = minetest.get_perlin_map(np_biome, chulens):get3dMap_flat(minposxyz)
local nvals_wave = minetest.get_perlin_map(np_wave, chulens):get3dMap_flat(minposxyz)
local chulay = math.floor((minp.y + 32) / 80) -- chunk layer number, 0 = surface chunk
local tercen = (math.floor(chulay / CHUINT) * CHUINT + CHUINT / 2) * 80 - 32 -- terrain centre of this layer
local nixyz = 1
local nixz = 1
local stable = {}
local under = {}
for z = z0, z1 do -- for each xy plane progressing northwards
local viu = area:index(x0, y0-1, z) -- initialise stability table
for x = x0, x1 do
local si = x - x0 + 1
local nodidu = data[viu]
if nodidu == c_air
or nodidu == c_water then
stable[si] = 0
else -- all else including ignore in ungenerated chunks
stable[si] = 2
end
under[si] = 0
viu = viu + 1
end
for y = y0, y1 do -- for each x row progressing upwards
local vi = area:index(x0, y, z)
for x = x0, x1 do -- for each node do
local si = x - x0 + 1
local flomid = tercen + nvals_wave[nixyz] * WAVAMP -- y of floatland middle
local grad -- density for node
if y > flomid then
grad = ((y - flomid) / HISCAL) ^ HIEXP
else
grad = ((flomid - y) / LOSCAL) ^ LOEXP
end
local density = nvals_float[nixyz] - grad + CLUSAV + nvals_cluster[nixyz] * CLUSAM
local n_biome = nvals_biome[nixyz]
local biome = false
if n_biome > 0.4 + (math.random() - 0.5) * 0.02 then
biome = 3 -- desert
elseif n_biome < -0.4 + (math.random() - 0.5) * 0.02 then
biome = 1 -- tundra
else
biome = 2 -- forest / grassland
end
local weba = math.abs(nvals_weba[nixyz]) < TTUN -- check for tunnel
local webb = math.abs(nvals_webb[nixyz]) < TTUN
local notun = not (weba and webb)
if density > 0 and density < TVOID and notun then -- if floatland shell
if y > flomid and density < TSTONE and stable[si] >= 2 then
if biome == 1 then
data[vi] = c_floatsand -- sand
under[si] = 1
elseif biome == 2 then
data[vi] = c_yfloatsand
under[si] = 2
else
data[vi] = c_pfloatsand
under[si] = 3
end
else
if math.random() < FLOCHA then
data[vi] = c_floc -- floc
else
data[vi] = c_floatstone -- stone
end
stable[si] = stable[si] + 1
end
elseif density < 0 and under[si] ~= 0 then
if under[si] == 1 then
if math.random(1, 500) == 1 then
glowtest_crystals(data, "green", vi)
elseif math.random(1, 500) == 1 then
glowtest_crystals(data, "blue", vi)
elseif math.random(1, 1000) == 1 then
glowtest_sgreentree(x, y, z, area, data)
elseif math.random(1, 1000) == 1 then
glowtest_sbluetree(x, y, z, area, data)
elseif math.random(1, 10000) == 1 then
glowtest_bigtree(x, y, z, area, data, "green")
elseif math.random(1, 10000) == 1 then
glowtest_bigtree(x, y, z, area, data, "blue")
end
elseif under[si] == 2 then
if math.random(1, 500) == 1 then
glowtest_crystals(data, "red", vi)
elseif math.random(1, 500) == 1 then
glowtest_crystals(data, "yellow", vi)
elseif math.random(1, 1000) == 1 then
glowtest_sredtree(x, y, z, area, data)
elseif math.random(1, 1000) == 1 then
glowtest_syellowtree(x, y, z, area, data)
elseif math.random(1, 10000) == 1 then
glowtest_bigtree(x, y, z, area, data, "red")
elseif math.random(1, 10000) == 1 then
glowtest_bigtree(x, y, z, area, data, "yellow")
end
elseif under[si] == 3 then
if math.random(1, 500) == 1 then
glowtest_crystals(data, "pink", vi)
elseif math.random(1, 1000) == 1 then
glowtest_spinktree(x, y, z, area, data)
elseif math.random(1, 10000) == 1 then
glowtest_bigtree(x, y, z, area, data, "pink")
end
end
stable[si] = 0
under[si] = 0
else -- air
stable[si] = 0
under[si] = 0
end
nixyz = nixyz + 1
nixz = nixz + 1
vi = vi + 1
end
nixz = nixz - sidelen
end
nixz = nixz + sidelen
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)
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: 723 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 541 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 606 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 612 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 567 B

View File

@ -0,0 +1,4 @@
fracture 0.2.1 by paramat
For latest stable Minetest back to 0.4.8
Depends default
Licenses: code WTFPL

View File

@ -0,0 +1,2 @@
default
glowtest

View File

@ -0,0 +1,197 @@
function fracture_appletree(x, y, z, area, data)
local c_tree = minetest.get_content_id("default:tree")
local c_apple = minetest.get_content_id("default:apple")
local c_appleaf = minetest.get_content_id("fracture:appleleaf")
for j = -2, 4 do
if j == 3 or j == 4 then
for i = -2, 2 do
for k = -2, 2 do
local vi = area:index(x + i, y + j, z + k)
if math.random(64) == 2 then
data[vi] = c_apple
elseif math.random(5) ~= 2 then
data[vi] = c_appleaf
end
end
end
elseif j == 2 then
for i = -1, 1 do
for k = -1, 1 do
if math.abs(i) + math.abs(k) == 2 then
local vi = area:index(x + i, y + j, z + k)
data[vi] = c_tree
end
end
end
else
local vi = area:index(x, y + j, z)
data[vi] = c_tree
end
end
end
function fracture_cactus(x, y, z, area, data)
local c_cactus = minetest.get_content_id("fracture:cactus")
for j = -2, 4 do
for i = -2, 2 do
if i == 0 or j == 2 or (j == 3 and math.abs(i) == 2) then
local vi = area:index(x + i, y + j, z)
data[vi] = c_cactus
end
end
end
end
function fracture_flower(data, vi)
local c_danwhi = minetest.get_content_id("flowers:dandelion_white")
local c_danyel = minetest.get_content_id("flowers:dandelion_yellow")
local c_rose = minetest.get_content_id("flowers:rose")
local c_tulip = minetest.get_content_id("flowers:tulip")
local c_geranium = minetest.get_content_id("flowers:geranium")
local c_viola = minetest.get_content_id("flowers:viola")
local rand = math.random(6)
if rand == 1 then
data[vi] = c_danwhi
elseif rand == 2 then
data[vi] = c_rose
elseif rand == 3 then
data[vi] = c_tulip
elseif rand == 4 then
data[vi] = c_danyel
elseif rand == 5 then
data[vi] = c_geranium
else
data[vi] = c_viola
end
end
-- Singlenode option
local SINGLENODE = false
if SINGLENODE then
minetest.register_on_mapgen_init(function(mgparams)
minetest.set_mapgen_params({mgname="singlenode", water_level=-32000})
end)
-- Spawn player. Dependant on chunk size = 5 mapblocks
function spawnplayer(player)
local TSTONE = 0.02
local PSCA = 26 -- Player scatter from world centre in chunks (80 nodes).
local xsp
local ysp
local zsp
local np_realm = {
offset = 0,
scale = 1,
spread = {x=8192, y=8192, z=8192},
seed = 98320,
octaves = 3,
persist = 0.4
}
local np_terrain = {
offset = 0,
scale = 1,
spread = {x=384, y=128, z=384},
seed = 593,
octaves = 5,
persist = 0.67
}
local np_terralt = {
offset = 0,
scale = 1,
spread = {x=621, y=207, z=621},
seed = 593,
octaves = 5,
persist = 0.67
}
for chunk = 1, 128 do
print ("[fracture] searching for spawn "..chunk)
local x0 = 80 * math.random(-PSCA, PSCA) - 32
local z0 = 80 * math.random(-PSCA, PSCA) - 32
local y0 = 80 * math.random(-PSCA, PSCA) - 32
local x1 = x0 + 79
local z1 = z0 + 79
local y1 = y0 + 79
local sidelen = 80
local chulens = {x=sidelen, y=sidelen, z=sidelen}
local minposxyz = {x=x0, y=y0, z=z0}
local nvals_realm = minetest.get_perlin_map(np_realm, chulens):get3dMap_flat(minposxyz)
local nvals_terrain = minetest.get_perlin_map(np_terrain, chulens):get3dMap_flat(minposxyz)
local nvals_terralt = minetest.get_perlin_map(np_terralt, chulens):get3dMap_flat(minposxyz)
local nixyz = 1
local stable = {}
for z = z0, z1 do
for y = y0, y1 do
for x = x0, x1 do
local si = x - x0 + 1
local n_realm = nvals_realm[nixyz]
local n_terrain = nvals_terrain[nixyz]
local n_terralt = nvals_terralt[nixyz]
local density = (n_terrain + n_terralt) * 0.5 - math.abs(n_realm) ^ 1.5 * 64
if density >= TSTONE then
stable[si] = true
elseif stable[si] and density < 0 then
ysp = y + 1
xsp = x
zsp = z
break
end
nixyz = nixyz + 1
end
if ysp then
break
end
end
if ysp then
break
end
end
if ysp then
break
end
end
print ("[fracture] spawn player ("..xsp.." "..ysp.." "..zsp..")")
player:setpos({x=xsp, y=ysp, z=zsp})
end
minetest.register_on_newplayer(function(player)
spawnplayer(player)
end)
minetest.register_on_respawnplayer(function(player)
spawnplayer(player)
return true
end)
end
-- ABM
-- Appletree sapling
minetest.register_abm({
nodenames = {"fracture:appling"},
interval = 31,
chance = 5,
action = function(pos, node)
local x = pos.x
local y = pos.y
local z = pos.z
local vm = minetest.get_voxel_manip()
local pos1 = {x=x-2, y=y-2, z=z-2}
local pos2 = {x=x+2, y=y+4, z=z+2}
local emin, emax = vm:read_from_map(pos1, pos2)
local area = VoxelArea:new({MinEdge=emin, MaxEdge=emax})
local data = vm:get_data()
fracture_appletree(x, y, z, area, data)
vm:set_data(data)
vm:write_to_map()
vm:update_map()
end,
})

304
realms/fracture/init.lua Normal file
View File

@ -0,0 +1,304 @@
-- fracture 0.2.1 by paramat
-- For latest stable Minetest and back to 0.4.8
-- Depends default
-- License: code WTFPL
-- update spawnplayer function
-- tunnels replace fissures
-- remove soil depth table, pines
-- thicker dirt/sand
-- new edge erosion stability system, calculation only to 15 nodes below
-- TODO
-- integrate water pools. Clouds, humidity linked to distribution
-- Parameters
local YMIN = 5000
local YMAX = 6000
local TSTONE = 0.03 -- Stone density threshold, controls average depth of dirt/sand
local STABLE = 3 -- Minimum depth of stone for stable support of dirt/sand
local TTUN = 0.02 -- Tunnel width
local ORECHA = 1 / 5 ^ 3 -- Ore chance per stone node
local BLEND = 0.02 -- Controls biome blend distance
local APPCHA = 1 / 59 ^ 2 -- Appletree
local CACCHA = 1 / 61 ^ 2 -- Cactus
local FLOCHA = 1 / 47 ^ 2 -- Random flower
local GRACHA = 1 / 7 ^ 2 -- Grass_5
local DRYCHA = 1 / 47 ^ 2 -- Dry shrub
-- 3D noise for realm
local np_realm = {
offset = 0,
scale = 1,
spread = {x=1192, y=1192, z=1192},
seed = 98320,
octaves = 3,
persist = 0.4
}
-- 3D noise for terrain
local np_terrain = {
offset = 0,
scale = 1,
spread = {x=384, y=128, z=384},
seed = 593,
octaves = 5,
persist = 0.67
}
-- 3D noise for alt terrain in golden ratio
local np_terralt = {
offset = 0,
scale = 1,
spread = {x=311, y=104, z=311},
seed = 593,
octaves = 5,
persist = 0.67
}
-- 3D noises for tunnels
local np_weba = {
offset = 0,
scale = 1,
spread = {x=192, y=192, z=192},
seed = 5900033,
octaves = 3,
persist = 0.4
}
local np_webb = {
offset = 0,
scale = 1,
spread = {x=191, y=191, z=191},
seed = 33,
octaves = 3,
persist = 0.4
}
-- 3D noise for temperature
local np_biome = {
offset = 0,
scale = 1,
spread = {x=512, y=512, z=512},
seed = -188900,
octaves = 3,
persist = 0.4
}
-- 3D noise for clouds
local np_cloud = {
offset = 0,
scale = 1,
spread = {x=414, y=414, z=414},
seed = 1313131313,
octaves = 4,
persist = 0.8
}
-- Stuff
dofile(minetest.get_modpath("fracture").."/functions.lua")
dofile(minetest.get_modpath("fracture").."/nodes.lua")
-- On generated function
minetest.register_on_generated(function(minp, maxp, seed)
if minp.y < YMIN or maxp.y > YMAX then
return
end
local t0 = 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_stone = minetest.get_content_id("fracture:stone")
local c_destone = minetest.get_content_id("fracture:desertstone")
local c_cloud = minetest.get_content_id("fracture:cloud")
local c_dirt = minetest.get_content_id("fracture:dirt")
local c_grass = minetest.get_content_id("fracture:grass")
local c_desand = minetest.get_content_id("default:desert_sand")
local c_snowblock = minetest.get_content_id("default:snowblock")
local c_stodiam = minetest.get_content_id("default:stone_with_diamond")
local c_stomese = minetest.get_content_id("default:stone_with_mese")
local c_stogold = minetest.get_content_id("default:stone_with_gold")
local c_stocopp = minetest.get_content_id("default:stone_with_copper")
local c_stoiron = minetest.get_content_id("default:stone_with_iron")
local c_stocoal = minetest.get_content_id("default:stone_with_coal")
local c_grass5 = minetest.get_content_id("default:grass_5")
local c_dryshrub = minetest.get_content_id("default:dry_shrub")
local sidelen = x1 - x0 + 1 -- mapchunk side length
local facearea = sidelen ^ 2 -- mapchunk face area
local chulens = {x=sidelen, y=sidelen+16, z=sidelen}
local minposxyz = {x=x0, y=y0-15, z=z0}
local nvals_realm = minetest.get_perlin_map(np_realm, chulens):get3dMap_flat(minposxyz)
local nvals_terrain = minetest.get_perlin_map(np_terrain, chulens):get3dMap_flat(minposxyz)
local nvals_terralt = minetest.get_perlin_map(np_terralt, chulens):get3dMap_flat(minposxyz)
local nvals_weba = minetest.get_perlin_map(np_weba, chulens):get3dMap_flat(minposxyz)
local nvals_webb = minetest.get_perlin_map(np_webb, chulens):get3dMap_flat(minposxyz)
local nvals_biome = minetest.get_perlin_map(np_biome, chulens):get3dMap_flat(minposxyz)
local nvals_cloud = minetest.get_perlin_map(np_cloud, chulens):get3dMap_flat(minposxyz)
local nixyz = 1
local stable = {}
local under = {}
for z = z0, z1 do
for x = x0, x1 do -- set initial values of tables to zero
local si = x - x0 + 1
stable[si] = 0
under[si] = 0
end
for y = y0 - 15, y1 + 1 do
local vi = area:index(x0, y, z)
local viu = area:index(x0, y-1, z)
for x = x0, x1 do
local si = x - x0 + 1
local n_realm = nvals_realm[nixyz]
local n_terrain = nvals_terrain[nixyz]
local n_terralt = nvals_terralt[nixyz]
local density = (n_terrain + n_terralt) * 0.5 -- - math.abs(n_realm) ^ 1.5 * 64
local n_biome = nvals_biome[nixyz]
local biome = false
if n_biome > 0.4 + (math.random() - 0.5) * BLEND then
biome = 3 -- desert
elseif n_biome < -0.4 + (math.random() - 0.5) * BLEND then
biome = 1 -- tundra
else
biome = 2 -- forest / grassland
end
local weba = math.abs(nvals_weba[nixyz]) < TTUN
local webb = math.abs(nvals_webb[nixyz]) < TTUN
local novoid = not (weba and webb)
if y < y0 then -- overgeneration, initialise tables
if density >= TSTONE then
stable[si] = stable[si] + 1
elseif density >= 0 and density < TSTONE then
stable[si] = stable[si] - 1
else
stable[si] = 0
end
elseif y >= y0 and y <= y1 then
if novoid and density >= TSTONE then -- stone, ores
if biome == 3 then
data[vi] = c_destone
elseif math.random() < ORECHA then
local osel = math.random(24)
if osel == 24 then
data[vi] = c_stodiam
elseif osel == 23 then
data[vi] = c_stomese
elseif osel == 22 then
data[vi] = c_stogold
elseif osel >= 19 then
data[vi] = c_stocopp
elseif osel >= 10 then
data[vi] = c_stoiron
else
data[vi] = c_stocoal
end
else
data[vi] = c_stone
end
stable[si] = stable[si] + 1
under[si] = 0
elseif density >= 0 and density < TSTONE
and stable[si] >= STABLE then -- fine materials
if biome == 3 then
data[vi] = c_desand
under[si] = 3
elseif biome == 1 then
data[vi] = c_dirt
under[si] = 1
else
data[vi] = c_dirt
under[si] = 2
end
local oldstable = stable[si]
stable[si] = stable[si] - 1
elseif density < 0 and under[si] ~= 0 then -- air above surface node
if under[si] == 1 then
data[viu] = c_dirt
data[vi] = c_snowblock
elseif under[si] == 2 then
if math.random() < APPCHA then
fracture_appletree(x, y, z, area, data)
else
data[viu] = c_grass
if math.random() < FLOCHA then
fracture_flower(data, vi)
elseif math.random() < GRACHA then
data[vi] = c_grass5
end
end
elseif under[si] == 3 then
if math.random() < CACCHA then
fracture_cactus(x, y, z, area, data)
elseif math.random() < DRYCHA then
data[vi] = c_dryshrub
end
end
stable[si] = 0
under[si] = 0
--[[elseif density < TSTONE and y - y0 == 16
and biome ~= 3 and math.abs(y) > 1024 then -- clouds
local xrq = 16 * math.floor((x - x0) / 16)
local zrq = 16 * math.floor((z - z0) / 16)
local yrq = 16
local qixyz = zrq * facearea + yrq * sidelen + xrq + 1
if math.abs(nvals_cloud[qixyz]) < 0.05 then
data[vi] = c_cloud
end
stable[si] = 0
under[si] = 0]]
else -- air
stable[si] = 0
under[si] = 0
end
elseif y == y1 + 1 then -- overgeneration, detect surface, add surface nodes
if density < 0 and under[si] ~= 0 then
if under[si] == 1 then
data[viu] = c_dirt
data[vi] = c_snowblock -- added in chunk above
elseif under[si] == 2 then
data[viu] = c_grass
end
end
end
nixyz = nixyz + 1
vi = vi + 1
viu = viu + 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() - t0) * 1000)
print ("[fracture] "..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.

109
realms/fracture/nodes.lua Normal file
View File

@ -0,0 +1,109 @@
minetest.register_node("fracture:stone", {
description = "FR Stone",
tiles = {"default_stone.png"},
is_ground_content = false,
groups = {cracky=3},
drop = "default:cobble",
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("fracture:desertstone", {
description = "FR Desert Stone",
tiles = {"default_desert_stone.png"},
is_ground_content = false,
groups = {cracky=3},
drop = "default:desert_stone",
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("fracture:dirt", {
description = "Dirt",
tiles = {"default_dirt.png"},
is_ground_content = false,
groups = {crumbly=3,soil=1},
drop = "default:dirt",
sounds = default.node_sound_dirt_defaults(),
soil = {
base = "fracture:dirt",
dry = "farming:soil",
wet = "farming:soil_wet"
}
})
minetest.register_node("fracture:grass", {
description = "Grass",
tiles = {"default_grass.png", "default_dirt.png", "default_grass.png"},
is_ground_content = false,
groups = {crumbly=3,soil=1},
drop = "default:dirt",
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.25},
}),
soil = {
base = "fracture:grass",
dry = "farming:soil",
wet = "farming:soil_wet"
}
})
minetest.register_node("fracture:appleleaf", {
description = "Appletree Leaves",
drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"default_leaves.png"},
paramtype = "light",
is_ground_content = false,
groups = {snappy=3, flammable=2},
drop = {
max_items = 1,
items = {
{items = {"fracture:appling"},rarity = 20},
{items = {"fracture:appleleaf"}}
}
},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("fracture:appling", {
description = "Appletree Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"default_sapling.png"},
inventory_image = "default_sapling.png",
wield_image = "default_sapling.png",
paramtype = "light",
walkable = false,
is_ground_content = 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},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("fracture:cactus", {
description = "Cactus",
tiles = {"default_cactus_top.png", "default_cactus_top.png", "default_cactus_side.png"},
paramtype2 = "facedir",
is_ground_content = false,
groups = {snappy=1, choppy=3, flammable=2},
drop = "default:cactus",
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node
})
minetest.register_node("fracture:cloud", {
description = "Cloud",
drawtype = "glasslike",
tiles = {"fracture_cloud.png"},
paramtype = "light",
is_ground_content = false,
sunlight_propagates = true,
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
post_effect_color = {a=63, r=241, g=248, b=255},
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 860 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 693 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 802 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

View File

@ -0,0 +1 @@
default

View File

@ -0,0 +1,751 @@
--Crystal 1
minetest.register_node("glowtest:blue_crystal_1", {
description = "Blue Crystal",
drawtype = "nodebox",
tiles = {"glowtest_blue.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,crystal=1},
sounds = default.node_sound_glass_defaults(),
node_box = {
type = "fixed",
fixed = {
{-0.1875,-0.5,-0.125,0.1875,0.3125,0.1875},
{0.0625,-0.5,-0.25,0.3125,0,0},
{0.0625,-0.5,0.1875,0.25,0.1875,0.375},
{-0.3125,-0.5,-0.3125,-0.0625,0.0625,0},
{-0.375,-0.5,0.0625,-0.125,-0.0625,0.3125},
}
},
on_place = function(itemstack, placer, pointed_thing)
local stack = ItemStack("glowtest:blue_crystal_"..math.random(1,5))
local ret = minetest.item_place(stack, placer, pointed_thing)
return ItemStack("glowtest:blue_crystal_1 "..itemstack:get_count()-(1-ret:get_count()))
end,
})
minetest.register_node("glowtest:green_crystal_1", {
description = "Green Crystal",
drawtype = "nodebox",
tiles = {"glowtest_green.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,crystal=1},
sounds = default.node_sound_glass_defaults(),
node_box = {
type = "fixed",
fixed = {
{-0.1875,-0.5,-0.125,0.1875,0.3125,0.1875},
{0.0625,-0.5,-0.25,0.3125,0,0},
{0.0625,-0.5,0.1875,0.25,0.1875,0.375},
{-0.3125,-0.5,-0.3125,-0.0625,0.0625,0},
{-0.375,-0.5,0.0625,-0.125,-0.0625,0.3125},
}
},
on_place = function(itemstack, placer, pointed_thing)
local stack = ItemStack("glowtest:green_crystal_"..math.random(1,5))
local ret = minetest.item_place(stack, placer, pointed_thing)
return ItemStack("glowtest:green_crystal_1 "..itemstack:get_count()-(1-ret:get_count()))
end,
})
minetest.register_node("glowtest:red_crystal_1", {
description = "Red Crystal",
drawtype = "nodebox",
tiles = {"glowtest_red.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,crystal_cursed=1},
sounds = default.node_sound_glass_defaults(),
node_box = {
type = "fixed",
fixed = {
{-0.1875,-0.5,-0.125,0.1875,0.3125,0.1875},
{0.0625,-0.5,-0.25,0.3125,0,0},
{0.0625,-0.5,0.1875,0.25,0.1875,0.375},
{-0.3125,-0.5,-0.3125,-0.0625,0.0625,0},
{-0.375,-0.5,0.0625,-0.125,-0.0625,0.3125},
}
},
on_place = function(itemstack, placer, pointed_thing)
local stack = ItemStack("glowtest:red_crystal_"..math.random(1,5))
local ret = minetest.item_place(stack, placer, pointed_thing)
return ItemStack("glowtest:red_crystal_1 "..itemstack:get_count()-(1-ret:get_count()))
end,
})
minetest.register_node("glowtest:pink_crystal_1", {
description = "Pink Crystal",
drawtype = "nodebox",
tiles = {"glowtest_pink.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,crystal=1},
sounds = default.node_sound_glass_defaults(),
node_box = {
type = "fixed",
fixed = {
{-0.1875,-0.5,-0.125,0.1875,0.3125,0.1875},
{0.0625,-0.5,-0.25,0.3125,0,0},
{0.0625,-0.5,0.1875,0.25,0.1875,0.375},
{-0.3125,-0.5,-0.3125,-0.0625,0.0625,0},
{-0.375,-0.5,0.0625,-0.125,-0.0625,0.3125},
}
},
on_place = function(itemstack, placer, pointed_thing)
local stack = ItemStack("glowtest:pink_crystal_"..math.random(1,5))
local ret = minetest.item_place(stack, placer, pointed_thing)
return ItemStack("glowtest:pink_crystal_1 "..itemstack:get_count()-(1-ret:get_count()))
end,
})
minetest.register_node("glowtest:yellow_crystal_1", {
description = "Yellow Crystal",
drawtype = "nodebox",
tiles = {"glowtest_yellow.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,crystal=1},
sounds = default.node_sound_glass_defaults(),
node_box = {
type = "fixed",
fixed = {
{-0.1875,-0.5,-0.125,0.1875,0.3125,0.1875},
{0.0625,-0.5,-0.25,0.3125,0,0},
{0.0625,-0.5,0.1875,0.25,0.1875,0.375},
{-0.3125,-0.5,-0.3125,-0.0625,0.0625,0},
{-0.375,-0.5,0.0625,-0.125,-0.0625,0.3125},
}
},
on_place = function(itemstack, placer, pointed_thing)
local stack = ItemStack("glowtest:yellow_crystal_"..math.random(1,5))
local ret = minetest.item_place(stack, placer, pointed_thing)
return ItemStack("glowtest:yellow_crystal_1 "..itemstack:get_count()-(1-ret:get_count()))
end,
})
--Crystal 2
minetest.register_node("glowtest:blue_crystal_2", {
drawtype = "nodebox",
tiles = {"glowtest_blue.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:blue_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.1875,-0.5,-0.125,0.1875,0.5,0.1875},
{0.1875,-0.5,-0.25,0.5,0.1875,0},
{0.0625,-0.5,0.1875,0.375,0.375,0.375},
{-0.375,-0.5,-0.3125,-0.0625,0.25,0},
{-0.5,-0.5,-0.0625,-0.125,0,0.3125},
{0,-0.5,-0.5,0.3125,-0.0625,-0.1875},
}
}
})
minetest.register_node("glowtest:green_crystal_2", {
drawtype = "nodebox",
tiles = {"glowtest_green.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:green_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.1875,-0.5,-0.125,0.1875,0.5,0.1875},
{0.1875,-0.5,-0.25,0.5,0.1875,0},
{0.0625,-0.5,0.1875,0.375,0.375,0.375},
{-0.375,-0.5,-0.3125,-0.0625,0.25,0},
{-0.5,-0.5,-0.0625,-0.125,0,0.3125},
{0,-0.5,-0.5,0.3125,-0.0625,-0.1875},
}
}
})
minetest.register_node("glowtest:red_crystal_2", {
drawtype = "nodebox",
tiles = {"glowtest_red.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:red_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.1875,-0.5,-0.125,0.1875,0.5,0.1875},
{0.1875,-0.5,-0.25,0.5,0.1875,0},
{0.0625,-0.5,0.1875,0.375,0.375,0.375},
{-0.375,-0.5,-0.3125,-0.0625,0.25,0},
{-0.5,-0.5,-0.0625,-0.125,0,0.3125},
{0,-0.5,-0.5,0.3125,-0.0625,-0.1875},
}
}
})
minetest.register_node("glowtest:pink_crystal_2", {
drawtype = "nodebox",
tiles = {"glowtest_pink.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:pink_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.1875,-0.5,-0.125,0.1875,0.5,0.1875},
{0.1875,-0.5,-0.25,0.5,0.1875,0},
{0.0625,-0.5,0.1875,0.375,0.375,0.375},
{-0.375,-0.5,-0.3125,-0.0625,0.25,0},
{-0.5,-0.5,-0.0625,-0.125,0,0.3125},
{0,-0.5,-0.5,0.3125,-0.0625,-0.1875},
}
}
})
minetest.register_node("glowtest:yellow_crystal_2", {
drawtype = "nodebox",
tiles = {"glowtest_yellow.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:yellow_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.1875,-0.5,-0.125,0.1875,0.5,0.1875},
{0.1875,-0.5,-0.25,0.5,0.1875,0},
{0.0625,-0.5,0.1875,0.375,0.375,0.375},
{-0.375,-0.5,-0.3125,-0.0625,0.25,0},
{-0.5,-0.5,-0.0625,-0.125,0,0.3125},
{0,-0.5,-0.5,0.3125,-0.0625,-0.1875},
}
}
})
--Crystal 3
minetest.register_node("glowtest:blue_crystal_3", {
drawtype = "nodebox",
tiles = {"glowtest_blue.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:blue_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.125,-0.5,-0.25,0.25,0.5,0.1875},
{-0.125,-0.5,-0.4375,0.125,0.25,-0.1875},
{0,-0.5,-0.125,0.461539,0,0.3125},
{-0.5,-0.5,0,-0.0625,0.25,0.413465},
{-0.375,-0.5,-0.25,-0.0625,-0.0625,0.0625},
{0.1875,-0.5,-0.5,0.5,-0.25,-0.1875},
{-0.4375,-0.5,-0.5,-0.0625,-0.25,-0.125},
}
}
})
minetest.register_node("glowtest:green_crystal_3", {
drawtype = "nodebox",
tiles = {"glowtest_green.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:green_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.125,-0.5,-0.25,0.25,0.5,0.1875},
{-0.125,-0.5,-0.4375,0.125,0.25,-0.1875},
{0,-0.5,-0.125,0.461539,0,0.3125},
{-0.5,-0.5,0,-0.0625,0.25,0.413465},
{-0.375,-0.5,-0.25,-0.0625,-0.0625,0.0625},
{0.1875,-0.5,-0.5,0.5,-0.25,-0.1875},
{-0.4375,-0.5,-0.5,-0.0625,-0.25,-0.125},
}
}
})
minetest.register_node("glowtest:red_crystal_3", {
drawtype = "nodebox",
tiles = {"glowtest_red.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:red_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.125,-0.5,-0.25,0.25,0.5,0.1875},
{-0.125,-0.5,-0.4375,0.125,0.25,-0.1875},
{0,-0.5,-0.125,0.461539,0,0.3125},
{-0.5,-0.5,0,-0.0625,0.25,0.413465},
{-0.375,-0.5,-0.25,-0.0625,-0.0625,0.0625},
{0.1875,-0.5,-0.5,0.5,-0.25,-0.1875},
{-0.4375,-0.5,-0.5,-0.0625,-0.25,-0.125},
}
}
})
minetest.register_node("glowtest:pink_crystal_3", {
drawtype = "nodebox",
tiles = {"glowtest_pink.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:pink_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.125,-0.5,-0.25,0.25,0.5,0.1875},
{-0.125,-0.5,-0.4375,0.125,0.25,-0.1875},
{0,-0.5,-0.125,0.461539,0,0.3125},
{-0.5,-0.5,0,-0.0625,0.25,0.413465},
{-0.375,-0.5,-0.25,-0.0625,-0.0625,0.0625},
{0.1875,-0.5,-0.5,0.5,-0.25,-0.1875},
{-0.4375,-0.5,-0.5,-0.0625,-0.25,-0.125},
}
}
})
minetest.register_node("glowtest:yellow_crystal_3", {
drawtype = "nodebox",
tiles = {"glowtest_yellow.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:yellow_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.125,-0.5,-0.25,0.25,0.5,0.1875},
{-0.125,-0.5,-0.4375,0.125,0.25,-0.1875},
{0,-0.5,-0.125,0.461539,0,0.3125},
{-0.5,-0.5,0,-0.0625,0.25,0.413465},
{-0.375,-0.5,-0.25,-0.0625,-0.0625,0.0625},
{0.1875,-0.5,-0.5,0.5,-0.25,-0.1875},
{-0.4375,-0.5,-0.5,-0.0625,-0.25,-0.125},
}
}
})
--Crystal 4
minetest.register_node("glowtest:blue_crystal_4", {
drawtype = "nodebox",
tiles = {"glowtest_blue.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:blue_crystal_1",
node_box = {
type = "fixed",
fixed = {
{0.125,-0.5,-0.25,0.5,-0.125,0.125},
{-0.125,-0.5,-0.0625,0.1875,0.375,0.3125},
{0.0625,-0.5,-0.5,0.375,-0.0625,-0.125},
{-0.3125,-0.5,-0.3125,0,-0.1875,0.0625},
{-0.0625,-0.5,-0.1875,0.375,0.25,0.125},
{-0.375,-0.5,0.125,0,0.25,0.5},
}
}
})
minetest.register_node("glowtest:green_crystal_4", {
drawtype = "nodebox",
tiles = {"glowtest_green.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:green_crystal_1",
node_box = {
type = "fixed",
fixed = {
{0.125,-0.5,-0.25,0.5,-0.125,0.125},
{-0.125,-0.5,-0.0625,0.1875,0.375,0.3125},
{0.0625,-0.5,-0.5,0.375,-0.0625,-0.125},
{-0.3125,-0.5,-0.3125,0,-0.1875,0.0625},
{-0.0625,-0.5,-0.1875,0.375,0.25,0.125},
{-0.375,-0.5,0.125,0,0.25,0.5},
}
}
})
minetest.register_node("glowtest:red_crystal_4", {
drawtype = "nodebox",
tiles = {"glowtest_red.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:red_crystal_1",
node_box = {
type = "fixed",
fixed = {
{0.125,-0.5,-0.25,0.5,-0.125,0.125},
{-0.125,-0.5,-0.0625,0.1875,0.375,0.3125},
{0.0625,-0.5,-0.5,0.375,-0.0625,-0.125},
{-0.3125,-0.5,-0.3125,0,-0.1875,0.0625},
{-0.0625,-0.5,-0.1875,0.375,0.25,0.125},
{-0.375,-0.5,0.125,0,0.25,0.5},
}
}
})
minetest.register_node("glowtest:pink_crystal_4", {
drawtype = "nodebox",
tiles = {"glowtest_pink.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:pink_crystal_1",
node_box = {
type = "fixed",
fixed = {
{0.125,-0.5,-0.25,0.5,-0.125,0.125},
{-0.125,-0.5,-0.0625,0.1875,0.375,0.3125},
{0.0625,-0.5,-0.5,0.375,-0.0625,-0.125},
{-0.3125,-0.5,-0.3125,0,-0.1875,0.0625},
{-0.0625,-0.5,-0.1875,0.375,0.25,0.125},
{-0.375,-0.5,0.125,0,0.25,0.5},
}
}
})
minetest.register_node("glowtest:yellow_crystal_4", {
drawtype = "nodebox",
tiles = {"glowtest_yellow.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:yellow_crystal_1",
node_box = {
type = "fixed",
fixed = {
{0.125,-0.5,-0.25,0.5,-0.125,0.125},
{-0.125,-0.5,-0.0625,0.1875,0.375,0.3125},
{0.0625,-0.5,-0.5,0.375,-0.0625,-0.125},
{-0.3125,-0.5,-0.3125,0,-0.1875,0.0625},
{-0.0625,-0.5,-0.1875,0.375,0.25,0.125},
{-0.375,-0.5,0.125,0,0.25,0.5},
}
}
})
--Crystal 5
minetest.register_node("glowtest:blue_crystal_5", {
drawtype = "nodebox",
tiles = {"glowtest_blue.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:blue_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.3125,-0.5,-0.1875,0,0.5,0.125},
{-0.1875,-0.5,-0.3125,0.1875,0.125,0},
{-0.25,-0.5,-0.5,0.0625,0.3125,-0.1875},
{0.0625,-0.5,-0.125,0.375,-0.125,0.1875},
{0.0625,-0.5,-0.375,0.3125,-0.25,-0.1875},
{-0.1875,-0.5,0,0.125,0.0625,0.5},
}
}
})
minetest.register_node("glowtest:green_crystal_5", {
drawtype = "nodebox",
tiles = {"glowtest_green.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:green_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.3125,-0.5,-0.1875,0,0.5,0.125},
{-0.1875,-0.5,-0.3125,0.1875,0.125,0},
{-0.25,-0.5,-0.5,0.0625,0.3125,-0.1875},
{0.0625,-0.5,-0.125,0.375,-0.125,0.1875},
{0.0625,-0.5,-0.375,0.3125,-0.25,-0.1875},
{-0.1875,-0.5,0,0.125,0.0625,0.5},
}
}
})
minetest.register_node("glowtest:red_crystal_5", {
drawtype = "nodebox",
tiles = {"glowtest_red.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:red_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.3125,-0.5,-0.1875,0,0.5,0.125},
{-0.1875,-0.5,-0.3125,0.1875,0.125,0},
{-0.25,-0.5,-0.5,0.0625,0.3125,-0.1875},
{0.0625,-0.5,-0.125,0.375,-0.125,0.1875},
{0.0625,-0.5,-0.375,0.3125,-0.25,-0.1875},
{-0.1875,-0.5,0,0.125,0.0625,0.5},
}
}
})
minetest.register_node("glowtest:pink_crystal_5", {
drawtype = "nodebox",
tiles = {"glowtest_pink.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:pink_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.3125,-0.5,-0.1875,0,0.5,0.125},
{-0.1875,-0.5,-0.3125,0.1875,0.125,0},
{-0.25,-0.5,-0.5,0.0625,0.3125,-0.1875},
{0.0625,-0.5,-0.125,0.375,-0.125,0.1875},
{0.0625,-0.5,-0.375,0.3125,-0.25,-0.1875},
{-0.1875,-0.5,0,0.125,0.0625,0.5},
}
}
})
minetest.register_node("glowtest:yellow_crystal_5", {
drawtype = "nodebox",
tiles = {"glowtest_yellow.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:yellow_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.3125,-0.5,-0.1875,0,0.5,0.125},
{-0.1875,-0.5,-0.3125,0.1875,0.125,0},
{-0.25,-0.5,-0.5,0.0625,0.3125,-0.1875},
{0.0625,-0.5,-0.125,0.375,-0.125,0.1875},
{0.0625,-0.5,-0.375,0.3125,-0.25,-0.1875},
{-0.1875,-0.5,0,0.125,0.0625,0.5},
}
}
})
--Crystal 6
minetest.register_node("glowtest:blue_crystal_6", {
drawtype = "nodebox",
tiles = {"glowtest_blue.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:blue_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.125,-0.5,-0.1875,0.1875,0.1875,0.125},
{0,-0.5,-0.375,0.3125,-0.0625,-0.0625},
{-0.25,-0.5,-0.0625,0.0625,0,0.25},
{0.0625,-0.5,0,0.461539,-0.25,0.375},
{-0.3125,-0.5,-0.4375,0.0625,-0.1875,-0.0625},
}
}
})
minetest.register_node("glowtest:green_crystal_6", {
drawtype = "nodebox",
tiles = {"glowtest_green.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:green_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.125,-0.5,-0.1875,0.1875,0.1875,0.125},
{0,-0.5,-0.375,0.3125,-0.0625,-0.0625},
{-0.25,-0.5,-0.0625,0.0625,0,0.25},
{0.0625,-0.5,0,0.461539,-0.25,0.375},
{-0.3125,-0.5,-0.4375,0.0625,-0.1875,-0.0625},
}
}
})
minetest.register_node("glowtest:red_crystal_6", {
drawtype = "nodebox",
tiles = {"glowtest_red.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:red_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.125,-0.5,-0.1875,0.1875,0.1875,0.125},
{0,-0.5,-0.375,0.3125,-0.0625,-0.0625},
{-0.25,-0.5,-0.0625,0.0625,0,0.25},
{0.0625,-0.5,0,0.461539,-0.25,0.375},
{-0.3125,-0.5,-0.4375,0.0625,-0.1875,-0.0625},
}
}
})
minetest.register_node("glowtest:pink_crystal_6", {
drawtype = "nodebox",
tiles = {"glowtest_pink.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:pink_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.125,-0.5,-0.1875,0.1875,0.1875,0.125},
{0,-0.5,-0.375,0.3125,-0.0625,-0.0625},
{-0.25,-0.5,-0.0625,0.0625,0,0.25},
{0.0625,-0.5,0,0.461539,-0.25,0.375},
{-0.3125,-0.5,-0.4375,0.0625,-0.1875,-0.0625},
}
}
})
minetest.register_node("glowtest:yellow_crystal_6", {
drawtype = "nodebox",
tiles = {"glowtest_yellow.png"},
paramtype = "light",
sunlight_propagates = true,
light_source = 8,
alpha = 200,
is_ground_content = false,
groups = {cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
drop = "glowtest:yellow_crystal_1",
node_box = {
type = "fixed",
fixed = {
{-0.125,-0.5,-0.1875,0.1875,0.1875,0.125},
{0,-0.5,-0.375,0.3125,-0.0625,-0.0625},
{-0.25,-0.5,-0.0625,0.0625,0,0.25},
{0.0625,-0.5,0,0.461539,-0.25,0.375},
{-0.3125,-0.5,-0.4375,0.0625,-0.1875,-0.0625},
}
}
})

View File

@ -0,0 +1,499 @@
minetest.register_node("glowtest:tree", {
description = "Glowing Tree",
tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"},
paramtype2 = "facedir",
light_source = 2,
groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
sounds = default.node_sound_wood_defaults(),
drop = "default:tree",
on_place = minetest.rotate_node
})
minetest.register_node("glowtest:stonetree", {
description = "Glowing Stone Tree",
tiles = {"glowtest_cursed_tree.png", "glowtest_cursed_tree.png", "glowtest_cursed_tree_top.png"},
paramtype2 = "facedir",
light_source = 2,
groups = {tree=1,cracky=3},
sounds = default.node_sound_wood_defaults(),
drop = {
max_items = 1,
items = {
{ items = {'default:lava_source'}, rarity = 100},
{ items = {'default:tree'} }
}
},
on_place = minetest.rotate_node
})
minetest.register_node("glowtest:blueleaf", {
description = "Glowing Blue Leaf",
drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"glowtest_blueleaf.png"},
paramtype = "light",
light_source = 3,
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
alpha = 200,
sunlight_propagates = true,
drop = {
max_items = 1,
items = {
{ items = {'glowtest:sbluesapling'}, rarity = 20},
{ items = {'glowtest:mbluesapling'}, rarity = 40},
{ items = {'glowtest:lbluesapling'}, rarity = 60},
{ items = {'glowtest:blueleaf'} }
}
},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("glowtest:redleaf", {
description = "Glowing Blood Leaf",
drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"glowtest_redleaf.png"},
paramtype = "light",
light_source = 4,
alpha = 200,
sunlight_propagates = true,
groups = {snappy=3, leafdecay=3, leaves=1},
drop = {
max_items = 1,
items = {
{ items = {'glowtest:sredsapling'}, rarity = 20},
{ items = {'glowtest:mredsapling'}, rarity = 40},
{ items = {'glowtest:lredsapling'}, rarity = 60},
{ items = {'glowtest:redleaf'} }
}
},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("glowtest:blackleaf", {
description = "Glowing Cursed Leaf",
drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"glowtest_blackleaf.png"},
paramtype = "light",
light_source = 4,
alpha = 200,
sunlight_propagates = true,
groups = {snappy=3, leafdecay=3, leaves=1},
drop = {
max_items = 1,
items = {
{ items = {'glowtest:sblacksapling'}, rarity = 20},
{ items = {'glowtest:mblacksapling'}, rarity = 40},
{ items = {'glowtest:lblacksapling'}, rarity = 60},
{ items = {'glowtest:blackleaf'} }
}
},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("glowtest:pinkleaf", {
description = "Glowing Pink Leaf",
drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"glowtest_pinkleaf.png"},
paramtype = "light",
light_source = 4,
alpha = 200,
sunlight_propagates = true,
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
drop = {
max_items = 1,
items = {
{ items = {'glowtest:spinksapling'}, rarity = 20},
{ items = {'glowtest:mpinksapling'}, rarity = 40},
{ items = {'glowtest:lpinksapling'}, rarity = 60},
{ items = {'glowtest:pinkleaf'} }
}
},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("glowtest:yellowleaf", {
description = "Glowing Yellow Leaf",
drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"glowtest_yellowleaf.png"},
paramtype = "light",
light_source = 4,
alpha = 200,
sunlight_propagates = true,
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
drop = {
max_items = 1,
items = {
{ items = {'glowtest:syellowsapling'}, rarity = 20},
{ items = {'glowtest:myellowsapling'}, rarity = 40},
{ items = {'glowtest:lyellowsapling'}, rarity = 60},
{ items = {'glowtest:yellowleaf'} }
}
},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("glowtest:greenleaf", {
description = "Glowing Green Leaf",
drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"glowtest_greenleaf.png"},
paramtype = "light",
light_source = 4,
alpha = 200,
sunlight_propagates = true,
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
drop = {
max_items = 1,
items = {
{ items = {'glowtest:sgreensapling'}, rarity = 20},
{ items = {'glowtest:mgreensapling'}, rarity = 40},
{ items = {'glowtest:lgreensapling'}, rarity = 60},
{ items = {'glowtest:greenleaf'} }
}
},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("glowtest:whiteleaf", {
description = "Glowing White Leaf",
drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"glowtest_whiteleaf.png"},
paramtype = "light",
light_source = 4,
alpha = 200,
sunlight_propagates = true,
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
drop = {
max_items = 1,
items = {
{ items = {'glowtest:swhitesapling'}, rarity = 20},
{ items = {'glowtest:mwhitesapling'}, rarity = 40},
{ items = {'glowtest:lwhitesapling'}, rarity = 60},
{ items = {'glowtest:whiteleaf'} }
}
},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("glowtest:sgreensapling", {
description = "Small Green Sapling",
drawtype = "plantlike",
visual_scale = 0.7,
tiles = {"glowtest_greensapling.png"},
inventory_image = "glowtest_greensapling.png",
wield_image = "glowtest_greensapling.png",
paramtype = "light",
walkable = false,
light_source = 1,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 },
},
})
minetest.register_node("glowtest:mgreensapling", {
description = "Medium Green Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"glowtest_greensapling.png"},
inventory_image = "glowtest_greensapling.png",
wield_image = "glowtest_greensapling.png",
paramtype = "light",
walkable = false,
light_source = 1,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:lgreensapling", {
description = "Large Green Sapling",
drawtype = "plantlike",
visual_scale = 2.0,
tiles = {"glowtest_greensapling.png"},
inventory_image = "glowtest_greensapling.png",
wield_image = "glowtest_greensapling.png",
paramtype = "light",
walkable = false,
light_source = 1,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:sbluesapling", {
description = "Small Blue Sapling",
drawtype = "plantlike",
visual_scale = 0.7,
tiles = {"glowtest_bluesapling.png"},
inventory_image = "glowtest_bluesapling.png",
wield_image = "glowtest_bluesapling.png",
paramtype = "light",
walkable = false,
light_source = 1,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 },
},
})
minetest.register_node("glowtest:mbluesapling", {
description = "Medium Blue Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"glowtest_bluesapling.png"},
inventory_image = "glowtest_bluesapling.png",
wield_image = "glowtest_bluesapling.png",
paramtype = "light",
walkable = false,
light_source = 1,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:lbluesapling", {
description = "Large Blue Sapling",
drawtype = "plantlike",
visual_scale = 2.0,
tiles = {"glowtest_bluesapling.png"},
inventory_image = "glowtest_bluesapling.png",
wield_image = "glowtest_bluesapling.png",
paramtype = "light",
walkable = false,
light_source = 1,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:spinksapling", {
description = "Small Pink Sapling",
drawtype = "plantlike",
visual_scale = 0.7,
tiles = {"glowtest_pinksapling.png"},
inventory_image = "glowtest_pinksapling.png",
wield_image = "glowtest_pinksapling.png",
paramtype = "light",
walkable = false,
light_source = 1,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 },
},
})
minetest.register_node("glowtest:mpinksapling", {
description = "Medium Pink Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"glowtest_pinksapling.png"},
inventory_image = "glowtest_pinksapling.png",
wield_image = "glowtest_pinksapling.png",
paramtype = "light",
walkable = false,
light_source = 1,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:lpinksapling", {
description = "Large Pink Sapling",
drawtype = "plantlike",
visual_scale = 2.0,
tiles = {"glowtest_pinksapling.png"},
inventory_image = "glowtest_pinksapling.png",
wield_image = "glowtest_pinksapling.png",
paramtype = "light",
walkable = false,
light_source = 1,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:syellowsapling", {
description = "Small Yellow Sapling",
drawtype = "plantlike",
visual_scale = 0.7,
tiles = {"glowtest_yellowsapling.png"},
inventory_image = "glowtest_yellowsapling.png",
wield_image = "glowtest_yellowsapling.png",
paramtype = "light",
walkable = false,
light_source = 1,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 },
},
})
minetest.register_node("glowtest:myellowsapling", {
description = "Medium Yellow Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"glowtest_yellowsapling.png"},
inventory_image = "glowtest_yellowsapling.png",
wield_image = "glowtest_yellowsapling.png",
paramtype = "light",
walkable = false,
light_source = 1,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:lyellowsapling", {
description = "Large Yellow Sapling",
drawtype = "plantlike",
visual_scale = 2.0,
tiles = {"glowtest_yellowsapling.png"},
inventory_image = "glowtest_yellowsapling.png",
wield_image = "glowtest_yellowsapling.png",
paramtype = "light",
walkable = false,
light_source = 1,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:sredsapling", {
description = "Small Blood Sapling",
drawtype = "plantlike",
visual_scale = 0.7,
tiles = {"glowtest_redsapling.png"},
inventory_image = "glowtest_redsapling.png",
wield_image = "glowtest_redsapling.png",
paramtype = "light",
walkable = false,
light_source = 1,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 },
},
})
minetest.register_node("glowtest:mredsapling", {
description = "Medium Blood Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"glowtest_redsapling.png"},
inventory_image = "glowtest_redsapling.png",
wield_image = "glowtest_redsapling.png",
paramtype = "light",
walkable = false,
light_source = 1,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:lredsapling", {
description = "Large Blood Sapling",
drawtype = "plantlike",
visual_scale = 2.0,
tiles = {"glowtest_redsapling.png"},
inventory_image = "glowtest_redsapling.png",
wield_image = "glowtest_redsapling.png",
paramtype = "light",
walkable = false,
light_source = 1,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:swhitesapling", {
description = "Small White Sapling",
drawtype = "plantlike",
visual_scale = 0.7,
tiles = {"glowtest_whitesapling.png"},
inventory_image = "glowtest_whitesapling.png",
wield_image = "glowtest_whitesapling.png",
paramtype = "light",
walkable = false,
light_source = 1,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 },
},
})
minetest.register_node("glowtest:mwhitesapling", {
description = "Medium White Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"glowtest_whitesapling.png"},
inventory_image = "glowtest_whitesapling.png",
wield_image = "glowtest_whitesapling.png",
paramtype = "light",
walkable = false,
light_source = 1,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:lwhitesapling", {
description = "Large White Sapling",
drawtype = "plantlike",
visual_scale = 2.0,
tiles = {"glowtest_whitesapling.png"},
inventory_image = "glowtest_whitesapling.png",
wield_image = "glowtest_whitesapling.png",
paramtype = "light",
walkable = false,
light_source = 1,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:sblacksapling", {
description = "Small Cursed Sapling",
drawtype = "plantlike",
visual_scale = 0.7,
tiles = {"glowtest_blacksapling.png"},
inventory_image = "glowtest_blacksapling.png",
wield_image = "glowtest_blacksapling.png",
paramtype = "light",
walkable = false,
light_source = 1,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:mblacksapling", {
description = "Medium Cursed Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"glowtest_blacksapling.png"},
inventory_image = "glowtest_blacksapling.png",
wield_image = "glowtest_blacksapling.png",
paramtype = "light",
walkable = false,
light_source = 1,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("glowtest:lblacksapling", {
description = "Large Cursed Sapling",
drawtype = "plantlike",
visual_scale = 2.0,
tiles = {"glowtest_blacksapling.png"},
inventory_image = "glowtest_blacksapling.png",
wield_image = "glowtest_blacksapling.png",
paramtype = "light",
walkable = false,
light_source = 1,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})

File diff suppressed because it is too large Load Diff

3
realms/glowtest/init.lua Normal file
View File

@ -0,0 +1,3 @@
dofile(minetest.get_modpath("glowtest").."/glowtest/nodes.lua")
dofile(minetest.get_modpath("glowtest").."/glowtest/trees.lua")
dofile(minetest.get_modpath("glowtest").."/glowtest/crystal.lua")

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 588 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 313 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 743 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 704 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 687 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 614 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 313 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 645 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 604 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 614 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 665 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 547 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 613 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 641 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

12
realms/license.txt Normal file
View File

@ -0,0 +1,12 @@
All of the mods, except portals, written by paramat. Check their directories for more info.
Portals:
Code: MIT, based (very loosely) on PilzAdam's Nether mod.
Copyright (c) 2016 Amaz
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Textures: CC BY-SA 3.0

0
realms/modpack.txt Normal file
View File

View File

@ -0,0 +1,3 @@
default
floatindev
asteroid

486
realms/portals/init.lua Normal file
View File

@ -0,0 +1,486 @@
--[[local portals = {
{min_y = 9000, max_y = 9100, material = "default:brick", portal = "nether", desc = "Nether", pec = "800080"},
{min_y = 11150, max_y = 11250, material = "default:stonebrick", portal = "floaty", desc = "Float", pec = "00b1b7"},
{min_y = 9000, max_y = 9100, material = "default:stone", portal = "abc", desc = "Abc", pec = "800080"},
{min_y = 9000, max_y = 9100, material = "default:stone", portal = "abc", desc = "Abc", pec = "800080"},
}]]--
local function get_nodedef_field(nodename, fieldname)
if not minetest.registered_nodes[nodename] then
return nil
end
return minetest.registered_nodes[nodename][fieldname]
end
local radius = 100
function get_surface_pos(pos, min_y, max_y)
local sminp = {x = pos.x - 10, y = min_y, z = pos.z - 10}
local smaxp = {x = pos.x + 10, y = max_y, z = pos.z + 10}
local minp = {
x = pos.x - radius - 1,
y = min_y,
z = pos.z - radius - 1
}
local maxp = {
x = pos.x + radius - 1,
y = max_y,
z = pos.z + radius - 1
}
local seen_air = false
local ground_pos = {}
--local nnu = minetest.get_node({x=pos.x,y=pos.y-2,z=pos.z}).name
--local ngu = minetest.get_node_group(nnu, "water")
--if ngu == 0 and nnu ~= "ignore" then
for x = sminp.x, smaxp.x do
for z = sminp.z, smaxp.z do
for y = smaxp.y, sminp.y, -1 do
local nodename = minetest.get_node({x=x,y=y,z=z}).name
local goodnode = get_nodedef_field(nodename, "walkable")
local nodenamea = minetest.get_node({x=x,y=y+1,z=z}).name
if goodnode == true and nodename ~= "air" and nodenamea == "air" then
ground_pos = {x = x, y = y + 1, z = z}
seen_air = true
break
end
end
end
end
--end
if seen_air then
return ground_pos
else
for x = minp.x, maxp.x do
for z = minp.z, maxp.z do
for y = maxp.y, minp.y, -1 do
local nodename = minetest.get_node({x=x,y=y,z=z}).name
local goodnode = get_nodedef_field(nodename, "walkable")
local nodenamea = minetest.get_node({x=x,y=y+1,z=z}).name
if goodnode == true and nodename ~= "air" and nodenamea == "air" then
ground_pos = {x = x, y = y + 1, z = z}
seen_air = true
break
end
end
end
end
if seen_air then
return ground_pos
else
return false
end
end
end
local function hex_rbg(code)
if type(code) == 'number' then
xcode= string.format('%x+', code):upper()
end
code = code:match'%x+':upper()
return {
a = 180;
r = loadstring('return 0x' .. code:sub(1,2))();
g = loadstring('return 0x' .. code:sub(3,4))();
b = loadstring('return 0x' .. code:sub(5,6))();
}
end
local function build_portal(pos, target, material, portal)
local p = {x=pos.x-1, y=pos.y-1, z=pos.z}
local p1 = {x=pos.x-1, y=pos.y-1, z=pos.z}
local p2 = {x=p1.x+3, y=p1.y+4, z=p1.z}
for i=1,4 do
minetest.set_node(p, {name = material})
p.y = p.y+1
end
for i=1,3 do
minetest.set_node(p, {name = material})
p.x = p.x+1
end
for i=1,4 do
minetest.set_node(p, {name = material})
p.y = p.y-1
end
for i=1,3 do
minetest.set_node(p, {name = material})
p.x = p.x-1
end
p.z = p.z + 1
for i = 1, 4 do
minetest.set_node(p, {name = "default:stone"})
p.x = p.x + 1
end
for x=p1.x,p2.x do
for y=p1.y,p2.y do
p = {x=x, y=y, z=p1.z}
if not (x == p1.x or x == p2.x or y==p1.y or y==p2.y) then
minetest.set_node(p, {name="portals:" .. portal, param2=0})
end
local meta = minetest.get_meta(p)
local opos = target
meta:set_string("p1", minetest.pos_to_string(p1))
meta:set_string("p2", minetest.pos_to_string(p2))
meta:set_string("target", minetest.pos_to_string(target))
if y ~= p1.y then
for z=-2,2 do
if z ~= 0 then
p.z = p.z+z
--if minetest.registered_nodes[minetest.get_node(p).name].is_ground_content then
minetest.remove_node(p)
--end
p.z = p.z-z
end
end
end
end
end
end
local function set_target(p1, p2, npos)
for x=p1.x,p2.x do
for y=p1.y,p2.y do
for z=p1.z,p2.z do
local meta = minetest.get_meta({x=x, y=y, z=z})
meta:set_string("target", npos)
end
end
end
end
local function move_check(p1, max, dir, material)
local p = {x=p1.x, y=p1.y, z=p1.z}
local d = math.abs(max-p1[dir]) / (max-p1[dir])
while p[dir] ~= max do
p[dir] = p[dir] + d
if minetest.get_node(p).name ~= material then
return false
end
end
return true
end
local function check_portal(p1, p2, material)
if p1.x ~= p2.x then
if not move_check(p1, p2.x, "x", material) then
return false
end
if not move_check(p2, p1.x, "x", material) then
return false
end
elseif p1.z ~= p2.z then
if not move_check(p1, p2.z, "z", material) then
return false
end
if not move_check(p2, p1.z, "z", material) then
return false
end
else
return false
end
if not move_check(p1, p2.y, "y", material) then
return false
end
if not move_check(p2, p1.y, "y", material) then
return false
end
return true
end
local function is_portal(pos, material)
for d=-3,3 do
for y=-4,4 do
local px = {x=pos.x+d, y=pos.y+y, z=pos.z}
local pz = {x=pos.x, y=pos.y+y, z=pos.z+d}
if check_portal(px, {x=px.x+3, y=px.y+4, z=px.z}, material) then
return px, {x=px.x+3, y=px.y+4, z=px.z}
end
if check_portal(pz, {x=pz.x, y=pz.y+4, z=pz.z+3}, material) then
return pz, {x=pz.x, y=pz.y+4, z=pz.z+3}
end
end
end
end
function make_portal(pos, portal, material)
print(portal)
local p1, p2 = is_portal(pos, material)
if not p1 or not p2 then
return false
end
for d=1,2 do
for y=p1.y+1,p2.y-1 do
local p
if p1.z == p2.z then
p = {x=p1.x+d, y=y, z=p1.z}
else
p = {x=p1.x, y=y, z=p1.z+d}
end
if minetest.get_node(p).name ~= "air" then
return false
end
end
end
local param2
if p1.z == p2.z then param2 = 0 else param2 = 1 end
for d=0,3 do
for y=p1.y,p2.y do
local p = {}
if param2 == 0 then p = {x=p1.x+d, y=y, z=p1.z} else p = {x=p1.x, y=y, z=p1.z+d} end
if minetest.get_node(p).name == "air" then
minetest.set_node(p, {name="portals:" .. portal, param2=param2})
end
local meta = minetest.get_meta(p)
meta:set_string("p1", minetest.pos_to_string(p1))
meta:set_string("p2", minetest.pos_to_string(p2))
meta:set_string("target", "first")
end
end
return true
end
local function teleport_stuff(p1, p2, npos, opos, material, portal, obj, text, img)
set_target(p1, p2, minetest.pos_to_string(npos))
obj:moveto({x = npos.x + 1, y = npos.y, z = npos.z + 1}, false)
minetest.after(2, function()
build_portal(npos, opos, material, portal)
obj:moveto({x = npos.x + 1, y = npos.y, z = npos.z + 1}, false)
end)
obj:set_physics_override(1, 1, 1)
obj:hud_remove(text)
obj:hud_remove(img)
end
local function destroy(pos, material, portal)
local name = "portals:" .. portal
local meta = minetest.get_meta(pos)
local p1 = minetest.string_to_pos(meta:get_string("p1"))
local p2 = minetest.string_to_pos(meta:get_string("p2"))
local target = minetest.string_to_pos(meta:get_string("target"))
if not p1 or not p2 then
return
end
for x=p1.x,p2.x do
for y=p1.y,p2.y do
for z=p1.z,p2.z do
local nn = minetest.get_node({x=x,y=y,z=z}).name
if nn == material or nn == name then
if nn == name then
minetest.remove_node({x=x,y=y,z=z})
end
local m = minetest.get_meta({x=x,y=y,z=z})
m:set_string("p1", "")
m:set_string("p2", "")
m:set_string("target", "")
end
end
end
end
end
function portal_stuff(min_y, max_y, material, portal, desc, pec)
minetest.register_node("portals:" .. portal, {
description = desc .. " Portal",
tiles = {
"blank.png",
"blank.png",
"blank.png",
"blank.png",
{
name = portal .. "_portal.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 0.5,
},
},
{
name = portal .. "_portal.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 0.5,
},
},
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
use_texture_alpha = true,
walkable = false,
digable = false,
pointable = false,
buildable_to = false,
drop = "",
light_source = 5,
post_effect_color = hex_rbg(pec),
alpha = 192,
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.1, 0.5, 0.5, 0.1},
},
},
groups = {not_in_creative_inventory=1}
})
minetest.register_abm({
nodenames = {"portals:" .. portal},
interval = 2,
chance = 2,
action = function(pos, node)
minetest.add_particlespawner(
32, --amount
4, --time
{x=pos.x-0.25, y=pos.y-0.25, z=pos.z-0.25}, --minpos
{x=pos.x+0.25, y=pos.y+0.25, z=pos.z+0.25}, --maxpos
{x=-0.8, y=-0.8, z=-0.8}, --minvel
{x=0.8, y=0.8, z=0.8}, --maxvel
{x=0,y=0,z=0}, --minacc
{x=0,y=0,z=0}, --maxacc
0.5, --minexptime
1, --maxexptime
1, --minsize
2, --maxsize
false, --collisiondetection
portal .. "_particle.png" --texture
)
for _,obj in ipairs(minetest.get_objects_inside_radius(pos, 1)) do
if obj:is_player() then
local meta = minetest.get_meta(pos)
if meta then
local target = meta:get_string("target")
local to = minetest.string_to_pos(target)
local p1 = minetest.string_to_pos(meta:get_string("p1"))
local p2 = minetest.string_to_pos(meta:get_string("p2"))
if target == "first" then
local opos = obj:getpos()
local dpos = {x = opos.x, y = min_y, z = opos.z}
obj:set_physics_override(0, 0, 0)
obj:moveto(dpos, false)
local img = obj:hud_add({
hud_elem_type = "image",
position = {x=0.5, y=0.5},
scale = {x=1, y=1},
number = 0xFF0000,
text = "portal_text.png",
offset = {x=0, y=0},
})
local text = obj:hud_add({
hud_elem_type = "text",
position = {x=0.5, y=0.5},
scale = {x=-100},
number = 0xFF0000,
text = "Terrain generating... Please wait!",
offset = {x=0, y=0},
})
local npos = nil
minetest.after(2, function()
npos = get_surface_pos(dpos, min_y, max_y)
if npos and npos ~= false then
teleport_stuff(p1, p2, npos, opos, material, portal, obj, text, img)
elseif npos == false then
obj:moveto({x = opos.x + 100, y = min_y, z = opos.z + 100})
minetest.after(2, function()
npos = get_surface_pos({x = opos.x + 100, y = min_y, z = opos.z + 100}, min_y, max_y)
if npos and npos ~= false then
teleport_stuff(p1, p2, npos, opos, material, portal, obj, text, img)
else
teleport_stuff(p1, p2, dpos, opos, material, portal, obj, text, img)
end
end)
end
end)
elseif to then
local objpos = obj:getpos()
objpos.y = objpos.y+0.1 -- Fix some glitches at -8000
if minetest.get_node(objpos).name ~= "portals:" .. portal then
return
end
obj:setpos({x = to.x + 1, y = to.y, z = to.z + 1})
end
end
end
end
end,
})
minetest.register_craftitem("portals:igniter_" .. portal, {
description = desc .. " Portal Igniter",
inventory_image = "default_mese_crystal_fragment.png^[colorize:#" .. pec .. "99",
on_place = function(stack, placer, pt)
local pos = placer:getpos()
if pt.under and minetest.get_node(pt.under).name == material then
if pos.y > min_y and pos.y < max_y then
minetest.chat_send_player(placer:get_player_name(), "You are already in the same realm as this portal would lead to!")
return
end
local done = make_portal(pt.under, portal, material)
if done and not minetest.setting_getbool("creative_mode") then
stack:take_item()
end
minetest.emerge_area({x = pos.x-100, y = min_y, z = pos.z-100}, {x = pos.x+100, y = max_y, z = pos.z+100})
end
return stack
end,
})
minetest.override_item(material, {
on_destruct = function(pos)
destroy(pos, material, portal)
end
})
end
portal_stuff(9000, 9100, "floatindev:floc", "nether", "Nether", "800080")
portal_stuff(11125, 11275, "asteroid:meteorite_block", "floaty", "Float", "00b1b7")
portal_stuff(5100, 5300, "default:stone", "abc", "Abc", "800080")
portal_stuff(15000, 15200, "default:mese", "asteroid", "Asteroid", "eaec28")
--[[pos = {x=0, y=0, z=0}
minetest.register_globalstep(function(dtime)
for _, player in ipairs(minetest.get_connected_players()) do
local name = player:get_player_name()
local space = 1000 --value for space, change the value to however you like.
local pos = player:getpos()
--The skybox for space, feel free to change it to however you like.
local spaceskybox = {
"sky_pos_y.png",
"sky_neg_y.png",
"sky_pos_z.png",
"sky_neg_z.png",
"sky_neg_x.png",
"sky_pos_x.png",
}
--If the player has reached Space
if minetest.get_player_by_name(name) and pos.y >= space then
player:set_sky({}, "skybox", spaceskybox) -- Sets skybox
elseif minetest.get_player_by_name(name) and pos.y < space then
player:set_physics_override(1, 1, 1) -- speed, jump, gravity [default]
player:set_sky({}, "regular", {}) -- Sets skybox, in this case it sets the skybox to it's default setting if and only if the player's Y value is less than the value of space.
end
end
end)
minetest.register_on_leaveplayer(function(player)
local name = player:get_player_name()
if name then
player:set_sky({}, "regular", {})
end
end)]]

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Some files were not shown because too many files have changed in this diff Show More