123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963 |
- cavestuff = cavestuff or {}
- cavestuff.modpath = minetest.get_modpath("cavestuff")
- -- Localize for performance.
- local math_random = math.random
- -- Functions.
- dofile(cavestuff.modpath .. "/functions.lua")
- minetest.register_node("cavestuff:cobble_with_moss", {
- description = "Cave Stone With Moss",
- tiles = {
- "default_cobble.png^caverealms_moss.png",
- "default_cobble.png",
- "default_cobble.png^caverealms_moss_side.png",
- },
- groups = utility.dig_groups("softcobble", {
- falling_node = 1,
- melts = 1,
- cavern_soil = 1, cobble_type = 1,
- }),
- _melts_to = "cavestuff:cobble_with_rockmelt",
- sounds = default.node_sound_gravel_defaults({
- footstep = {name="default_grass_footstep", gain=0.25},
- }),
- light_source = 1,
- movement_speed_multiplier = default.SLOW_SPEED_GRASS,
- drop = "default:cobble",
- silverpick_drop = true,
- -- Common stone does not count toward tool's dig count.
- _toolranks = {
- ignore = true,
- },
- })
- minetest.register_node("cavestuff:cobble_with_lichen", {
- description = "Cave Stone With Lichen",
- tiles = {
- "default_cobble.png^caverealms_lichen.png",
- "default_cobble.png",
- "default_cobble.png^caverealms_lichen_side.png",
- },
- groups = utility.dig_groups("softcobble", {
- falling_node = 1,
- melts = 1,
- cavern_soil = 1, cobble_type = 1,
- }),
- _melts_to = "cavestuff:cobble_with_rockmelt",
- sounds = default.node_sound_gravel_defaults({
- footstep = {name="default_grass_footstep", gain=0.25},
- }),
- light_source = 1,
- movement_speed_multiplier = default.SLOW_SPEED_GRASS,
- drop = "default:cobble",
- silverpick_drop = true,
- -- Common stone does not count toward tool's dig count.
- _toolranks = {
- ignore = true,
- },
- })
- minetest.register_node("cavestuff:cobble_with_algae", {
- description = "Cave Stone With Algae",
- tiles = {
- "default_cobble.png^caverealms_algae.png",
- "default_cobble.png",
- "default_cobble.png^caverealms_algae_side.png",
- },
- groups = utility.dig_groups("softcobble", {
- falling_node = 1,
- melts = 1,
- cavern_soil = 1, cobble_type = 1,
- }),
- _melts_to = "cavestuff:cobble_with_rockmelt",
- sounds = default.node_sound_gravel_defaults({
- footstep = {name="default_grass_footstep", gain=0.25},
- }),
- light_source = 1,
- movement_speed_multiplier = default.SLOW_SPEED_GRASS,
- drop = "default:cobble",
- silverpick_drop = true,
- -- Common stone does not count toward tool's dig count.
- _toolranks = {
- ignore = true,
- },
- })
- minetest.register_node("cavestuff:cobble_with_salt", {
- description = "Cave Stone With Salt",
- tiles = {
- "default_cobble.png^caverealms_salty.png",
- "default_cobble.png",
- "default_cobble.png^caverealms_salty_side.png",
- },
- groups = utility.dig_groups("softcobble", {
- falling_node = 1,
- melts = 1, cobble_type = 1,
- }),
- _melts_to = "cavestuff:cobble_with_rockmelt",
- sounds = default.node_sound_gravel_defaults(),
- light_source = 1,
- movement_speed_multiplier = default.SLOW_SPEED_GRASS,
- drop = "default:cobble",
- silverpick_drop = true,
- -- Common stone does not count toward tool's dig count.
- _toolranks = {
- ignore = true,
- },
- })
- minetest.register_node("cavestuff:cobble_with_rockmelt", {
- description = "Rockmelt Cobble",
- tiles = {"caverealms_hot_cobble.png"},
- groups = utility.dig_groups("softcobble", {hot=1, falling_node=1, melt_around=3, cobble_type=1, rockmelt=1}),
- damage_per_second = 1,
- light_source = 5,
- sounds = default.node_sound_stone_defaults(),
- drop = "default:cobble",
- movement_speed_multiplier = default.SLOW_SPEED,
- on_construct = function(pos)
- torchmelt.start_melting(pos)
- end,
- after_place_node = function(...)
- return cavestuff.hotcobble.after_place_node(...)
- end,
- after_dig_node = function(...)
- return cavestuff.hotcobble.after_dig_node(...)
- end,
- on_player_walk_over = function(...)
- return cavestuff.hotcobble.on_player_walk_over(...)
- end,
- on_finish_collapse = function(...)
- return cavestuff.hotcobble.on_finish_collapse(...)
- end,
- -- Common stone does not count toward tool's dig count.
- _toolranks = {
- ignore = true,
- },
- })
- minetest.register_node("cavestuff:glow_sapphire", {
- description = "Glowing Sapphire",
- tiles = {"caverealms_glow_crystal.png"},
- groups = utility.dig_groups("crystal"),
- sounds = default.node_sound_glass_defaults(),
- light_source = 13,
- paramtype = "light",
- use_texture_alpha = true,
- drawtype = "glasslike",
- sunlight_propagates = true,
- })
- stairs.register_stair_and_slab(
- "glow_sapphire",
- "cavestuff:glow_sapphire",
- utility.dig_groups("crystal"),
- {"caverealms_glow_crystal.png"},
- "Glowing Sapphire",
- default.node_sound_glass_defaults()
- )
- minetest.override_item("stairs:slab_glow_sapphire", {
- sunlight_propagates = true,
- light_source = 13,
- })
- minetest.override_item("stairs:stair_glow_sapphire", {
- sunlight_propagates = true,
- light_source = 13,
- })
- minetest.register_node("cavestuff:glow_emerald", {
- description = "Glowing Emerald",
- tiles = {"caverealms_glow_emerald.png"},
- groups = utility.dig_groups("crystal"),
- sounds = default.node_sound_glass_defaults(),
- light_source = 10,
- paramtype = "light",
- use_texture_alpha = true,
- drawtype = "glasslike",
- sunlight_propagates = true,
- })
- stairs.register_stair_and_slab(
- "glow_emerald",
- "cavestuff:glow_emerald",
- utility.dig_groups("crystal"),
- {"caverealms_glow_emerald.png"},
- "Glowing Emerald",
- default.node_sound_glass_defaults()
- )
- minetest.override_item("stairs:slab_glow_emerald", {
- sunlight_propagates = true,
- light_source = 10,
- })
- minetest.override_item("stairs:stair_glow_emerald", {
- sunlight_propagates = true,
- light_source = 10,
- })
- minetest.register_node("cavestuff:glow_mese", {
- description = "Glowing Mese",
- tiles = {"caverealms_glow_mese.png"},
- groups = utility.dig_groups("crystal"),
- sounds = default.node_sound_glass_defaults(),
- light_source = 14,
- paramtype = "light",
- use_texture_alpha = true,
- drawtype = "glasslike",
- sunlight_propagates = true,
- })
- stairs.register_stair_and_slab(
- "glow_mese",
- "cavestuff:glow_mese",
- utility.dig_groups("crystal"),
- {"caverealms_glow_mese.png"},
- "Glowing Mese",
- default.node_sound_glass_defaults()
- )
- minetest.override_item("stairs:slab_glow_mese", {
- sunlight_propagates = true,
- light_source = 14,
- })
- minetest.override_item("stairs:stair_glow_mese", {
- sunlight_propagates = true,
- light_source = 14,
- })
- minetest.register_node("cavestuff:glow_ruby", {
- description = "Glowing Ruby",
- tiles = {"caverealms_glow_ruby.png"},
- groups = utility.dig_groups("crystal"),
- sounds = default.node_sound_glass_defaults(),
- light_source = 8,
- paramtype = "light",
- use_texture_alpha = true,
- drawtype = "glasslike",
- sunlight_propagates = true,
- })
- stairs.register_stair_and_slab(
- "glow_ruby",
- "cavestuff:glow_ruby",
- utility.dig_groups("crystal"),
- {"caverealms_glow_ruby.png"},
- "Glowing Ruby",
- default.node_sound_glass_defaults()
- )
- minetest.override_item("stairs:slab_glow_ruby", {
- sunlight_propagates = true,
- light_source = 8,
- })
- minetest.override_item("stairs:stair_glow_ruby", {
- sunlight_propagates = true,
- light_source = 8,
- })
- minetest.register_node("cavestuff:glow_amethyst", {
- description = "Glowing Amethyst",
- tiles = {"caverealms_glow_amethyst.png"},
- groups = utility.dig_groups("crystal"),
- sounds = default.node_sound_glass_defaults(),
- light_source = 7,
- paramtype = "light",
- use_texture_alpha = true,
- drawtype = "glasslike",
- sunlight_propagates = true,
- })
- stairs.register_stair_and_slab(
- "glow_amethyst",
- "cavestuff:glow_amethyst",
- utility.dig_groups("crystal"),
- {"caverealms_glow_amethyst.png"},
- "Glowing Amethyst",
- default.node_sound_glass_defaults()
- )
- minetest.override_item("stairs:slab_glow_amethyst", {
- sunlight_propagates = true,
- light_source = 7,
- })
- minetest.override_item("stairs:stair_glow_amethyst", {
- sunlight_propagates = true,
- light_source = 7,
- })
- minetest.register_node("cavestuff:glow_sapphire_ore", {
- description = "Embedded Glowing Sapphire",
- tiles = {"caverealms_glow_ore.png"},
- groups = utility.dig_groups("hardore"),
- sounds = default.node_sound_stone_defaults(),
- light_source = 8,
- paramtype = "light",
- })
- stairs.register_stair_and_slab(
- "glow_sapphire_ore",
- "cavestuff:glow_sapphire_ore",
- utility.dig_groups("hardore"),
- {"caverealms_glow_ore.png"},
- "Embedded Glowing Sapphire",
- default.node_sound_stone_defaults()
- )
- minetest.override_item("stairs:slab_glow_sapphire_ore", {
- light_source = 8,
- })
- minetest.override_item("stairs:stair_glow_sapphire_ore", {
- light_source = 8,
- })
- minetest.register_node("cavestuff:glow_emerald_ore", {
- description = "Embedded Glowing Emerald",
- tiles = {"caverealms_glow_emerald_ore.png"},
- groups = utility.dig_groups("hardore"),
- sounds = default.node_sound_stone_defaults(),
- light_source = 8,
- paramtype = "light",
- })
- stairs.register_stair_and_slab(
- "glow_emerald_ore",
- "cavestuff:glow_emerald_ore",
- utility.dig_groups("hardore"),
- {"caverealms_glow_emerald_ore.png"},
- "Embedded Glowing Emerald",
- default.node_sound_stone_defaults()
- )
- minetest.override_item("stairs:slab_glow_emerald_ore", {
- light_source = 8,
- })
- minetest.override_item("stairs:stair_glow_emerald_ore", {
- light_source = 8,
- })
- minetest.register_node("cavestuff:glow_ruby_ore", {
- description = "Embedded Glowing Ruby",
- tiles = {"caverealms_glow_ruby_ore.png"},
- groups = utility.dig_groups("hardore"),
- sounds = default.node_sound_stone_defaults(),
- light_source = 8,
- paramtype = "light",
- })
- stairs.register_stair_and_slab(
- "glow_ruby_ore",
- "cavestuff:glow_ruby_ore",
- utility.dig_groups("hardore"),
- {"caverealms_glow_ruby_ore.png"},
- "Embedded Glowing Ruby",
- default.node_sound_stone_defaults()
- )
- minetest.override_item("stairs:slab_glow_ruby_ore", {
- light_source = 8,
- })
- minetest.override_item("stairs:stair_glow_ruby_ore", {
- light_source = 8,
- })
- minetest.register_node("cavestuff:glow_amethyst_ore", {
- description = "Embedded Glowing Amethyst",
- tiles = {"caverealms_glow_amethyst_ore.png"},
- groups = utility.dig_groups("hardore"),
- sounds = default.node_sound_stone_defaults(),
- light_source = 8,
- paramtype = "light",
- })
- stairs.register_stair_and_slab(
- "glow_amethyst_ore",
- "cavestuff:glow_amethyst_ore",
- utility.dig_groups("hardore"),
- {"caverealms_glow_amethyst_ore.png"},
- "Embedded Glowing Amethyst",
- default.node_sound_stone_defaults()
- )
- minetest.override_item("stairs:slab_glow_amethyst_ore", {
- light_source = 8,
- })
- minetest.override_item("stairs:stair_glow_amethyst_ore", {
- light_source = 8,
- })
- minetest.register_node("cavestuff:glow_worm", {
- description = "Glow Worms",
- tiles = {"caverealms_glow_worm.png"},
- inventory_image = "caverealms_glow_worm.png",
- wield_image = "caverealms_glow_worm.png",
- groups = utility.dig_groups("plant", {
- hanging_node = 1, flammable = 3,
- }),
- light_source = 5,
- paramtype = "light",
- drawtype = "plantlike",
- movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
- walkable = false,
- climbable = true,
- drop = "",
- shears_drop = true,
- -- Selection box interferes with hanging node group?
- -- Making the selection box smaller seems to prevent the
- -- hanging node group from working properly.
- selection_box = {
- type = "fixed",
- fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
- },
- })
- minetest.register_node("cavestuff:glow_obsidian", {
- description = "Luminescent Obsidian",
- tiles = {"caverealms_glow_obsidian.png"},
- groups = utility.dig_groups("obsidian", {
- immovable = 1,
- }),
- light_source = 7,
- sounds = default.node_sound_stone_defaults(),
- on_blast = function(...) end, -- Blast resistant.
- })
- minetest.register_craft({
- output = "cavestuff:glow_obsidian",
- type = "shapeless",
- recipe = {"default:obsidian", "glowstone:glowing_dust"},
- })
- stairs.register_stair_and_slab("glow_obsidian", "cavestuff:glow_obsidian",
- utility.dig_groups("obsidian"),
- {"caverealms_glow_obsidian.png"},
- "Luminescent Obsidian",
- default.node_sound_stone_defaults())
- minetest.register_node("cavestuff:glow_obsidian_brick", {
- description = "Luminescent Obsidian Brick",
- tiles = {"caverealms_glow_obsidian_brick.png"},
- groups = utility.dig_groups("brick", {
- immovable = 1,
- }),
- light_source = 7,
- sounds = default.node_sound_stone_defaults(),
- })
- minetest.register_craft({
- output = "cavestuff:glow_obsidian_brick",
- recipe = {
- {"cavestuff:glow_obsidian", "cavestuff:glow_obsidian"},
- {"cavestuff:glow_obsidian", "cavestuff:glow_obsidian"},
- },
- })
- stairs.register_stair_and_slab(
- "glow_obsidian_brick",
- "cavestuff:glow_obsidian_brick",
- utility.dig_groups("brick"),
- {"caverealms_glow_obsidian_brick.png"},
- "Luminescent Obsidian Brick",
- default.node_sound_stone_defaults())
- minetest.register_node("cavestuff:glow_obsidian_block", {
- description = "Luminescent Obsidian Block",
- tiles = {"caverealms_glow_obsidian_block.png"},
- groups = utility.dig_groups("block", {
- immovable = 1,
- }),
- light_source = 7,
- sounds = default.node_sound_stone_defaults(),
- })
- minetest.register_craft({
- output = "cavestuff:glow_obsidian_block 9",
- recipe = {
- {"cavestuff:glow_obsidian", "cavestuff:glow_obsidian", "cavestuff:glow_obsidian"},
- {"cavestuff:glow_obsidian", "cavestuff:glow_obsidian", "cavestuff:glow_obsidian"},
- {"cavestuff:glow_obsidian", "cavestuff:glow_obsidian", "cavestuff:glow_obsidian"},
- },
- })
- stairs.register_stair_and_slab(
- "glow_obsidian_block",
- "cavestuff:glow_obsidian_block",
- utility.dig_groups("block"),
- {"caverealms_glow_obsidian_block.png"},
- "Luminescent Obsidian Block",
- default.node_sound_stone_defaults())
- minetest.register_node("cavestuff:dark_obsidian", {
- description = "Dead Obsidian",
- tiles = {"technic_obsidian.png"},
- groups = utility.dig_groups("obsidian", {
- immovable = 1,
- }),
- sounds = default.node_sound_stone_defaults(),
- movement_speed_multiplier = default.ROAD_SPEED_CAVERN,
- on_blast = function(...) end, -- Blast resistant.
- after_destruct = function(pos)
- minetest.after(0, ambiance.recheck_nearby_sound_beacons, {x=pos.x, y=pos.y, z=pos.z}, 16)
- end,
- })
- stairs.register_stair_and_slab(
- "dark_obsidian",
- "cavestuff:dark_obsidian",
- utility.dig_groups("obsidian"),
- {"technic_obsidian.png"},
- "Dead Obsidian",
- default.node_sound_stone_defaults())
- minetest.register_node("cavestuff:dark_obsidian_brick", {
- description = "Dead Obsidian Brick",
- tiles = {"technic_obsidian_brick.png"},
- groups = utility.dig_groups("obsidian"),
- sounds = default.node_sound_stone_defaults(),
- on_blast = function(...) end, -- Blast resistant.
- })
- stairs.register_stair_and_slab(
- "dark_obsidian_brick",
- "cavestuff:dark_obsidian_brick",
- utility.dig_groups("obsidian"),
- {"technic_obsidian_brick.png"},
- "Dead Obsidian Brick",
- default.node_sound_stone_defaults())
- minetest.register_node("cavestuff:dark_obsidian_block", {
- description = "Dead Obsidian Block",
- tiles = {"technic_obsidian_block.png"},
- groups = utility.dig_groups("obsidian"),
- sounds = default.node_sound_stone_defaults(),
- on_blast = function(...) end, -- Blast resistant.
- })
- stairs.register_stair_and_slab(
- "dark_obsidian_block",
- "cavestuff:dark_obsidian_block",
- utility.dig_groups("obsidian"),
- {"technic_obsidian_block.png"},
- "Dead Obsidian Block",
- default.node_sound_stone_defaults())
- minetest.register_craft({
- output = "cavestuff:dark_obsidian_brick 4",
- recipe = {
- {"cavestuff:dark_obsidian", "cavestuff:dark_obsidian"},
- {"cavestuff:dark_obsidian", "cavestuff:dark_obsidian"},
- }
- })
- minetest.register_craft({
- output = "cavestuff:dark_obsidian_block 9",
- recipe = {
- {"cavestuff:dark_obsidian", "cavestuff:dark_obsidian", "cavestuff:dark_obsidian"},
- {"cavestuff:dark_obsidian", "cavestuff:dark_obsidian", "cavestuff:dark_obsidian"},
- {"cavestuff:dark_obsidian", "cavestuff:dark_obsidian", "cavestuff:dark_obsidian"},
- }
- })
- minetest.register_node("cavestuff:coal_dust", {
- description = "Coal Dust Block",
- tiles = {"caverealms_coal_dust.png"},
- groups = utility.dig_groups("sand", {falling_node = 1}),
- sounds = default.node_sound_gravel_defaults(),
- --drop = "dusts:coal 9",
- movement_speed_multiplier = default.SLOW_SPEED,
- })
- minetest.register_craft({
- output = "cavestuff:coal_dust",
- recipe = {
- {"dusts:coal", "dusts:coal", "dusts:coal"},
- {"dusts:coal", "default:sand", "dusts:coal"},
- {"dusts:coal", "dusts:coal", "dusts:coal"},
- },
- })
- minetest.register_node("cavestuff:salt_crystal", {
- description = "Salt Crystal",
- tiles = {"caverealms_salt_crystal.png"},
- groups = utility.dig_groups("crystal"),
- sounds = default.node_sound_gravel_defaults(),
- light_source = 1,
- paramtype = "light",
- use_texture_alpha = true,
- drawtype = "glasslike",
- sunlight_propagates = true,
- })
- local eat_mushroom = minetest.item_eat(1)
- local function mushroom_poison(pname, step)
- local msg = "# Server: <" .. rename.gpn(pname) .. "> ate a mushroom. Desperate!"
- hb4.delayed_harm({name=pname, step=step, min=1, max=3, msg=msg, poison=true})
- end
- minetest.register_node("cavestuff:mycena", {
- description = "Mycena Mushroom",
- tiles = {"caverealms_mycena.png"},
- inventory_image = "caverealms_mycena.png",
- wield_image = "caverealms_mycena.png",
- groups = utility.dig_groups("plant", {attached_node = 1, flammable = 3}),
- light_source = 3,
- paramtype = "light",
- drawtype = "plantlike",
- movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
- walkable = false,
- buildable_to = true,
- visual_scale = 0.6,
- selection_box = {
- type = "fixed",
- fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
- },
- sounds = default.node_sound_leaves_defaults(),
- drop = "",
- shears_drop = true,
- flowerpot_drop = "cavestuff:mycena",
- on_use = function(itemstack, user, pointed_thing)
- if not user or not user:is_player() then return end
- minetest.after(1, mushroom_poison, user:get_player_name(), 3)
- return eat_mushroom(itemstack, user, pointed_thing)
- end,
- on_construct = function(...)
- return flowers.on_mushroom_construct(...)
- end,
- on_destruct = function(...)
- return flowers.on_mushroom_destruct(...)
- end,
- on_timer = function(...)
- return flowers.on_mushroom_timer(...)
- end,
- on_punch = function(...)
- return flowers.on_mushroom_punch(...)
- end,
- })
- minetest.register_node("cavestuff:fungus", {
- description = "Glowing Fungus",
- tiles = {"caverealms_fungi.png"},
- inventory_image = "caverealms_fungi.png",
- wield_image = "caverealms_fungi.png",
- groups = utility.dig_groups("plant", {attached_node = 1, flammable = 3}),
- light_source = 3,
- paramtype = "light",
- drawtype = "firelike",
- movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
- walkable = false,
- buildable_to = true,
- --visual_scale = 1.0,
- selection_box = {
- type = "fixed",
- fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
- },
- sounds = default.node_sound_leaves_defaults(),
- drop = "",
- shears_drop = true,
- flowerpot_drop = "cavestuff:fungus",
- on_use = function(itemstack, user, pointed_thing)
- if not user or not user:is_player() then return end
- -- Fewer steps than the mycena, to simulate being less poisonous.
- minetest.after(1, mushroom_poison, user:get_player_name(), 2)
- return eat_mushroom(itemstack, user, pointed_thing)
- end,
- on_construct = function(...)
- return flowers.on_mushroom_construct(...)
- end,
- on_destruct = function(...)
- return flowers.on_mushroom_destruct(...)
- end,
- on_timer = function(...)
- return flowers.on_mushroom_timer(...)
- end,
- on_punch = function(...)
- return flowers.on_mushroom_punch(...)
- end,
- })
- minetest.register_node("cavestuff:icicle_up", {
- description = "Icicle",
- tiles = {"caverealms_icicle_up.png"},
- inventory_image = "caverealms_icicle_up.png",
- wield_image = "caverealms_icicle_up.png",
- groups = utility.dig_groups("bigitem", {
- attached_node = 1,
- melts = 1,
- }),
- sounds = default.node_sound_glass_defaults(),
- paramtype = "light",
- drawtype = "plantlike",
- movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
- walkable = false,
- --visual_scale = 1.0,
- selection_box = {
- type = "fixed",
- fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
- },
- collision_box = {
- type = "fixed",
- fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
- },
- })
- minetest.register_node("cavestuff:icicle_up_glowing", {
- description = "Icicle With Glowing Minerals",
- tiles = {"caverealms_icicle_up.png"},
- inventory_image = "caverealms_icicle_up.png",
- wield_image = "caverealms_icicle_up.png",
- groups = utility.dig_groups("bigitem", {
- attached_node = 1,
- melts = 1,
- }),
- sounds = default.node_sound_glass_defaults(),
- paramtype = "light",
- drawtype = "plantlike",
- movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
- walkable = false,
- light_source = 7,
- --visual_scale = 1.0,
- selection_box = {
- type = "fixed",
- fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
- },
- collision_box = {
- type = "fixed",
- fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
- },
- })
- minetest.register_node("cavestuff:icicle_down", {
- description = "Icicle",
- tiles = {"caverealms_icicle_down.png"},
- inventory_image = "caverealms_icicle_down.png",
- wield_image = "caverealms_icicle_down.png",
- groups = utility.dig_groups("bigitem", {
- hanging_node = 1,
- melts = 1,
- }),
- sounds = default.node_sound_glass_defaults(),
- paramtype = "light",
- drawtype = "plantlike",
- movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
- walkable = false,
- --visual_scale = 1.0,
- selection_box = {
- type = "fixed",
- fixed = {-0.5, 5/16, -0.5, 0.5, 0.5, 0.5},
- },
- collision_box = {
- type = "fixed",
- fixed = {-0.5, 5/16, -0.5, 0.5, 0.5, 0.5},
- },
- })
- minetest.register_node("cavestuff:icicle_down_glowing", {
- description = "Icicle With Glowing Minerals",
- tiles = {"caverealms_icicle_down.png"},
- inventory_image = "caverealms_icicle_down.png",
- wield_image = "caverealms_icicle_down.png",
- groups = utility.dig_groups("bigitem", {
- hanging_node = 1,
- melts = 1,
- }),
- sounds = default.node_sound_glass_defaults(),
- paramtype = "light",
- drawtype = "plantlike",
- movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
- walkable = false,
- light_source = 7,
- --visual_scale = 1.0,
- selection_box = {
- type = "fixed",
- fixed = {-0.5, 5/16, -0.5, 0.5, 0.5, 0.5},
- },
- collision_box = {
- type = "fixed",
- fixed = {-0.5, 5/16, -0.5, 0.5, 0.5, 0.5},
- },
- })
- for i=1, 4, 1 do
- minetest.register_node("cavestuff:bluecrystal" .. i, {
- description = "Moon Gem",
- mesh = "mese_crystal_ore" .. i .. ".obj",
- tiles = {"caverealms_glow_crystal.png"},
- paramtype = "light",
- paramtype2 = "facedir",
- drawtype = "mesh",
- groups = utility.dig_groups("crystal", {
- attached_node = 1, fall_damage_add_percent = 100,
- }),
- use_texture_alpha = true,
- sounds = default.node_sound_glass_defaults(),
- light_source = 5,
- selection_box = {
- type = "fixed",
- fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
- },
- visual_scale = 1.3,
- on_rotate = function(...)
- return screwdriver.rotate_simple(...)
- end,
- on_construct = function(pos)
- local node = minetest.get_node(pos)
- node.param2 = math_random(0, 3)
- minetest.swap_node(pos, node)
- end,
- on_player_walk_over = function(pos, player)
- player:set_hp(player:get_hp() - 1)
- if player:get_hp() == 0 then
- minetest.chat_send_all("# Server: <" .. rename.gpn(player:get_player_name()) .. "> stepped on a moon spike.")
- end
- end,
- })
- end
- for i=1, 4, 1 do
- minetest.register_node("cavestuff:saltcrystal" .. i, {
- description = "Salt Crystal",
- mesh = "mese_crystal_ore" .. i .. ".obj",
- tiles = {"caverealms_salty.png"},
- paramtype = "light",
- paramtype2 = "facedir",
- drawtype = "mesh",
- groups = utility.dig_groups("crystal", {
- attached_node = 1,
- fall_damage_add_percent = 100,
- }),
- use_texture_alpha = true,
- sounds = default.node_sound_glass_defaults(),
- light_source = 5,
- selection_box = {
- type = "fixed",
- fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
- },
- on_rotate = function(...)
- return screwdriver.rotate_simple(...)
- end,
- on_construct = function(pos)
- local node = minetest.get_node(pos)
- node.param2 = math_random(0, 3)
- minetest.swap_node(pos, node)
- end,
- on_player_walk_over = function(pos, player)
- player:set_hp(player:get_hp() - 1)
- if player:get_hp() == 0 then
- minetest.chat_send_all("# Server: <" .. rename.gpn(player:get_player_name()) .. "> stepped on a salt spike.")
- end
- end,
- })
- end
- for i=1, 4, 1 do
- minetest.register_node("cavestuff:spike" .. i, {
- description = "Rock Spike",
- mesh = "mese_crystal_ore" .. i .. ".obj",
- tiles = {"default_stone.png"},
- drawtype = "mesh",
- paramtype = "light",
- paramtype2 = "facedir",
- groups = utility.dig_groups("crystal", {
- attached_node = 1, fall_damage_add_percent = 100,
- }),
- sounds = default.node_sound_stone_defaults(),
- selection_box = {
- type = "fixed",
- fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
- },
- on_rotate = function(...)
- return screwdriver.rotate_simple(...)
- end,
- on_construct = function(pos)
- local node = minetest.get_node(pos)
- node.param2 = math_random(0, 3)
- minetest.swap_node(pos, node)
- end,
- on_player_walk_over = function(pos, player)
- player:set_hp(player:get_hp() - 1)
- if player:get_hp() == 0 then
- minetest.chat_send_all("# Server: <" .. rename.gpn(player:get_player_name()) .. "> stepped on a rock spike.")
- end
- end,
- })
- end
- for i=1, 4, 1 do
- minetest.register_node("cavestuff:redspike" .. i, {
- description = "Redstone Spike",
- mesh = "mese_crystal_ore" .. i .. ".obj",
- tiles = {"default_desert_stone.png"},
- drawtype = "mesh",
- paramtype = "light",
- paramtype2 = "facedir",
- groups = utility.dig_groups("crystal", {
- attached_node = 1, fall_damage_add_percent = 100,
- }),
- sounds = default.node_sound_stone_defaults(),
- selection_box = {
- type = "fixed",
- fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
- },
- on_rotate = function(...)
- return screwdriver.rotate_simple(...)
- end,
- on_construct = function(pos)
- local node = minetest.get_node(pos)
- node.param2 = math_random(0, 3)
- minetest.swap_node(pos, node)
- end,
- on_player_walk_over = function(pos, player)
- player:set_hp(player:get_hp() - 1)
- if player:get_hp() == 0 then
- minetest.chat_send_all("# Server: <" .. rename.gpn(player:get_player_name()) .. "> stepped on a rock spike.")
- end
- end,
- })
- end
- -- Special cobble type which mimics default cobble. Needed for cavegen.
- -- The player should not be able to obtain this nodetype directly.
- minetest.register_node("cavestuff:cobble", {
- description = "Cobblestone",
- tiles = {"default_cobble.png"},
- is_ground_content = true, -- Important!
- groups = utility.dig_groups("cobble", {
- melts = 1, cobble_type = 1,
- }),
- _melts_to = "cavestuff:cobble_with_rockmelt",
- drop = "default:cobble", -- Mimic default cobble.
- sounds = default.node_sound_stone_defaults(),
- -- Common stone does not count toward tool's dig count.
- _toolranks = {
- ignore = true,
- },
- })
|