develop #32

Merged
milan merged 7 commits from develop into master 2021-02-28 22:06:32 +01:00
12 changed files with 1531 additions and 1008 deletions
Showing only changes of commit 067fadf85d - Show all commits

View file

@ -113,7 +113,7 @@ for _, nodeclass in ipairs(NodeClass) do
paramtype = "light",
paramtype2 = "color",
is_ground_content = true,
groups = {cracky=3, ud_param2_colorable = 1},
groups = {cracky=3, stone=1, ud_param2_colorable = 1},
sounds = default.node_sound_stone_defaults(),
on_construct = unifieddyes.on_construct,
on_dig = unifieddyes.on_dig
@ -131,7 +131,7 @@ for _, nodeclass in ipairs(NodeClass) do
paramtype = "light",
paramtype2 = "color",
is_ground_content = true,
groups = {cracky=3, ud_param2_colorable = 1},
groups = {cracky=3, stone=2, ud_param2_colorable = 1},
sounds = default.node_sound_stone_defaults(),
on_construct = unifieddyes.on_construct,
on_dig = unifieddyes.on_dig
@ -149,7 +149,7 @@ for _, nodeclass in ipairs(NodeClass) do
paramtype = "light",
paramtype2 = "color",
is_ground_content = true,
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3, ud_param2_colorable = 1},
groups = {snappy=2, choppy=2, wood=1, oddly_breakable_by_hand=2,flammable=3, ud_param2_colorable = 1},
sounds = default.node_sound_wood_defaults(),
on_construct = unifieddyes.on_construct,
on_dig = unifieddyes.on_dig
@ -169,7 +169,7 @@ minetest.register_node("blox:wood_tinted", {
paramtype = "light",
paramtype2 = "color",
is_ground_content = true,
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3, ud_param2_colorable = 1},
groups = {snappy=2, choppy=2, wood=1, oddly_breakable_by_hand=2,flammable=3, ud_param2_colorable = 1},
sounds = default.node_sound_wood_defaults(),
on_construct = unifieddyes.on_construct,
on_dig = unifieddyes.on_dig
@ -182,7 +182,7 @@ minetest.register_node("blox:stone_square", {
paramtype = "light",
paramtype2 = "color",
is_ground_content = true,
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3, ud_param2_colorable = 1},
groups = {snappy=2, choppy=2, stone=1, oddly_breakable_by_hand=2,flammable=3, ud_param2_colorable = 1},
sounds = default.node_sound_wood_defaults(),
on_construct = unifieddyes.on_construct,
on_dig = unifieddyes.on_dig
@ -195,7 +195,7 @@ minetest.register_node("blox:cobble_tinted", {
paramtype = "light",
paramtype2 = "color",
is_ground_content = true,
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3, not_in_creative_inventory = 1, ud_param2_colorable = 1},
groups = {snappy=2, choppy=2, stone=2, oddly_breakable_by_hand=2,flammable=3, not_in_creative_inventory = 1, ud_param2_colorable = 1},
sounds = default.node_sound_wood_defaults(),
on_construct = unifieddyes.on_construct,
on_dig = unifieddyes.on_dig
@ -208,7 +208,7 @@ minetest.register_node("blox:stone_tinted", {
paramtype = "light",
paramtype2 = "color",
is_ground_content = true,
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3, not_in_creative_inventory = 1, ud_param2_colorable = 1},
groups = {snappy=2, choppy=2, stone=1, oddly_breakable_by_hand=2,flammable=3, not_in_creative_inventory = 1, ud_param2_colorable = 1},
sounds = default.node_sound_wood_defaults(),
on_construct = unifieddyes.on_construct,
on_dig = unifieddyes.on_dig,

View file

@ -13,3 +13,10 @@ nyancat?
usesdirt?
worldedit?
signs_lib?
bakedclay?
farming?
wool?
bushes_classic?
dryplants?
bedrock?
cottages?

View file

@ -12,942 +12,8 @@ gloopblocks = {}
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
-- Nodes
minetest.register_node("gloopblocks:rainbow_block_diagonal", {
description = S("Diagonal Rainbow Block"),
tiles = {"gloopblocks_rainbow_block.png"},
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_defaults(),
})
minetest.register_alias("gloopblocks:rainbow_block", "gloopblocks:rainbow_block_diagonal")
minetest.register_node("gloopblocks:rainbow_block_horizontal", {
description = S("Horizontal Rainbow Block"),
tiles = {
"gloopblocks_rainbow_horizontal.png^[transformR90",
"gloopblocks_rainbow_horizontal.png^[transformR90",
"gloopblocks_rainbow_horizontal.png"
},
paramtype = "light",
light_source = default.LIGHT_MAX,
paramtype2 = "facedir",
groups = {cracky = 2},
is_ground_content = false,
sounds = default.node_sound_defaults(),
})
minetest.register_node("gloopblocks:evil_block", {
description = S("Evil Block"),
tiles = {"gloopblocks_evil_block.png"},
light_source = 5,
is_ground_content = true,
groups = {cracky=2},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("gloopblocks:basalt", {
description = S("Basalt"),
tiles = {"gloopblocks_basalt.png"},
groups = {cracky=2},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("gloopblocks:pumice", {
description = S("Pumice"),
tiles = {"gloopblocks_pumice.png"},
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("gloopblocks:pavement", {
description = S("Pavement"),
tiles = {"gloopblocks_pavement.png"},
groups = {cracky=3, oddly_breakable_by_hand=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("gloopblocks:oerkki_block", {
drawtype = "nodebox",
description = S("Oerkki Block"),
paramtype = "light",
paramtype2 = "facedir",
tiles = {
"gloopblocks_oerkkiblock_tb.png",
"gloopblocks_oerkkiblock_tb.png",
"gloopblocks_oerkkiblock_sides.png",
"gloopblocks_oerkkiblock_sides.png",
"gloopblocks_oerkkiblock_sides.png",
"gloopblocks_oerkkiblock_front.png"
},
groups = {cracky=3, oddly_breakable_by_hand=3},
sounds = default.node_sound_stone_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 }
},
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.1875, 0.5, 0.5, 0.1875}, -- NodeBox1
{-0.5, -0.5, -0.5, -0.4375, 0.5, 0.5}, -- NodeBox2
{0.4375, -0.5, -0.5, 0.5, 0.5, 0.5}, -- NodeBox3
{-0.5, 0.4375, -0.5, 0.5, 0.5, 0.5}, -- NodeBox4
{-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5}, -- NodeBox5
{-0.5, -0.0625, -0.5, 0.5, 0.0625, 0.5}, -- NodeBox6
}
}
})
minetest.register_node("gloopblocks:stone_brick_mossy", {
description = S("Mossy Stone Brick"),
tiles = {"gloopblocks_stone_brick_mossy.png"},
groups = {cracky=3, stone=1},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("gloopblocks:stone_mossy", {
description = S("Mossy Stone"),
tiles = {"gloopblocks_stone_mossy.png"},
groups = {cracky=3, stone=1},
sounds = default.node_sound_stone_defaults(),
drop = "default:mossycobble"
})
minetest.register_node("gloopblocks:cobble_road", {
description = S("Cobblestone Road Bed"),
tiles = {"gloopblocks_cobble_road.png"},
groups = {cracky=3, stone=1},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("gloopblocks:cobble_road_mossy", {
description = S("Mossy Cobblestone Road Bed"),
tiles = {"gloopblocks_cobble_road_mossy.png"},
groups = {cracky=3, stone=1},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("gloopblocks:scaffolding", {
description = S("Wooden Scaffold"),
drawtype = "allfaces",
paramtype = "light",
sunlight_propagates = true,
tiles = {"gloopblocks_scaffold.png"},
groups = {choppy=3, oddly_breakable_by_hand=3},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_alias("moreblocks:oerkkiblock", "gloopblocks:oerkki_block")
minetest.register_alias("gloopblocks:obsidian", "default:obsidian")
-- Nodes imported from Usesdirt ================================================================================
if not minetest.get_modpath("usesdirt") then
local dirt_brick_tex = "default_dirt.png^gloopblocks_dirt_brick_overlay.png"
local dirt_cobble_tex = "default_cobble.png^(default_dirt.png^[mask:gloopblocks_dirt_cobble_mask.png)"
local dirt_stone_tex = "default_stone.png^(default_dirt.png^[mask:gloopblocks_dirt_stone_mask.png)"
local dirt_ladder_tex = "(default_dirt.png^[mask:gloopblocks_ladder_mask.png)^gloopblocks_ladder_overlay.png"
local dirt_brick_ladder_tex = "(("..dirt_brick_tex..")^[mask:gloopblocks_ladder_mask.png)^gloopblocks_ladder_overlay.png"
local dirt_cobble_ladder_tex = "(("..dirt_cobble_tex..")^[mask:gloopblocks_ladder_mask.png)^gloopblocks_ladder_overlay.png"
local dirt_stone_ladder_tex = "(("..dirt_stone_tex..")^[mask:gloopblocks_ladder_mask.png)^gloopblocks_ladder_overlay.png"
minetest.register_node(":usesdirt:dirt_brick", {
tiles = { dirt_brick_tex },
description = "Dirt Brick",
groups = {snappy=2,choppy=1,oddly_breakable_by_hand=2},
})
minetest.register_node(":usesdirt:dirt_brick_ladder", {
description = "Dirt Brick Ladder",
drawtype = "signlike",
tiles = { dirt_brick_ladder_tex },
inventory_image = dirt_brick_ladder_tex,
wield_image = dirt_brick_ladder_tex,
paramtype = "light",
paramtype2 = "wallmounted",
is_ground_content = true,
walkable = false,
climbable = true,
selection_box = {
type = "wallmounted",
--wall_top = = <default>
--wall_bottom = = <default>
--wall_side = = <default>
},
groups = {cracky=3, stone=2},
legacy_wallmounted = true,
})
minetest.register_craft({
output = 'usesdirt:dirt_brick_ladder 3',
recipe = {
{'usesdirt:dirt_brick', '', 'usesdirt:dirt_brick'},
{'usesdirt:dirt_brick', 'usesdirt:dirt_brick','usesdirt:dirt_brick'},
{'usesdirt:dirt_brick','','usesdirt:dirt_brick'},
}
})
default.register_fence(":usesdirt:dirt_brick_fence", {
description = "Dirt Brick Fence",
texture = dirt_brick_tex,
inventory_image = "default_fence_overlay.png^("..dirt_brick_tex..")^default_fence_overlay.png^[makealpha:255,126,126",
wield_image = "default_fence_overlay.png^("..dirt_brick_tex..")^default_fence_overlay.png^[makealpha:255,126,126",
material = "usesdirt:dirt_brick",
groups = {cracky=3, stone=2},
sounds = default.node_sound_stone_defaults(),
check_for_pole = true
})
if minetest.get_modpath("moreblocks") then
minetest.register_craft({
output = 'usesdirt:dirt_brick 24',
recipe = {
{'moreblocks:dirt_compressed', 'moreblocks:dirt_compressed', '' },
{'moreblocks:dirt_compressed', 'moreblocks:dirt_compressed', '' }
}
})
else
minetest.register_craft({
output = 'usesdirt:dirt_brick 6',
recipe = {
{'default:dirt', 'default:dirt', 'default:dirt'},
{'default:dirt', 'default:dirt', 'default:dirt'},
{'default:dirt', 'default:dirt', 'default:dirt'},
}
})
end
minetest.register_node(":usesdirt:dirt_ladder", {
description = "Dirt Ladder",
drawtype = "signlike",
tiles = { dirt_ladder_tex },
inventory_image = dirt_ladder_tex,
wield_image = dirt_ladder_tex,
paramtype = "light",
paramtype2 = "wallmounted",
is_ground_content = true,
walkable = false,
climbable = true,
selection_box = {
type = "wallmounted",
--wall_top = = <default>
--wall_bottom = = <default>
--wall_side = = <default>
},
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3},
legacy_wallmounted = true,
})
minetest.register_craft({
output = 'usesdirt:dirt_ladder 3',
recipe = {
{'usesdirt:dirt_brick', '', 'usesdirt:dirt_brick'},
{'usesdirt:dirt_brick', 'usesdirt:dirt_brick','usesdirt:dirt_brick'},
{'usesdirt:dirt_brick','','usesdirt:dirt_brick'},
}
})
default.register_fence(":usesdirt:dirt_fence", {
description = "Dirt Fence",
texture = "default_dirt.png",
inventory_image = "default_fence_overlay.png^default_dirt.png^default_fence_overlay.png^[makealpha:255,126,126",
wield_image = "default_fence_overlay.png^default_dirt.png^default_fence_overlay.png^[makealpha:255,126,126",
material = "default:dirt",
groups = {snappy=2,choppy=1,oddly_breakable_by_hand=3},
sounds = default.node_sound_dirt_defaults(),
check_for_pole = true
})
----
minetest.register_node(":usesdirt:dirt_cobble_stone", {
tiles = { dirt_cobble_tex },
description = "Dirt Cobble Stone",
is_ground_content = true,
groups = {cracky=3, stone=2},
})
minetest.register_craft({
output = '"usesdirt:dirt_cobble_stone" 3',
recipe = {
{'usesdirt:dirt_brick', 'usesdirt:dirt_brick', 'usesdirt:dirt_brick'},
{'usesdirt:dirt_brick', 'usesdirt:dirt_brick', 'usesdirt:dirt_brick'},
{'usesdirt:dirt_brick', 'usesdirt:dirt_brick', 'usesdirt:dirt_brick'},
}
})
minetest.register_node(":usesdirt:dirt_cobble_stone_ladder", {
description = "Dirt Cobble Stone Ladder",
drawtype = "signlike",
tiles = { dirt_cobble_ladder_tex },
inventory_image = dirt_cobble_ladder_tex,
wield_image = dirt_cobble_ladder_tex,
paramtype = "light",
paramtype2 = "wallmounted",
is_ground_content = true,
walkable = false,
climbable = true,
selection_box = {
type = "wallmounted",
--wall_top = = <default>
--wall_bottom = = <default>
--wall_side = = <default>
},
groups = {cracky=3, stone=2},
legacy_wallmounted = true,
})
minetest.register_craft({
output = 'usesdirt:dirt_cobble_stone_ladder 3',
recipe = {
{'usesdirt:dirt_cobble_stone', '', 'usesdirt:dirt_cobble_stone'},
{'usesdirt:dirt_cobble_stone', 'usesdirt:dirt_cobble_stone','usesdirt:dirt_cobble_stone'},
{'usesdirt:dirt_cobble_stone','','usesdirt:dirt_cobble_stone'},
}
})
default.register_fence(":usesdirt:dirt_cobble_stone_fence", {
description = "Dirt Cobble Stone Fence",
texture = dirt_cobble_tex,
inventory_image = "default_fence_overlay.png^("..dirt_cobble_tex..")^default_fence_overlay.png^[makealpha:255,126,126",
wield_image = "default_fence_overlay.png^("..dirt_cobble_tex..")^default_fence_overlay.png^[makealpha:255,126,126",
material = "usesdirt:dirt_cobble_stone",
groups = {cracky=3, stone=2},
sounds = default.node_sound_stone_defaults(),
check_for_pole = true
})
----
minetest.register_node(":usesdirt:dirt_stone", {
tiles = { dirt_stone_tex },
description = "Dirt Stone",
is_ground_content = true,
groups = {cracky=3, stone=2},
})
minetest.register_node(":usesdirt:dirt_stone_ladder", {
description = "Dirt Stone Ladder",
drawtype = "signlike",
tiles = { dirt_stone_ladder_tex },
inventory_image = dirt_stone_ladder_tex,
wield_image = dirt_stone_ladder_tex,
paramtype = "light",
paramtype2 = "wallmounted",
is_ground_content = true,
walkable = false,
climbable = true,
selection_box = {
type = "wallmounted",
--wall_top = = <default>
--wall_bottom = = <default>
--wall_side = = <default>
},
groups = {cracky=3, stone=2},
legacy_wallmounted = true,
})
minetest.register_craft({
output = 'usesdirt:dirt_stone_ladder 3',
recipe = {
{'usesdirt:dirt_stone', '', 'usesdirt:dirt_stone'},
{'usesdirt:dirt_stone', 'usesdirt:dirt_stone','usesdirt:dirt_stone'},
{'usesdirt:dirt_stone','','usesdirt:dirt_stone'},
}
})
default.register_fence(":usesdirt:dirt_stone_fence", {
description = "Dirt Stone Fence",
texture = dirt_stone_tex,
inventory_image = "default_fence_overlay.png^("..dirt_stone_tex..")^default_fence_overlay.png^[makealpha:255,126,126",
wield_image = "default_fence_overlay.png^("..dirt_stone_tex..")^default_fence_overlay.png^[makealpha:255,126,126",
material = "usesdirt:dirt_stone",
groups = {cracky=3, stone=2},
sounds = default.node_sound_stone_defaults(),
check_for_pole = true
})
end
-- Stairs/slabs defs, conversion of normal -> mossy items
if minetest.setting_getbool("gloopblocks_mossy_conversion") ~= false then
function gloopblocks_register_mossy_conversion(mossyobjects)
for i in ipairs(mossyobjects) do
minetest.register_abm({
nodenames = { mossyobjects[i][1] },
neighbors = {"default:water_source", "default:water_flowing"},
interval = 120,
chance = 50,
action = function(pos, node)
if minetest.find_node_near(pos, 2, "air") then
local fdir = node.param2
minetest.add_node(pos, {name = mossyobjects[i][2], param2 = fdir})
end
end,
})
end
end
end
if minetest.get_modpath("moreblocks") then
stairsplus:register_all("gloopblocks", "oerkki_block", "gloopblocks:oerkki_block", {
description = S("Oerkki Block"),
tiles = {
"gloopblocks_oerkkiblock_tb.png",
"gloopblocks_oerkkiblock_tb.png",
"gloopblocks_oerkkiblock_sides.png",
"gloopblocks_oerkkiblock_sides.png",
"gloopblocks_oerkkiblock_sides.png",
"gloopblocks_oerkkiblock_front.png"
},
groups = {cracky=2, not_in_creative_inventory=1},
sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true,
})
stairsplus:register_all("gloopblocks", "stone_brick_mossy", "gloopblocks:stone_brick_mossy", {
description = S("Mossy Stone Brick"),
tiles = {"gloopblocks_stone_brick_mossy.png"},
groups = {cracky=1, not_in_creative_inventory=1},
sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true,
})
stairsplus:register_all("gloopblocks", "stone_mossy", "gloopblocks:stone_mossy", {
description = S("Mossy Stone"),
tiles = {"gloopblocks_stone_mossy.png"},
groups = {cracky=1, not_in_creative_inventory=1},
sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true,
})
stairsplus:register_all("gloopblocks", "cobble_road", "gloopblocks:cobble_road", {
description = S("Cobblestone Roadbed"),
tiles = {"gloopblocks_cobble_road.png"},
groups = {cracky=3, stone=1, not_in_creative_inventory=1},
sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true,
})
stairsplus:register_all("gloopblocks", "cobble_road_mossy", "gloopblocks:cobble_road_mossy", {
description = S("Mossy Cobblestone Roadbed"),
tiles = {"gloopblocks_cobble_road_mossy.png"},
groups = {cracky=3, stone=1, not_in_creative_inventory=1},
sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true,
})
stairsplus:register_all("gloopblocks", "pavement", "gloopblocks:pavement", {
description = S("Pavement"),
tiles = {"gloopblocks_pavement.png"},
groups = {cracky=2, not_in_creative_inventory=1},
sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true,
})
stairsplus:register_all("gloopblocks", "rainbow_block", "gloopblocks:rainbow_block", {
description = S("Rainbow Block"),
tiles = {"gloopblocks_rainbow_block.png"},
groups = {cracky=3, not_in_creative_inventory=1},
sounds = default.node_sound_defaults(),
sunlight_propagates = true,
})
stairsplus:register_all("gloopblocks", "evil_block", "gloopblocks:evil_block", {
description = S("Evil Block"),
tiles = {"gloopblocks_evil_block.png"},
groups = {cracky=3, not_in_creative_inventory=1},
sounds = default.node_sound_defaults(),
light_source = 5,
sunlight_propagates = true,
})
stairsplus:register_all("gloopblocks", "basalt", "gloopblocks:basalt", {
description = S("Basalt"),
tiles = {"gloopblocks_basalt.png"},
groups = {cracky=2, not_in_creative_inventory=1},
sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true,
})
stairsplus:register_all("gloopblocks", "pumice", "gloopblocks:pumice", {
description = S("Pumice"),
tiles = {"gloopblocks_pumice.png"},
groups = {cracky=3, not_in_creative_inventory=1},
sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true,
})
stairsplus:register_all("gloopblocks", "gravel", "default:gravel", {
description = S("Gravel"),
tiles = {"default_gravel.png"},
groups = {crumbly = 2, falling_node = 1, not_in_creative_inventory=1},
sounds = default.node_sound_stone_defaults(),
sunlight_propagates = false,
})
if minetest.get_modpath("caverealms") then
stairsplus:register_all("caverealms", "glow_crystal", "caverealms:glow_crystal", {
description = S("Glow Crystal"),
tiles = {"caverealms_glow_crystal.png"},
groups = {cracky=3, not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
light_source = 12,
use_texture_alpha = true,
paramtype="light",
sunlight_propagates = true,
})
stairsplus:register_all("caverealms", "glow_emerald", "caverealms:glow_emerald", {
description = S("Glow Emerald"),
tiles = {"caverealms_glow_emerald.png"},
groups = {cracky=3, not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
light_source = 12,
use_texture_alpha = true,
paramtype="light",
sunlight_propagates = true,
})
stairsplus:register_all("caverealms", "glow_mese", "caverealms:glow_mese", {
description = S("Glow Mese"),
tiles = {"caverealms_glow_mese.png"},
groups = {cracky=3, not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
light_source = 12,
use_texture_alpha = true,
paramtype="light",
sunlight_propagates = true,
})
end
-- ABMs for mossy objects
if minetest.setting_getbool("gloopblocks_mossy_conversion") ~= false then
gloopblocks_register_mossy_conversion({
{ "moreblocks:stair_cobble", "moreblocks:stair_mossycobble" },
{ "moreblocks:stair_cobble_inner", "moreblocks:stair_mossycobble_inner" },
{ "moreblocks:stair_cobble_outer", "moreblocks:stair_mossycobble_outer" },
{ "moreblocks:stair_cobble_half", "moreblocks:stair_mossycobble_half" },
{ "moreblocks:slab_cobble_quarter", "moreblocks:slab_mossycobble_quarter" },
{ "moreblocks:slab_cobble", "moreblocks:slab_mossycobble" },
{ "moreblocks:slab_cobble_three_quarter", "moreblocks:slab_mossycobble_three_quarter" },
{ "moreblocks:panel_cobble", "moreblocks:panel_mossycobble" },
{ "moreblocks:micro_cobble", "moreblocks:micro_mossycobble" },
{ "moreblocks:stair_cobble_alt", "moreblocks:stair_mossycobble_alt" },
{ "gloopblocks:cobble_road", "gloopblocks:cobble_road_mossy" },
{ "gloopblocks:stair_cobble_road", "gloopblocks:stair_cobble_road_mossy" },
{ "gloopblocks:slab_cobble_road", "gloopblocks:slab_cobble_road_mossy" },
{ "gloopblocks:stair_cobble_road", "gloopblocks:stair_cobble_road_mossy" },
{ "gloopblocks:stair_cobble_road_inner", "gloopblocks:stair_cobble_road_mossy_inner" },
{ "gloopblocks:stair_cobble_road_outer", "gloopblocks:stair_cobble_road_mossy_outer" },
{ "gloopblocks:stair_cobble_road_half", "gloopblocks:stair_cobble_road_mossy_half" },
{ "gloopblocks:slab_cobble_road_quarter", "gloopblocks:slab_cobble_road_mossy_quarter" },
{ "gloopblocks:slab_cobble_road", "gloopblocks:slab_cobble_road_mossy" },
{ "gloopblocks:slab_cobble_road_three_quarter", "gloopblocks:slab_cobble_road_mossy_three_quarter" },
{ "gloopblocks:panel_cobble_road", "gloopblocks:panel_cobble_road_mossy" },
{ "gloopblocks:micro_cobble_road", "gloopblocks:micro_cobble_road_mossy" },
{ "gloopblocks:stair_cobble_road_alt", "gloopblocks:stair_cobble_road_mossy_alt" },
{ "default:stonebrick", "gloopblocks:stone_brick_mossy" },
{ "default:stair_stonebrick", "gloopblocks:stair_stone_brick_mossy" },
{ "default:slab_stonebrick", "gloopblocks:slab_stone_brick_mossy" },
{ "moreblocks:stair_stonebrick", "gloopblocks:stair_stone_brick_mossy" },
{ "moreblocks:stair_stonebrick_inner", "gloopblocks:stair_stone_brick_mossy_inner" },
{ "moreblocks:stair_stonebrick_outer", "gloopblocks:stair_stone_brick_mossy_outer" },
{ "moreblocks:stair_stonebrick_half", "gloopblocks:stair_stone_brick_mossy_half" },
{ "moreblocks:slab_stonebrick_quarter", "gloopblocks:slab_stone_brick_mossy_quarter" },
{ "moreblocks:slab_stonebrick", "gloopblocks:slab_stone_brick_mossy" },
{ "moreblocks:slab_stonebrick_three_quarter", "gloopblocks:slab_stone_brick_mossy_three_quarter" },
{ "moreblocks:panel_stonebrick", "gloopblocks:panel_stone_brick_mossy" },
{ "moreblocks:micro_stonebrick", "gloopblocks:micro_stone_brick_mossy" },
{ "moreblocks:stair_stonebrick_alt", "gloopblocks:stair_stone_brick_mossy_alt" },
{ "default:stone", "gloopblocks:stone_mossy" },
{ "default:stair_stone", "gloopblocks:stair_stone_mossy" },
{ "default:slab_stone", "gloopblocks:slab_stone_mossy" },
{ "moreblocks:stair_stone", "gloopblocks:stair_stone_mossy" },
{ "moreblocks:stair_stone_inner", "gloopblocks:stair_stone_mossy_inner" },
{ "moreblocks:stair_stone_outer", "gloopblocks:stair_stone_mossy_outer" },
{ "moreblocks:stair_stone_half", "gloopblocks:stair_stone_mossy_half" },
{ "moreblocks:slab_stone_quarter", "gloopblocks:slab_stone_mossy_quarter" },
{ "moreblocks:slab_stone", "gloopblocks:slab_stone_mossy" },
{ "moreblocks:slab_stone_three_quarter", "gloopblocks:slab_stone_mossy_three_quarter" },
{ "moreblocks:panel_stone", "gloopblocks:panel_stone_mossy" },
{ "moreblocks:micro_stone", "gloopblocks:micro_stone_mossy" },
{ "moreblocks:stair_stone_alt", "gloopblocks:stair_stone_mossy_alt" },
})
end
elseif minetest.get_modpath("stairs") then
--stairs.register_stair(subname, recipeitem, groups, images, description, sounds)
-- stairs:xxxx_stone_mossy ; xxxx = stair or slab
stairs.register_stair_and_slab("stone_mossy", "gloopblocks:stone_mossy",
{cracky=3},
{"gloopblocks_stone_mossy.png"},
S("Mossy Stone Stair"),
S("Mossy Stone Slab"),
default.node_sound_stone_defaults())
-- stairs:xxxx_mossycobble
stairs.register_stair_and_slab("mossycobble", "default:mossycobble",
{cracky=3},
{"default_mossycobble.png"},
S("Mossy Cobble Stair"),
S("Mossy Cobble Slab"),
default.node_sound_stone_defaults())
-- stairs:xxxx_stone_brick_mossy
stairs.register_stair_and_slab("stone_brick_mossy", "gloopblocks:stone_brick_mossy",
{cracky=3},
{"gloopblocks_stone_brick_mossy.png"},
S("Mossy Stone Brick Stair"),
S("Mossy Stone Brick Slab"),
default.node_sound_stone_defaults())
-- stairs:xxxx_cobble_road
stairs.register_stair_and_slab("cobble_road", "gloopblocks:cobble_road",
{cracky=3},
{"gloopblocks_cobble_road.png"},
S("Cobble Roadbed Stair"),
S("Cobble Roadbed Slab"),
default.node_sound_stone_defaults())
-- stairs:xxxx_cobble_road_mossy
stairs.register_stair_and_slab("cobble_road_mossy", "gloopblocks:cobble_road_mossy",
{cracky=3},
{"gloopblocks_cobble_road_mossy.png"},
S("Mossy Cobble Roadbed Stair"),
S("Mossy Cobble Roadbed Slab"),
default.node_sound_stone_defaults())
-- stairs:xxxx_cement
stairs.register_stair_and_slab("cement", "gloopblocks:cement",
{cracky=2},
{"basic_materials_cement_block.png"},
S("Cement Stair"),
S("Cement Slab"),
default.node_sound_stone_defaults())
-- stairs:xxxx_pavement
stairs.register_stair_and_slab("pavement", "gloopblocks:pavement",
{cracky=3, oddly_breakable_by_hand=3},
{"gloopblocks_pavement.png"},
S("Pavement Stair"),
S("Pavement Slab"),
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("basalt", "gloopblocks:basalt",
{cracky=2},
{"gloopblocks_basalt.png"},
S("Basalt Stair"),
S("Basalt Slab"),
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("pumice", "gloopblocks:pumice",
{cracky=3},
{"gloopblocks_pumice.png"},
S("Pumice Stair"),
S("Pumice Slab"),
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("rainbow_block", "gloopblocks:rainbow_block",
{cracky=3},
{"gloopblocks_rainbow_block.png"},
S("Rainbow Block Stair"),
S("Rainbow Block Slab"),
default.node_sound_defaults())
if minetest.setting_getbool("gloopblocks_mossy_conversion") ~= false then
gloopblocks_register_mossy_conversion({
{ "default:cobble", "default:mossycobble" },
{ "stairs:stair_cobble", "stairs:stair_mossycobble" },
{ "stairs:slab_cobble", "stairs:slab_mossycobble" },
{ "gloopblocks:cobble_road", "gloopblocks:cobble_road_mossy" },
{ "stairs:stair_cobble_road", "stairs:stair_cobble_road_mossy" },
{ "stairs:slab_cobble_road", "stairs:slab_cobble_road_mossy" },
{ "default:stonebrick", "gloopblocks:stone_brick_mossy" },
{ "stairs:stair_stonebrick", "stairs:stair_stone_brick_mossy" },
{ "stairs:slab_stonebrick", "stairs:slab_stone_brick_mossy" },
{ "default:stone", "gloopblocks:stone_mossy" },
{ "stairs:stair_stone", "stairs:stair_stone_mossy" },
{ "stairs:slab_stone", "stairs:slab_stone_mossy" },
})
end
minetest.register_alias("default:stair_mossycobble", "stairs:stair_mossycobble")
minetest.register_alias("default:slab_mossycobble", "stairs:slab_mossycobble")
minetest.register_alias("gloopblocks:stair_cobble_road", "stairs:stair_cobble_road")
minetest.register_alias("gloopblocks:slab_cobble_road", "stairs:slab_cobble_road")
minetest.register_alias("gloopblocks:stair_cobble_road_mossy", "stairs:stair_cobble_road_mossy")
minetest.register_alias("gloopblocks:slab_cobble_road_mossy", "stairs:slab_cobble_road_mossy")
minetest.register_alias("gloopblocks:stair_stone_brick_mossy", "stairs:stair_stone_brick_mossy")
minetest.register_alias("gloopblocks:slab_stone_brick_mossy", "stairs:slab_stone_brick_mossy")
minetest.register_alias("gloopblocks:stair_stone_mossy", "stairs:stair_stone_mossy")
minetest.register_alias("gloopblocks:slab_stone_mossy", "stairs:slab_stone_mossy")
minetest.register_alias("gloopblocks:stair_cement", "stairs:stair_cement")
minetest.register_alias("gloopblocks:slab_cement", "stairs:slab_cement")
minetest.register_alias("gloopblocks:stair_pavement", "stairs:stair_pavement")
minetest.register_alias("gloopblocks:slab_pavement", "stairs:slab_pavement")
minetest.register_alias("gloopblocks:stair_pumice", "stairs:stair_pumice")
minetest.register_alias("gloopblocks:slab_pumice", "stairs:slab_pumice")
minetest.register_alias("gloopblocks:stair_basalt", "stairs:stair_basalt")
minetest.register_alias("gloopblocks:slab_basalt", "stairs:slab_basalt")
minetest.register_alias("gloopblocks:stair_rainbow_block", "stairs:stair_rainbow_block")
minetest.register_alias("gloopblocks:slab_rainbow_block", "stairs:slab_rainbow_block")
end
-- Tools
minetest.register_tool("gloopblocks:pick_cement", {
description = S("Cement Pickaxe"),
inventory_image = "gloopblocks_cement_pick.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
cracky={times={[1]=3.50, [2]=1.40, [3]=0.90}, uses=25, maxlevel=2}
},
damage_groups = {fleshy=4},
},
})
minetest.register_tool("gloopblocks:shovel_cement", {
description = S("Cement Shovel"),
inventory_image = "gloopblocks_cement_shovel.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
crumbly={times={[1]=1.50, [2]=0.60, [3]=0.45}, uses=25, maxlevel=2}
},
damage_groups = {fleshy=4},
},
})
minetest.register_tool("gloopblocks:axe_cement", {
description = S("Cement Axe"),
inventory_image = "gloopblocks_cement_axe.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
choppy={times={[1]=3.00, [2]=1.30, [3]=0.80}, uses=25, maxlevel=2},
fleshy={times={[2]=1.20, [3]=0.65}, uses=30, maxlevel=1}
},
damage_groups = {fleshy=4},
},
})
minetest.register_tool("gloopblocks:sword_cement", {
description = S("Cement Sword"),
inventory_image = "gloopblocks_cement_sword.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
fleshy={times={[1]=1.60, [2]=0.80, [3]=0.40}, uses=15, maxlevel=2},
snappy={times={[2]=0.75, [3]=0.35}, uses=30, maxlevel=1},
choppy={times={[3]=0.80}, uses=30, maxlevel=0}
},
damage_groups = {fleshy=6},
}
})
minetest.register_tool("gloopblocks:pick_evil", {
description = S("Evil Pickaxe"),
inventory_image = "gloopblocks_evil_pick.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=3,
groupcaps={
cracky={times={[1]=0.10, [2]=0.10, [3]=0.10}, uses=10, maxlevel=2}
},
damage_groups = {fleshy=6},
},
})
minetest.register_tool("gloopblocks:shovel_evil", {
description = S("Evil Shovel"),
inventory_image = "gloopblocks_evil_shovel.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=3,
groupcaps={
crumbly={times={[1]=0.05, [2]=0.05, [3]=0.05}, uses=10, maxlevel=2}
},
damage_groups = {fleshy=6},
},
})
minetest.register_tool("gloopblocks:axe_evil", {
description = S("Evil Axe"),
inventory_image = "gloopblocks_evil_axe.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=3,
groupcaps={
choppy={times={[1]=0.15, [2]=0.15, [3]=0.15}, uses=10, maxlevel=2},
fleshy={times={[1]=0.15, [2]=0.15, [3]=0.15}, uses=10, maxlevel=2}
},
damage_groups = {fleshy=6},
},
})
minetest.register_tool("gloopblocks:sword_evil", {
description = S("Evil Sword"),
inventory_image = "gloopblocks_evil_sword.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=3,
groupcaps={
fleshy={times={[1]=0.20, [2]=0.20, [3]=0.20}, uses=10, maxlevel=2},
snappy={times={[1]=0.20, [2]=0.20, [3]=0.20}, uses=10, maxlevel=2},
choppy={times={[1]=0.20, [2]=0.20, [3]=0.20}, uses=10, maxlevel=2}
},
damage_groups = {fleshy=8},
}
})
-- Other items
minetest.register_craftitem("gloopblocks:evil_stick", {
description = S("Evil Stick"),
inventory_image = "gloopblocks_evil_stick.png",
})
-- define lava-cooling-based nodes and hook into the default lavacooling
-- functions to generate basalt, pumice, and obsidian
if minetest.setting_getbool("gloopblocks_lavacooling") ~= false then
minetest.register_node("gloopblocks:obsidian_cooled", {
description = S("Obsidian"),
tiles = {"default_obsidian.png"},
is_ground_content = true,
sounds = default.node_sound_stone_defaults(),
groups = {cracky=1, level=2, not_in_creative_inventory=1},
drop = "default:obsidian",
after_place_node = function(pos, placer, itemstack, pointed_thing)
minetest.add_node(pos, {name = "default:obsidian"})
end
})
minetest.register_node("gloopblocks:basalt_cooled", {
description = S("Basalt"),
tiles = {"gloopblocks_basalt.png"},
groups = {cracky=2, not_in_creative_inventory=1},
sounds = default.node_sound_stone_defaults(),
drop = "gloopblocks:basalt",
after_place_node = function(pos, placer, itemstack, pointed_thing)
minetest.add_node(pos, {name = "gloopblocks:basalt"})
end
})
minetest.register_node("gloopblocks:pumice_cooled", {
description = S("Pumice"),
tiles = {"gloopblocks_pumice.png"},
groups = {cracky=3, not_in_creative_inventory=1},
sounds = default.node_sound_stone_defaults(),
drop = "gloopblocks:pumice",
after_place_node = function(pos, placer, itemstack, pointed_thing)
minetest.add_node(pos, {name = "gloopblocks:pumice"})
end
})
local gloopblocks_search_nearby_nodes = function(pos, node)
if minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z}).name == node then return true end
if minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z}).name == node then return true end
if minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == node then return true end
if minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == node then return true end
if minetest.get_node({x=pos.x, y=pos.y, z=pos.z-1}).name == node then return true end
if minetest.get_node({x=pos.x, y=pos.y, z=pos.z+1}).name == node then return true end
return false
end
default.cool_lava = function(pos, node)
if node.name == "default:lava_source" then
if gloopblocks_search_nearby_nodes(pos,"default:water_source")
or gloopblocks_search_nearby_nodes(pos,"default:water_flowing") then
minetest.set_node(pos, {name="gloopblocks:obsidian_cooled"})
end
else -- Lava flowing
if gloopblocks_search_nearby_nodes(pos,"default:water_source") then
minetest.set_node(pos, {name="gloopblocks:basalt_cooled"})
elseif gloopblocks_search_nearby_nodes(pos,"default:water_flowing") then
minetest.set_node(pos, {name="gloopblocks:pumice_cooled"})
end
end
end
end
local fence_texture =
"default_fence_overlay.png^default_steel_block.png^default_fence_overlay.png^[makealpha:255,126,126"
minetest.register_node("gloopblocks:fence_steel", {
description = S("Steel Fence"),
drawtype = "fencelike",
tiles = {"default_steel_block.png"},
inventory_image = fence_texture,
wield_image = fence_texture,
paramtype = "light",
sunlight_propagates = true,
is_ground_content = false,
selection_box = {
type = "fixed",
fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7},
},
groups = {choppy = 2, oddly_breakable_by_hand = 2 },
sounds = default.node_sound_stone_defaults(),
})
if minetest.get_modpath("worldedit") then
function gloopblocks.liquid_ungrief(pos1, pos2, name)
local count
local p1to2 = minetest.pos_to_string(pos1).." and "..minetest.pos_to_string(pos2)
local volume = worldedit.volume(pos1, pos2)
minetest.chat_send_player(name, "Cleaning-up lava/water griefing between "..p1to2.."...")
if volume > 1000000 then
minetest.chat_send_player(name, "This operation could affect up to "..volume.." nodes. It may take a while.")
end
minetest.log("action", name.." performs lava/water greifing cleanup between "..p1to2..".")
count = worldedit.replace(pos1, pos2, "default:lava_source", "air")
count = worldedit.replace(pos1, pos2, "default:lava_flowing", "air")
count = worldedit.replace(pos1, pos2, "default:water_source", "air")
count = worldedit.replace(pos1, pos2, "default:water_flowing", "air")
count = worldedit.replace(pos1, pos2, "default:river_water_source", "air")
count = worldedit.replace(pos1, pos2, "default:river_water_flowing", "air")
count = worldedit.replace(pos1, pos2, "gloopblocks:pumice_cooled", "air")
count = worldedit.replace(pos1, pos2, "gloopblocks:basalt_cooled", "air")
count = worldedit.replace(pos1, pos2, "gloopblocks:obsidian_cooled", "air")
count = worldedit.fixlight(pos1, pos2)
minetest.chat_send_player(name, "Operation completed.")
end
minetest.register_chatcommand("/liquid_ungrief", {
params = "[size]",
privs = {worldedit = true},
description = "Repairs greifing caused by spilling lava and water (and their \"cooling\" results)",
func = function(name, params)
local pos1 = worldedit.pos1[name]
local pos2 = worldedit.pos2[name]
if not pos1 or not pos2 then return end
gloopblocks.liquid_ungrief(pos1, pos2, name)
end
})
end
dofile(minetest.get_modpath("gloopblocks").."/crafts.lua")
minetest.register_alias("nyancat:nyancat_rainbow", "gloopblocks:rainbow_block_horizontal")
minetest.register_alias("default:nyancat_rainbow", "gloopblocks:rainbow_block_horizontal")
dofile(MP.."/main.lua")
dofile(MP.."/crafts.lua")
dofile(MP.."/lava-handling.lua")
print(S("Gloopblocks Loaded!"))

View file

@ -0,0 +1,306 @@
-- Load support for intllib.
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
-- define lava-cooling-based nodes and hook into the default lavacooling
-- functions to generate basalt, pumice, and obsidian
if minetest.setting_getbool("gloopblocks_lavacooling") ~= false then
minetest.register_node("gloopblocks:obsidian_cooled", {
description = S("Obsidian"),
tiles = {"default_obsidian.png"},
is_ground_content = true,
sounds = default.node_sound_stone_defaults(),
groups = {cracky=1, level=2, not_in_creative_inventory=1},
drop = "default:obsidian",
after_place_node = function(pos, placer, itemstack, pointed_thing)
minetest.add_node(pos, {name = "default:obsidian"})
end
})
minetest.register_node("gloopblocks:basalt_cooled", {
description = S("Basalt"),
tiles = {"gloopblocks_basalt.png"},
groups = {cracky=2, not_in_creative_inventory=1},
sounds = default.node_sound_stone_defaults(),
drop = "gloopblocks:basalt",
after_place_node = function(pos, placer, itemstack, pointed_thing)
minetest.add_node(pos, {name = "gloopblocks:basalt"})
end
})
minetest.register_node("gloopblocks:pumice_cooled", {
description = S("Pumice"),
tiles = {"gloopblocks_pumice.png"},
groups = {cracky=3, not_in_creative_inventory=1},
sounds = default.node_sound_stone_defaults(),
drop = "gloopblocks:pumice",
after_place_node = function(pos, placer, itemstack, pointed_thing)
minetest.add_node(pos, {name = "gloopblocks:pumice"})
end
})
local gloopblocks_search_nearby_nodes = function(pos, node)
if minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z}).name == node then return true end
if minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z}).name == node then return true end
if minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == node then return true end
if minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == node then return true end
if minetest.get_node({x=pos.x, y=pos.y, z=pos.z-1}).name == node then return true end
if minetest.get_node({x=pos.x, y=pos.y, z=pos.z+1}).name == node then return true end
return false
end
default.cool_lava = function(pos, node)
if node.name == "default:lava_source" then
if gloopblocks_search_nearby_nodes(pos,"default:water_source")
or gloopblocks_search_nearby_nodes(pos,"default:water_flowing") then
minetest.set_node(pos, {name="gloopblocks:obsidian_cooled"})
end
else -- Lava flowing
if gloopblocks_search_nearby_nodes(pos,"default:water_source") then
minetest.set_node(pos, {name="gloopblocks:basalt_cooled"})
elseif gloopblocks_search_nearby_nodes(pos,"default:water_flowing") then
minetest.set_node(pos, {name="gloopblocks:pumice_cooled"})
end
end
end
end
-- Allows lava to "bake" neighboring nodes (or reduce them to ashes)
-- disabled by default. You probably don't want this on a creative server :-P
if minetest.setting_getbool("gloopblocks_lava_damage") then
minetest.register_node("gloopblocks:ash_block", {
description = S("Block of ashes"),
tiles = {"gloopblocks_ashes.png"},
groups = {crumbly = 3},
sounds = default.node_sound_dirt_defaults(),
})
local cbox = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, -0.125, 0.5}
}
minetest.register_node("gloopblocks:ash_pile", {
description = S("Pile of ashes"),
drawtype = "mesh",
mesh = "gloopblocks_ash_pile.obj",
tiles = {"gloopblocks_ashes.png"},
selection_box = cbox,
collision_box = cbox,
groups = {crumbly = 3},
sounds = default.node_sound_dirt_defaults(),
})
gloopblocks.lava_damage_nodes = {
["default:cactus"] = "gloopblocks:ash_block",
["default:coalblock"] = "gloopblocks:ash_block",
["default:desert_cobble"] = "default:desert_stone",
["default:desert_sandstone"] = "default:desert_sandstone_block",
["default:gravel"] = "default:cobble",
["default:ice"] = "default:snowblock",
["default:permafrost"] = "default:dirt",
["default:permafrost_with_moss"] = "default:dirt",
["default:sandstone"] = "default:sandstone_block",
["default:silver_sandstone"] = "default:silver_sandstone_block",
["default:snowblock"] = "default:water_source",
["basic_materials:cement_block"] = "basic_materials:concrete_block",
["bedrock:deepstone"] = "default:stone",
["building_blocks:hardwood"] = "default:coalblock",
["building_blocks:Tar"] = "gloopblocks:pavement",
["bushes:basket_empty"] = "gloopblocks:ash_pile",
["bushes:basket_blackberry"] = "gloopblocks:ash_pile",
["bushes:basket_blueberry"] = "gloopblocks:ash_pile",
["bushes:basket_gooseberry"] = "gloopblocks:ash_pile",
["bushes:basket_mixed_berry"] = "gloopblocks:ash_pile",
["bushes:basket_raspberry"] = "gloopblocks:ash_pile",
["bushes:basket_strawberry"] = "gloopblocks:ash_pile",
["caverealms:thin_ice"] = "default:water_source",
["castle_masonry:rubble"] = "default:desert_stone",
["usesdirt:dirt_stone"] = "default:stone",
["usesdirt:dirt_cobble_stone"] = "default:stone",
["wool:dark_grey"] = "gloopblocks:ash_pile"
}
gloopblocks.lava_damage_groups = {
["wood"] = "default:coalblock",
["tree"] = "default:coalblock",
["soil"] = "gloopblocks:basalt",
["leaves"] = "gloopblocks:ash_pile",
["fence"] = "gloopblocks:ash_pile",
["stone"] = "default:stone",
}
if minetest.get_modpath("cottages") then
gloopblocks.lava_damage_nodes["cottages:hay"] = "cottages:reet"
gloopblocks.lava_damage_nodes["cottages:hay_bale"] = "cottages:reet"
gloopblocks.lava_damage_nodes["cottages:hay_mat"] = "cottages:straw_mat"
gloopblocks.lava_damage_nodes["cottages:reet"] = "gloopblocks:ash_pile"
gloopblocks.lava_damage_nodes["cottages:roof_black"] = "gloopblocks:ash_pile"
gloopblocks.lava_damage_nodes["cottages:roof_brown"] = "gloopblocks:ash_pile"
gloopblocks.lava_damage_nodes["cottages:roof_red"] = "gloopblocks:ash_pile"
gloopblocks.lava_damage_nodes["cottages:roof_reet"] = "gloopblocks:ash_pile"
gloopblocks.lava_damage_nodes["cottages:roof_straw"] = "cottages:roof_reet"
gloopblocks.lava_damage_nodes["cottages:roof_wood"] = "gloopblocks:ash_pile"
gloopblocks.lava_damage_nodes["cottages:roof_connector_black"] = "gloopblocks:ash_pile"
gloopblocks.lava_damage_nodes["cottages:roof_connector_brown"] = "gloopblocks:ash_pile"
gloopblocks.lava_damage_nodes["cottages:roof_connector_red"] = "gloopblocks:ash_pile"
gloopblocks.lava_damage_nodes["cottages:roof_connector_reet"] = "gloopblocks:ash_pile"
gloopblocks.lava_damage_nodes["cottages:roof_connector_straw"] = "cottages:roof_connector_reet"
gloopblocks.lava_damage_nodes["cottages:roof_connector_wood"] = "gloopblocks:ash_pile"
gloopblocks.lava_damage_nodes["cottages:roof_flat_black"] = "gloopblocks:ash_pile"
gloopblocks.lava_damage_nodes["cottages:roof_flat_brown"] = "gloopblocks:ash_pile"
gloopblocks.lava_damage_nodes["cottages:roof_flat_red"] = "gloopblocks:ash_pile"
gloopblocks.lava_damage_nodes["cottages:roof_flat_reet"] = "gloopblocks:ash_pile"
gloopblocks.lava_damage_nodes["cottages:roof_flat_straw"] = "cottages:roof_flat_reet"
gloopblocks.lava_damage_nodes["cottages:roof_flat_wood"] = "gloopblocks:ash_pile"
gloopblocks.lava_damage_nodes["cottages:straw_ground"] = "cottages:loam"
gloopblocks.lava_damage_nodes["cottages:loam"] = "default:dirt"
gloopblocks.lava_damage_nodes["cottages:feldweg"] = "default:dirt"
gloopblocks.lava_damage_nodes["cottages:feldweg_crossing"] = "default:dirt"
gloopblocks.lava_damage_nodes["cottages:feldweg_curve"] = "default:dirt"
gloopblocks.lava_damage_nodes["cottages:feldweg_end"] = "default:dirt"
gloopblocks.lava_damage_nodes["cottages:feldweg_slope"] = "default:dirt"
gloopblocks.lava_damage_nodes["cottages:feldweg_slope_long"] = "default:dirt"
gloopblocks.lava_damage_nodes["cottages:feldweg_t_junction"] = "default:dirt"
end
if minetest.get_modpath("dryplants") then
gloopblocks.lava_damage_nodes["dryplants:wetreed"] = "dryplants:reed"
gloopblocks.lava_damage_nodes["dryplants:wetreed_slab"] = "dryplants:reed_slab"
gloopblocks.lava_damage_nodes["dryplants:wetreed_roof"] = "dryplants:reed_roof"
gloopblocks.lava_damage_nodes["dryplants:wetreed_roof_corner"] = "dryplants:reed_roof_corner"
gloopblocks.lava_damage_nodes["dryplants:wetreed_roof_corner_2"] = "dryplants:reed_roof_corner_2"
gloopblocks.lava_damage_nodes["dryplants:reed"] = "gloopblocks:ash_pile"
gloopblocks.lava_damage_nodes["dryplants:reed_slab"] = "gloopblocks:ash_pile"
gloopblocks.lava_damage_nodes["dryplants:reed_roof"] = "gloopblocks:ash_pile"
gloopblocks.lava_damage_nodes["dryplants:reed_roof_corner"] = "gloopblocks:ash_pile"
gloopblocks.lava_damage_nodes["dryplants:reed_roof_corner_2"] = "gloopblocks:ash_pile"
end
if minetest.get_modpath("wool") then
gloopblocks.lava_damage_groups["wool"] = "wool:dark_grey"
end
if minetest.get_modpath("bakedclay") then
gloopblocks.lava_damage_nodes["default:clay"] = "bakedclay:dark_grey"
gloopblocks.lava_damage_groups["bakedclay"] = "bakedclay:dark_grey"
else
gloopblocks.lava_damage_nodes["default:clay"] = "gloopblocks:basalt"
end
if minetest.get_modpath("moreblocks") then
gloopblocks.lava_damage_groups["sand"] = "moreblocks:coal_glass"
else
gloopblocks.lava_damage_groups["sand"] = "default:obsidian_glass"
end
if minetest.get_modpath("farming") then
gloopblocks.lava_damage_nodes["farming:soil_wet"] = "farming:soil"
end
gloopblocks.lava_neighbors = {
{ x=-1, y=-1, z=-1 },
{ x=-1, y=-1, z= 0 },
{ x=-1, y=-1, z= 1 },
{ x=-1, y= 0, z=-1 },
{ x=-1, y= 0, z= 0 },
{ x=-1, y= 0, z= 1 },
{ x=-1, y= 1, z=-1 },
{ x=-1, y= 1, z= 0 },
{ x=-1, y= 1, z= 1 },
{ x= 0, y=-1, z=-1 },
{ x= 0, y=-1, z= 0 },
{ x= 0, y=-1, z= 1 },
{ x= 0, y= 0, z=-1 },
-- { x= 0, y= 0, z= 0 }, -- will always be the lava node, so ignore this space
{ x= 0, y= 0, z= 1 },
{ x= 0, y= 1, z=-1 },
{ x= 0, y= 1, z= 0 },
{ x= 0, y= 1, z= 1 },
{ x= 1, y=-1, z=-1 },
{ x= 1, y=-1, z= 0 },
{ x= 1, y=-1, z= 1 },
{ x= 1, y= 0, z=-1 },
{ x= 1, y= 0, z= 0 },
{ x= 1, y= 0, z= 1 },
{ x= 1, y= 1, z=-1 },
{ x= 1, y= 1, z= 0 },
{ x= 1, y= 1, z= 1 },
}
minetest.register_abm({
nodenames = {"default:lava_source", "default:lava_flowing"},
interval = 5,
chance = 2,
action = function(pos, node, active_object_count, active_object_count_wider)
local r=gloopblocks.lava_neighbors[math.random(1, 26)]
local pos2 = {
x = pos.x + r.x,
y = pos.y + r.y,
z = pos.z + r.z
}
local newnode
local chknode = minetest.get_node(pos2)
local def = minetest.registered_items[chknode.name]
if gloopblocks.lava_damage_nodes[chknode.name] then
newnode = gloopblocks.lava_damage_nodes[chknode.name]
elseif def and def.drawtype == "plantlike" then
newnode = "air"
else
for group, new in pairs(gloopblocks.lava_damage_groups) do
if minetest.get_item_group(chknode.name, group) > 0 then
newnode = new
break
end
end
end
if newnode then
minetest.set_node(pos2, {name = newnode, param2 = chknode.param2})
end
end
})
end
if minetest.get_modpath("worldedit") then
function gloopblocks.liquid_ungrief(pos1, pos2, name)
local count
local p1to2 = minetest.pos_to_string(pos1).." and "..minetest.pos_to_string(pos2)
local volume = worldedit.volume(pos1, pos2)
minetest.chat_send_player(name, "Cleaning-up lava/water griefing between "..p1to2.."...")
if volume > 1000000 then
minetest.chat_send_player(name, "This operation could affect up to "..volume.." nodes. It may take a while.")
end
minetest.log("action", name.." performs lava/water greifing cleanup between "..p1to2..".")
count = worldedit.replace(pos1, pos2, "default:lava_source", "air")
count = worldedit.replace(pos1, pos2, "default:lava_flowing", "air")
count = worldedit.replace(pos1, pos2, "default:water_source", "air")
count = worldedit.replace(pos1, pos2, "default:water_flowing", "air")
count = worldedit.replace(pos1, pos2, "default:river_water_source", "air")
count = worldedit.replace(pos1, pos2, "default:river_water_flowing", "air")
count = worldedit.replace(pos1, pos2, "gloopblocks:pumice_cooled", "air")
count = worldedit.replace(pos1, pos2, "gloopblocks:basalt_cooled", "air")
count = worldedit.replace(pos1, pos2, "gloopblocks:obsidian_cooled", "air")
count = worldedit.fixlight(pos1, pos2)
minetest.chat_send_player(name, "Operation completed.")
end
minetest.register_chatcommand("/liquid_ungrief", {
params = "[size]",
privs = {worldedit = true},
description = "Repairs greifing caused by spilling lava and water (and their \"cooling\" results)",
func = function(name, params)
local pos1 = worldedit.pos1[name]
local pos2 = worldedit.pos2[name]
if not pos1 or not pos2 then return end
gloopblocks.liquid_ungrief(pos1, pos2, name)
end
})
end

