Rename mod: default to mcl_core

This commit is contained in:
Wuzzy 2017-01-31 23:32:56 +01:00
parent d0ecf0c66c
commit 02fe45bca2
393 changed files with 2205 additions and 2210 deletions

View File

@ -1,2 +1,2 @@
default mcl_core
mcl_wool mcl_wool

View File

@ -55,7 +55,7 @@ minetest.register_node("beds:bed_bottom", {
paramtype2 = "facedir", paramtype2 = "facedir",
stack_max = 1, stack_max = 1,
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,deco_block=1}, groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,deco_block=1},
sounds = default.node_sound_wood_defaults(), sounds = mcl_core.node_sound_wood_defaults(),
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5}, fixed = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5},
@ -152,7 +152,7 @@ minetest.register_node("beds:bed_top", {
paramtype2 = "facedir", paramtype2 = "facedir",
is_ground_content = false, is_ground_content = false,
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,not_in_creative_inventory=1}, groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,not_in_creative_inventory=1},
sounds = default.node_sound_wood_defaults(), sounds = mcl_core.node_sound_wood_defaults(),
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5}, fixed = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5},

View File

@ -1 +1 @@
default mcl_core

View File

@ -10,7 +10,7 @@ local function deepcopy ( t )
return nt; return nt;
end end
local newbook = deepcopy(minetest.registered_items["default:book"]); local newbook = deepcopy(minetest.registered_items["mcl_core:book"]);
newbook.on_use = function ( itemstack, user, pointed_thing ) newbook.on_use = function ( itemstack, user, pointed_thing )
@ -21,16 +21,16 @@ newbook.on_use = function ( itemstack, user, pointed_thing )
"textarea[0.5,0.25;7.5,9.25;text;;"..minetest.formspec_escape(text).."]".. "textarea[0.5,0.25;7.5,9.25;text;;"..minetest.formspec_escape(text).."]"..
"button_exit[3,8.25;2,1;ok;Exit]"; "button_exit[3,8.25;2,1;ok;Exit]";
minetest.show_formspec(user:get_player_name(), "default:book", formspec); minetest.show_formspec(user:get_player_name(), "mcl_core:book", formspec);
end end
minetest.register_craftitem(":default:book", newbook); minetest.register_craftitem(":mcl_core:book", newbook);
minetest.register_on_player_receive_fields(function ( player, formname, fields ) minetest.register_on_player_receive_fields(function ( player, formname, fields )
if ((formname == "default:book") and fields and fields.text) then if ((formname == "mcl_core:book") and fields and fields.text) then
local stack = player:get_wielded_item(); local stack = player:get_wielded_item();
if (stack:get_name() and (stack:get_name() == "default:book")) then if (stack:get_name() and (stack:get_name() == "mcl_core:book")) then
local t = stack:to_table(); local t = stack:to_table();
t.metadata = fields.text; t.metadata = fields.text;
player:set_wielded_item(ItemStack(t)); player:set_wielded_item(ItemStack(t));

View File

@ -1,2 +1 @@
default mcl_core

View File

@ -10,8 +10,8 @@ minetest.register_alias("bucket_lava", "bucket:bucket_lava")
minetest.register_craft({ minetest.register_craft({
output = 'bucket:bucket_empty 1', output = 'bucket:bucket_empty 1',
recipe = { recipe = {
{'default:steel_ingot', '', 'default:steel_ingot'}, {'mcl_core:steel_ingot', '', 'mcl_core:steel_ingot'},
{'', 'default:steel_ingot', ''}, {'', 'mcl_core:steel_ingot', ''},
} }
}) })
@ -130,16 +130,16 @@ minetest.register_craftitem("bucket:bucket_empty", {
}) })
bucket.register_liquid( bucket.register_liquid(
"default:water_source", "mcl_core:water_source",
"default:water_flowing", "mcl_core:water_flowing",
"bucket:bucket_water", "bucket:bucket_water",
"bucket_water.png", "bucket_water.png",
"Water Bucket" "Water Bucket"
) )
bucket.register_liquid( bucket.register_liquid(
"default:lava_source", "mcl_core:lava_source",
"default:lava_flowing", "mcl_core:lava_flowing",
"bucket:bucket_lava", "bucket:bucket_lava",
"bucket_lava.png", "bucket_lava.png",
"Lava Bucket" "Lava Bucket"

View File

@ -100,7 +100,7 @@ minetest.register_entity(":__builtin:item", {
return return
end end
--[[ if name == "default:water_source" then --[[ if name == "mcl_core:water_source" then
self.object:setacceleration({x = 0, y = 4, z = 0}) self.object:setacceleration({x = 0, y = 4, z = 0})
else else
self.object:setacceleration({x = 0, y = -10, z = 0}) self.object:setacceleration({x = 0, y = -10, z = 0})
@ -120,7 +120,7 @@ minetest.register_entity(":__builtin:item", {
local name = minetest.get_node(pos).name local name = minetest.get_node(pos).name
local par2 = minetest.get_node(pos).param2 local par2 = minetest.get_node(pos).param2
if name == "default:water_flowing" and par2 < param2 then if name == "mcl_core:water_flowing" and par2 < param2 then
return pos return pos
end end

View File

@ -232,10 +232,10 @@ crafting.set_creative_formspec = function(player, start_i, pagenum, show, page,
"image[" .. boffset[check] .. ";1,1;crafting_creative_marker.png]" "image[" .. boffset[check] .. ";1,1;crafting_creative_marker.png]"
end end
formspec = "size[10,9.3]".. formspec = "size[10,9.3]"..
default.inventory_header.. mcl_core.inventory_header..
"background[-0.19,-0.25;10.5,9.87;"..inv_bg.."]".. "background[-0.19,-0.25;10.5,9.87;"..inv_bg.."]"..
"label[-5,-5;"..name.."]".. "label[-5,-5;"..name.."]"..
"item_image_button[-0.1,0;1,1;default:brick;blocks;]".. --build blocks "item_image_button[-0.1,0;1,1;mcl_core:brick;blocks;]".. --build blocks
tab(name, "blocks") .. tab(name, "blocks") ..
"tooltip[blocks;Building Blocks]".. "tooltip[blocks;Building Blocks]"..
"item_image_button[1.15,0;1,1;mcl_flowers:peony;deco;]".. --decoration blocks "item_image_button[1.15,0;1,1;mcl_flowers:peony;deco;]".. --decoration blocks
@ -256,19 +256,19 @@ crafting.set_creative_formspec = function(player, start_i, pagenum, show, page,
"image[0,1;5,0.75;fnt_"..name..".png]".. "image[0,1;5,0.75;fnt_"..name..".png]"..
"list[current_player;main;0,7;9,1;]".. "list[current_player;main;0,7;9,1;]"..
main_list.. main_list..
"item_image_button[-0.1,8.37;1,1;default:apple;food;]".. --foodstuff "item_image_button[-0.1,8.37;1,1;mcl_core:apple;food;]".. --foodstuff
tab(name, "food") .. tab(name, "food") ..
"tooltip[food;Foodstuffs]".. "tooltip[food;Foodstuffs]"..
"item_image_button[1.15,8.37;1,1;default:axe_steel;tools;]".. --tools "item_image_button[1.15,8.37;1,1;mcl_core:axe_steel;tools;]".. --tools
tab(name, "tools") .. tab(name, "tools") ..
"tooltip[tools;Tools]".. "tooltip[tools;Tools]"..
"item_image_button[2.415,8.37;1,1;default:sword_gold;combat;]".. --combat "item_image_button[2.415,8.37;1,1;mcl_core:sword_gold;combat;]".. --combat
tab(name, "combat") .. tab(name, "combat") ..
"tooltip[combat;Combat]".. "tooltip[combat;Combat]"..
"item_image_button[3.693,8.37;1,1;mcl_potions:glass_bottle;brew;]".. --brewing "item_image_button[3.693,8.37;1,1;mcl_potions:glass_bottle;brew;]".. --brewing
tab(name, "brew") .. tab(name, "brew") ..
"tooltip[brew;Brewing]".. "tooltip[brew;Brewing]"..
"item_image_button[4.938,8.37;1,1;default:stick;matr;]".. --materials "item_image_button[4.938,8.37;1,1;mcl_core:stick;matr;]".. --materials
tab(name, "matr") .. tab(name, "matr") ..
"tooltip[matr;Materials]".. "tooltip[matr;Materials]"..
"item_image_button[9.19,8.37;1,1;mcl_chests:chest;inv;]".. --inventory "item_image_button[9.19,8.37;1,1;mcl_chests:chest;inv;]".. --inventory

View File

@ -1 +1 @@
default mcl_core

View File

@ -82,7 +82,7 @@ local function set_inventory(player)
local form = "size[9,8.75]".. local form = "size[9,8.75]"..
"background[-0.19,-0.25;9.41,9.49;crafting_formspec_bg.png^crafting_inventory.png"..armor_img.."]".. "background[-0.19,-0.25;9.41,9.49;crafting_formspec_bg.png^crafting_inventory.png"..armor_img.."]"..
default.inventory_header.. mcl_core.inventory_header..
img_element.. img_element..
--armor --armor
"list[detached:"..player_name.."_armor;armor;0,0;1,1;1]".. "list[detached:"..player_name.."_armor;armor;0,0;1,1;1]"..
@ -110,7 +110,7 @@ local function set_workbench(player)
local form = "size[9,8.75]".. local form = "size[9,8.75]"..
"background[-0.19,-0.25;9.41,9.49;crafting_formspec_bg.png^crafting_inventory_workbench.png]".. "background[-0.19,-0.25;9.41,9.49;crafting_formspec_bg.png^crafting_inventory_workbench.png]"..
default.inventory_header.. mcl_core.inventory_header..
"list[current_player;main;0,4.5;9,3;9]".. "list[current_player;main;0,4.5;9,3;9]"..
"list[current_player;main;0,7.74;9,1;]".. "list[current_player;main;0,7.74;9,1;]"..
"list[current_player;craft;1.75,0.5;3,3;]".. "list[current_player;craft;1.75,0.5;3,3;]"..
@ -168,7 +168,7 @@ minetest.register_node("crafting:workbench", {
on_rightclick = function(pos, node, clicker, itemstack) on_rightclick = function(pos, node, clicker, itemstack)
set_workbench(clicker) set_workbench(clicker)
end, end,
sounds = default.node_sound_wood_defaults(), sounds = mcl_core.node_sound_wood_defaults(),
}) })
minetest.register_craft({ minetest.register_craft({

View File

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

File diff suppressed because it is too large Load Diff

View File

@ -1,29 +0,0 @@
-- Minetest 0.4 mod: default
-- See README.txt for licensing and other information.
-- The API documentation in here was moved into doc/lua_api.txt
-- Definitions made by this mod that other mods can use too
default = {}
default.gui_slots = "listcolors[#9990;#FFF7;#FFF0;#000;#FFF]"
default.gui_bg = "bgcolor[#080808BB;true]"
default.gui_bg_img = ""
default.inventory_header = default.gui_slots .. default.gui_bg
minetest.nodedef_default.stack_max = 64
minetest.craftitemdef_default.stack_max = 64
-- Load files
dofile(minetest.get_modpath("default").."/functions.lua")
dofile(minetest.get_modpath("default").."/nodes.lua")
dofile(minetest.get_modpath("default").."/tools.lua")
dofile(minetest.get_modpath("default").."/craftitems.lua")
dofile(minetest.get_modpath("default").."/crafting.lua")
dofile(minetest.get_modpath("default").."/mapgen.lua")
dofile(minetest.get_modpath("default").."/player.lua")
-- Aliases
minetest.register_alias("default:desert_sand", "default:sand")
minetest.register_alias("default:desert_stone", "default:sandstone")
minetest.register_alias("default:iron_lump", "default:stone_with_iron")
minetest.register_alias("default:gold_lump", "default:stone_with_gold")

View File

@ -1 +1 @@
default mcl_core

View File

@ -301,15 +301,15 @@ doors:register_door("doors:door_wood", {
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2,door=1}, groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2,door=1},
tiles_bottom = {"door_wood_b.png", "door_brown.png"}, tiles_bottom = {"door_wood_b.png", "door_brown.png"},
tiles_top = {"door_wood_a.png", "door_brown.png"}, tiles_top = {"door_wood_a.png", "door_brown.png"},
sounds = default.node_sound_wood_defaults(), sounds = mcl_core.node_sound_wood_defaults(),
}) })
minetest.register_craft({ minetest.register_craft({
output = "doors:door_wood 3", output = "doors:door_wood 3",
recipe = { recipe = {
{"default:wood", "default:wood"}, {"mcl_core:wood", "mcl_core:wood"},
{"default:wood", "default:wood"}, {"mcl_core:wood", "mcl_core:wood"},
{"default:wood", "default:wood"} {"mcl_core:wood", "mcl_core:wood"}
} }
}) })
@ -320,15 +320,15 @@ doors:register_door("doors:door_acacia", {
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2,door=1}, groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2,door=1},
tiles_bottom = {"door_acacia_b.png", "door_brown.png"}, tiles_bottom = {"door_acacia_b.png", "door_brown.png"},
tiles_top = {"door_acacia_a.png", "door_brown.png"}, tiles_top = {"door_acacia_a.png", "door_brown.png"},
sounds = default.node_sound_wood_defaults(), sounds = mcl_core.node_sound_wood_defaults(),
}) })
minetest.register_craft({ minetest.register_craft({
output = "doors:door_acacia 3", output = "doors:door_acacia 3",
recipe = { recipe = {
{"default:acaciawood", "default:acaciawood"}, {"mcl_core:acaciawood", "mcl_core:acaciawood"},
{"default:acaciawood", "default:acaciawood"}, {"mcl_core:acaciawood", "mcl_core:acaciawood"},
{"default:acaciawood", "default:acaciawood"} {"mcl_core:acaciawood", "mcl_core:acaciawood"}
} }
}) })
@ -339,15 +339,15 @@ doors:register_door("doors:door_birch", {
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2,door=1}, groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2,door=1},
tiles_bottom = {"door_birch_b.png", "door_brown.png"}, tiles_bottom = {"door_birch_b.png", "door_brown.png"},
tiles_top = {"door_birch_a.png", "door_brown.png"}, tiles_top = {"door_birch_a.png", "door_brown.png"},
sounds = default.node_sound_wood_defaults(), sounds = mcl_core.node_sound_wood_defaults(),
}) })
minetest.register_craft({ minetest.register_craft({
output = "doors:door_birch 3", output = "doors:door_birch 3",
recipe = { recipe = {
{"default:birchwood", "default:birchwood"}, {"mcl_core:birchwood", "mcl_core:birchwood"},
{"default:birchwood", "default:birchwood"}, {"mcl_core:birchwood", "mcl_core:birchwood"},
{"default:birchwood", "default:birchwood"}, {"mcl_core:birchwood", "mcl_core:birchwood"},
} }
}) })
@ -358,15 +358,15 @@ doors:register_door("doors:door_dark_oak", {
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2,door=1}, groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2,door=1},
tiles_bottom = {"door_dark_oak_b.png", "door_brown.png"}, tiles_bottom = {"door_dark_oak_b.png", "door_brown.png"},
tiles_top = {"door_dark_oak_a.png", "door_brown.png"}, tiles_top = {"door_dark_oak_a.png", "door_brown.png"},
sounds = default.node_sound_wood_defaults(), sounds = mcl_core.node_sound_wood_defaults(),
}) })
minetest.register_craft({ minetest.register_craft({
output = "doors:door_dark_oak 3", output = "doors:door_dark_oak 3",
recipe = { recipe = {
{"default:darkwood", "default:darkwood"}, {"mcl_core:darkwood", "mcl_core:darkwood"},
{"default:darkwood", "default:darkwood"}, {"mcl_core:darkwood", "mcl_core:darkwood"},
{"default:darkwood", "default:darkwood"}, {"mcl_core:darkwood", "mcl_core:darkwood"},
} }
}) })
@ -377,15 +377,15 @@ doors:register_door("doors:door_jungle", {
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2,door=1}, groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2,door=1},
tiles_bottom = {"door_jungle_b.png", "door_brown.png"}, tiles_bottom = {"door_jungle_b.png", "door_brown.png"},
tiles_top = {"door_jungle_a.png", "door_brown.png"}, tiles_top = {"door_jungle_a.png", "door_brown.png"},
sounds = default.node_sound_wood_defaults(), sounds = mcl_core.node_sound_wood_defaults(),
}) })
minetest.register_craft({ minetest.register_craft({
output = "doors:door_jungle 3", output = "doors:door_jungle 3",
recipe = { recipe = {
{"default:junglewood", "default:junglewood"}, {"mcl_core:junglewood", "mcl_core:junglewood"},
{"default:junglewood", "default:junglewood"}, {"mcl_core:junglewood", "mcl_core:junglewood"},
{"default:junglewood", "default:junglewood"} {"mcl_core:junglewood", "mcl_core:junglewood"}
} }
}) })
@ -396,15 +396,15 @@ doors:register_door("doors:door_spruce", {
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2,door=1}, groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2,door=1},
tiles_bottom = {"door_spruce_b.png", "door_brown.png"}, tiles_bottom = {"door_spruce_b.png", "door_brown.png"},
tiles_top = {"door_spruce_a.png", "door_brown.png"}, tiles_top = {"door_spruce_a.png", "door_brown.png"},
sounds = default.node_sound_wood_defaults(), sounds = mcl_core.node_sound_wood_defaults(),
}) })
minetest.register_craft({ minetest.register_craft({
output = "doors:door_spruce 3", output = "doors:door_spruce 3",
recipe = { recipe = {
{"default:sprucewood", "default:sprucewood"}, {"mcl_core:sprucewood", "mcl_core:sprucewood"},
{"default:sprucewood", "default:sprucewood"}, {"mcl_core:sprucewood", "mcl_core:sprucewood"},
{"default:sprucewood", "default:sprucewood"} {"mcl_core:sprucewood", "mcl_core:sprucewood"}
} }
}) })
@ -446,15 +446,15 @@ doors:register_door("doors:door_steel", {
groups = {snappy=1,cracky=1,level=2,door=1,mesecon_effector_on=1}, groups = {snappy=1,cracky=1,level=2,door=1,mesecon_effector_on=1},
tiles_bottom = {"door_steel_b.png", "door_grey.png"}, tiles_bottom = {"door_steel_b.png", "door_grey.png"},
tiles_top = {"door_steel_a.png", "door_grey.png"}, tiles_top = {"door_steel_a.png", "door_grey.png"},
sounds = default.node_sound_metal_defaults(), sounds = mcl_core.node_sound_metal_defaults(),
}) })
minetest.register_craft({ minetest.register_craft({
output = "doors:door_steel 3", output = "doors:door_steel 3",
recipe = { recipe = {
{"default:steel_ingot", "default:steel_ingot"}, {"mcl_core:steel_ingot", "mcl_core:steel_ingot"},
{"default:steel_ingot", "default:steel_ingot"}, {"mcl_core:steel_ingot", "mcl_core:steel_ingot"},
{"default:steel_ingot", "default:steel_ingot"} {"mcl_core:steel_ingot", "mcl_core:steel_ingot"}
} }
}) })
@ -504,7 +504,7 @@ minetest.register_node("doors:trapdoor", {
stack_max = 64, stack_max = 64,
paramtype2 = "facedir", paramtype2 = "facedir",
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,mesecon_effector_on=1,flammable=2,door=1}, groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,mesecon_effector_on=1,flammable=2,door=1},
sounds = default.node_sound_wood_defaults(), sounds = mcl_core.node_sound_wood_defaults(),
drop = "doors:trapdoor", drop = "doors:trapdoor",
node_box = { node_box = {
type = "fixed", type = "fixed",
@ -550,7 +550,7 @@ minetest.register_node("doors:trapdoor_open", {
paramtype2 = "facedir", paramtype2 = "facedir",
pointable = true, pointable = true,
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,mesecon_effector_on=1,flammable=2,door=1}, groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,mesecon_effector_on=1,flammable=2,door=1},
sounds = default.node_sound_wood_defaults(), sounds = mcl_core.node_sound_wood_defaults(),
drop = "doors:trapdoor", drop = "doors:trapdoor",
node_box = { node_box = {
type = "fixed", type = "fixed",
@ -628,7 +628,7 @@ minetest.register_node("doors:iron_trapdoor", {
stack_max = 64, stack_max = 64,
paramtype2 = "facedir", paramtype2 = "facedir",
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,mesecon_effector_on=1,flammable=0,door=1}, groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,mesecon_effector_on=1,flammable=0,door=1},
sounds = default.node_sound_wood_defaults(), sounds = mcl_core.node_sound_wood_defaults(),
drop = "doors:iron_trapdoor", drop = "doors:iron_trapdoor",
node_box = { node_box = {
type = "fixed", type = "fixed",
@ -671,7 +671,7 @@ minetest.register_node("doors:iron_trapdoor_open", {
is_ground_content = false, is_ground_content = false,
pointable = true, pointable = true,
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=0,door=1,mesecon_effector_on=1}, groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=0,door=1,mesecon_effector_on=1},
sounds = default.node_sound_wood_defaults(), sounds = mcl_core.node_sound_wood_defaults(),
drop = "doors:iron_trapdoor", drop = "doors:iron_trapdoor",
node_box = { node_box = {
type = "fixed", type = "fixed",
@ -691,8 +691,8 @@ minetest.register_node("doors:iron_trapdoor_open", {
minetest.register_craft({ minetest.register_craft({
output = 'doors:iron_trapdoor', output = 'doors:iron_trapdoor',
recipe = { recipe = {
{'default:steel_ingot', 'default:steel_ingot', ''}, {'mcl_core:steel_ingot', 'mcl_core:steel_ingot', ''},
{'default:steel_ingot', 'default:steel_ingot', ''}, {'mcl_core:steel_ingot', 'mcl_core:steel_ingot', ''},
{'', '', ''}, {'', '', ''},
} }
}) })

View File

@ -1,2 +1 @@
default mcl_core

View File

@ -1 +1 @@
default mcl_core

View File

@ -83,9 +83,9 @@ end
minetest.register_craft({ minetest.register_craft({
output = 'gemalde:node_1', output = 'gemalde:node_1',
recipe = { recipe = {
{'default:stick', 'default:stick', 'default:stick'}, {'mcl_core:stick', 'mcl_core:stick', 'mcl_core:stick'},
{'default:stick', 'group:wool', 'default:stick'}, {'mcl_core:stick', 'group:wool', 'mcl_core:stick'},
{'default:stick', 'default:stick', 'default:stick'}, {'mcl_core:stick', 'mcl_core:stick', 'mcl_core:stick'},
} }
}) })

View File

@ -1,2 +1,2 @@
default mcl_core
mcl_dye mcl_dye

View File

@ -25,13 +25,13 @@ minetest.register_node("hardened_clay:hardened_clay", {
tiles = {"hardened_clay.png"}, tiles = {"hardened_clay.png"},
stack_max = 64, stack_max = 64,
groups = {cracky=3,hardened_clay=1,building_block=1}, groups = {cracky=3,hardened_clay=1,building_block=1},
sounds = default.node_sound_stone_defaults(), sounds = mcl_core.node_sound_stone_defaults(),
}) })
minetest.register_craft({ minetest.register_craft({
type = "cooking", type = "cooking",
output = "hardened_clay:hardened_clay", output = "hardened_clay:hardened_clay",
recipe = "default:clay", recipe = "mcl_core:clay",
cooktime = 10, cooktime = 10,
}) })
@ -46,7 +46,7 @@ for _, row in ipairs(clay.dyes) do
tiles = {"hardened_clay_stained_"..name..".png"}, tiles = {"hardened_clay_stained_"..name..".png"},
groups = {cracky=3,hardened_clay=1,building_block=1}, groups = {cracky=3,hardened_clay=1,building_block=1},
stack_max = 64, stack_max = 64,
sounds = default.node_sound_stone_defaults(), sounds = mcl_core.node_sound_stone_defaults(),
}) })
if craft_color_group then if craft_color_group then
minetest.register_craft({ minetest.register_craft({

View File

@ -1,6 +1,6 @@
hudbars hudbars
intllib? intllib?
default? mlc_core?
flowers? flowers?
animalmaterials? animalmaterials?
bucket? bucket?

View File

@ -1 +1 @@
default mcl_core

View File

@ -100,7 +100,7 @@ minetest.register_node("itemframes:frame",{
paramtype2 = "facedir", paramtype2 = "facedir",
sunlight_propagates = true, sunlight_propagates = true,
groups = { choppy=2,dig_immediate=2,deco_block=1}, groups = { choppy=2,dig_immediate=2,deco_block=1},
sounds = default.node_sound_defaults(), sounds = mcl_core.node_sound_defaults(),
after_place_node = function(pos, placer, itemstack) after_place_node = function(pos, placer, itemstack)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
meta:set_string("owner",placer:get_player_name()) meta:set_string("owner",placer:get_player_name())
@ -133,8 +133,8 @@ minetest.register_node("itemframes:frame",{
minetest.register_craft({ minetest.register_craft({
output = 'itemframes:frame', output = 'itemframes:frame',
recipe = { recipe = {
{'default:stick', 'default:stick', 'default:stick'}, {'mcl_core:stick', 'mcl_core:stick', 'mcl_core:stick'},
{'default:stick', 'mcl_mobitems:leather', 'default:stick'}, {'mcl_core:stick', 'mcl_mobitems:leather', 'mcl_core:stick'},
{'default:stick', 'default:stick', 'default:stick'}, {'mcl_core:stick', 'mcl_core:stick', 'mcl_core:stick'},
} }
}) })

View File

@ -1 +1 @@
default mcl_core

View File

@ -135,7 +135,7 @@ end
local woods = { "", "_spruce", "_birch", "_jungle", "_dark", "_acacia" } local woods = { "", "_spruce", "_birch", "_jungle", "_dark", "_acacia" }
local names = { "Oak Boat", "Spruce Boat", "Birch Boat", "Jungle Boat", "Dark Oak Boat", "Acacia Boat" } local names = { "Oak Boat", "Spruce Boat", "Birch Boat", "Jungle Boat", "Dark Oak Boat", "Acacia Boat" }
local craftstuffs = { "default:wood", "default:sprucewood", "default:birchwood", "default:junglewood", "default:darkwood", "default:acaciawood" } local craftstuffs = { "mcl_core:wood", "mcl_core:sprucewood", "mcl_core:birchwood", "mcl_core:junglewood", "mcl_core:darkwood", "mcl_core:acaciawood" }
for w=1, #woods do for w=1, #woods do
local textures = {"mcl_boats_texture.png"} local textures = {"mcl_boats_texture.png"}

View File

@ -1,4 +1,4 @@
default mcl_core
bucket bucket
mcl_farming mcl_farming
mcl_mobitems mcl_mobitems

View File

@ -15,7 +15,7 @@ minetest.register_craft({
output = "mcl_cake:cake", output = "mcl_cake:cake",
recipe = { recipe = {
{'mcl_mobitems:milk_bucket', 'mcl_mobitems:milk_bucket', 'mcl_mobitems:milk_bucket'}, {'mcl_mobitems:milk_bucket', 'mcl_mobitems:milk_bucket', 'mcl_mobitems:milk_bucket'},
{'default:sugar', 'mcl_throwing:egg', 'default:sugar'}, {'mcl_core:sugar', 'mcl_throwing:egg', 'mcl_core:sugar'},
{'mcl_farming:wheat_harvested', 'mcl_farming:wheat_harvested', 'mcl_farming:wheat_harvested'}, {'mcl_farming:wheat_harvested', 'mcl_farming:wheat_harvested', 'mcl_farming:wheat_harvested'},
}, },
replacements = { replacements = {
@ -48,7 +48,7 @@ minetest.register_node("mcl_cake:cake", {
minetest.do_item_eat(2, ItemStack("mcl_cake:cake_5"), ItemStack("mcl_cake:cake"), clicker, {type="nothing"}) minetest.do_item_eat(2, ItemStack("mcl_cake:cake_5"), ItemStack("mcl_cake:cake"), clicker, {type="nothing"})
minetest.add_node(pos,{type="node",name="mcl_cake:cake_5",param2=0}) minetest.add_node(pos,{type="node",name="mcl_cake:cake_5",param2=0})
end, end,
sounds = default.node_sound_leaves_defaults(), sounds = mcl_core.node_sound_leaves_defaults(),
}) })
minetest.register_node("mcl_cake:cake_5", { minetest.register_node("mcl_cake:cake_5", {
description = "Cake (5 Slices Left)", description = "Cake (5 Slices Left)",
@ -70,7 +70,7 @@ minetest.register_node("mcl_cake:cake_5", {
minetest.do_item_eat(2, ItemStack("mcl_cake:cake_4"), ItemStack("mcl_cake:cake_5"), clicker, {type="nothing"}) minetest.do_item_eat(2, ItemStack("mcl_cake:cake_4"), ItemStack("mcl_cake:cake_5"), clicker, {type="nothing"})
minetest.add_node(pos,{type="node",name="mcl_cake:cake_4",param2=0}) minetest.add_node(pos,{type="node",name="mcl_cake:cake_4",param2=0})
end, end,
sounds = default.node_sound_leaves_defaults(), sounds = mcl_core.node_sound_leaves_defaults(),
}) })
minetest.register_node("mcl_cake:cake_4", { minetest.register_node("mcl_cake:cake_4", {
description = "Cake (4 Slices Left)", description = "Cake (4 Slices Left)",
@ -92,7 +92,7 @@ minetest.register_node("mcl_cake:cake_4", {
minetest.do_item_eat(2, ItemStack("mcl_cake:cake_3"), ItemStack("mcl_cake:cake_4"), clicker, {type="nothing"}) minetest.do_item_eat(2, ItemStack("mcl_cake:cake_3"), ItemStack("mcl_cake:cake_4"), clicker, {type="nothing"})
minetest.add_node(pos,{type="node",name="mcl_cake:cake_3",param2=0}) minetest.add_node(pos,{type="node",name="mcl_cake:cake_3",param2=0})
end, end,
sounds = default.node_sound_leaves_defaults(), sounds = mcl_core.node_sound_leaves_defaults(),
}) })
minetest.register_node("mcl_cake:cake_3", { minetest.register_node("mcl_cake:cake_3", {
description = "Cake (3 Slices Left)", description = "Cake (3 Slices Left)",
@ -114,7 +114,7 @@ minetest.register_node("mcl_cake:cake_3", {
minetest.do_item_eat(2, ItemStack("mcl_cake:cake_2"), ItemStack("mcl_cake:cake_3"), clicker, {type="nothing"}) minetest.do_item_eat(2, ItemStack("mcl_cake:cake_2"), ItemStack("mcl_cake:cake_3"), clicker, {type="nothing"})
minetest.add_node(pos,{type="node",name="mcl_cake:cake_2",param2=0}) minetest.add_node(pos,{type="node",name="mcl_cake:cake_2",param2=0})
end, end,
sounds = default.node_sound_leaves_defaults(), sounds = mcl_core.node_sound_leaves_defaults(),
}) })
minetest.register_node("mcl_cake:cake_2", { minetest.register_node("mcl_cake:cake_2", {
description = "Cake (2 Slices Left)", description = "Cake (2 Slices Left)",
@ -136,7 +136,7 @@ minetest.register_node("mcl_cake:cake_2", {
minetest.do_item_eat(2, ItemStack("mcl_cake:cake_1"), ItemStack("mcl_cake:cake_2"), clicker, {type="nothing"}) minetest.do_item_eat(2, ItemStack("mcl_cake:cake_1"), ItemStack("mcl_cake:cake_2"), clicker, {type="nothing"})
minetest.add_node(pos,{type="node",name="mcl_cake:cake_1",param2=0}) minetest.add_node(pos,{type="node",name="mcl_cake:cake_1",param2=0})
end, end,
sounds = default.node_sound_leaves_defaults(), sounds = mcl_core.node_sound_leaves_defaults(),
}) })
minetest.register_node("mcl_cake:cake_1", { minetest.register_node("mcl_cake:cake_1", {
description = "Cake (1 Slice Left)", description = "Cake (1 Slice Left)",
@ -158,5 +158,5 @@ minetest.register_node("mcl_cake:cake_1", {
minetest.do_item_eat(2, ItemStack("mcl:cake:cake 0"), ItemStack("mcl_cake:cake_1"), clicker, {type="nothing"}) minetest.do_item_eat(2, ItemStack("mcl:cake:cake 0"), ItemStack("mcl_cake:cake_1"), clicker, {type="nothing"})
minetest.remove_node(pos) minetest.remove_node(pos)
end, end,
sounds = default.node_sound_leaves_defaults(), sounds = mcl_core.node_sound_leaves_defaults(),
}) })

View File

@ -1 +1 @@
default mcl_core

View File

@ -30,7 +30,7 @@ minetest.register_node("mcl_chests:chest", {
stack_max = 64, stack_max = 64,
groups = {choppy=2,oddly_breakable_by_hand=2, deco_block=1}, groups = {choppy=2,oddly_breakable_by_hand=2, deco_block=1},
is_ground_content = false, is_ground_content = false,
sounds = default.node_sound_wood_defaults(), sounds = mcl_core.node_sound_wood_defaults(),
on_construct = function(pos) on_construct = function(pos)
local param2 = minetest.get_node(pos).param2 local param2 = minetest.get_node(pos).param2
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
@ -40,7 +40,7 @@ minetest.register_node("mcl_chests:chest", {
meta:set_string("formspec", meta:set_string("formspec",
"size[9,11.5]".. "size[9,11.5]"..
"background[-0.19,-0.25;9.41,12.5;crafting_inventory_chest_large.png]".. "background[-0.19,-0.25;9.41,12.5;crafting_inventory_chest_large.png]"..
default.inventory_header.. mcl_core.inventory_header..
"list[nodemeta:"..p.x..","..p.y..","..p.z..";main;0,0.5;9,3;]".. "list[nodemeta:"..p.x..","..p.y..","..p.z..";main;0,0.5;9,3;]"..
"list[current_name;main;0,3.5;9,3;]".. "list[current_name;main;0,3.5;9,3;]"..
"list[current_player;main;0,7.5;9,3;9]".. "list[current_player;main;0,7.5;9,3;9]"..
@ -54,7 +54,7 @@ minetest.register_node("mcl_chests:chest", {
m:set_string("formspec", m:set_string("formspec",
"size[9,11.5]".. "size[9,11.5]"..
"background[-0.19,-0.25;9.41,12.5;crafting_inventory_chest_large.png]".. "background[-0.19,-0.25;9.41,12.5;crafting_inventory_chest_large.png]"..
default.inventory_header.. mcl_core.inventory_header..
"list[current_name;main;0,0.5;9,3;]".. "list[current_name;main;0,0.5;9,3;]"..
"list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;0,3.5;9,3;]".. "list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;0,3.5;9,3;]"..
"list[current_player;main;0,7.5;9,3;9]".. "list[current_player;main;0,7.5;9,3;9]"..
@ -69,7 +69,7 @@ minetest.register_node("mcl_chests:chest", {
meta:set_string("formspec", meta:set_string("formspec",
"size[9,11.5]".. "size[9,11.5]"..
"background[-0.19,-0.25;9.41,12.5;crafting_inventory_chest_large.png]".. "background[-0.19,-0.25;9.41,12.5;crafting_inventory_chest_large.png]"..
default.inventory_header.. mcl_core.inventory_header..
"list[current_name;main;0,0.5;9,3;]".. "list[current_name;main;0,0.5;9,3;]"..
"list[nodemeta:"..p.x..","..p.y..","..p.z..";main;0,3.5;9,3;]".. "list[nodemeta:"..p.x..","..p.y..","..p.z..";main;0,3.5;9,3;]"..
"list[current_player;main;0,7.5;9,3;9]".. "list[current_player;main;0,7.5;9,3;9]"..
@ -83,7 +83,7 @@ minetest.register_node("mcl_chests:chest", {
m:set_string("formspec", m:set_string("formspec",
"size[9,11.5]".. "size[9,11.5]"..
"background[-0.19,-0.25;9.41,12.5;crafting_inventory_chest_large.png]".. "background[-0.19,-0.25;9.41,12.5;crafting_inventory_chest_large.png]"..
default.inventory_header.. mcl_core.inventory_header..
"list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;0,0.5;9,3;]".. "list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;0,0.5;9,3;]"..
"list[current_name;main;0,3.5;9,3;]".. "list[current_name;main;0,3.5;9,3;]"..
"list[current_player;main;0,7.5;9,3;9]".. "list[current_player;main;0,7.5;9,3;9]"..
@ -96,7 +96,7 @@ minetest.register_node("mcl_chests:chest", {
meta:set_string("formspec", meta:set_string("formspec",
"size[9,8.75]".. "size[9,8.75]"..
"background[-0.19,-0.25;9.41,10.48;crafting_inventory_chest.png]".. "background[-0.19,-0.25;9.41,10.48;crafting_inventory_chest.png]"..
default.inventory_header.. mcl_core.inventory_header..
"list[current_name;main;0,0.5;9,3;]".. "list[current_name;main;0,0.5;9,3;]"..
"list[current_player;main;0,4.5;9,3;9]".. "list[current_player;main;0,4.5;9,3;9]"..
"list[current_player;main;0,7.74;9,1;]".. "list[current_player;main;0,7.74;9,1;]"..
@ -141,7 +141,7 @@ minetest.register_node("mcl_chests:chest_left", {
groups = {choppy=2,oddly_breakable_by_hand=2,not_in_creative_inventory=1}, groups = {choppy=2,oddly_breakable_by_hand=2,not_in_creative_inventory=1},
drop = "mcl_chests:chest", drop = "mcl_chests:chest",
is_ground_content = false, is_ground_content = false,
sounds = default.node_sound_wood_defaults(), sounds = mcl_core.node_sound_wood_defaults(),
on_destruct = function(pos) on_destruct = function(pos)
local n = minetest.get_node(pos) local n = minetest.get_node(pos)
if n.name == "mcl_chests:chest" then if n.name == "mcl_chests:chest" then
@ -156,7 +156,7 @@ minetest.register_node("mcl_chests:chest_left", {
meta:set_string("formspec", meta:set_string("formspec",
"size[9,8.75]".. "size[9,8.75]"..
"background[-0.19,-0.25;9.41,10.48;crafting_inventory_chest.png]".. "background[-0.19,-0.25;9.41,10.48;crafting_inventory_chest.png]"..
default.inventory_header.. mcl_core.inventory_header..
"list[current_name;main;0,0.5;9,3;]".. "list[current_name;main;0,0.5;9,3;]"..
"list[current_player;main;0,4.5;9,3;9]".. "list[current_player;main;0,4.5;9,3;9]"..
"list[current_player;main;0,7.74;9,1;]".. "list[current_player;main;0,7.74;9,1;]"..
@ -199,7 +199,7 @@ minetest.register_node("mcl_chests:chest_right", {
groups = {choppy=2,oddly_breakable_by_hand=2,not_in_creative_inventory=1}, groups = {choppy=2,oddly_breakable_by_hand=2,not_in_creative_inventory=1},
drop = "mcl_chests:chest", drop = "mcl_chests:chest",
is_ground_content = false, is_ground_content = false,
sounds = default.node_sound_wood_defaults(), sounds = mcl_core.node_sound_wood_defaults(),
on_destruct = function(pos) on_destruct = function(pos)
local n = minetest.get_node(pos) local n = minetest.get_node(pos)
if n.name == "mcl_chests:chest" then if n.name == "mcl_chests:chest" then
@ -214,7 +214,7 @@ minetest.register_node("mcl_chests:chest_right", {
meta:set_string("formspec", meta:set_string("formspec",
"size[9,8.75]".. "size[9,8.75]"..
"background[-0.19,-0.25;9.41,10.48;crafting_inventory_chest.png]".. "background[-0.19,-0.25;9.41,10.48;crafting_inventory_chest.png]"..
default.inventory_header.. mcl_core.inventory_header..
"list[current_name;main;0,0.5;9,3;]".. "list[current_name;main;0,0.5;9,3;]"..
"list[current_player;main;0,4.5;9,3;9]".. "list[current_player;main;0,4.5;9,3;9]"..
"list[current_player;main;0,7.74;9,1;]".. "list[current_player;main;0,7.74;9,1;]"..

View File

@ -1,2 +1,2 @@
default mcl_core
mesecons mesecons

View File

@ -75,9 +75,9 @@ end)
minetest.register_craft({ minetest.register_craft({
output = 'mcl_clock:clock', output = 'mcl_clock:clock',
recipe = { recipe = {
{'', 'default:gold_ingot', ''}, {'', 'mcl_core:gold_ingot', ''},
{'default:gold_ingot', 'mesecons:redstone', 'default:gold_ingot'}, {'mcl_core:gold_ingot', 'mesecons:redstone', 'mcl_core:gold_ingot'},
{'', 'default:gold_ingot', ''} {'', 'mcl_core:gold_ingot', ''}
} }
}) })

View File

@ -1,2 +1,2 @@
default mcl_core
mesecons mesecons

View File

@ -55,9 +55,9 @@ end
minetest.register_craft({ minetest.register_craft({
output = 'mcl_compass:'..stereotype_frame, output = 'mcl_compass:'..stereotype_frame,
recipe = { recipe = {
{'', 'default:steel_ingot', ''}, {'', 'mcl_core:steel_ingot', ''},
{'default:steel_ingot', 'mesecons:redstone', 'default:steel_ingot'}, {'mcl_core:steel_ingot', 'mesecons:redstone', 'mcl_core:steel_ingot'},
{'', 'default:steel_ingot', ''} {'', 'mcl_core:steel_ingot', ''}
} }
}) })

1058
mods/mcl_core/crafting.lua Normal file

File diff suppressed because it is too large Load Diff

View File

@ -4,28 +4,28 @@
-- Crafting items -- Crafting items
-- --
minetest.register_craftitem("default:stick", { minetest.register_craftitem("mcl_core:stick", {
description = "Stick", description = "Stick",
inventory_image = "default_stick.png", inventory_image = "default_stick.png",
stack_max = 64, stack_max = 64,
groups = { craftitem=1 }, groups = { craftitem=1 },
}) })
minetest.register_craftitem("default:paper", { minetest.register_craftitem("mcl_core:paper", {
description = "Paper", description = "Paper",
inventory_image = "default_paper.png", inventory_image = "default_paper.png",
stack_max = 64, stack_max = 64,
groups = { craftitem=1 }, groups = { craftitem=1 },
}) })
minetest.register_craftitem("default:book", { minetest.register_craftitem("mcl_core:book", {
description = "Book", description = "Book",
inventory_image = "default_book.png", inventory_image = "default_book.png",
stack_max = 64, stack_max = 64,
groups = { craftitem=1 }, groups = { craftitem=1 },
}) })
minetest.register_craftitem("default:coal_lump", { minetest.register_craftitem("mcl_core:coal_lump", {
description = "Coal", description = "Coal",
groups = { coal=1 }, groups = { coal=1 },
inventory_image = "default_coal_lump.png", inventory_image = "default_coal_lump.png",
@ -33,7 +33,7 @@ minetest.register_craftitem("default:coal_lump", {
groups = { craftitem=1 }, groups = { craftitem=1 },
}) })
minetest.register_craftitem("default:charcoal_lump", { minetest.register_craftitem("mcl_core:charcoal_lump", {
description = "Charcoal", description = "Charcoal",
groups = { coal=1 }, groups = { coal=1 },
inventory_image = "default_charcoal_lump.png", inventory_image = "default_charcoal_lump.png",
@ -41,91 +41,91 @@ minetest.register_craftitem("default:charcoal_lump", {
groups = { craftitem=1 }, groups = { craftitem=1 },
}) })
minetest.register_craftitem("default:iron_nugget", { minetest.register_craftitem("mcl_core:iron_nugget", {
description = "Iron Nugget", description = "Iron Nugget",
inventory_image = "default_iron_nugget.png", inventory_image = "default_iron_nugget.png",
stack_max = 64, stack_max = 64,
groups = { craftitem=1 }, groups = { craftitem=1 },
}) })
minetest.register_craftitem("default:gold_nugget", { minetest.register_craftitem("mcl_core:gold_nugget", {
description = "Gold Nugget", description = "Gold Nugget",
inventory_image = "default_gold_nugget.png", inventory_image = "default_gold_nugget.png",
stack_max = 64, stack_max = 64,
groups = { craftitem=1 }, groups = { craftitem=1 },
}) })
minetest.register_craftitem("default:diamond", { minetest.register_craftitem("mcl_core:diamond", {
description = "Diamond", description = "Diamond",
inventory_image = "default_diamond.png", inventory_image = "default_diamond.png",
stack_max = 64, stack_max = 64,
groups = { craftitem=1 }, groups = { craftitem=1 },
}) })
minetest.register_craftitem("default:clay_lump", { minetest.register_craftitem("mcl_core:clay_lump", {
description = "Clay", description = "Clay",
inventory_image = "default_clay_lump.png", inventory_image = "default_clay_lump.png",
stack_max = 64, stack_max = 64,
groups = { craftitem=1 }, groups = { craftitem=1 },
}) })
minetest.register_craftitem("default:steel_ingot", { minetest.register_craftitem("mcl_core:steel_ingot", {
description = "Iron Ingot", description = "Iron Ingot",
inventory_image = "default_steel_ingot.png", inventory_image = "default_steel_ingot.png",
stack_max = 64, stack_max = 64,
groups = { craftitem=1 }, groups = { craftitem=1 },
}) })
minetest.register_craftitem("default:gold_ingot", { minetest.register_craftitem("mcl_core:gold_ingot", {
description = "Gold Ingot", description = "Gold Ingot",
inventory_image = "default_gold_ingot.png", inventory_image = "default_gold_ingot.png",
stack_max = 64, stack_max = 64,
groups = { craftitem=1 }, groups = { craftitem=1 },
}) })
minetest.register_craftitem("default:emerald", { minetest.register_craftitem("mcl_core:emerald", {
description = "Emerald", description = "Emerald",
inventory_image = "default_emerald.png", inventory_image = "default_emerald.png",
stack_max = 64, stack_max = 64,
groups = { craftitem=1 }, groups = { craftitem=1 },
}) })
minetest.register_craftitem("default:clay_brick", { minetest.register_craftitem("mcl_core:clay_brick", {
description = "Brick", description = "Brick",
inventory_image = "default_clay_brick.png", inventory_image = "default_clay_brick.png",
stack_max = 64, stack_max = 64,
groups = { craftitem=1 }, groups = { craftitem=1 },
}) })
minetest.register_craftitem("default:flint", { minetest.register_craftitem("mcl_core:flint", {
description = "Flint", description = "Flint",
inventory_image = "default_flint.png", inventory_image = "default_flint.png",
stack_max = 64, stack_max = 64,
groups = { craftitem=1 }, groups = { craftitem=1 },
}) })
minetest.register_craftitem("default:gunpowder", { minetest.register_craftitem("mcl_core:gunpowder", {
description = "Gunpowder", description = "Gunpowder",
inventory_image = "default_gunpowder.png", inventory_image = "default_gunpowder.png",
stack_max = 64, stack_max = 64,
groups = { craftitem=1 }, groups = { craftitem=1 },
}) })
minetest.register_craftitem("default:bone", { minetest.register_craftitem("mcl_core:bone", {
description = "Bone", description = "Bone",
inventory_image = "default_bone.png", inventory_image = "default_bone.png",
stack_max = 64, stack_max = 64,
groups = { craftitem=1 }, groups = { craftitem=1 },
}) })
minetest.register_craftitem("default:glowstone_dust", { minetest.register_craftitem("mcl_core:glowstone_dust", {
description = "Glowstone Dust", description = "Glowstone Dust",
inventory_image = "default_glowstone_dust.png", inventory_image = "default_glowstone_dust.png",
stack_max = 64, stack_max = 64,
groups = { craftitem=1 }, groups = { craftitem=1 },
}) })
minetest.register_craftitem("default:fish_raw", { minetest.register_craftitem("mcl_core:fish_raw", {
description = "Raw Fish", description = "Raw Fish",
inventory_image = "default_fish.png", inventory_image = "default_fish.png",
on_use = minetest.item_eat(2), on_use = minetest.item_eat(2),
@ -133,7 +133,7 @@ minetest.register_craftitem("default:fish_raw", {
groups = { food=1, eatable = 2 }, groups = { food=1, eatable = 2 },
}) })
minetest.register_craftitem("default:fish", { minetest.register_craftitem("mcl_core:fish", {
description = "Cooked Fish", description = "Cooked Fish",
inventory_image = "default_fish_cooked.png", inventory_image = "default_fish_cooked.png",
on_use = minetest.item_eat(4), on_use = minetest.item_eat(4),
@ -141,35 +141,35 @@ minetest.register_craftitem("default:fish", {
groups = { food=1, eatable=4 }, groups = { food=1, eatable=4 },
}) })
minetest.register_craftitem("default:sugar", { minetest.register_craftitem("mcl_core:sugar", {
description = "Sugar", description = "Sugar",
inventory_image = "default_sugar.png", inventory_image = "default_sugar.png",
stack_max = 64, stack_max = 64,
groups = { craftitem = 1 }, groups = { craftitem = 1 },
}) })
minetest.register_craftitem("default:string",{ minetest.register_craftitem("mcl_core:string",{
description = "String", description = "String",
inventory_image = "default_string.png", inventory_image = "default_string.png",
stack_max = 64, stack_max = 64,
groups = { craftitem = 1 }, groups = { craftitem = 1 },
}) })
minetest.register_craftitem("default:bowl",{ minetest.register_craftitem("mcl_core:bowl",{
description = "Bowl", description = "Bowl",
inventory_image = "default_bowl.png", inventory_image = "default_bowl.png",
stack_max = 64, stack_max = 64,
groups = { craftitem = 1 }, groups = { craftitem = 1 },
}) })
minetest.register_craftitem("default:prismarine_cry", { minetest.register_craftitem("mcl_core:prismarine_cry", {
description = "Prismarine Crystals", description = "Prismarine Crystals",
inventory_image = "default_prismarine_crystals.png", inventory_image = "default_prismarine_crystals.png",
stack_max = 64, stack_max = 64,
groups = { craftitem = 1 }, groups = { craftitem = 1 },
}) })
minetest.register_craftitem("default:prismarine_shard", { minetest.register_craftitem("mcl_core:prismarine_shard", {
description = "Prismarine Shard", description = "Prismarine Shard",
inventory_image = "default_prismarine_shard.png", inventory_image = "default_prismarine_shard.png",
stack_max = 64, stack_max = 64,
@ -177,7 +177,7 @@ minetest.register_craftitem("default:prismarine_shard", {
groups = { craftitem=1 }, groups = { craftitem=1 },
}) })
minetest.register_craftitem("default:quartz_crystal", { minetest.register_craftitem("mcl_core:quartz_crystal", {
description = "Nether Quartz", description = "Nether Quartz",
inventory_image = "default_quartz_crystal.png", inventory_image = "default_quartz_crystal.png",
stack_max = 64, stack_max = 64,
@ -185,7 +185,7 @@ minetest.register_craftitem("default:quartz_crystal", {
groups = { craftitem=1 }, groups = { craftitem=1 },
}) })
minetest.register_craftitem("default:apple", { minetest.register_craftitem("mcl_core:apple", {
description = "Apple", description = "Apple",
wield_image = "default_apple.png", wield_image = "default_apple.png",
inventory_image = "default_apple.png", inventory_image = "default_apple.png",
@ -194,7 +194,7 @@ minetest.register_craftitem("default:apple", {
groups = { food = 2 }, groups = { food = 2 },
}) })
minetest.register_craftitem("default:apple_gold", { minetest.register_craftitem("mcl_core:apple_gold", {
description = core.colorize("#55FFFF", "Golden Apple"), description = core.colorize("#55FFFF", "Golden Apple"),
wield_image = "default_apple_gold.png", wield_image = "default_apple_gold.png",
inventory_image = "default_apple_gold.png", inventory_image = "default_apple_gold.png",
@ -203,4 +203,4 @@ minetest.register_craftitem("default:apple_gold", {
groups = { food = 2 }, groups = { food = 2 },
}) })
minetest.register_alias("default:iron_ingot", "default:steel_ingot") minetest.register_alias("mcl_core:iron_ingot", "mcl_core:steel_ingot")

View File

@ -2,31 +2,31 @@
-- Lavacooling -- Lavacooling
-- --
default.cool_lava_source = function(pos) mcl_core.cool_lava_source = function(pos)
minetest.set_node(pos, {name="default:obsidian"}) minetest.set_node(pos, {name="mcl_core:obsidian"})
end end
default.cool_lava_flowing = function(pos) mcl_core.cool_lava_flowing = function(pos)
minetest.set_node(pos, {name="default:stone"}) minetest.set_node(pos, {name="mcl_core:stone"})
end end
minetest.register_abm({ minetest.register_abm({
nodenames = {"default:lava_flowing"}, nodenames = {"mcl_core:lava_flowing"},
neighbors = {"group:water"}, neighbors = {"group:water"},
interval = 1, interval = 1,
chance = 1, chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider) action = function(pos, node, active_object_count, active_object_count_wider)
default.cool_lava_flowing(pos, node, active_object_count, active_object_count_wider) mcl_core.cool_lava_flowing(pos, node, active_object_count, active_object_count_wider)
end, end,
}) })
minetest.register_abm({ minetest.register_abm({
nodenames = {"default:lava_source"}, nodenames = {"mcl_core:lava_source"},
neighbors = {"group:water"}, neighbors = {"group:water"},
interval = 1, interval = 1,
chance = 1, chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider) action = function(pos, node, active_object_count, active_object_count_wider)
default.cool_lava_source(pos, node, active_object_count, active_object_count_wider) mcl_core.cool_lava_source(pos, node, active_object_count, active_object_count_wider)
end, end,
}) })
@ -41,13 +41,13 @@ local grow_cactus = function(pos, node)
if minetest.get_item_group(name, "sand") ~= 0 then if minetest.get_item_group(name, "sand") ~= 0 then
pos.y = pos.y+1 pos.y = pos.y+1
local height = 0 local height = 0
while minetest.get_node(pos).name == "default:cactus" and height < 4 do while minetest.get_node(pos).name == "mcl_core:cactus" and height < 4 do
height = height+1 height = height+1
pos.y = pos.y+1 pos.y = pos.y+1
end end
if height < 3 then if height < 3 then
if minetest.get_node(pos).name == "air" then if minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name="default:cactus"}) minetest.set_node(pos, {name="mcl_core:cactus"})
end end
end end
end end
@ -62,13 +62,13 @@ local grow_reeds = function(pos, node)
end end
pos.y = pos.y+1 pos.y = pos.y+1
local height = 0 local height = 0
while minetest.get_node(pos).name == "default:reeds" and height < 3 do while minetest.get_node(pos).name == "mcl_core:reeds" and height < 3 do
height = height+1 height = height+1
pos.y = pos.y+1 pos.y = pos.y+1
end end
if height < 3 then if height < 3 then
if minetest.get_node(pos).name == "air" then if minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name="default:reeds"}) minetest.set_node(pos, {name="mcl_core:reeds"})
end end
end end
end end
@ -101,7 +101,7 @@ minetest.register_abm({
for zp=-1,1 do for zp=-1,1 do
local p = {x=pos.x+xp, y=pos.y, z=pos.z+zp} local p = {x=pos.x+xp, y=pos.y, z=pos.z+zp}
local n = minetest.get_node(p) local n = minetest.get_node(p)
if (n.name=="default:water_flowing") then if (n.name=="mcl_core:water_flowing") then
drop_attached_node(pos) drop_attached_node(pos)
minetest.dig_node(pos) minetest.dig_node(pos)
break break
@ -111,7 +111,7 @@ minetest.register_abm({
for yp=-1,1 do for yp=-1,1 do
local p = {x=pos.x, y=pos.y+yp, z=pos.z} local p = {x=pos.x, y=pos.y+yp, z=pos.z}
local n = minetest.get_node(p) local n = minetest.get_node(p)
if (n.name=="default:water_flowing") then if (n.name=="mcl_core:water_flowing") then
drop_attached_node(pos) drop_attached_node(pos)
minetest.dig_node(pos) minetest.dig_node(pos)
break break
@ -122,7 +122,7 @@ minetest.register_abm({
}) })
minetest.register_abm({ minetest.register_abm({
nodenames = {"default:cactus"}, nodenames = {"mcl_core:cactus"},
neighbors = {"group:sand"}, neighbors = {"group:sand"},
interval = 25, interval = 25,
chance = 10, chance = 10,
@ -132,8 +132,8 @@ minetest.register_abm({
}) })
minetest.register_abm({ minetest.register_abm({
nodenames = {"default:reeds"}, nodenames = {"mcl_core:reeds"},
neighbors = {"default:dirt", "default:dirt_with_grass"}, neighbors = {"mcl_core:dirt", "mcl_core:dirt_with_grass"},
interval = 25, interval = 25,
chance = 10, chance = 10,
action = function(pos) action = function(pos)
@ -145,7 +145,7 @@ minetest.register_abm({
-- Papyrus and cactus drop -- Papyrus and cactus drop
-- --
local timber_nodenames={"default:reeds", "default:cactus"} local timber_nodenames={"mcl_core:reeds", "mcl_core:cactus"}
minetest.register_on_dignode(function(pos, node) minetest.register_on_dignode(function(pos, node)
local i=1 local i=1
@ -166,7 +166,7 @@ end)
-- Flint and Steel -- Flint and Steel
-- --
function default.set_fire(pointed_thing) function mcl_core.set_fire(pointed_thing)
local n = minetest.get_node(pointed_thing.above) local n = minetest.get_node(pointed_thing.above)
if n.name ~= "" and n.name == "air" and not minetest.is_protected(pointed_thing.above, "fire") then if n.name ~= "" and n.name == "air" and not minetest.is_protected(pointed_thing.above, "fire") then
minetest.add_node(pointed_thing.above, {name="fire:basic_flame"}) minetest.add_node(pointed_thing.above, {name="fire:basic_flame"})
@ -177,7 +177,7 @@ end
-- Fire Particles -- Fire Particles
-- --
function default.add_fire(pos) function mcl_core.add_fire(pos)
local null = {x=0, y=0, z=0} local null = {x=0, y=0, z=0}
pos.y = pos.y+0.19 pos.y = pos.y+0.19
minetest.add_particle(pos, null, null, 1.1, minetest.add_particle(pos, null, null, 1.1,
@ -197,9 +197,9 @@ local pos
local function apple_leave() local function apple_leave()
if math.random(0, 10) == 3 then if math.random(0, 10) == 3 then
return {name = "default:apple"} return {name = "mcl_core:apple"}
else else
return {name = "default:leaves"} return {name = "mcl_core:leaves"}
end end
end end
@ -207,7 +207,7 @@ local function air_leave()
if math.random(0, 50) == 3 then if math.random(0, 50) == 3 then
return {name = "air"} return {name = "air"}
else else
return {name = "default:leaves"} return {name = "mcl_core:leaves"}
end end
end end
@ -314,14 +314,14 @@ local function generate_tree(pos, trunk, leaves, typearbre)
for dz=0,1 do for dz=0,1 do
pos.z = pos.z + dz pos.z = pos.z + dz
--> 0 --> 0
if minetest.get_node(pos).name == "default:dirt_with_grass" if minetest.get_node(pos).name == "mcl_core:dirt_with_grass"
or minetest.get_node(pos).name == "default:dirt" then else or minetest.get_node(pos).name == "mcl_core:dirt" then else
return return
end end
pos.x = pos.x+1 pos.x = pos.x+1
--> 1 --> 1
if minetest.get_node(pos).name == "default:dirt_with_grass" if minetest.get_node(pos).name == "mcl_core:dirt_with_grass"
or minetest.get_node(pos).name == "default:dirt" then else or minetest.get_node(pos).name == "mcl_core:dirt" then else
return return
end end
pos.x = pos.x-1 pos.x = pos.x-1
@ -339,22 +339,22 @@ local function generate_tree(pos, trunk, leaves, typearbre)
if dz == -1 then if dz == -1 then
pos.z = pos.z + dz pos.z = pos.z + dz
if math.random(1, 3) == 1 and minetest.get_node(pos).name == "air" then if math.random(1, 3) == 1 and minetest.get_node(pos).name == "air" then
minetest.add_node(pos, {name = "default:vine", param2 = 4}) minetest.add_node(pos, {name = "mcl_core:vine", param2 = 4})
end end
pos.x = pos.x+1 pos.x = pos.x+1
if math.random(1, 3) == 1 and minetest.get_node(pos).name == "air" then if math.random(1, 3) == 1 and minetest.get_node(pos).name == "air" then
minetest.add_node(pos, {name = "default:vine", param2 = 4}) minetest.add_node(pos, {name = "mcl_core:vine", param2 = 4})
end end
pos.x = pos.x-1 pos.x = pos.x-1
pos.z = pos.z - dz pos.z = pos.z - dz
elseif dz == 2 then elseif dz == 2 then
pos.z = pos.z + dz pos.z = pos.z + dz
if math.random(1, 3) == 1 and minetest.get_node(pos).name == "air"then if math.random(1, 3) == 1 and minetest.get_node(pos).name == "air"then
minetest.add_node(pos, {name = "default:vine", param2 = 5}) minetest.add_node(pos, {name = "mcl_core:vine", param2 = 5})
end end
pos.x = pos.x+1 pos.x = pos.x+1
if math.random(1, 3) == 1 and minetest.get_node(pos).name == "air" then if math.random(1, 3) == 1 and minetest.get_node(pos).name == "air" then
minetest.add_node(pos, {name = "default:vine", param2 = 5}) minetest.add_node(pos, {name = "mcl_core:vine", param2 = 5})
end end
pos.x = pos.x-1 pos.x = pos.x-1
pos.z = pos.z - dz pos.z = pos.z - dz
@ -362,7 +362,7 @@ local function generate_tree(pos, trunk, leaves, typearbre)
pos.z = pos.z + dz pos.z = pos.z + dz
pos.x = pos.x-1 pos.x = pos.x-1
if math.random(1, 3) == 1 and minetest.get_node(pos).name == "air" then if math.random(1, 3) == 1 and minetest.get_node(pos).name == "air" then
minetest.add_node(pos, {name = "default:vine", param2 = 2}) minetest.add_node(pos, {name = "mcl_core:vine", param2 = 2})
end end
pos.x = pos.x+1 pos.x = pos.x+1
if minetest.get_node(pos).name == "air" then if minetest.get_node(pos).name == "air" then
@ -374,7 +374,7 @@ local function generate_tree(pos, trunk, leaves, typearbre)
end end
pos.x = pos.x+1 pos.x = pos.x+1
if math.random(1, 3) == 1 and minetest.get_node(pos).name == "air" then if math.random(1, 3) == 1 and minetest.get_node(pos).name == "air" then
minetest.add_node(pos, {name = "default:vine", param2 = 3}) minetest.add_node(pos, {name = "mcl_core:vine", param2 = 3})
end end
pos.x = pos.x-2 pos.x = pos.x-2
pos.z = pos.z - dz pos.z = pos.z - dz
@ -395,21 +395,21 @@ local function generate_tree(pos, trunk, leaves, typearbre)
pos.z = pos.z+dz pos.z = pos.z+dz
if dx == 0 and dz == 0 and dy==3 then if dx == 0 and dz == 0 and dy==3 then
if minetest.get_node(pos).name == "air" or minetest.get_node(pos).name == "default:vine" and math.random(1, 2) == 1 then if minetest.get_node(pos).name == "air" or minetest.get_node(pos).name == "mcl_core:vine" and math.random(1, 2) == 1 then
minetest.add_node(pos, node) minetest.add_node(pos, node)
end end
elseif dx == 0 and dz == 0 and dy==4 then elseif dx == 0 and dz == 0 and dy==4 then
if minetest.get_node(pos).name == "air" or minetest.get_node(pos).name == "default:vine" and math.random(1, 5) == 1 then if minetest.get_node(pos).name == "air" or minetest.get_node(pos).name == "mcl_core:vine" and math.random(1, 5) == 1 then
minetest.add_node(pos, node) minetest.add_node(pos, node)
minetest.add_node(pos, air_leave()) minetest.add_node(pos, air_leave())
end end
elseif math.abs(dx) ~= 2 and math.abs(dz) ~= 2 then elseif math.abs(dx) ~= 2 and math.abs(dz) ~= 2 then
if minetest.get_node(pos).name == "air" or minetest.get_node(pos).name == "default:vine" then if minetest.get_node(pos).name == "air" or minetest.get_node(pos).name == "mcl_core:vine" then
minetest.add_node(pos, node) minetest.add_node(pos, node)
end end
else else
if math.abs(dx) ~= 2 or math.abs(dz) ~= 2 then if math.abs(dx) ~= 2 or math.abs(dz) ~= 2 then
if minetest.get_node(pos).name == "air" or minetest.get_node(pos).name == "default:vine" and math.random(1, 3) == 1 then if minetest.get_node(pos).name == "air" or minetest.get_node(pos).name == "mcl_core:vine" and math.random(1, 3) == 1 then
minetest.add_node(pos, node) minetest.add_node(pos, node)
end end
else else
@ -431,37 +431,36 @@ local plant_tab = {}
local rnd_max = 5 local rnd_max = 5
minetest.after(0.5, function() minetest.after(0.5, function()
plant_tab[0] = "air" plant_tab[0] = "air"
plant_tab[1] = "default:grass" plant_tab[1] = "mcl_core:grass"
plant_tab[2] = "default:grass" plant_tab[2] = "mcl_core:grass"
plant_tab[3] = "default:grass" plant_tab[3] = "mcl_core:grass"
plant_tab[4] = "default:grass" plant_tab[4] = "mcl_core:grass"
plant_tab[5] = "default:grass" plant_tab[5] = "mcl_core:grass"
if minetest.get_modpath("mcl_flowers") ~= nil then if minetest.get_modpath("mcl_flowers") ~= nil then
rnd_max = 16 rnd_max = 15
plant_tab[6] = "mcl_flowers:dandelion_yellow" plant_tab[6] = "mcl_flowers:dandelion"
plant_tab[7] = "mcl_flowers:rose" plant_tab[7] = "mcl_flowers:blue_orchid"
plant_tab[8] = "mcl_flowers:oxeye_daisy" plant_tab[8] = "mcl_flowers:oxeye_daisy"
plant_tab[9] = "mcl_flowers:tulip_orange" plant_tab[9] = "mcl_flowers:tulip_orange"
plant_tab[10] = "mcl_flowers:tulip_red" plant_tab[10] = "mcl_flowers:tulip_red"
plant_tab[11] = "mcl_flowers:tulip_white" plant_tab[11] = "mcl_flowers:tulip_white"
plant_tab[12] = "mcl_flowers:tulip_pink" plant_tab[12] = "mcl_flowers:tulip_pink"
plant_tab[13] = "mcl_flowers:allium" plant_tab[13] = "mcl_flowers:allium"
plant_tab[14] = "mcl_flowers:paeonia" plant_tab[14] = "mcl_flowers:poppy"
plant_tab[15] = "mcl_flowers:houstonia" plant_tab[15] = "mcl_flowers:azure_bluet"
plant_tab[16] = "mcl_flowers:blue_orchid"
end end
end) end)
function default.duengen(pointed_thing) function mcl_core.duengen(pointed_thing)
pos = pointed_thing.under pos = pointed_thing.under
n = minetest.get_node(pos) n = minetest.get_node(pos)
if n.name == "" then return false end if n.name == "" then return false end
local stage = "" local stage = ""
if n.name == "default:sapling" then if n.name == "mcl_core:sapling" then
minetest.add_node(pos, {name="air"}) minetest.add_node(pos, {name="air"})
generate_tree(pos, "default:tree", "default:leaves", 1) generate_tree(pos, "mcl_core:tree", "mcl_core:leaves", 1)
return true return true
elseif string.find(n.name, "mcl_farming:wheat_") ~= nil then elseif string.find(n.name, "mcl_farming:wheat_") ~= nil then
stage = string.sub(n.name, 15) stage = string.sub(n.name, 15)
@ -505,17 +504,17 @@ function default.duengen(pointed_thing)
minetest.add_node(pos, {name="mcl_farming:melontige_unconnect"}) minetest.add_node(pos, {name="mcl_farming:melontige_unconnect"})
end end
return true return true
elseif n.name ~= "" and n.name == "default:junglesapling" then elseif n.name ~= "" and n.name == "mcl_core:junglesapling" then
minetest.add_node(pos, {name="air"}) minetest.add_node(pos, {name="air"})
generate_tree(pos, "default:jungletree", "default:jungleleaves", 2) generate_tree(pos, "mcl_core:jungletree", "mcl_core:jungleleaves", 2)
return true return true
elseif n.name ~="" and n.name == "default:reeds" then elseif n.name ~="" and n.name == "mcl_core:reeds" then
grow_reeds(pos) grow_reeds(pos)
return true return true
elseif n.name ~="" and n.name == "default:cactus" then elseif n.name ~="" and n.name == "mcl_core:cactus" then
grow_cactus(pos) grow_cactus(pos)
return true return true
elseif n.name == "default:dirt_with_grass" then elseif n.name == "mcl_core:dirt_with_grass" then
for i = -2, 3, 1 do for i = -2, 3, 1 do
for j = -3, 2, 1 do for j = -3, 2, 1 do
pos = pointed_thing.above pos = pointed_thing.above
@ -523,7 +522,7 @@ function default.duengen(pointed_thing)
n = minetest.get_node(pos) n = minetest.get_node(pos)
n2 = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}) n2 = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z})
if n.name ~= "" and n.name == "air" and n2.name == "default:dirt_with_grass" then if n.name ~= "" and n.name == "air" and n2.name == "mcl_core:dirt_with_grass" then
if math.random(0,5) > 3 then if math.random(0,5) > 3 then
minetest.add_node(pos, {name=plant_tab[math.random(0, rnd_max)]}) minetest.add_node(pos, {name=plant_tab[math.random(0, rnd_max)]})
else else
@ -545,7 +544,7 @@ end
------------------------------ ------------------------------
-- turn dirt to dirt with grass -- turn dirt to dirt with grass
minetest.register_abm({ minetest.register_abm({
nodenames = {"default:dirt"}, nodenames = {"mcl_core:dirt"},
neighbors = {"air"}, neighbors = {"air"},
interval = 30, interval = 30,
chance = 20, chance = 20,
@ -565,7 +564,7 @@ minetest.register_abm({
if can_change > 3 then if can_change > 3 then
local light = minetest.get_node_light(pos) local light = minetest.get_node_light(pos)
if light or light > 10 then if light or light > 10 then
minetest.add_node(pos, {name="default:dirt_with_grass"}) minetest.add_node(pos, {name="mcl_core:dirt_with_grass"})
end end
end end
@ -581,7 +580,7 @@ minetest.register_abm({
-- Normal tree -- Normal tree
minetest.register_abm({ minetest.register_abm({
nodenames = {"default:sapling"}, nodenames = {"mcl_core:sapling"},
neighbors = {"group:soil_sapling"}, neighbors = {"group:soil_sapling"},
interval = 30, interval = 30,
chance = 15, chance = 15,
@ -591,14 +590,14 @@ minetest.register_abm({
local soiltype = minetest.get_item_group(soilnode.name, "soil_sapling") local soiltype = minetest.get_item_group(soilnode.name, "soil_sapling")
if soiltype >= 1 and light and light >= 9 then if soiltype >= 1 and light and light >= 9 then
minetest.add_node(pos, {name="air"}) minetest.add_node(pos, {name="air"})
generate_tree(pos, "default:tree", "default:leaves", 1) generate_tree(pos, "mcl_core:tree", "mcl_core:leaves", 1)
end end
end, end,
}) })
-- Jungle Tree -- Jungle Tree
minetest.register_abm({ minetest.register_abm({
nodenames = {"default:junglesapling"}, nodenames = {"mcl_core:junglesapling"},
neighbors = {"group:soil_sapling"}, neighbors = {"group:soil_sapling"},
interval = 30, interval = 30,
chance = 15, chance = 15,
@ -608,7 +607,7 @@ minetest.register_abm({
local soiltype = minetest.get_item_group(soilnode.name, "soil_sapling") local soiltype = minetest.get_item_group(soilnode.name, "soil_sapling")
if soiltype == 2 and light and light >= 9 then if soiltype == 2 and light and light >= 9 then
minetest.add_node(pos, {name="air"}) minetest.add_node(pos, {name="air"})
generate_tree(pos, "default:jungletree", "default:jungleleaves", 2) generate_tree(pos, "mcl_core:jungletree", "mcl_core:jungleleaves", 2)
end end
end, end,
}) })
@ -617,7 +616,7 @@ minetest.register_abm({
-- Vine generating -- -- Vine generating --
--------------------- ---------------------
minetest.register_abm({ minetest.register_abm({
nodenames = {"default:vine"}, nodenames = {"mcl_core:vine"},
interval = 80, interval = 80,
chance = 5, chance = 5,
action = function(pos, node, active_object_count, active_object_count_wider) action = function(pos, node, active_object_count, active_object_count_wider)
@ -625,7 +624,7 @@ minetest.register_abm({
local n = minetest.get_node(newpos) local n = minetest.get_node(newpos)
if n.name == "air" then if n.name == "air" then
local walldir = node.param2 local walldir = node.param2
minetest.add_node(newpos, {name = "default:vine", param2 = walldir}) minetest.add_node(newpos, {name = "mcl_core:vine", param2 = walldir})
end end
end end
}) })
@ -635,7 +634,7 @@ minetest.register_abm({
-- Sounds -- Sounds
-- --
function default.node_sound_defaults(table) function mcl_core.node_sound_defaults(table)
table = table or {} table = table or {}
table.footstep = table.footstep or table.footstep = table.footstep or
{name="", gain=1.0} {name="", gain=1.0}
@ -646,20 +645,20 @@ function default.node_sound_defaults(table)
return table return table
end end
function default.node_sound_stone_defaults(table) function mcl_core.node_sound_stone_defaults(table)
table = table or {} table = table or {}
table.footstep = table.footstep or table.footstep = table.footstep or
{name="default_hard_footstep", gain=0.5} {name="default_hard_footstep", gain=0.5}
table.dug = table.dug or table.dug = table.dug or
{name="default_hard_footstep", gain=1.0} {name="default_hard_footstep", gain=1.0}
default.node_sound_defaults(table) mcl_core.node_sound_defaults(table)
return table return table
end end
-- TODO: Maybe add custom metal sounds -- TODO: Maybe add custom metal sounds
default.node_sound_metal_defaults = default.node_sound_stone_defaults mcl_core.node_sound_metal_defaults = mcl_core.node_sound_stone_defaults
function default.node_sound_dirt_defaults(table) function mcl_core.node_sound_dirt_defaults(table)
table = table or {} table = table or {}
table.footstep = table.footstep or table.footstep = table.footstep or
{name="default_dirt_footstep", gain=1.0} {name="default_dirt_footstep", gain=1.0}
@ -667,11 +666,11 @@ function default.node_sound_dirt_defaults(table)
{name="default_dirt_footstep", gain=1.5} {name="default_dirt_footstep", gain=1.5}
table.place = table.place or table.place = table.place or
{name="default_place_node", gain=1.0} {name="default_place_node", gain=1.0}
default.node_sound_defaults(table) mcl_core.node_sound_defaults(table)
return table return table
end end
function default.node_sound_sand_defaults(table) function mcl_core.node_sound_sand_defaults(table)
table = table or {} table = table or {}
table.footstep = table.footstep or table.footstep = table.footstep or
{name="default_sand_footstep", gain=0.5} {name="default_sand_footstep", gain=0.5}
@ -679,21 +678,21 @@ function default.node_sound_sand_defaults(table)
{name="default_sand_footstep", gain=1.0} {name="default_sand_footstep", gain=1.0}
table.place = table.place or table.place = table.place or
{name="default_place_node", gain=1.0} {name="default_place_node", gain=1.0}
default.node_sound_defaults(table) mcl_core.node_sound_defaults(table)
return table return table
end end
function default.node_sound_wood_defaults(table) function mcl_core.node_sound_wood_defaults(table)
table = table or {} table = table or {}
table.footstep = table.footstep or table.footstep = table.footstep or
{name="default_wood_footstep", gain=0.5} {name="default_wood_footstep", gain=0.5}
table.dug = table.dug or table.dug = table.dug or
{name="default_wood_footstep", gain=1.0} {name="default_wood_footstep", gain=1.0}
default.node_sound_defaults(table) mcl_core.node_sound_defaults(table)
return table return table
end end
function default.node_sound_leaves_defaults(table) function mcl_core.node_sound_leaves_defaults(table)
table = table or {} table = table or {}
table.footstep = table.footstep or table.footstep = table.footstep or
{name="default_grass_footstep", gain=0.35} {name="default_grass_footstep", gain=0.35}
@ -703,17 +702,17 @@ function default.node_sound_leaves_defaults(table)
{name="default_dig_crumbly", gain=0.4} {name="default_dig_crumbly", gain=0.4}
table.place = table.place or table.place = table.place or
{name="default_place_node", gain=1.0} {name="default_place_node", gain=1.0}
default.node_sound_defaults(table) mcl_core.node_sound_defaults(table)
return table return table
end end
function default.node_sound_glass_defaults(table) function mcl_core.node_sound_glass_defaults(table)
table = table or {} table = table or {}
table.footstep = table.footstep or table.footstep = table.footstep or
{name="default_glass_footstep", gain=0.5} {name="default_glass_footstep", gain=0.5}
table.dug = table.dug or table.dug = table.dug or
{name="default_break_glass", gain=1.0} {name="default_break_glass", gain=1.0}
default.node_sound_defaults(table) mcl_core.node_sound_defaults(table)
return table return table
end end
@ -730,14 +729,14 @@ end
-- If the node is in the leafdecay_drop group then the it will always be dropped -- If the node is in the leafdecay_drop group then the it will always be dropped
-- as an item -- as an item
default.leafdecay_trunk_cache = {} mcl_core.leafdecay_trunk_cache = {}
default.leafdecay_enable_cache = true mcl_core.leafdecay_enable_cache = true
-- Spread the load of finding trunks -- Spread the load of finding trunks
default.leafdecay_trunk_find_allow_accumulator = 0 mcl_core.leafdecay_trunk_find_allow_accumulator = 0
minetest.register_globalstep(function(dtime) minetest.register_globalstep(function(dtime)
local finds_per_second = 5000 local finds_per_second = 5000
default.leafdecay_trunk_find_allow_accumulator = mcl_core.leafdecay_trunk_find_allow_accumulator =
math.floor(dtime * finds_per_second) math.floor(dtime * finds_per_second)
end) end)
@ -762,9 +761,9 @@ minetest.register_abm({
return return
end end
local p0_hash = nil local p0_hash = nil
if default.leafdecay_enable_cache then if mcl_core.leafdecay_enable_cache then
p0_hash = minetest.hash_node_position(p0) p0_hash = minetest.hash_node_position(p0)
local trunkp = default.leafdecay_trunk_cache[p0_hash] local trunkp = mcl_core.leafdecay_trunk_cache[p0_hash]
if trunkp then if trunkp then
local n = minetest.get_node(trunkp) local n = minetest.get_node(trunkp)
local reg = minetest.registered_nodes[n.name] local reg = minetest.registered_nodes[n.name]
@ -775,22 +774,22 @@ minetest.register_abm({
end end
--print("cached trunk is invalid") --print("cached trunk is invalid")
-- Cache is invalid -- Cache is invalid
table.remove(default.leafdecay_trunk_cache, p0_hash) table.remove(mcl_core.leafdecay_trunk_cache, p0_hash)
end end
end end
if default.leafdecay_trunk_find_allow_accumulator <= 0 then if mcl_core.leafdecay_trunk_find_allow_accumulator <= 0 then
return return
end end
default.leafdecay_trunk_find_allow_accumulator = mcl_core.leafdecay_trunk_find_allow_accumulator =
default.leafdecay_trunk_find_allow_accumulator - 1 mcl_core.leafdecay_trunk_find_allow_accumulator - 1
-- Assume ignore is a trunk, to make the thing work at the border of the active area -- Assume ignore is a trunk, to make the thing work at the border of the active area
local p1 = minetest.find_node_near(p0, d, {"ignore", "group:tree"}) local p1 = minetest.find_node_near(p0, d, {"ignore", "group:tree"})
if p1 then if p1 then
do_preserve = true do_preserve = true
if default.leafdecay_enable_cache then if mcl_core.leafdecay_enable_cache then
--print("caching trunk") --print("caching trunk")
-- Cache the trunk -- Cache the trunk
default.leafdecay_trunk_cache[p0_hash] = p1 mcl_core.leafdecay_trunk_cache[p0_hash] = p1
end end
end end
if not do_preserve then if not do_preserve then
@ -817,9 +816,9 @@ minetest.register_abm({
------------------------ ------------------------
-- Create Color Glass -- -- Create Color Glass --
------------------------ ------------------------
function default.add_glass(desc, recipeitem, color) function mcl_core.add_glass(desc, recipeitem, color)
minetest.register_node("default:glass_"..color, { minetest.register_node("mcl_core:glass_"..color, {
description = desc, description = desc,
drawtype = "glasslike", drawtype = "glasslike",
is_ground_content = false, is_ground_content = false,
@ -829,16 +828,16 @@ function default.add_glass(desc, recipeitem, color)
use_texture_alpha = true, use_texture_alpha = true,
stack_max = 64, stack_max = 64,
groups = {cracky=3,oddly_breakable_by_hand=3, building_block=1}, groups = {cracky=3,oddly_breakable_by_hand=3, building_block=1},
sounds = default.node_sound_glass_defaults(), sounds = mcl_core.node_sound_glass_defaults(),
drop = "", drop = "",
}) })
minetest.register_craft({ minetest.register_craft({
output = 'default:glass_'..color..' 8', output = 'mcl_core:glass_'..color..' 8',
recipe = { recipe = {
{'default:glass','default:glass','default:glass'}, {'mcl_core:glass','mcl_core:glass','mcl_core:glass'},
{'default:glass','group:dye,'..recipeitem,'default:glass'}, {'mcl_core:glass','group:dye,'..recipeitem,'mcl_core:glass'},
{'default:glass','default:glass','default:glass'}, {'mcl_core:glass','mcl_core:glass','mcl_core:glass'},
} }
}) })
end end

29
mods/mcl_core/init.lua Normal file
View File

@ -0,0 +1,29 @@
-- Minetest 0.4 mod: default
-- See README.txt for licensing and other information.
-- The API documentation in here was moved into doc/lua_api.txt
-- Definitions made by this mod that other mods can use too
mcl_core = {}
mcl_core.gui_slots = "listcolors[#9990;#FFF7;#FFF0;#000;#FFF]"
mcl_core.gui_bg = "bgcolor[#080808BB;true]"
mcl_core.gui_bg_img = ""
mcl_core.inventory_header = mcl_core.gui_slots .. mcl_core.gui_bg
minetest.nodedef_default.stack_max = 64
minetest.craftitemdef_default.stack_max = 64
-- Load files
dofile(minetest.get_modpath("mcl_core").."/functions.lua")
dofile(minetest.get_modpath("mcl_core").."/nodes.lua")
dofile(minetest.get_modpath("mcl_core").."/tools.lua")
dofile(minetest.get_modpath("mcl_core").."/craftitems.lua")
dofile(minetest.get_modpath("mcl_core").."/crafting.lua")
dofile(minetest.get_modpath("mcl_core").."/mapgen.lua")
dofile(minetest.get_modpath("mcl_core").."/player.lua")
-- Aliases
minetest.register_alias("default:desert_sand", "mcl_core:sand")
minetest.register_alias("default:desert_stone", "mcl_core:sandstone")
minetest.register_alias("default:iron_lump", "mcl_core:iron_lump")
minetest.register_alias("default:gold_lump", "mcl_core:gold_lump")

View File

@ -5,38 +5,38 @@
-- --
minetest.register_alias("mapgen_air", "air") minetest.register_alias("mapgen_air", "air")
minetest.register_alias("mapgen_stone", "default:stone") minetest.register_alias("mapgen_stone", "mcl_core:stone")
minetest.register_alias("mapgen_tree", "default:tree") minetest.register_alias("mapgen_tree", "mcl_core:tree")
minetest.register_alias("mapgen_leaves", "default:leaves") minetest.register_alias("mapgen_leaves", "mcl_core:leaves")
minetest.register_alias("mapgen_jungletree", "default:jungletree") minetest.register_alias("mapgen_jungletree", "mcl_core:jungletree")
minetest.register_alias("mapgen_jungleleaves", "default:jungleleaves") minetest.register_alias("mapgen_jungleleaves", "mcl_core:jungleleaves")
minetest.register_alias("mapgen_pine_tree", "default:darktree") minetest.register_alias("mapgen_pine_tree", "mcl_core:darktree")
minetest.register_alias("mapgen_pine_needles", "default:darkleaves") minetest.register_alias("mapgen_pine_needles", "mcl_core:darkleaves")
minetest.register_alias("mapgen_apple", "default:leaves") minetest.register_alias("mapgen_apple", "mcl_core:leaves")
minetest.register_alias("mapgen_water_source", "default:water_source") minetest.register_alias("mapgen_water_source", "mcl_core:water_source")
minetest.register_alias("mapgen_dirt", "default:dirt") minetest.register_alias("mapgen_dirt", "mcl_core:dirt")
minetest.register_alias("mapgen_dirt_with_grass", "default:dirt_with_grass") minetest.register_alias("mapgen_dirt_with_grass", "mcl_core:dirt_with_grass")
minetest.register_alias("mapgen_dirt_with_snow", "default:dirt_with_snow") minetest.register_alias("mapgen_dirt_with_snow", "mcl_core:dirt_with_snow")
minetest.register_alias("mapgen_sand", "default:sand") minetest.register_alias("mapgen_sand", "mcl_core:sand")
minetest.register_alias("mapgen_gravel", "default:gravel") minetest.register_alias("mapgen_gravel", "mcl_core:gravel")
minetest.register_alias("mapgen_clay", "default:clay") minetest.register_alias("mapgen_clay", "mcl_core:clay")
minetest.register_alias("mapgen_lava_source", "default:lava_source") minetest.register_alias("mapgen_lava_source", "mcl_core:lava_source")
minetest.register_alias("mapgen_cobble", "default:cobble") minetest.register_alias("mapgen_cobble", "mcl_core:cobble")
minetest.register_alias("mapgen_mossycobble", "default:mossycobble") minetest.register_alias("mapgen_mossycobble", "mcl_core:mossycobble")
minetest.register_alias("mapgen_junglegrass", "default:junglegrass") minetest.register_alias("mapgen_junglegrass", "mcl_core:junglegrass")
minetest.register_alias("mapgen_stone_with_coal", "default:stone_with_coal") minetest.register_alias("mapgen_stone_with_coal", "mcl_core:stone_with_coal")
minetest.register_alias("mapgen_stone_with_iron", "default:stone_with_iron") minetest.register_alias("mapgen_stone_with_iron", "mcl_core:stone_with_iron")
minetest.register_alias("mapgen_desert_sand", "default:sand") minetest.register_alias("mapgen_desert_sand", "mcl_core:sand")
minetest.register_alias("mapgen_desert_stone", "default:sandstone") minetest.register_alias("mapgen_desert_stone", "mcl_core:sandstone")
minetest.register_alias("mapgen_sandstone", "default:sandstone") minetest.register_alias("mapgen_sandstone", "mcl_core:sandstone")
minetest.register_alias("mapgen_river_water_source", "default:water_source") minetest.register_alias("mapgen_river_water_source", "mcl_core:water_source")
minetest.register_alias("mapgen_snow", "default:snow") minetest.register_alias("mapgen_snow", "mcl_core:snow")
minetest.register_alias("mapgen_snowblock", "default:snowblock") minetest.register_alias("mapgen_snowblock", "mcl_core:snowblock")
minetest.register_alias("mapgen_ice", "default:ice") minetest.register_alias("mapgen_ice", "mcl_core:ice")
minetest.register_alias("mapgen_stair_cobble", "stairs:stair_cobble") minetest.register_alias("mapgen_stair_cobble", "stairs:stair_cobble")
minetest.register_alias("mapgen_sandstonebrick", "default:sandstonesmooth") minetest.register_alias("mapgen_sandstonebrick", "mcl_core:sandstonesmooth")
minetest.register_alias("mapgen_stair_sandstonebrick", "stairs:stair_sandstone") minetest.register_alias("mapgen_stair_sandstonebrick", "stairs:stair_sandstone")
-- --
@ -46,8 +46,8 @@ minetest.register_alias("mapgen_stair_sandstonebrick", "stairs:stair_sandstone")
-- Gravel -- Gravel
minetest.register_ore({ minetest.register_ore({
ore_type = "blob", ore_type = "blob",
ore = "default:gravel", ore = "mcl_core:gravel",
wherein = {"default:stone"}, wherein = {"mcl_core:stone"},
clust_scarcity = 14*14*14, clust_scarcity = 14*14*14,
clust_num_ores = 33, clust_num_ores = 33,
clust_size = 5, clust_size = 5,
@ -60,8 +60,8 @@ minetest.register_ore({
-- --
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
ore = "default:stone_with_coal", ore = "mcl_core:stone_with_coal",
wherein = "default:stone", wherein = "mcl_core:stone",
clust_scarcity = 500, clust_scarcity = 500,
clust_num_ores = 5, clust_num_ores = 5,
clust_size = 3, clust_size = 3,
@ -70,8 +70,8 @@ minetest.register_ore({
}) })
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
ore = "default:stone_with_coal", ore = "mcl_core:stone_with_coal",
wherein = "default:stone", wherein = "mcl_core:stone",
clust_scarcity = 500, clust_scarcity = 500,
clust_num_ores = 8, clust_num_ores = 8,
clust_size = 3, clust_size = 3,
@ -80,8 +80,8 @@ minetest.register_ore({
}) })
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
ore = "default:stone_with_coal", ore = "mcl_core:stone_with_coal",
wherein = "default:stone", wherein = "mcl_core:stone",
clust_scarcity = 1000, clust_scarcity = 1000,
clust_num_ores = 6, clust_num_ores = 6,
clust_size = 3, clust_size = 3,
@ -90,8 +90,8 @@ minetest.register_ore({
}) })
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
ore = "default:stone_with_coal", ore = "mcl_core:stone_with_coal",
wherein = "default:stone", wherein = "mcl_core:stone",
clust_scarcity = 5000, clust_scarcity = 5000,
clust_num_ores = 4, clust_num_ores = 4,
clust_size = 2, clust_size = 2,
@ -104,8 +104,8 @@ minetest.register_ore({
-- --
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
ore = "default:stone_with_iron", ore = "mcl_core:stone_with_iron",
wherein = "default:stone", wherein = "mcl_core:stone",
clust_scarcity = 830, clust_scarcity = 830,
clust_num_ores = 5, clust_num_ores = 5,
clust_size = 3, clust_size = 3,
@ -114,8 +114,8 @@ minetest.register_ore({
}) })
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
ore = "default:stone_with_iron", ore = "mcl_core:stone_with_iron",
wherein = "default:stone", wherein = "mcl_core:stone",
clust_scarcity = 1660, clust_scarcity = 1660,
clust_num_ores = 3, clust_num_ores = 3,
clust_size = 2, clust_size = 2,
@ -128,8 +128,8 @@ minetest.register_ore({
-- --
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
ore = "default:stone_with_gold", ore = "mcl_core:stone_with_gold",
wherein = "default:stone", wherein = "mcl_core:stone",
clust_scarcity = 5000, clust_scarcity = 5000,
clust_num_ores = 5, clust_num_ores = 5,
clust_size = 3, clust_size = 3,
@ -138,8 +138,8 @@ minetest.register_ore({
}) })
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
ore = "default:stone_with_gold", ore = "mcl_core:stone_with_gold",
wherein = "default:stone", wherein = "mcl_core:stone",
clust_scarcity = 10000, clust_scarcity = 10000,
clust_num_ores = 3, clust_num_ores = 3,
clust_size = 2, clust_size = 2,
@ -152,8 +152,8 @@ minetest.register_ore({
-- --
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
ore = "default:stone_with_diamond", ore = "mcl_core:stone_with_diamond",
wherein = "default:stone", wherein = "mcl_core:stone",
clust_scarcity = 10000, clust_scarcity = 10000,
clust_num_ores = 4, clust_num_ores = 4,
clust_size = 3, clust_size = 3,
@ -162,8 +162,8 @@ minetest.register_ore({
}) })
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
ore = "default:stone_with_diamond", ore = "mcl_core:stone_with_diamond",
wherein = "default:stone", wherein = "mcl_core:stone",
clust_scarcity = 5000, clust_scarcity = 5000,
clust_num_ores = 2, clust_num_ores = 2,
clust_size = 2, clust_size = 2,
@ -172,8 +172,8 @@ minetest.register_ore({
}) })
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
ore = "default:stone_with_diamond", ore = "mcl_core:stone_with_diamond",
wherein = "default:stone", wherein = "mcl_core:stone",
clust_scarcity = 10000, clust_scarcity = 10000,
clust_num_ores = 8, clust_num_ores = 8,
clust_size = 3, clust_size = 3,
@ -187,8 +187,8 @@ minetest.register_ore({
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
ore = "default:stone_with_redstone", ore = "mcl_core:stone_with_redstone",
wherein = "default:stone", wherein = "mcl_core:stone",
clust_scarcity = 10000, clust_scarcity = 10000,
clust_num_ores = 5, clust_num_ores = 5,
clust_size = 3, clust_size = 3,
@ -198,8 +198,8 @@ minetest.register_ore({
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
ore = "default:stone_with_redstone", ore = "mcl_core:stone_with_redstone",
wherein = "default:stone", wherein = "mcl_core:stone",
clust_scarcity = 10000, clust_scarcity = 10000,
clust_num_ores = 10, clust_num_ores = 10,
clust_size = 4, clust_size = 4,
@ -213,8 +213,8 @@ minetest.register_ore({
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
ore = "default:stone_with_emerald", ore = "mcl_core:stone_with_emerald",
wherein = "default:stone", wherein = "mcl_core:stone",
clust_scarcity = 10000, clust_scarcity = 10000,
clust_num_ores = 1, clust_num_ores = 1,
clust_size = 2, clust_size = 2,
@ -224,8 +224,8 @@ minetest.register_ore({
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
ore = "default:stone_with_emerald", ore = "mcl_core:stone_with_emerald",
wherein = "default:stone", wherein = "mcl_core:stone",
clust_scarcity = 50000, clust_scarcity = 50000,
clust_num_ores = 3, clust_num_ores = 3,
clust_size = 2, clust_size = 2,
@ -239,8 +239,8 @@ minetest.register_ore({
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
ore = "default:stone_with_lapis", ore = "mcl_core:stone_with_lapis",
wherein = "default:stone", wherein = "mcl_core:stone",
clust_scarcity = 10000, clust_scarcity = 10000,
clust_num_ores = 7, clust_num_ores = 7,
clust_size = 4, clust_size = 4,
@ -250,8 +250,8 @@ minetest.register_ore({
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
ore = "default:stone_with_lapis", ore = "mcl_core:stone_with_lapis",
wherein = "default:stone", wherein = "mcl_core:stone",
clust_scarcity = 10000, clust_scarcity = 10000,
clust_num_ores = 5, clust_num_ores = 5,
clust_size = 4, clust_size = 4,
@ -266,8 +266,8 @@ minetest.register_ore({
-- --
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
ore = "default:glowstone", ore = "mcl_core:glowstone",
wherein = "default:stone", wherein = "mcl_core:stone",
clust_scarcity = 50000, clust_scarcity = 50000,
clust_num_ores = 10, clust_num_ores = 10,
clust_size = 5, clust_size = 5,
@ -275,8 +275,8 @@ minetest.register_ore({
y_max = -0, y_max = -0,
}) })
function default.generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, chunk_size, ore_per_chunk, y_min, y_max) function mcl_core.generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, chunk_size, ore_per_chunk, y_min, y_max)
minetest.log('action', "WARNING: default.generate_ore is deprecated") minetest.log('action', "WARNING: mcl_core.generate_ore is deprecated")
if maxp.y < y_min or minp.y > y_max then if maxp.y < y_min or minp.y > y_max then
return return
@ -317,26 +317,26 @@ function default.generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume
--print("generate_ore done") --print("generate_ore done")
end end
function default.make_reeds(pos, size) function mcl_core.make_reeds(pos, size)
for y=0,size-1 do for y=0,size-1 do
local p = {x=pos.x, y=pos.y+y, z=pos.z} local p = {x=pos.x, y=pos.y+y, z=pos.z}
local nn = minetest.get_node(p).name local nn = minetest.get_node(p).name
if minetest.registered_nodes[nn] and if minetest.registered_nodes[nn] and
minetest.registered_nodes[nn].buildable_to then minetest.registered_nodes[nn].buildable_to then
minetest.set_node(p, {name="default:reeds"}) minetest.set_node(p, {name="mcl_core:reeds"})
else else
return return
end end
end end
end end
function default.make_cactus(pos, size) function mcl_core.make_cactus(pos, size)
for y=0,size-1 do for y=0,size-1 do
local p = {x=pos.x, y=pos.y+y, z=pos.z} local p = {x=pos.x, y=pos.y+y, z=pos.z}
local nn = minetest.get_node(p).name local nn = minetest.get_node(p).name
if minetest.registered_nodes[nn] and if minetest.registered_nodes[nn] and
minetest.registered_nodes[nn].buildable_to then minetest.registered_nodes[nn].buildable_to then
minetest.set_node(p, {name="default:cactus"}) minetest.set_node(p, {name="mcl_core:cactus"})
else else
return return
end end
@ -354,17 +354,17 @@ minetest.register_on_generated(function(minp, maxp, seed)
for divz=0+1,divs-1-1 do for divz=0+1,divs-1-1 do
local cx = minp.x + math.floor((divx+0.5)*divlen) local cx = minp.x + math.floor((divx+0.5)*divlen)
local cz = minp.z + math.floor((divz+0.5)*divlen) local cz = minp.z + math.floor((divz+0.5)*divlen)
if minetest.get_node({x=cx,y=1,z=cz}).name == "default:water_source" and if minetest.get_node({x=cx,y=1,z=cz}).name == "mcl_core:water_source" and
minetest.get_node({x=cx,y=0,z=cz}).name == "default:sand" then minetest.get_node({x=cx,y=0,z=cz}).name == "mcl_core:sand" then
local is_shallow = true local is_shallow = true
local num_water_around = 0 local num_water_around = 0
if minetest.get_node({x=cx-divlen*2,y=1,z=cz+0}).name == "default:water_source" then if minetest.get_node({x=cx-divlen*2,y=1,z=cz+0}).name == "mcl_core:water_source" then
num_water_around = num_water_around + 1 end num_water_around = num_water_around + 1 end
if minetest.get_node({x=cx+divlen*2,y=1,z=cz+0}).name == "default:water_source" then if minetest.get_node({x=cx+divlen*2,y=1,z=cz+0}).name == "mcl_core:water_source" then
num_water_around = num_water_around + 1 end num_water_around = num_water_around + 1 end
if minetest.get_node({x=cx+0,y=1,z=cz-divlen*2}).name == "default:water_source" then if minetest.get_node({x=cx+0,y=1,z=cz-divlen*2}).name == "mcl_core:water_source" then
num_water_around = num_water_around + 1 end num_water_around = num_water_around + 1 end
if minetest.get_node({x=cx+0,y=1,z=cz+divlen*2}).name == "default:water_source" then if minetest.get_node({x=cx+0,y=1,z=cz+divlen*2}).name == "mcl_core:water_source" then
num_water_around = num_water_around + 1 end num_water_around = num_water_around + 1 end
if num_water_around >= 2 then if num_water_around >= 2 then
is_shallow = false is_shallow = false
@ -372,8 +372,8 @@ minetest.register_on_generated(function(minp, maxp, seed)
if is_shallow then if is_shallow then
for x1=-divlen,divlen do for x1=-divlen,divlen do
for z1=-divlen,divlen do for z1=-divlen,divlen do
if minetest.get_node({x=cx+x1,y=0,z=cz+z1}).name == "default:sand" or minetest.get_node({x=cx+x1,y=0,z=cz+z1}).name == "default:sandstone" then if minetest.get_node({x=cx+x1,y=0,z=cz+z1}).name == "mcl_core:sand" or minetest.get_node({x=cx+x1,y=0,z=cz+z1}).name == "mcl_core:sandstone" then
minetest.set_node({x=cx+x1,y=0,z=cz+z1}, {name="default:clay"}) minetest.set_node({x=cx+x1,y=0,z=cz+z1}, {name="mcl_core:clay"})
end end
end end
end end
@ -399,12 +399,12 @@ minetest.register_on_generated(function(minp, maxp, seed)
for i=0,reeds_amount do for i=0,reeds_amount do
local x = pr:next(x0, x1) local x = pr:next(x0, x1)
local z = pr:next(z0, z1) local z = pr:next(z0, z1)
if minetest.get_node({x=x,y=1,z=z}).name == "default:dirt_with_grass" and if minetest.get_node({x=x,y=1,z=z}).name == "mcl_core:dirt_with_grass" and
minetest.find_node_near({x=x,y=1,z=z}, 1, "default:water_source") then minetest.find_node_near({x=x,y=1,z=z}, 1, "mcl_core:water_source") then
default.make_reeds({x=x,y=2,z=z}, pr:next(2, 4)) mcl_core.make_reeds({x=x,y=2,z=z}, pr:next(2, 4))
end end
local p = {x=x,y=1,z=z} local p = {x=x,y=1,z=z}
if minetest.get_node(p).name == "default:sand" then if minetest.get_node(p).name == "mcl_core:sand" then
if math.random(0,1000) == 1 then -- 0,12000 if math.random(0,1000) == 1 then -- 0,12000
-- TODO: Re-enable random_struct -- TODO: Re-enable random_struct
--random_struct.call_struct(p,2) --random_struct.call_struct(p,2)
@ -441,8 +441,8 @@ minetest.register_on_generated(function(minp, maxp, seed)
end end
end end
-- If sand, make cactus -- If sand, make cactus
if ground_y and minetest.get_node({x=x,y=ground_y,z=z}).name == "default:sand" then if ground_y and minetest.get_node({x=x,y=ground_y,z=z}).name == "mcl_core:sand" then
default.make_cactus({x=x,y=ground_y+1,z=z}, pr:next(3, 4)) mcl_core.make_cactus({x=x,y=ground_y+1,z=z}, pr:next(3, 4))
end end
end end
end end
@ -482,12 +482,12 @@ minetest.register_on_generated(function(minp, maxp, seed)
minetest.registered_nodes[nn].buildable_to then minetest.registered_nodes[nn].buildable_to then
nn = minetest.get_node({x=x,y=ground_y,z=z}).name nn = minetest.get_node({x=x,y=ground_y,z=z}).name
-- If sand, add dry shrub -- If sand, add dry shrub
if nn == "default:sand" then if nn == "mcl_core:sand" then
minetest.set_node(p,{name="default:dry_shrub"}) minetest.set_node(p,{name="mcl_core:dry_shrub"})
-- If dirt with grass, add grass -- If dirt with grass, add grass
elseif nn == "default:dirt_with_grass" then elseif nn == "mcl_core:dirt_with_grass" then
minetest.set_node(p,{name="default:grass"}) minetest.set_node(p,{name="mcl_core:grass"})
if math.random(0,12000) == 1 then if math.random(0,12000) == 1 then
-- TODO: Re-enable random_struct -- TODO: Re-enable random_struct
--random_struct.call_struct(p,1) --random_struct.call_struct(p,1)
@ -517,24 +517,24 @@ local function replace(old, new, min, max)
y_max = max, y_max = max,
}) })
end end
replace("air", "default:bedrock", -90, -80) replace("air", "mcl_core:bedrock", -90, -80)
replace("air", "default:lava_source", -80, -70) replace("air", "mcl_core:lava_source", -80, -70)
replace("default:stone", "default:bedrock", -90, -80) replace("mcl_core:stone", "mcl_core:bedrock", -90, -80)
replace("default:gravel", "default:bedrock", -90, -80) replace("mcl_core:gravel", "mcl_core:bedrock", -90, -80)
replace("default:dirt", "default:bedrock", -90, -80) replace("mcl_core:dirt", "mcl_core:bedrock", -90, -80)
replace("default:sand", "default:bedrock", -90, -80) replace("mcl_core:sand", "mcl_core:bedrock", -90, -80)
replace("default:cobble", "default:bedrock", -90, -80) replace("mcl_core:cobble", "mcl_core:bedrock", -90, -80)
replace("default:mossycobble", "default:bedrock", -90, -80) replace("mcl_core:mossycobble", "mcl_core:bedrock", -90, -80)
replace("stairs:stair_cobble", "default:bedrock", -90, -80) replace("stairs:stair_cobble", "mcl_core:bedrock", -90, -80)
replace("default:lava_source", "default:bedrock", -90, -80) replace("mcl_core:lava_source", "mcl_core:bedrock", -90, -80)
replace("default:lava_flowing", "default:bedrock", -90, -80) replace("mcl_core:lava_flowing", "mcl_core:bedrock", -90, -80)
replace("default:water_source", "default:bedrock", -90, -80) replace("mcl_core:water_source", "mcl_core:bedrock", -90, -80)
replace("default:water_flowing", "default:bedrock", -90, -80) replace("mcl_core:water_flowing", "mcl_core:bedrock", -90, -80)
local function bedrock(old) local function bedrock(old)
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
ore = "default:bedrock", ore = "mcl_core:bedrock",
wherein = old, wherein = old,
clust_scarcity = 5, clust_scarcity = 5,
clust_num_ores = 3, clust_num_ores = 3,
@ -544,15 +544,15 @@ local function bedrock(old)
}) })
end end
bedrock("air") bedrock("air")
bedrock("default:stone") bedrock("mcl_core:stone")
bedrock("default:gravel") bedrock("mcl_core:gravel")
bedrock("default:dirt") bedrock("mcl_core:dirt")
bedrock("default:sand") bedrock("mcl_core:sand")
bedrock("default:cobble") bedrock("mcl_core:cobble")
bedrock("default:mossycobble") bedrock("mcl_core:mossycobble")
bedrock("stairs:stair_cobble") bedrock("stairs:stair_cobble")
bedrock("default:lava_source") bedrock("mcl_core:lava_source")
bedrock("default:lava_flowing") bedrock("mcl_core:lava_flowing")
bedrock("default:water_source") bedrock("mcl_core:water_source")
bedrock("default:water_flowing") bedrock("mcl_core:water_flowing")

1
mods/mcl_core/mod.conf Normal file
View File

@ -0,0 +1 @@
name = mcl_core

View File

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

File diff suppressed because it is too large Load Diff

View File

@ -6,29 +6,29 @@
API API
--- ---
default.player_register_model(name, def) mcl_core.player_register_model(name, def)
^ Register a new model to be used by players. ^ Register a new model to be used by players.
^ <name> is the model filename such as "character.x", "foo.b3d", etc. ^ <name> is the model filename such as "character.x", "foo.b3d", etc.
^ See Model Definition below for format of <def>. ^ See Model Definition below for format of <def>.
default.registered_player_models[name] mcl_core.registered_player_models[name]
^ See Model Definition below for format. ^ See Model Definition below for format.
default.player_set_model(player, model_name) mcl_core.player_set_model(player, model_name)
^ <player> is a PlayerRef. ^ <player> is a PlayerRef.
^ <model_name> is a model registered with player_register_model. ^ <model_name> is a model registered with player_register_model.
default.player_set_animation(player, anim_name [, speed]) mcl_core.player_set_animation(player, anim_name [, speed])
^ <player> is a PlayerRef. ^ <player> is a PlayerRef.
^ <anim_name> is the name of the animation. ^ <anim_name> is the name of the animation.
^ <speed> is in frames per second. If nil, default from the model is used ^ <speed> is in frames per second. If nil, default from the model is used
default.player_set_textures(player, textures) mcl_core.player_set_textures(player, textures)
^ <player> is a PlayerRef. ^ <player> is a PlayerRef.
^ <textures> is an array of textures ^ <textures> is an array of textures
^ If <textures> is nil, the default textures from the model def are used ^ If <textures> is nil, the default textures from the model def are used
default.player_get_animation(player) mcl_core.player_get_animation(player)
^ <player> is a PlayerRef. ^ <player> is a PlayerRef.
^ Returns a table containing fields "model", "textures" and "animation". ^ Returns a table containing fields "model", "textures" and "animation".
^ Any of the fields of the returned table may be nil. ^ Any of the fields of the returned table may be nil.
@ -54,17 +54,17 @@ model_def = {
-- Note: This is currently broken due to a bug in Irrlicht, leave at 0 -- Note: This is currently broken due to a bug in Irrlicht, leave at 0
local animation_blend = 0 local animation_blend = 0
default.registered_player_models = { } mcl_core.registered_player_models = { }
-- Local for speed. -- Local for speed.
local models = default.registered_player_models local models = mcl_core.registered_player_models
function default.player_register_model(name, def) function mcl_core.player_register_model(name, def)
models[name] = def models[name] = def
end end
-- Default player appearance -- Default player appearance
default.player_register_model("character.x", { mcl_core.player_register_model("character.x", {
animation_speed = 30, animation_speed = 30,
textures = {"character.png", }, textures = {"character.png", },
animations = { animations = {
@ -84,9 +84,9 @@ local player_model = {}
local player_textures = {} local player_textures = {}
local player_anim = {} local player_anim = {}
local player_sneak = {} local player_sneak = {}
default.player_attached = {} mcl_core.player_attached = {}
function default.player_get_animation(player) function mcl_core.player_get_animation(player)
local name = player:get_player_name() local name = player:get_player_name()
return { return {
model = player_model[name], model = player_model[name],
@ -96,7 +96,7 @@ function default.player_get_animation(player)
end end
-- Called when a player's appearance needs to be updated -- Called when a player's appearance needs to be updated
function default.player_set_model(player, model_name) function mcl_core.player_set_model(player, model_name)
local name = player:get_player_name() local name = player:get_player_name()
local model = models[model_name] local model = models[model_name]
if model then if model then
@ -109,7 +109,7 @@ function default.player_set_model(player, model_name)
visual = "mesh", visual = "mesh",
visual_size = model.visual_size or {x=1, y=1}, visual_size = model.visual_size or {x=1, y=1},
}) })
default.player_set_animation(player, "stand") mcl_core.player_set_animation(player, "stand")
else else
player:set_properties({ player:set_properties({
textures = { "player.png", "player_back.png", }, textures = { "player.png", "player_back.png", },
@ -119,13 +119,13 @@ function default.player_set_model(player, model_name)
player_model[name] = model_name player_model[name] = model_name
end end
function default.player_set_textures(player, textures) function mcl_core.player_set_textures(player, textures)
local name = player:get_player_name() local name = player:get_player_name()
player_textures[name] = textures player_textures[name] = textures
player:set_properties({textures = textures,}) player:set_properties({textures = textures,})
end end
function default.player_set_animation(player, anim_name, speed) function mcl_core.player_set_animation(player, anim_name, speed)
local name = player:get_player_name() local name = player:get_player_name()
if player_anim[name] == anim_name then if player_anim[name] == anim_name then
return return
@ -141,8 +141,8 @@ end
-- Update appearance when the player joins -- Update appearance when the player joins
minetest.register_on_joinplayer(function(player) minetest.register_on_joinplayer(function(player)
default.player_attached[player:get_player_name()] = false mcl_core.player_attached[player:get_player_name()] = false
default.player_set_model(player, "character.x") mcl_core.player_set_model(player, "character.x")
-- Minecraft has no sneak glitch -- Minecraft has no sneak glitch
-- sneak is also disabled because it is buggy in Minetest (can be used to negate fall damage) -- sneak is also disabled because it is buggy in Minetest (can be used to negate fall damage)
player:set_physics_override({sneak_glitch=false}) player:set_physics_override({sneak_glitch=false})
@ -159,7 +159,7 @@ minetest.register_on_leaveplayer(function(player)
end) end)
-- Localize for better performance. -- Localize for better performance.
local player_set_animation = default.player_set_animation local player_set_animation = mcl_core.player_set_animation
-- Check each player and apply animations -- Check each player and apply animations
minetest.register_globalstep(function(dtime) minetest.register_globalstep(function(dtime)
@ -167,7 +167,7 @@ minetest.register_globalstep(function(dtime)
local name = player:get_player_name() local name = player:get_player_name()
local model_name = player_model[name] local model_name = player_model[name]
local model = model_name and models[model_name] local model = model_name and models[model_name]
if model and not default.player_attached[name] then if model and not mcl_core.player_attached[name] then
local controls = player:get_player_control() local controls = player:get_player_control()
local walking = false local walking = false
local animation_speed_mod = model.animation_speed or 30 local animation_speed_mod = model.animation_speed or 30

View File

Before

Width:  |  Height:  |  Size: 175 B

After

Width:  |  Height:  |  Size: 175 B

View File

Before

Width:  |  Height:  |  Size: 780 B

After

Width:  |  Height:  |  Size: 780 B

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

Before

Width:  |  Height:  |  Size: 115 B

After

Width:  |  Height:  |  Size: 115 B

View File

Before

Width:  |  Height:  |  Size: 867 B

After

Width:  |  Height:  |  Size: 867 B

View File

Before

Width:  |  Height:  |  Size: 365 B

After

Width:  |  Height:  |  Size: 365 B

View File

Before

Width:  |  Height:  |  Size: 790 B

After

Width:  |  Height:  |  Size: 790 B

View File

Before

Width:  |  Height:  |  Size: 786 B

After

Width:  |  Height:  |  Size: 786 B

View File

Before

Width:  |  Height:  |  Size: 346 B

After

Width:  |  Height:  |  Size: 346 B

View File

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

Before

Width:  |  Height:  |  Size: 331 B

After

Width:  |  Height:  |  Size: 331 B

View File

Before

Width:  |  Height:  |  Size: 261 B

After

Width:  |  Height:  |  Size: 261 B

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 327 B

After

Width:  |  Height:  |  Size: 327 B

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