From 36897537a52b53857b641dd4474230a8cb7c160d Mon Sep 17 00:00:00 2001 From: LeMagnesium Date: Sat, 24 Jan 2015 19:38:53 +0100 Subject: [PATCH] Updated maptools mod : not running yet --- mods/maptools/config.lua | 6 +- mods/maptools/default_nodes.lua | 2 +- mods/maptools/init.lua | 165 +++++++++++++------------------- 3 files changed, 67 insertions(+), 106 deletions(-) diff --git a/mods/maptools/config.lua b/mods/maptools/config.lua index 225a09b1..9de05951 100644 --- a/mods/maptools/config.lua +++ b/mods/maptools/config.lua @@ -26,8 +26,4 @@ local function setting(settingtype, name, default) end -- Show Map Tools stuff in creative inventory (1 or 0): -<<<<<<< HEAD -setting("integer", "hide_from_creative_inventory", 0) -======= -setting("integer", "hide_from_creative_inventory", 1) ->>>>>>> Maptool's update +setting("integer", "hide_from_creative_inventory", 0) \ No newline at end of file diff --git a/mods/maptools/default_nodes.lua b/mods/maptools/default_nodes.lua index 3ac0caf5..7c1e135e 100644 --- a/mods/maptools/default_nodes.lua +++ b/mods/maptools/default_nodes.lua @@ -360,7 +360,7 @@ minetest.register_node("maptools:diamondblock", { description = S("Unbreakable Diamond Block"), range = 12, stack_max = 10000, - tiles = {"default_steel_block.png"}, + tiles = {"default_diamond_block.png"}, drop = "", groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative}, sounds = default.node_sound_stone_defaults(), diff --git a/mods/maptools/init.lua b/mods/maptools/init.lua index 8b095d2d..bf876672 100644 --- a/mods/maptools/init.lua +++ b/mods/maptools/init.lua @@ -1,102 +1,3 @@ -<<<<<<< HEAD ---[[ -===================================================================== -** Map Tools ** -By Calinou. - -Copyright (c) 2012-2015 Calinou and contributors. -Licensed under the zlib license. See LICENSE.md for more information. -===================================================================== ---]] - -maptools = {} - -local S -if minetest.get_modpath("intllib") then - S = intllib.Getter() -else - S = function(s) return s end -end -maptools.intllib = S - -local modpath = minetest.get_modpath("maptools") - -dofile(modpath .. "/config.lua") -dofile(modpath .. "/aliases.lua") -dofile(modpath .. "/craftitems.lua") -dofile(modpath .. "/default_nodes.lua") -dofile(modpath .. "/nodes.lua") -dofile(modpath .. "/tools.lua") - ---[[ -Map Tools by Calinou -Licensed under the zlib license for code and CC BY-SA 3.0 for textures, see LICENSE.txt for info. ---]] - --- Redefine cloud so that the admin pickaxe can mine it. - -minetest.register_node(":default:cloud", { - description = S("Cloud"), - tiles = {"default_cloud.png"}, - drop = "", - groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative}, - sounds = default.node_sound_defaults(), -}) - --- Items - -minetest.register_craft({ - type = "fuel", - recipe = "maptools:infinitefuel", - burntime = 1000000000, -}) - --- Items - -minetest.register_craftitem("maptools:copper_coin", { - description = S("Copper Coin"), - inventory_image = "maptools_copper_coin.png", - wield_scale = {x = 0.5, y = 0.5, z = 0.25}, - stack_max = 10000, - groups = {not_in_creative_inventory = maptools.creative}, -}) - -minetest.register_craftitem("maptools:silver_coin", { - description = S("Silver Coin"), - inventory_image = "maptools_silver_coin.png", - wield_scale = {x = 0.5, y = 0.5, z = 0.25}, - stack_max = 10000, - groups = {not_in_creative_inventory = maptools.creative}, -}) - -minetest.register_craftitem("maptools:gold_coin", { - description = S("Gold Coin"), - inventory_image = "maptools_gold_coin.png", - wield_scale = {x = 0.5, y = 0.5, z = 0.25}, - stack_max = 10000, - groups = {not_in_creative_inventory = maptools.creative}, -}) - -minetest.register_craftitem("maptools:infinitefuel", { - description = S("Infinite Fuel"), - inventory_image = "maptools_infinitefuel.png", - stack_max = 10000, - groups = {not_in_creative_inventory = maptools.creative}, -}) - -minetest.register_on_punchnode(function(pos, node, puncher) - if puncher:get_wielded_item():get_name() == "maptools:pick_admin" - and minetest.get_node(pos).name ~= "air" then - minetest.log("action", puncher:get_player_name() .. " digs " .. minetest.get_node(pos).name .. " at " .. minetest.pos_to_string(pos) .. " using an Admin Pickaxe.") - minetest.remove_node(pos) -- The node is removed directly, which means it even works on non-empty containers and group-less nodes. - nodeupdate(pos) -- Run node update actions like falling nodes. - end -end) - -if minetest.setting_getbool("log_mods") then - minetest.log("action", S("[maptools] loaded.")) -end -======= --[[ ===================================================================== ** Map Tools ** @@ -126,7 +27,71 @@ dofile(modpath .. "/default_nodes.lua") dofile(modpath .. "/nodes.lua") dofile(modpath .. "/tools.lua") +--[[ +Map Tools by Calinou +Licensed under the zlib license for code and CC BY-SA 3.0 for textures, see LICENSE.txt for info. +--]] + +-- Redefine cloud so that the admin pickaxe can mine it. + +minetest.register_node(":default:cloud", { + description = S("Cloud"), + tiles = {"default_cloud.png"}, + drop = "", + groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative}, + sounds = default.node_sound_defaults(), +}) + +-- Items + +minetest.register_craft({ + type = "fuel", + recipe = "maptools:infinitefuel", + burntime = 1000000000, +}) + +-- Items + +minetest.register_craftitem("maptools:copper_coin", { + description = S("Copper Coin"), + inventory_image = "maptools_copper_coin.png", + wield_scale = {x = 0.5, y = 0.5, z = 0.25}, + stack_max = 10000, + groups = {not_in_creative_inventory = maptools.creative}, +}) + +minetest.register_craftitem("maptools:silver_coin", { + description = S("Silver Coin"), + inventory_image = "maptools_silver_coin.png", + wield_scale = {x = 0.5, y = 0.5, z = 0.25}, + stack_max = 10000, + groups = {not_in_creative_inventory = maptools.creative}, +}) + +minetest.register_craftitem("maptools:gold_coin", { + description = S("Gold Coin"), + inventory_image = "maptools_gold_coin.png", + wield_scale = {x = 0.5, y = 0.5, z = 0.25}, + stack_max = 10000, + groups = {not_in_creative_inventory = maptools.creative}, +}) + +minetest.register_craftitem("maptools:infinitefuel", { + description = S("Infinite Fuel"), + inventory_image = "maptools_infinitefuel.png", + stack_max = 10000, + groups = {not_in_creative_inventory = maptools.creative}, +}) + +minetest.register_on_punchnode(function(pos, node, puncher) + if puncher:get_wielded_item():get_name() == "maptools:pick_admin" + and minetest.get_node(pos).name ~= "air" then + minetest.log("action", puncher:get_player_name() .. " digs " .. minetest.get_node(pos).name .. " at " .. minetest.pos_to_string(pos) .. " using an Admin Pickaxe.") + minetest.remove_node(pos) -- The node is removed directly, which means it even works on non-empty containers and group-less nodes. + nodeupdate(pos) -- Run node update actions like falling nodes. + end +end) + if minetest.setting_getbool("log_mods") then minetest.log("action", S("[maptools] loaded.")) end ->>>>>>> Maptool's update