From 6bde327624cce50bb33f45ebe624e0744375ed90 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Tue, 1 Dec 2015 18:13:06 +0000 Subject: [PATCH] Remove lots of unneeded nodes, craftitem and recipes from default --- mods/default/aliases.lua | 7 +- mods/default/crafting.lua | 107 ---------------- mods/default/craftitems.lua | 91 -------------- mods/default/mapgen.lua | 58 --------- mods/default/nodes.lua | 241 ------------------------------------ 5 files changed, 2 insertions(+), 502 deletions(-) diff --git a/mods/default/aliases.lua b/mods/default/aliases.lua index 1f67336..0726feb 100644 --- a/mods/default/aliases.lua +++ b/mods/default/aliases.lua @@ -39,8 +39,8 @@ minetest.register_alias("locked_chest", "default:chest_locked") minetest.register_alias("cobble", "default:cobble") minetest.register_alias("mossycobble", "default:mossycobble") minetest.register_alias("steelblock", "default:steelblock") -minetest.register_alias("nyancat", "default:nyancat") -minetest.register_alias("nyancat_rainbow", "default:nyancat_rainbow") +minetest.register_alias("nyancat", "air") +minetest.register_alias("nyancat_rainbow", "air") minetest.register_alias("apple", "default:apple") minetest.register_alias("WPick", "default:pick_wood") @@ -66,6 +66,3 @@ minetest.register_alias("lump_of_clay", "default:clay_lump") minetest.register_alias("steel_ingot", "default:steel_ingot") minetest.register_alias("clay_brick", "default:clay_brick") minetest.register_alias("snow", "default:snow") - --- Mese now comes in the form of blocks, ore, crystal and fragments -minetest.register_alias("default:mese", "default:mese_block") diff --git a/mods/default/crafting.lua b/mods/default/crafting.lua index d7b9676..234a27b 100644 --- a/mods/default/crafting.lua +++ b/mods/default/crafting.lua @@ -36,15 +36,6 @@ minetest.register_craft({ } }) -minetest.register_craft({ - output = 'default:sign_wall', - recipe = { - {'group:wood', 'group:wood', 'group:wood'}, - {'group:wood', 'group:wood', 'group:wood'}, - {'', 'group:stick', ''}, - } -}) - minetest.register_craft({ output = 'default:torch 4', recipe = { @@ -323,15 +314,6 @@ minetest.register_craft({ } }) -minetest.register_craft({ - output = 'default:rail 24', - recipe = { - {'default:steel_ingot', '', 'default:steel_ingot'}, - {'default:steel_ingot', 'group:stick', 'default:steel_ingot'}, - {'default:steel_ingot', '', 'default:steel_ingot'}, - } -}) - minetest.register_craft({ type = "shapeless", output = "default:bronze_ingot", @@ -457,54 +439,6 @@ minetest.register_craft({ } }) -minetest.register_craft({ - output = 'default:clay', - recipe = { - {'default:clay_lump', 'default:clay_lump'}, - {'default:clay_lump', 'default:clay_lump'}, - } -}) - -minetest.register_craft({ - output = 'default:brick', - recipe = { - {'default:clay_brick', 'default:clay_brick'}, - {'default:clay_brick', 'default:clay_brick'}, - } -}) - -minetest.register_craft({ - output = 'default:clay_brick 4', - recipe = { - {'default:brick'}, - } -}) - -minetest.register_craft({ - output = 'default:paper', - recipe = { - {'default:papyrus', 'default:papyrus', 'default:papyrus'}, - } -}) - -minetest.register_craft({ - output = 'default:book', - recipe = { - {'default:paper'}, - {'default:paper'}, - {'default:paper'}, - } -}) - -minetest.register_craft({ - output = 'default:bookshelf', - recipe = { - {'group:wood', 'group:wood', 'group:wood'}, - {'default:book', 'default:book', 'default:book'}, - {'group:wood', 'group:wood', 'group:wood'}, - } -}) - minetest.register_craft({ output = 'default:ladder', recipe = { @@ -661,11 +595,6 @@ minetest.register_craft({ recipe = "default:gold_lump", }) -minetest.register_craft({ - type = "cooking", - output = "default:clay_brick", - recipe = "default:clay_lump", -}) -- -- Fuels @@ -701,12 +630,6 @@ minetest.register_craft({ burntime = 1, }) -minetest.register_craft({ - type = "fuel", - recipe = "default:bookshelf", - burntime = 30, -}) - minetest.register_craft({ type = "fuel", recipe = "default:fence_wood", @@ -737,36 +660,6 @@ minetest.register_craft({ burntime = 4, }) -minetest.register_craft({ - type = "fuel", - recipe = "default:sign_wall", - burntime = 10, -}) - -minetest.register_craft({ - type = "fuel", - recipe = "default:chest", - burntime = 30, -}) - -minetest.register_craft({ - type = "fuel", - recipe = "default:chest_locked", - burntime = 30, -}) - -minetest.register_craft({ - type = "fuel", - recipe = "default:nyancat", - burntime = 1, -}) - -minetest.register_craft({ - type = "fuel", - recipe = "default:nyancat_rainbow", - burntime = 1, -}) - minetest.register_craft({ type = "fuel", recipe = "default:apple", diff --git a/mods/default/craftitems.lua b/mods/default/craftitems.lua index facff57..c040a25 100644 --- a/mods/default/craftitems.lua +++ b/mods/default/craftitems.lua @@ -6,87 +6,6 @@ minetest.register_craftitem("default:stick", { groups = {stick=1}, }) -minetest.register_craftitem("default:paper", { - description = "Paper", - inventory_image = "default_paper.png", -}) - -local function book_on_use(itemstack, user, pointed_thing) - local player_name = user:get_player_name() - local data = minetest.deserialize(itemstack:get_metadata()) - local title, text, owner = "", "", player_name - if data then - title, text, owner = data.title, data.text, data.owner - end - local formspec - if owner == player_name then - formspec = "size[8,8]"..default.gui_bg.. - "field[0.5,1;7.5,0;title;Title:;".. - minetest.formspec_escape(title).."]".. - "textarea[0.5,1.5;7.5,7;text;Contents:;".. - minetest.formspec_escape(text).."]".. - "button_exit[2.5,7.5;3,1;save;Save]" - else - formspec = "size[8,8]"..default.gui_bg.. - "label[0.5,0.5;by "..owner.."]".. - "label[0.5,0;"..minetest.formspec_escape(title).."]".. - "textarea[0.5,1.5;7.5,7;;"..minetest.formspec_escape(text)..";]" - end - minetest.show_formspec(user:get_player_name(), "default:book", formspec) -end - -minetest.register_on_player_receive_fields(function(player, form_name, fields) - if form_name ~= "default:book" or not fields.save or - fields.title == "" or fields.text == "" then - return - end - local inv = player:get_inventory() - local stack = player:get_wielded_item() - local new_stack, data - if stack:get_name() ~= "default:book_written" then - local count = stack:get_count() - if count == 1 then - stack:set_name("default:book_written") - else - stack:set_count(count - 1) - new_stack = ItemStack("default:book_written") - end - else - data = minetest.deserialize(stack:get_metadata()) - end - if not data then data = {} end - data.title = fields.title - data.text = fields.text - data.owner = player:get_player_name() - local data_str = minetest.serialize(data) - if new_stack then - new_stack:set_metadata(data_str) - if inv:room_for_item("main", new_stack) then - inv:add_item("main", new_stack) - else - minetest.add_item(player:getpos(), new_stack) - end - else - stack:set_metadata(data_str) - end - player:set_wielded_item(stack) -end) - -minetest.register_craftitem("default:book", { - description = "Book", - inventory_image = "default_book.png", - groups = {book=1}, - on_use = book_on_use, -}) - -minetest.register_craftitem("default:book_written", { - description = "Book With Text", - inventory_image = "default_book.png", - groups = {book=1, not_in_creative_inventory=1}, - stack_max = 1, - on_use = book_on_use, -}) - minetest.register_craftitem("default:coal_lump", { description = "Coal Lump", inventory_image = "default_coal_lump.png", @@ -118,11 +37,6 @@ minetest.register_craftitem("default:diamond", { inventory_image = "default_diamond.png", }) -minetest.register_craftitem("default:clay_lump", { - description = "Clay Lump", - inventory_image = "default_clay_lump.png", -}) - minetest.register_craftitem("default:steel_ingot", { description = "Steel Ingot", inventory_image = "default_steel_ingot.png", @@ -148,11 +62,6 @@ minetest.register_craftitem("default:mese_crystal_fragment", { inventory_image = "default_mese_crystal_fragment.png", }) -minetest.register_craftitem("default:clay_brick", { - description = "Clay Brick", - inventory_image = "default_clay_brick.png", -}) - minetest.register_craftitem("default:obsidian_shard", { description = "Obsidian Shard", inventory_image = "default_obsidian_shard.png", diff --git a/mods/default/mapgen.lua b/mods/default/mapgen.lua index 5beb065..b2fca4a 100644 --- a/mods/default/mapgen.lua +++ b/mods/default/mapgen.lua @@ -651,61 +651,3 @@ elseif mg_params.mgname ~= "singlenode" then default.register_biomes() default.register_decorations() end - - --- --- Generate nyan cats in all mapgens --- - - --- facedir: 0/1/2/3 (head node facedir value) --- length: length of rainbow tail -function default.make_nyancat(pos, facedir, length) - local tailvec = {x = 0, y = 0, z = 0} - if facedir == 0 then - tailvec.z = 1 - elseif facedir == 1 then - tailvec.x = 1 - elseif facedir == 2 then - tailvec.z = -1 - elseif facedir == 3 then - tailvec.x = -1 - else - --print("default.make_nyancat(): Invalid facedir: "+dump(facedir)) - facedir = 0 - tailvec.z = 1 - end - local p = {x = pos.x, y = pos.y, z = pos.z} - minetest.set_node(p, {name = "default:nyancat", param2 = facedir}) - for i = 1, length do - p.x = p.x + tailvec.x - p.z = p.z + tailvec.z - minetest.set_node(p, {name = "default:nyancat_rainbow", param2 = facedir}) - end -end - - -function default.generate_nyancats(minp, maxp, seed) - local height_min = -31000 - local height_max = -32 - if maxp.y < height_min or minp.y > height_max then - return - end - local y_min = math.max(minp.y, height_min) - local y_max = math.min(maxp.y, height_max) - local volume = (maxp.x - minp.x + 1) * (y_max - y_min + 1) * (maxp.z - minp.z + 1) - local pr = PseudoRandom(seed + 9324342) - local max_num_nyancats = math.floor(volume / (16 * 16 * 16)) - for i = 1, max_num_nyancats do - if pr:next(0, 1000) == 0 then - local x0 = pr:next(minp.x, maxp.x) - local y0 = pr:next(minp.y, maxp.y) - local z0 = pr:next(minp.z, maxp.z) - local p0 = {x = x0, y = y0, z = z0} - default.make_nyancat(p0, pr:next(0, 3), pr:next(3, 15)) - end - end -end - - -minetest.register_on_generated(default.generate_nyancats) diff --git a/mods/default/nodes.lua b/mods/default/nodes.lua index a5c8737..9d7b36e 100644 --- a/mods/default/nodes.lua +++ b/mods/default/nodes.lua @@ -122,8 +122,6 @@ default:fence_wood default:glass default:obsidian_glass -default:rail - default:brick default:meselamp @@ -131,8 +129,6 @@ default:meselamp Misc ---- default:cloud -default:nyancat -default:nyancat_rainbow --]] @@ -303,18 +299,6 @@ minetest.register_node("default:gravel", { }), }) - - -minetest.register_node("default:clay", { - description = "Clay", - tiles = {"default_clay.png"}, - groups = {crumbly=3}, - drop = 'default:clay_lump 4', - sounds = default.node_sound_dirt_defaults(), -}) - - - minetest.register_node("default:snow", { description = "Snow", tiles = {"default_snow.png"}, @@ -963,102 +947,6 @@ minetest.register_node("default:river_water_flowing", { groups = {water=3, liquid=3, puts_out_fire=1, not_in_creative_inventory=1}, }) - - ---[[minetest.register_node("default:lava_source", { - description = "Lava Source", - inventory_image = minetest.inventorycube("default_lava.png"), - drawtype = "liquid", - tiles = { - { - name = "default_lava_source_animated.png", - animation = { - type = "vertical_frames", - aspect_w = 16, - aspect_h = 16, - length = 3.0, - }, - }, - }, - special_tiles = { - -- New-style lava source material (mostly unused) - { - name = "default_lava_source_animated.png", - animation = { - type = "vertical_frames", - aspect_w = 16, - aspect_h = 16, - length = 3.0, - }, - backface_culling = false, - }, - }, - paramtype = "light", - light_source = default.LIGHT_MAX - 1, - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - is_ground_content = false, - drop = "", - drowning = 1, - liquidtype = "source", - liquid_alternative_flowing = "default:lava_flowing", - liquid_alternative_source = "default:lava_source", - liquid_viscosity = 7, - liquid_renewable = false, - damage_per_second = 4 * 2, - post_effect_color = {a=192, r=255, g=64, b=0}, - groups = {lava=3, liquid=2, hot=3, igniter=1}, -}) - -minetest.register_node("default:lava_flowing", { - description = "Flowing Lava", - inventory_image = minetest.inventorycube("default_lava.png"), - drawtype = "flowingliquid", - tiles = {"default_lava.png"}, - special_tiles = { - { - name = "default_lava_flowing_animated.png", - backface_culling = false, - animation = { - type = "vertical_frames", - aspect_w = 16, - aspect_h = 16, - length = 3.3, - }, - }, - { - name = "default_lava_flowing_animated.png", - backface_culling = true, - animation = { - type = "vertical_frames", - aspect_w = 16, - aspect_h = 16, - length = 3.3, - }, - }, - }, - paramtype = "light", - paramtype2 = "flowingliquid", - light_source = default.LIGHT_MAX - 1, - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - is_ground_content = false, - drop = "", - drowning = 1, - liquidtype = "flowing", - liquid_alternative_flowing = "default:lava_flowing", - liquid_alternative_source = "default:lava_source", - liquid_viscosity = 7, - liquid_renewable = false, - damage_per_second = 4 * 2, - post_effect_color = {a=192, r=255, g=64, b=0}, - groups = {lava=3, liquid=2, hot=3, igniter=1, not_in_creative_inventory=1}, -})]] - -- -- Tools / "Advanced" crafting / Non-"natural" -- @@ -1114,81 +1002,6 @@ minetest.register_node("default:torch", { sounds = default.node_sound_defaults(), }) - -local bookshelf_formspec = - "size[8,7;]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "list[context;books;0,0.3;8,2;]".. - "list[current_player;main;0,2.85;8,1;]".. - "list[current_player;main;0,4.08;8,3;8]".. - "listring[context;books]".. - "listring[current_player;main]".. - default.get_hotbar_bg(0,2.85) - -minetest.register_node("default:bookshelf", { - description = "Bookshelf", - tiles = {"default_wood.png", "default_wood.png", "default_bookshelf.png"}, - is_ground_content = false, - groups = {choppy=3,oddly_breakable_by_hand=2,flammable=3}, - sounds = default.node_sound_wood_defaults(), - - on_construct = function(pos) - local meta = minetest.get_meta(pos) - meta:set_string("formspec", bookshelf_formspec) - local inv = meta:get_inventory() - inv:set_size("books", 8*2) - end, - can_dig = function(pos,player) - local meta = minetest.get_meta(pos); - local inv = meta:get_inventory() - return inv:is_empty("books") - end, - - allow_metadata_inventory_put = function(pos, listname, index, stack, player) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - local to_stack = inv:get_stack(listname, index) - if listname == "books" then - if minetest.get_item_group(stack:get_name(), "book") ~= 0 - and to_stack:is_empty() then - return 1 - else - return 0 - end - end - end, - - allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - local stack = inv:get_stack(from_list, from_index) - local to_stack = inv:get_stack(to_list, to_index) - if to_list == "books" then - if minetest.get_item_group(stack:get_name(), "book") ~= 0 - and to_stack:is_empty() then - return 1 - else - return 0 - end - end - end, - - on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) - minetest.log("action", player:get_player_name().. - " moves stuff in bookshelf at "..minetest.pos_to_string(pos)) - end, - on_metadata_inventory_put = function(pos, listname, index, stack, player) - minetest.log("action", player:get_player_name().. - " moves stuff to bookshelf at "..minetest.pos_to_string(pos)) - end, - on_metadata_inventory_take = function(pos, listname, index, stack, player) - minetest.log("action", player:get_player_name().. - " takes stuff from bookshelf at "..minetest.pos_to_string(pos)) - end, -}) - minetest.register_node("default:ladder", { description = "Ladder", drawtype = "signlike", @@ -1255,37 +1068,6 @@ minetest.register_node("default:obsidian_glass", { groups = {cracky=3,oddly_breakable_by_hand=3}, }) - - -minetest.register_node("default:rail", { - description = "Rail", - drawtype = "raillike", - tiles = {"default_rail.png", "default_rail_curved.png", "default_rail_t_junction.png", "default_rail_crossing.png"}, - inventory_image = "default_rail.png", - wield_image = "default_rail.png", - paramtype = "light", - sunlight_propagates = true, - walkable = false, - is_ground_content = false, - selection_box = { - type = "fixed", - -- but how to specify the dimensions for curved and sideways rails? - fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2}, - }, - groups = {bendy=2,dig_immediate=2,attached_node=1,connect_to_raillike=minetest.raillike_group("rail")}, -}) - - - -minetest.register_node("default:brick", { - description = "Brick Block", - tiles = {"default_brick.png"}, - is_ground_content = false, - groups = {cracky=3}, - sounds = default.node_sound_stone_defaults(), -}) - - minetest.register_node("default:meselamp", { description = "Mese Lamp", drawtype = "glasslike", @@ -1309,26 +1091,3 @@ minetest.register_node("default:cloud", { sounds = default.node_sound_defaults(), groups = {not_in_creative_inventory=1}, }) - -minetest.register_node("default:nyancat", { - description = "Nyan Cat", - tiles = {"default_nc_side.png", "default_nc_side.png", "default_nc_side.png", - "default_nc_side.png", "default_nc_back.png", "default_nc_front.png"}, - paramtype2 = "facedir", - groups = {cracky=2}, - is_ground_content = false, - legacy_facedir_simple = true, - sounds = default.node_sound_defaults(), -}) - -minetest.register_node("default:nyancat_rainbow", { - description = "Nyan Cat Rainbow", - tiles = { - "default_nc_rb.png^[transformR90", "default_nc_rb.png^[transformR90", - "default_nc_rb.png", "default_nc_rb.png" - }, - paramtype2 = "facedir", - groups = {cracky=2}, - is_ground_content = false, - sounds = default.node_sound_defaults(), -})