839
mods/gloopblocks/main.lua Normal file
View file

@ -0,0 +1,839 @@
-- Load support for intllib.
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
-- Nodes
minetest.register_node("gloopblocks:rainbow_block_diagonal", {
description = S("Diagonal Rainbow Block"),
tiles = {"gloopblocks_rainbow_block.png"},
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_defaults(),
})
minetest.register_alias("gloopblocks:rainbow_block", "gloopblocks:rainbow_block_diagonal")
minetest.register_node("gloopblocks:rainbow_block_horizontal", {
description = S("Horizontal Rainbow Block"),
tiles = {
"gloopblocks_rainbow_horizontal.png^[transformR90",
"gloopblocks_rainbow_horizontal.png^[transformR90",
"gloopblocks_rainbow_horizontal.png"
},
paramtype = "light",
light_source = default.LIGHT_MAX,
paramtype2 = "facedir",
groups = {cracky = 2},
is_ground_content = false,
sounds = default.node_sound_defaults(),
})
minetest.register_node("gloopblocks:evil_block", {
description = S("Evil Block"),
tiles = {"gloopblocks_evil_block.png"},
light_source = 5,
is_ground_content = true,
groups = {cracky=2},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("gloopblocks:basalt", {
description = S("Basalt"),
tiles = {"gloopblocks_basalt.png"},
groups = {cracky=2},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("gloopblocks:pumice", {
description = S("Pumice"),
tiles = {"gloopblocks_pumice.png"},
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("gloopblocks:pavement", {
description = S("Pavement"),
tiles = {"gloopblocks_pavement.png"},
groups = {cracky=3, oddly_breakable_by_hand=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("gloopblocks:oerkki_block", {
drawtype = "nodebox",
description = S("Oerkki Block"),
paramtype = "light",
paramtype2 = "facedir",
tiles = {
"gloopblocks_oerkkiblock_tb.png",
"gloopblocks_oerkkiblock_tb.png",
"gloopblocks_oerkkiblock_sides.png",
"gloopblocks_oerkkiblock_sides.png",
"gloopblocks_oerkkiblock_sides.png",
"gloopblocks_oerkkiblock_front.png"
},
groups = {cracky=3, oddly_breakable_by_hand=3},
sounds = default.node_sound_stone_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 }
},
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.1875, 0.5, 0.5, 0.1875}, -- NodeBox1
{-0.5, -0.5, -0.5, -0.4375, 0.5, 0.5}, -- NodeBox2
{0.4375, -0.5, -0.5, 0.5, 0.5, 0.5}, -- NodeBox3
{-0.5, 0.4375, -0.5, 0.5, 0.5, 0.5}, -- NodeBox4
{-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5}, -- NodeBox5
{-0.5, -0.0625, -0.5, 0.5, 0.0625, 0.5}, -- NodeBox6
}
}
})
minetest.register_node("gloopblocks:stone_brick_mossy", {
description = S("Mossy Stone Brick"),
tiles = {"gloopblocks_stone_brick_mossy.png"},
groups = {cracky=3, stone=1},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("gloopblocks:stone_mossy", {
description = S("Mossy Stone"),
tiles = {"gloopblocks_stone_mossy.png"},
groups = {cracky=3, stone=1},
sounds = default.node_sound_stone_defaults(),
drop = "default:mossycobble"
})
minetest.register_node("gloopblocks:cobble_road", {
description = S("Cobblestone Road Bed"),
tiles = {"gloopblocks_cobble_road.png"},
groups = {cracky=3, stone=1},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("gloopblocks:cobble_road_mossy", {
description = S("Mossy Cobblestone Road Bed"),
tiles = {"gloopblocks_cobble_road_mossy.png"},
groups = {cracky=3, stone=1},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("gloopblocks:scaffolding", {
description = S("Wooden Scaffold"),
drawtype = "allfaces",
paramtype = "light",
sunlight_propagates = true,
tiles = {"gloopblocks_scaffold.png"},
groups = {choppy=3, oddly_breakable_by_hand=3},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_alias("moreblocks:oerkkiblock", "gloopblocks:oerkki_block")
minetest.register_alias("gloopblocks:obsidian", "default:obsidian")
-- Nodes imported from Usesdirt ================================================================================
if not minetest.get_modpath("usesdirt") then
local dirt_brick_tex = "default_dirt.png^gloopblocks_dirt_brick_overlay.png"
local dirt_cobble_tex = "default_cobble.png^(default_dirt.png^[mask:gloopblocks_dirt_cobble_mask.png)"
local dirt_stone_tex = "default_stone.png^(default_dirt.png^[mask:gloopblocks_dirt_stone_mask.png)"
local dirt_ladder_tex = "(default_dirt.png^[mask:gloopblocks_ladder_mask.png)^gloopblocks_ladder_overlay.png"
local dirt_brick_ladder_tex = "(("..dirt_brick_tex..")^[mask:gloopblocks_ladder_mask.png)^gloopblocks_ladder_overlay.png"
local dirt_cobble_ladder_tex = "(("..dirt_cobble_tex..")^[mask:gloopblocks_ladder_mask.png)^gloopblocks_ladder_overlay.png"
local dirt_stone_ladder_tex = "(("..dirt_stone_tex..")^[mask:gloopblocks_ladder_mask.png)^gloopblocks_ladder_overlay.png"
minetest.register_node(":usesdirt:dirt_brick", {
tiles = { dirt_brick_tex },
description = "Dirt Brick",
groups = {snappy=2,choppy=1,oddly_breakable_by_hand=2},
})
minetest.register_node(":usesdirt:dirt_brick_ladder", {
description = "Dirt Brick Ladder",
drawtype = "signlike",
tiles = { dirt_brick_ladder_tex },
inventory_image = dirt_brick_ladder_tex,
wield_image = dirt_brick_ladder_tex,
paramtype = "light",
paramtype2 = "wallmounted",
is_ground_content = true,
walkable = false,
climbable = true,
selection_box = {
type = "wallmounted",
--wall_top = = <default>
--wall_bottom = = <default>
--wall_side = = <default>
},
groups = {cracky=3, stone=2},
legacy_wallmounted = true,
})
minetest.register_craft({
output = 'usesdirt:dirt_brick_ladder 3',
recipe = {
{'usesdirt:dirt_brick', '', 'usesdirt:dirt_brick'},
{'usesdirt:dirt_brick', 'usesdirt:dirt_brick','usesdirt:dirt_brick'},
{'usesdirt:dirt_brick','','usesdirt:dirt_brick'},
}
})
default.register_fence(":usesdirt:dirt_brick_fence", {
description = "Dirt Brick Fence",
texture = dirt_brick_tex,
inventory_image = "default_fence_overlay.png^("..dirt_brick_tex..")^default_fence_overlay.png^[makealpha:255,126,126",
wield_image = "default_fence_overlay.png^("..dirt_brick_tex..")^default_fence_overlay.png^[makealpha:255,126,126",
material = "usesdirt:dirt_brick",
groups = {cracky=3, stone=2},
sounds = default.node_sound_stone_defaults(),
check_for_pole = true
})
if minetest.get_modpath("moreblocks") then
minetest.register_craft({
output = 'usesdirt:dirt_brick 24',
recipe = {
{'moreblocks:dirt_compressed', 'moreblocks:dirt_compressed', '' },
{'moreblocks:dirt_compressed', 'moreblocks:dirt_compressed', '' }
}
})
else
minetest.register_craft({
output = 'usesdirt:dirt_brick 6',
recipe = {
{'default:dirt', 'default:dirt', 'default:dirt'},
{'default:dirt', 'default:dirt', 'default:dirt'},
{'default:dirt', 'default:dirt', 'default:dirt'},
}
})
end
minetest.register_node(":usesdirt:dirt_ladder", {
description = "Dirt Ladder",
drawtype = "signlike",
tiles = { dirt_ladder_tex },
inventory_image = dirt_ladder_tex,
wield_image = dirt_ladder_tex,
paramtype = "light",
paramtype2 = "wallmounted",
is_ground_content = true,
walkable = false,
climbable = true,
selection_box = {
type = "wallmounted",
--wall_top = = <default>
--wall_bottom = = <default>
--wall_side = = <default>
},
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3},
legacy_wallmounted = true,
})
minetest.register_craft({
output = 'usesdirt:dirt_ladder 3',
recipe = {
{'usesdirt:dirt_brick', '', 'usesdirt:dirt_brick'},
{'usesdirt:dirt_brick', 'usesdirt:dirt_brick','usesdirt:dirt_brick'},
{'usesdirt:dirt_brick','','usesdirt:dirt_brick'},
}
})
default.register_fence(":usesdirt:dirt_fence", {
description = "Dirt Fence",
texture = "default_dirt.png",
inventory_image = "default_fence_overlay.png^default_dirt.png^default_fence_overlay.png^[makealpha:255,126,126",
wield_image = "default_fence_overlay.png^default_dirt.png^default_fence_overlay.png^[makealpha:255,126,126",
material = "default:dirt",
groups = {snappy=2,choppy=1,oddly_breakable_by_hand=3},
sounds = default.node_sound_dirt_defaults(),
check_for_pole = true
})
----
minetest.register_node(":usesdirt:dirt_cobble_stone", {
tiles = { dirt_cobble_tex },
description = "Dirt Cobble Stone",
is_ground_content = true,
groups = {cracky=3, stone=2},
})
minetest.register_craft({
output = '"usesdirt:dirt_cobble_stone" 3',
recipe = {
{'usesdirt:dirt_brick', 'usesdirt:dirt_brick', 'usesdirt:dirt_brick'},
{'usesdirt:dirt_brick', 'usesdirt:dirt_brick', 'usesdirt:dirt_brick'},
{'usesdirt:dirt_brick', 'usesdirt:dirt_brick', 'usesdirt:dirt_brick'},
}
})
minetest.register_node(":usesdirt:dirt_cobble_stone_ladder", {
description = "Dirt Cobble Stone Ladder",
drawtype = "signlike",
tiles = { dirt_cobble_ladder_tex },
inventory_image = dirt_cobble_ladder_tex,
wield_image = dirt_cobble_ladder_tex,
paramtype = "light",
paramtype2 = "wallmounted",
is_ground_content = true,
walkable = false,
climbable = true,
selection_box = {
type = "wallmounted",
--wall_top = = <default>
--wall_bottom = = <default>
--wall_side = = <default>
},
groups = {cracky=3, stone=2},
legacy_wallmounted = true,
})
minetest.register_craft({
output = 'usesdirt:dirt_cobble_stone_ladder 3',
recipe = {
{'usesdirt:dirt_cobble_stone', '', 'usesdirt:dirt_cobble_stone'},
{'usesdirt:dirt_cobble_stone', 'usesdirt:dirt_cobble_stone','usesdirt:dirt_cobble_stone'},
{'usesdirt:dirt_cobble_stone','','usesdirt:dirt_cobble_stone'},
}
})
default.register_fence(":usesdirt:dirt_cobble_stone_fence", {
description = "Dirt Cobble Stone Fence",
texture = dirt_cobble_tex,
inventory_image = "default_fence_overlay.png^("..dirt_cobble_tex..")^default_fence_overlay.png^[makealpha:255,126,126",
wield_image = "default_fence_overlay.png^("..dirt_cobble_tex..")^default_fence_overlay.png^[makealpha:255,126,126",
material = "usesdirt:dirt_cobble_stone",
groups = {cracky=3, stone=2},
sounds = default.node_sound_stone_defaults(),
check_for_pole = true
})
----
minetest.register_node(":usesdirt:dirt_stone", {
tiles = { dirt_stone_tex },
description = "Dirt Stone",
is_ground_content = true,
groups = {cracky=3, stone=2},
})
minetest.register_node(":usesdirt:dirt_stone_ladder", {
description = "Dirt Stone Ladder",
drawtype = "signlike",
tiles = { dirt_stone_ladder_tex },
inventory_image = dirt_stone_ladder_tex,
wield_image = dirt_stone_ladder_tex,
paramtype = "light",
paramtype2 = "wallmounted",
is_ground_content = true,
walkable = false,
climbable = true,
selection_box = {
type = "wallmounted",
--wall_top = = <default>
--wall_bottom = = <default>
--wall_side = = <default>
},
groups = {cracky=3, stone=2},
legacy_wallmounted = true,
})
minetest.register_craft({
output = 'usesdirt:dirt_stone_ladder 3',
recipe = {
{'usesdirt:dirt_stone', '', 'usesdirt:dirt_stone'},
{'usesdirt:dirt_stone', 'usesdirt:dirt_stone','usesdirt:dirt_stone'},
{'usesdirt:dirt_stone','','usesdirt:dirt_stone'},
}
})
default.register_fence(":usesdirt:dirt_stone_fence", {
description = "Dirt Stone Fence",
texture = dirt_stone_tex,
inventory_image = "default_fence_overlay.png^("..dirt_stone_tex..")^default_fence_overlay.png^[makealpha:255,126,126",
wield_image = "default_fence_overlay.png^("..dirt_stone_tex..")^default_fence_overlay.png^[makealpha:255,126,126",
material = "usesdirt:dirt_stone",
groups = {cracky=3, stone=2},
sounds = default.node_sound_stone_defaults(),
check_for_pole = true
})
end
-- Stairs/slabs defs, conversion of normal -> mossy items
if minetest.setting_getbool("gloopblocks_mossy_conversion") ~= false then
function gloopblocks_register_mossy_conversion(mossyobjects)
for i in ipairs(mossyobjects) do
minetest.register_abm({
nodenames = { mossyobjects[i][1] },
neighbors = {"default:water_source", "default:water_flowing"},
interval = 120,
chance = 50,
action = function(pos, node)
if minetest.find_node_near(pos, 2, "air") then
local fdir = node.param2
minetest.add_node(pos, {name = mossyobjects[i][2], param2 = fdir})
end
end,
})
end
end
end
if minetest.get_modpath("moreblocks") then
stairsplus:register_all("gloopblocks", "oerkki_block", "gloopblocks:oerkki_block", {
description = S("Oerkki Block"),
tiles = {
"gloopblocks_oerkkiblock_tb.png",
"gloopblocks_oerkkiblock_tb.png",
"gloopblocks_oerkkiblock_sides.png",
"gloopblocks_oerkkiblock_sides.png",
"gloopblocks_oerkkiblock_sides.png",
"gloopblocks_oerkkiblock_front.png"
},
groups = {cracky=2, not_in_creative_inventory=1},
sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true,
})
stairsplus:register_all("gloopblocks", "stone_brick_mossy", "gloopblocks:stone_brick_mossy", {
description = S("Mossy Stone Brick"),
tiles = {"gloopblocks_stone_brick_mossy.png"},
groups = {cracky=1, not_in_creative_inventory=1},
sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true,
})
stairsplus:register_all("gloopblocks", "stone_mossy", "gloopblocks:stone_mossy", {
description = S("Mossy Stone"),
tiles = {"gloopblocks_stone_mossy.png"},
groups = {cracky=1, not_in_creative_inventory=1},
sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true,
})
stairsplus:register_all("gloopblocks", "cobble_road", "gloopblocks:cobble_road", {
description = S("Cobblestone Roadbed"),
tiles = {"gloopblocks_cobble_road.png"},
groups = {cracky=3, stone=1, not_in_creative_inventory=1},
sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true,
})
stairsplus:register_all("gloopblocks", "cobble_road_mossy", "gloopblocks:cobble_road_mossy", {
description = S("Mossy Cobblestone Roadbed"),
tiles = {"gloopblocks_cobble_road_mossy.png"},
groups = {cracky=3, stone=1, not_in_creative_inventory=1},
sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true,
})
stairsplus:register_all("gloopblocks", "pavement", "gloopblocks:pavement", {
description = S("Pavement"),
tiles = {"gloopblocks_pavement.png"},
groups = {cracky=2, not_in_creative_inventory=1},
sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true,
})
stairsplus:register_all("gloopblocks", "rainbow_block", "gloopblocks:rainbow_block", {
description = S("Rainbow Block"),
tiles = {"gloopblocks_rainbow_block.png"},
groups = {cracky=3, not_in_creative_inventory=1},
sounds = default.node_sound_defaults(),
sunlight_propagates = true,
})
stairsplus:register_all("gloopblocks", "evil_block", "gloopblocks:evil_block", {
description = S("Evil Block"),
tiles = {"gloopblocks_evil_block.png"},
groups = {cracky=3, not_in_creative_inventory=1},
sounds = default.node_sound_defaults(),
light_source = 5,
sunlight_propagates = true,
})
stairsplus:register_all("gloopblocks", "basalt", "gloopblocks:basalt", {
description = S("Basalt"),
tiles = {"gloopblocks_basalt.png"},
groups = {cracky=2, not_in_creative_inventory=1},
sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true,
})
stairsplus:register_all("gloopblocks", "pumice", "gloopblocks:pumice", {
description = S("Pumice"),
tiles = {"gloopblocks_pumice.png"},
groups = {cracky=3, not_in_creative_inventory=1},
sounds = default.node_sound_stone_defaults(),
sunlight_propagates = true,
})
stairsplus:register_all("gloopblocks", "gravel", "default:gravel", {
description = S("Gravel"),
tiles = {"default_gravel.png"},
groups = {crumbly = 2, falling_node = 1, not_in_creative_inventory=1},
sounds = default.node_sound_stone_defaults(),
sunlight_propagates = false,
})
if minetest.get_modpath("caverealms") then
stairsplus:register_all("caverealms", "glow_crystal", "caverealms:glow_crystal", {
description = S("Glow Crystal"),
tiles = {"caverealms_glow_crystal.png"},
groups = {cracky=3, not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
light_source = 12,
use_texture_alpha = true,
paramtype="light",
sunlight_propagates = true,
})
stairsplus:register_all("caverealms", "glow_emerald", "caverealms:glow_emerald", {
description = S("Glow Emerald"),
tiles = {"caverealms_glow_emerald.png"},
groups = {cracky=3, not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
light_source = 12,
use_texture_alpha = true,
paramtype="light",
sunlight_propagates = true,
})
stairsplus:register_all("caverealms", "glow_mese", "caverealms:glow_mese", {
description = S("Glow Mese"),
tiles = {"caverealms_glow_mese.png"},
groups = {cracky=3, not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults(),
light_source = 12,
use_texture_alpha = true,
paramtype="light",
sunlight_propagates = true,
})
end
-- ABMs for mossy objects
if minetest.setting_getbool("gloopblocks_mossy_conversion") ~= false then
gloopblocks_register_mossy_conversion({
{ "moreblocks:stair_cobble", "moreblocks:stair_mossycobble" },
{ "moreblocks:stair_cobble_inner", "moreblocks:stair_mossycobble_inner" },
{ "moreblocks:stair_cobble_outer", "moreblocks:stair_mossycobble_outer" },
{ "moreblocks:stair_cobble_half", "moreblocks:stair_mossycobble_half" },
{ "moreblocks:slab_cobble_quarter", "moreblocks:slab_mossycobble_quarter" },
{ "moreblocks:slab_cobble", "moreblocks:slab_mossycobble" },
{ "moreblocks:slab_cobble_three_quarter", "moreblocks:slab_mossycobble_three_quarter" },
{ "moreblocks:panel_cobble", "moreblocks:panel_mossycobble" },
{ "moreblocks:micro_cobble", "moreblocks:micro_mossycobble" },
{ "moreblocks:stair_cobble_alt", "moreblocks:stair_mossycobble_alt" },
{ "gloopblocks:cobble_road", "gloopblocks:cobble_road_mossy" },
{ "gloopblocks:stair_cobble_road", "gloopblocks:stair_cobble_road_mossy" },
{ "gloopblocks:slab_cobble_road", "gloopblocks:slab_cobble_road_mossy" },
{ "gloopblocks:stair_cobble_road", "gloopblocks:stair_cobble_road_mossy" },
{ "gloopblocks:stair_cobble_road_inner", "gloopblocks:stair_cobble_road_mossy_inner" },
{ "gloopblocks:stair_cobble_road_outer", "gloopblocks:stair_cobble_road_mossy_outer" },
{ "gloopblocks:stair_cobble_road_half", "gloopblocks:stair_cobble_road_mossy_half" },
{ "gloopblocks:slab_cobble_road_quarter", "gloopblocks:slab_cobble_road_mossy_quarter" },
{ "gloopblocks:slab_cobble_road", "gloopblocks:slab_cobble_road_mossy" },
{ "gloopblocks:slab_cobble_road_three_quarter", "gloopblocks:slab_cobble_road_mossy_three_quarter" },
{ "gloopblocks:panel_cobble_road", "gloopblocks:panel_cobble_road_mossy" },
{ "gloopblocks:micro_cobble_road", "gloopblocks:micro_cobble_road_mossy" },
{ "gloopblocks:stair_cobble_road_alt", "gloopblocks:stair_cobble_road_mossy_alt" },
{ "default:stonebrick", "gloopblocks:stone_brick_mossy" },
{ "default:stair_stonebrick", "gloopblocks:stair_stone_brick_mossy" },
{ "default:slab_stonebrick", "gloopblocks:slab_stone_brick_mossy" },
{ "moreblocks:stair_stonebrick", "gloopblocks:stair_stone_brick_mossy" },
{ "moreblocks:stair_stonebrick_inner", "gloopblocks:stair_stone_brick_mossy_inner" },
{ "moreblocks:stair_stonebrick_outer", "gloopblocks:stair_stone_brick_mossy_outer" },
{ "moreblocks:stair_stonebrick_half", "gloopblocks:stair_stone_brick_mossy_half" },
{ "moreblocks:slab_stonebrick_quarter", "gloopblocks:slab_stone_brick_mossy_quarter" },
{ "moreblocks:slab_stonebrick", "gloopblocks:slab_stone_brick_mossy" },
{ "moreblocks:slab_stonebrick_three_quarter", "gloopblocks:slab_stone_brick_mossy_three_quarter" },
{ "moreblocks:panel_stonebrick", "gloopblocks:panel_stone_brick_mossy" },
{ "moreblocks:micro_stonebrick", "gloopblocks:micro_stone_brick_mossy" },
{ "moreblocks:stair_stonebrick_alt", "gloopblocks:stair_stone_brick_mossy_alt" },
{ "default:stone", "gloopblocks:stone_mossy" },
{ "default:stair_stone", "gloopblocks:stair_stone_mossy" },
{ "default:slab_stone", "gloopblocks:slab_stone_mossy" },
{ "moreblocks:stair_stone", "gloopblocks:stair_stone_mossy" },
{ "moreblocks:stair_stone_inner", "gloopblocks:stair_stone_mossy_inner" },
{ "moreblocks:stair_stone_outer", "gloopblocks:stair_stone_mossy_outer" },
{ "moreblocks:stair_stone_half", "gloopblocks:stair_stone_mossy_half" },
{ "moreblocks:slab_stone_quarter", "gloopblocks:slab_stone_mossy_quarter" },
{ "moreblocks:slab_stone", "gloopblocks:slab_stone_mossy" },
{ "moreblocks:slab_stone_three_quarter", "gloopblocks:slab_stone_mossy_three_quarter" },
{ "moreblocks:panel_stone", "gloopblocks:panel_stone_mossy" },
{ "moreblocks:micro_stone", "gloopblocks:micro_stone_mossy" },
{ "moreblocks:stair_stone_alt", "gloopblocks:stair_stone_mossy_alt" },
})
end
elseif minetest.get_modpath("stairs") then
--stairs.register_stair(subname, recipeitem, groups, images, description, sounds)
-- stairs:xxxx_stone_mossy ; xxxx = stair or slab
stairs.register_stair_and_slab("stone_mossy", "gloopblocks:stone_mossy",
{cracky=3},
{"gloopblocks_stone_mossy.png"},
S("Mossy Stone Stair"),
S("Mossy Stone Slab"),
default.node_sound_stone_defaults())
-- stairs:xxxx_mossycobble
stairs.register_stair_and_slab("mossycobble", "default:mossycobble",
{cracky=3},
{"default_mossycobble.png"},
S("Mossy Cobble Stair"),
S("Mossy Cobble Slab"),
default.node_sound_stone_defaults())
-- stairs:xxxx_stone_brick_mossy
stairs.register_stair_and_slab("stone_brick_mossy", "gloopblocks:stone_brick_mossy",
{cracky=3},
{"gloopblocks_stone_brick_mossy.png"},
S("Mossy Stone Brick Stair"),
S("Mossy Stone Brick Slab"),
default.node_sound_stone_defaults())
-- stairs:xxxx_cobble_road
stairs.register_stair_and_slab("cobble_road", "gloopblocks:cobble_road",
{cracky=3},
{"gloopblocks_cobble_road.png"},
S("Cobble Roadbed Stair"),
S("Cobble Roadbed Slab"),
default.node_sound_stone_defaults())
-- stairs:xxxx_cobble_road_mossy
stairs.register_stair_and_slab("cobble_road_mossy", "gloopblocks:cobble_road_mossy",
{cracky=3},
{"gloopblocks_cobble_road_mossy.png"},
S("Mossy Cobble Roadbed Stair"),
S("Mossy Cobble Roadbed Slab"),
default.node_sound_stone_defaults())
-- stairs:xxxx_cement
stairs.register_stair_and_slab("cement", "gloopblocks:cement",
{cracky=2},
{"basic_materials_cement_block.png"},
S("Cement Stair"),
S("Cement Slab"),
default.node_sound_stone_defaults())
-- stairs:xxxx_pavement
stairs.register_stair_and_slab("pavement", "gloopblocks:pavement",
{cracky=3, oddly_breakable_by_hand=3},
{"gloopblocks_pavement.png"},
S("Pavement Stair"),
S("Pavement Slab"),
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("basalt", "gloopblocks:basalt",
{cracky=2},
{"gloopblocks_basalt.png"},
S("Basalt Stair"),
S("Basalt Slab"),
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("pumice", "gloopblocks:pumice",
{cracky=3},
{"gloopblocks_pumice.png"},
S("Pumice Stair"),
S("Pumice Slab"),
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("rainbow_block", "gloopblocks:rainbow_block",
{cracky=3},
{"gloopblocks_rainbow_block.png"},
S("Rainbow Block Stair"),
S("Rainbow Block Slab"),
default.node_sound_defaults())
if minetest.setting_getbool("gloopblocks_mossy_conversion") ~= false then
gloopblocks_register_mossy_conversion({
{ "default:cobble", "default:mossycobble" },
{ "stairs:stair_cobble", "stairs:stair_mossycobble" },
{ "stairs:slab_cobble", "stairs:slab_mossycobble" },
{ "gloopblocks:cobble_road", "gloopblocks:cobble_road_mossy" },
{ "stairs:stair_cobble_road", "stairs:stair_cobble_road_mossy" },
{ "stairs:slab_cobble_road", "stairs:slab_cobble_road_mossy" },
{ "default:stonebrick", "gloopblocks:stone_brick_mossy" },
{ "stairs:stair_stonebrick", "stairs:stair_stone_brick_mossy" },
{ "stairs:slab_stonebrick", "stairs:slab_stone_brick_mossy" },
{ "default:stone", "gloopblocks:stone_mossy" },
{ "stairs:stair_stone", "stairs:stair_stone_mossy" },
{ "stairs:slab_stone", "stairs:slab_stone_mossy" },
})
end
minetest.register_alias("default:stair_mossycobble", "stairs:stair_mossycobble")
minetest.register_alias("default:slab_mossycobble", "stairs:slab_mossycobble")
minetest.register_alias("gloopblocks:stair_cobble_road", "stairs:stair_cobble_road")
minetest.register_alias("gloopblocks:slab_cobble_road", "stairs:slab_cobble_road")
minetest.register_alias("gloopblocks:stair_cobble_road_mossy", "stairs:stair_cobble_road_mossy")
minetest.register_alias("gloopblocks:slab_cobble_road_mossy", "stairs:slab_cobble_road_mossy")
minetest.register_alias("gloopblocks:stair_stone_brick_mossy", "stairs:stair_stone_brick_mossy")
minetest.register_alias("gloopblocks:slab_stone_brick_mossy", "stairs:slab_stone_brick_mossy")
minetest.register_alias("gloopblocks:stair_stone_mossy", "stairs:stair_stone_mossy")
minetest.register_alias("gloopblocks:slab_stone_mossy", "stairs:slab_stone_mossy")
minetest.register_alias("gloopblocks:stair_cement", "stairs:stair_cement")
minetest.register_alias("gloopblocks:slab_cement", "stairs:slab_cement")
minetest.register_alias("gloopblocks:stair_pavement", "stairs:stair_pavement")
minetest.register_alias("gloopblocks:slab_pavement", "stairs:slab_pavement")
minetest.register_alias("gloopblocks:stair_pumice", "stairs:stair_pumice")
minetest.register_alias("gloopblocks:slab_pumice", "stairs:slab_pumice")
minetest.register_alias("gloopblocks:stair_basalt", "stairs:stair_basalt")
minetest.register_alias("gloopblocks:slab_basalt", "stairs:slab_basalt")
minetest.register_alias("gloopblocks:stair_rainbow_block", "stairs:stair_rainbow_block")
minetest.register_alias("gloopblocks:slab_rainbow_block", "stairs:slab_rainbow_block")
end
-- Tools
minetest.register_tool("gloopblocks:pick_cement", {
description = S("Cement Pickaxe"),
inventory_image = "gloopblocks_cement_pick.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
cracky={times={[1]=3.50, [2]=1.40, [3]=0.90}, uses=25, maxlevel=2}
},
damage_groups = {fleshy=4},
},
})
minetest.register_tool("gloopblocks:shovel_cement", {
description = S("Cement Shovel"),
inventory_image = "gloopblocks_cement_shovel.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
crumbly={times={[1]=1.50, [2]=0.60, [3]=0.45}, uses=25, maxlevel=2}
},
damage_groups = {fleshy=4},
},
})
minetest.register_tool("gloopblocks:axe_cement", {
description = S("Cement Axe"),
inventory_image = "gloopblocks_cement_axe.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
choppy={times={[1]=3.00, [2]=1.30, [3]=0.80}, uses=25, maxlevel=2},
fleshy={times={[2]=1.20, [3]=0.65}, uses=30, maxlevel=1}
},
damage_groups = {fleshy=4},
},
})
minetest.register_tool("gloopblocks:sword_cement", {
description = S("Cement Sword"),
inventory_image = "gloopblocks_cement_sword.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
fleshy={times={[1]=1.60, [2]=0.80, [3]=0.40}, uses=15, maxlevel=2},
snappy={times={[2]=0.75, [3]=0.35}, uses=30, maxlevel=1},
choppy={times={[3]=0.80}, uses=30, maxlevel=0}
},
damage_groups = {fleshy=6},
}
})
minetest.register_tool("gloopblocks:pick_evil", {
description = S("Evil Pickaxe"),
inventory_image = "gloopblocks_evil_pick.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=3,
groupcaps={
cracky={times={[1]=0.10, [2]=0.10, [3]=0.10}, uses=10, maxlevel=2}
},
damage_groups = {fleshy=6},
},
})
minetest.register_tool("gloopblocks:shovel_evil", {
description = S("Evil Shovel"),
inventory_image = "gloopblocks_evil_shovel.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=3,
groupcaps={
crumbly={times={[1]=0.05, [2]=0.05, [3]=0.05}, uses=10, maxlevel=2}
},
damage_groups = {fleshy=6},
},
})
minetest.register_tool("gloopblocks:axe_evil", {
description = S("Evil Axe"),
inventory_image = "gloopblocks_evil_axe.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=3,
groupcaps={
choppy={times={[1]=0.15, [2]=0.15, [3]=0.15}, uses=10, maxlevel=2},
fleshy={times={[1]=0.15, [2]=0.15, [3]=0.15}, uses=10, maxlevel=2}
},
damage_groups = {fleshy=6},
},
})
minetest.register_tool("gloopblocks:sword_evil", {
description = S("Evil Sword"),
inventory_image = "gloopblocks_evil_sword.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=3,
groupcaps={
fleshy={times={[1]=0.20, [2]=0.20, [3]=0.20}, uses=10, maxlevel=2},
snappy={times={[1]=0.20, [2]=0.20, [3]=0.20}, uses=10, maxlevel=2},
choppy={times={[1]=0.20, [2]=0.20, [3]=0.20}, uses=10, maxlevel=2}
},
damage_groups = {fleshy=8},
}
})
-- Other items
minetest.register_craftitem("gloopblocks:evil_stick", {
description = S("Evil Stick"),
inventory_image = "gloopblocks_evil_stick.png",
})
local fence_texture =
"default_fence_overlay.png^default_steel_block.png^default_fence_overlay.png^[makealpha:255,126,126"
minetest.register_node("gloopblocks:fence_steel", {
description = S("Steel Fence"),
drawtype = "fencelike",
tiles = {"default_steel_block.png"},
inventory_image = fence_texture,
wield_image = fence_texture,
paramtype = "light",
sunlight_propagates = true,
is_ground_content = false,
selection_box = {
type = "fixed",
fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7},
},
groups = {choppy = 2, oddly_breakable_by_hand = 2 },
sounds = default.node_sound_stone_defaults(),
})
minetest.register_alias("nyancat:nyancat_rainbow", "gloopblocks:rainbow_block_horizontal")
minetest.register_alias("default:nyancat_rainbow", "gloopblocks:rainbow_block_horizontal")

View file

@ -0,0 +1,197 @@
# Blender v2.73 (sub 0) OBJ File: 'anthill.blend'
# www.blender.org
o Cylinder_Cylinder.001
v 0.099056 -0.499969 -0.498228
v 0.038417 -0.200463 -0.141682
v 0.255808 -0.499933 -0.402046
v 0.095605 -0.174690 -0.147239
v 0.423075 -0.499913 -0.296918
v 0.102439 -0.169033 -0.075679
v 0.444026 -0.499843 -0.095234
v 0.125298 -0.217477 -0.063343
v 0.468682 -0.499958 0.074790
v 0.157655 -0.214352 0.001348
v 0.396548 -0.500000 0.246048
v 0.133778 -0.189245 0.108513
v 0.280708 -0.500000 0.383197
v 0.070517 -0.218946 0.104754
v 0.089852 -0.499943 0.434316
v 0.048523 -0.205247 0.128681
v -0.093309 -0.499902 0.467111
v -0.039037 -0.211895 0.149030
v -0.272965 -0.499875 0.396496
v -0.108297 -0.175918 0.104100
v -0.388317 -0.499877 0.239075
v -0.139068 -0.179051 0.073370
v -0.437531 -0.499999 0.063918
v -0.141812 -0.255882 0.005117
v -0.458429 -0.499805 -0.104397
v -0.189265 -0.217436 -0.065303
v -0.385597 -0.499914 -0.288584
v -0.112692 -0.207830 -0.096879
v -0.248347 -0.499927 -0.384586
v -0.083136 -0.202256 -0.170048
v -0.095346 -0.499958 -0.514449
v -0.023049 -0.216681 -0.204058
v 0.071880 -0.343843 -0.343933
v 0.189128 -0.354687 -0.277980
v 0.311273 -0.378789 -0.248498
v 0.296760 -0.346318 -0.056661
v 0.332231 -0.342427 0.044933
v 0.259921 -0.360316 0.147910
v 0.213270 -0.362883 0.253745
v 0.059007 -0.360067 0.351374
v -0.068448 -0.357957 0.335642
v -0.164888 -0.343166 0.232553
v -0.269761 -0.352370 0.140734
v -0.367168 -0.370891 0.062326
v -0.294491 -0.324099 -0.079712
v -0.276314 -0.352585 -0.236032
v -0.206169 -0.372829 -0.314307
v -0.065547 -0.371444 -0.355380
v 0.000709 -0.156135 -0.047193
vt 0.572002 0.826281
vt 0.535907 0.620231
vt 0.597591 0.625892
vt 0.604963 0.552988
vt 0.830215 0.729053
vt 0.629619 0.540419
vt 0.814561 0.533613
vt 0.664520 0.474514
vt 0.638766 0.365335
vt 0.774826 0.325198
vt 0.570532 0.369165
vt 0.724507 0.217375
vt 0.546808 0.344788
vt 0.452364 0.324057
vt 0.420641 0.133939
vt 0.377660 0.369831
vt 0.316619 0.238965
vt 0.344469 0.401138
vt 0.203502 0.332509
vt 0.341509 0.470674
vt 0.290325 0.542416
vt 0.176827 0.557096
vt 0.372919 0.574586
vt 0.196433 0.716353
vt 0.404798 0.649130
vt 0.469609 0.683778
vt 0.272092 0.796098
vt 0.770390 0.885486
vt 0.973405 0.572910
vt 0.591386 0.033412
vt 0.226599 0.867698
vt 0.423770 0.837943
vt 0.601314 0.983475
vt 0.078559 0.769893
vt 0.000000 0.582245
vt 0.098436 0.412390
vt 0.075624 0.232320
vt 0.200045 0.071942
vt 0.558116 0.117912
vt 0.922195 0.225217
vt 0.852821 0.430110
vt 0.698467 0.759089
vt 0.495235 0.523967
vt 0.391629 1.000000
vt 0.022541 0.410768
vt 0.797247 0.085491
vt 0.393825 0.000000
vt 0.950807 0.778383
vt 1.000000 0.399692
g Cylinder_Cylinder.001_None
s 1
f 33/1 2/2 4/3
f 4/3 6/4 35/5
f 35/5 6/4 8/6
f 36/7 8/6 10/8
f 10/8 12/9 38/10
f 12/9 14/11 39/12
f 39/12 14/11 16/13
f 16/13 18/14 41/15
f 18/14 20/16 42/17
f 20/16 22/18 43/19
f 43/19 22/18 24/20
f 24/20 26/21 45/22
f 26/21 28/23 46/24
f 46/24 28/23 30/25
f 32/26 2/2 33/1
f 47/27 30/25 32/26
f 3/28 7/29 15/30
f 29/31 47/27 48/32
f 48/32 33/1 1/33
f 27/34 46/24 47/27
f 25/35 45/22 46/24
f 44/36 45/22 25/35
f 21/37 43/19 44/36
f 42/17 43/19 21/37
f 41/15 42/17 19/38
f 15/30 40/39 41/15
f 39/12 40/39 15/30
f 11/40 38/10 39/12
f 37/41 38/10 11/40
f 7/29 36/7 37/41
f 35/5 36/7 7/29
f 3/28 34/42 35/5
f 33/1 34/42 3/28
f 4/3 2/2 49/43
f 2/2 32/26 49/43
f 32/26 30/25 49/43
f 30/25 28/23 49/43
f 28/23 26/21 49/43
f 26/21 24/20 49/43
f 24/20 22/18 49/43
f 22/18 20/16 49/43
f 20/16 18/14 49/43
f 18/14 16/13 49/43
f 16/13 14/11 49/43
f 14/11 12/9 49/43
f 12/9 10/8 49/43
f 10/8 8/6 49/43
f 8/6 6/4 49/43
f 6/4 4/3 49/43
f 34/42 33/1 4/3
f 34/42 4/3 35/5
f 36/7 35/5 8/6
f 37/41 36/7 10/8
f 37/41 10/8 38/10
f 38/10 12/9 39/12
f 40/39 39/12 16/13
f 40/39 16/13 41/15
f 41/15 18/14 42/17
f 42/17 20/16 43/19
f 44/36 43/19 24/20
f 44/36 24/20 45/22
f 45/22 26/21 46/24
f 47/27 46/24 30/25
f 48/32 32/26 33/1
f 48/32 47/27 32/26
f 29/31 31/44 1/33
f 23/45 27/34 29/31
f 27/34 23/45 25/35
f 15/30 19/38 21/37
f 11/40 13/46 15/30
f 15/30 17/47 19/38
f 3/28 23/45 29/31
f 29/31 1/33 3/28
f 3/28 5/48 7/29
f 7/29 9/49 11/40
f 23/45 15/30 21/37
f 15/30 23/45 3/28
f 15/30 7/29 11/40
f 31/44 29/31 48/32
f 31/44 48/32 1/33
f 29/31 27/34 47/27
f 27/34 25/35 46/24
f 23/45 44/36 25/35
f 23/45 21/37 44/36
f 19/38 42/17 21/37
f 17/47 41/15 19/38
f 17/47 15/30 41/15
f 13/46 39/12 15/30
f 13/46 11/40 39/12
f 9/49 37/41 11/40
f 9/49 7/29 37/41
f 5/48 35/5 7/29
f 5/48 3/28 35/5
f 1/33 33/1 3/28

Binary file not shown.

After

Width:  |  Height:  |  Size: 564 B

View file

@ -0,0 +1,3 @@
Bluish Boy
Daĉjo
CC 0 (1.0)

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

View file

@ -52,7 +52,7 @@ local settings_get
if minetest.setting_get then
settings_get = minetest.setting_get
else
settings_get = function(...) endminetest.settings:get(...) end
settings_get = function(...) return minetest.settings:get(...) end
end
gravelsieve.ore_rarity = tonumber(settings_get("gravelsieve_ore_rarity")) or 1.16
gravelsieve.ore_max_elevation = tonumber(settings_get("gravelsieve_ore_max_elevation")) or 0
@ -60,7 +60,9 @@ gravelsieve.ore_min_elevation = tonumber(settings_get("gravelsieve_ore_min_eleva
local y_spread = math.max(1 + gravelsieve.ore_max_elevation - gravelsieve.ore_min_elevation, 1)
-- Increase the probability over the natural occurrence
local PROBABILITY_FACTOR = 3
local PROBABILITY_FACTOR = tonumber(settings_get("gravelsieve_probability_factor")) or 3
local STEP_DELAY = tonumber(settings_get("gravelsieve_step_delay")) or 1.0
-- tubelib aging feature
local AGING_LEVEL1 = nil
@ -74,6 +76,8 @@ end
gravelsieve.ore_probability = {
}
gravelsieve.process_probabilities = {}
-- Pipeworks support
local pipeworks_after_dig = nil
@ -84,10 +88,6 @@ if minetest.get_modpath("pipeworks") and pipeworks ~= nil then
pipeworks_after_place = pipeworks.after_place
end
local function harmonic_sum(a, b)
return 1 / ((1 / a) + (1 / b))
end
local function calculate_probability(item)
local ymax = math.min(item.y_max, gravelsieve.ore_max_elevation)
local ymin = math.max(item.y_min, gravelsieve.ore_min_elevation)
@ -97,7 +97,7 @@ end
local function pairs_by_values(t, f)
if not f then
f = function(a, b) return a < b end
f = function(a, b) return a > b end
end
local s = {}
for k, v in pairs(t) do
@ -146,13 +146,14 @@ local function add_ores()
local count
drop, count = parse_drop(drop)
local probability = calculate_probability(item) / count
local probability = calculate_probability(item)
if probability > 0 then
local probabilityFraction = count / probability
local cur_probability = gravelsieve.ore_probability[drop]
if cur_probability then
gravelsieve.ore_probability[drop] = harmonic_sum(cur_probability, probability)
gravelsieve.ore_probability[drop] = cur_probability+probabilityFraction
else
gravelsieve.ore_probability[drop] = probability
gravelsieve.ore_probability[drop] = probabilityFraction
end
end
end
@ -161,13 +162,117 @@ local function add_ores()
minetest.log("action", "[gravelsieve] ore probabilties:")
local overall_probability = 0.0
for name,probability in pairs_by_values(gravelsieve.ore_probability) do
minetest.log("action", ("[gravelsieve] %-32s: 1 / %.02f"):format(name, probability))
overall_probability = overall_probability + 1.0/probability
minetest.log("action", ("[gravelsieve] %-32s: 1 / %.02f"):format(name, 1.0/probability))
overall_probability = overall_probability + probability
end
minetest.log("action", ("[gravelsieve] Overall probability %f"):format(overall_probability))
end
minetest.after(1, add_ores)
local function default_configuration()
local normal_gravel = "default:gravel"
local sieved_gravel = "gravelsieve:sieved_gravel"
local gravel_probabilities = table.copy(gravelsieve.ore_probability)
local overall_probability = 0
for _,v in pairs(gravel_probabilities) do
overall_probability = overall_probability+v
end
local remainder_probability = 0
if overall_probability < 1 then
remainder_probability = 1-overall_probability
end
gravel_probabilities[normal_gravel] = remainder_probability/2.0
gravel_probabilities[sieved_gravel] = remainder_probability/2.0
return {
[normal_gravel] = gravel_probabilities,
[sieved_gravel] = {
[sieved_gravel] = 1
}
}
end
local function normalize_probabilities(conf)
local total = 0
for _,val in pairs(conf) do
if val >= 0 then
total = total + val
end
end
local normalized = {}
for key,val in pairs(conf) do
if val >= 0 then
normalized[key] = val/total
end
end
return normalized
end
local function normalize_config(current_config)
local normalized_config = {}
-- Normalize all inputs so their output probabilities always add up to 1
for input, output_probabilities in pairs(current_config) do
if output_probabilities then
normalized_config[input] = normalize_probabilities(output_probabilities)
end
end
return normalized_config
end
local function merge_config(def_conf, new_conf)
local result_conf = table.copy(def_conf)
for key,val in pairs(new_conf) do
if type(val) == 'table' and type(result_conf[key]) == 'table' then
result_conf[key] = merge_config(result_conf[key], val)
else
result_conf[key] = val
end
end
return result_conf
end
local function configure_probabilities_step(current_config, funct_or_table)
local var_type = type(funct_or_table)
local conf
if var_type == 'function' then
conf = funct_or_table()
elseif var_type == 'table' then
conf = funct_or_table
end
if conf then
return merge_config(current_config, conf)
end
return current_config
end
local configured = false
local set_probabilities = {default_configuration}
function gravelsieve.set_probabilities(funct_or_table)
if configured then
-- This is here so you can do hard overrides after everything has loaded if you need to
-- Otherwise the order mods are loaded may cause them to override your configs
local current_config = gravelsieve.process_probabilities
current_config = configure_probabilities_step(current_config, funct_or_table)
gravelsieve.process_probabilities = normalize_config(current_config)
else
-- Build up a list of callbacks to be run after all mods are loaded
table.insert(set_probabilities, funct_or_table)
end
end
local function configure_probabilities()
configured = true
add_ores()
local current_config = {}
-- Run through all configs in order and merge them
for _,funct_or_table in ipairs(set_probabilities) do
current_config = configure_probabilities_step(current_config, funct_or_table)
end
gravelsieve.process_probabilities = normalize_config(current_config)
end
minetest.after(1, configure_probabilities)
local sieve_formspec =
"size[8,8]"..
@ -240,48 +345,35 @@ local function swap_node(pos, meta, start)
end
-- place ores to dst according to the calculated probability
local function random_ore(inv, src)
local num
for ore, probability in pairs(gravelsieve.ore_probability) do
if math.random(probability) == 1 then
local item = ItemStack(ore)
if inv:room_for_item("dst", item) then
inv:add_item("dst", item)
return true -- ore placed
local function move_random_ore(inv, item)
local running_total = 0
local probabilities = gravelsieve.process_probabilities[item]
local chosen = math.random()
for ore, probability in pairs(probabilities) do
running_total = running_total + probability
if chosen < running_total then
local ore_item = ItemStack(ore)
if not inv:room_for_item("dst", ore_item) then
return false
end
inv:add_item("dst", ore_item)
return true
end
end
return false -- Failure, this shouldn't really happen but might due to floating point errors
end
return false -- gravel has to be moved
end
local function add_gravel_to_dst(meta, inv)
-- maintain a counter for gravel kind selection
local gravel_cnt = meta:get_int("gravel_cnt") + 1
meta:set_int("gravel_cnt", gravel_cnt)
if (gravel_cnt % 2) == 0 then -- gravel or sieved gravel?
inv:add_item("dst", ItemStack("default:gravel")) -- add to dest
else
inv:add_item("dst", ItemStack("gravelsieve:sieved_gravel")) -- add to dest
end
end
-- move gravel and ores to dst
local function move_src2dst(meta, pos, inv, src, dst)
local function move_src2dst(meta, pos, inv, item, dst)
local src = ItemStack(item)
if inv:room_for_item("dst", dst) and inv:contains_item("src", src) then
local res = swap_node(pos, meta, false)
if res then -- time to move one item?
if src:get_name() == "default:gravel" then -- will we find ore?
if not random_ore(inv, src) then -- no ore found?
add_gravel_to_dst(meta, inv)
end
else
inv:add_item("dst", ItemStack("gravelsieve:sieved_gravel")) -- add to dest
end
local processed = move_random_ore(inv, item)
if processed then
inv:remove_item("src", src)
end
end
return true -- process finished
end
return false -- process still running
@ -291,20 +383,17 @@ end
local function sieve_node_timer(pos, elapsed)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local gravel = ItemStack("default:gravel")
local gravel_sieved = ItemStack("gravelsieve:sieved_gravel")
if move_src2dst(meta, pos, inv, gravel) then
for item,probabilities in pairs(gravelsieve.process_probabilities) do
if probabilities and move_src2dst(meta, pos, inv, item) then
aging(pos, meta)
return true
elseif move_src2dst(meta, pos, inv, gravel_sieved) then
aging(pos, meta)
return true
else
end
end
minetest.get_node_timer(pos):stop()
return false
end
end
for automatic = 0,1 do
@ -356,7 +445,7 @@ for idx = 0,4 do
local meta = minetest.get_meta(pos)
swap_node(pos, meta, true)
else
minetest.get_node_timer(pos):start(1.0)
minetest.get_node_timer(pos):start(STEP_DELAY)
end
return inv:add_item("src", stack)
end,
@ -425,7 +514,7 @@ for idx = 0,4 do
local meta = minetest.get_meta(pos)
swap_node(pos, meta, true)
else
minetest.get_node_timer(pos):start(1.0)
minetest.get_node_timer(pos):start(STEP_DELAY)
end
end,
@ -440,7 +529,7 @@ for idx = 0,4 do
meta:set_int("gravel_cnt", 0)
end
else
minetest.get_node_timer(pos):start(1.0)
minetest.get_node_timer(pos):start(STEP_DELAY)
end
end,
@ -449,7 +538,7 @@ for idx = 0,4 do
local meta = minetest.get_meta(pos)
swap_node(pos, meta, true)
else
minetest.get_node_timer(pos):start(1.0)
minetest.get_node_timer(pos):start(STEP_DELAY)
end
end,
@ -559,7 +648,7 @@ if minetest.global_exists("tubelib") then
return tubelib.get_item(meta, "dst")
end,
on_push_item = function(pos, side, item)
minetest.get_node_timer(pos):start(1.0)
minetest.get_node_timer(pos):start(STEP_DELAY)
local meta = minetest.get_meta(pos)
return tubelib.put_item(meta, "src", item)
end,
@ -568,7 +657,7 @@ if minetest.global_exists("tubelib") then
return tubelib.put_item(meta, "dst", item)
end,
on_node_load = function(pos)
minetest.get_node_timer(pos):start(1.0)
minetest.get_node_timer(pos):start(STEP_DELAY)
end,
on_node_repair = function(pos)
local meta = minetest.get_meta(pos)
@ -579,7 +668,7 @@ if minetest.global_exists("tubelib") then
inv:set_size('src', 1)
inv:set_size('dst', 16)
swap_node(pos, meta, false)
minetest.get_node_timer(pos):start(1.0)
minetest.get_node_timer(pos):start(STEP_DELAY)
return true
end,
})

View file

@ -1,6 +1,6 @@
# Vehicle Mash [![Build status](https://github.com/minetest-mods/vehicle_mash/workflows/build/badge.svg)](https://github.com/minetest-mods/vehicle_mash/actions) [![ContentDB](https://content.minetest.net/packages/Panquesito7/vehicle_mash/shields/downloads/)](https://content.minetest.net/packages/Panquesito7/vehicle_mash/)
- Current version: 2.2.2
- Current version: 2.3.0
- By [blert2112](https://github.com/blert2112), and handed over to [Panquesito7](https://github.com/Panquesito7).
![Screenshot](https://raw.githubusercontent.com/minetest-mods/vehicle_mash/master/screenshot.png)
@ -67,6 +67,18 @@ There are no pending tasks to do yet.
## Changelog
v2.3.0 2/12/2021
- Improved formatting in `README.md`.
- Added [API Mode](https://github.com/minetest-mods/vehicle_mash/commit/6b3bdac4d880a6fde298a286b3bd5043750e904e) setting.
- Removed F1 and 126r cars due to closed-source license.
- Improved vehicle drops.
- Vehicles can now drop multiple items.
- Add option for vehicles to fly (setting per vehicle).
- Can enable/disable crash separately for each vehicle.
- Added ContentDB badge on `README.md`.
- Improved GitHub workflow.
v2.2.2 6/02/2020
- Fix passengers not detaching when driver gets out.

View file

@ -26,7 +26,7 @@ function vehicle_mash.register_vehicle(name, def)
passenger3_eye_offset = def.passenger3_eye_offset,
passenger3_detach_pos_offset = def.passenger3_detach_pos_offset,
enable_crash = def.enable_crash or true,
enable_crash = def.enable_crash,
visual = def.visual,
mesh = def.mesh,
textures = def.textures,
@ -140,6 +140,10 @@ function vehicle_mash.register_vehicle(name, def)
end
end,
on_step = function(self, dtime)
-- Automatically set `enable_crash` to true if there's no value found
if def.enable_crash == nil then
def.enable_crash = true
end
drive(self, dtime, false, nil, nil, 0, def.can_fly, def.can_go_down, def.can_go_up, def.enable_crash)
end
})