Fix typo in survival formspec & create legacy file
authorCraig Davison <craig.davison3@gmail.com>
Wed, 24 Dec 2014 23:13:15 +0000 (23:13 +0000)
committerBlockMen <nmuelll@web.de>
Thu, 12 Feb 2015 21:18:22 +0000 (22:18 +0100)
mods/default/aliases.lua
mods/default/functions.lua
mods/default/init.lua
mods/default/legacy.lua [new file with mode: 0644]
mods/default/player.lua

index d80082e28216d25ced8058f71a2526904afb2fb7..72477513106712f0e1f1b0a7b1751c57daaca04f 100644 (file)
@@ -1,6 +1,7 @@
--- aliases (Minetest 0.4 mod)
--- Provides alias for most default items
+-- mods/default/aliases.lua
 
+-- Aliases to support loading worlds using nodes following the old naming convention
+-- These can also be helpful when using chat commands, for example /giveme
 minetest.register_alias("stone", "default:stone")
 minetest.register_alias("stone_with_coal", "default:stone_with_coal")
 minetest.register_alias("stone_with_iron", "default:stone_with_iron")
@@ -65,3 +66,7 @@ minetest.register_alias("lump_of_iron", "default:iron_lump")
 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")
index c5623205aaec1ad4a8c1af16f3c9bec5f69f2b9b..82c9282a04d35eecc6b455a95288dbc9570d7174 100644 (file)
@@ -83,25 +83,6 @@ function default.node_sound_glass_defaults(table)
        return table
 end
 
---
--- Legacy
---
-
-function default.spawn_falling_node(p, nodename)
-       spawn_falling_node(p, nodename)
-end
-
--- Horrible crap to support old code
--- Don't use this and never do what this does, it's completely wrong!
--- (More specifically, the client and the C++ code doesn't get the group)
-function default.register_falling_node(nodename, texture)
-       minetest.log("error", debug.traceback())
-       minetest.log('error', "WARNING: default.register_falling_node is deprecated")
-       if minetest.registered_nodes[nodename] then
-               minetest.registered_nodes[nodename].groups.falling_node = 1
-       end
-end
-
 --
 -- Lavacooling
 --
index 663a3ae12c5dbc5809d4ea36185184dfaa528e06..3f0efea99e4736dac10dd433d836a68ea13316ff 100644 (file)
@@ -21,7 +21,7 @@ function default.get_hotbar_bg(x,y)
        return out
 end
 
-default.gui_suvival_form = "size[8,8.5]"..
+default.gui_survival_form = "size[8,8.5]"..
                        default.gui_bg..
                        default.gui_bg_img..
                        default.gui_slots..
@@ -43,9 +43,4 @@ dofile(minetest.get_modpath("default").."/mapgen.lua")
 dofile(minetest.get_modpath("default").."/player.lua")
 dofile(minetest.get_modpath("default").."/trees.lua")
 dofile(minetest.get_modpath("default").."/aliases.lua")
-
--- Legacy:
-WATER_ALPHA = minetest.registered_nodes["default:water_source"].alpha
-WATER_VISC = minetest.registered_nodes["default:water_source"].liquid_viscosity
-LAVA_VISC = minetest.registered_nodes["default:lava_source"].liquid_viscosity
-LIGHT_MAX = default.LIGHT_MAX
+dofile(minetest.get_modpath("default").."/legacy.lua")
diff --git a/mods/default/legacy.lua b/mods/default/legacy.lua
new file mode 100644 (file)
index 0000000..76fcc8e
--- /dev/null
@@ -0,0 +1,25 @@
+-- mods/default/legacy.lua
+
+-- Horrible crap to support old code registering falling nodes
+-- Don't use this and never do what this does, it's completely wrong!
+-- (More specifically, the client and the C++ code doesn't get the group)
+function default.register_falling_node(nodename, texture)
+       minetest.log("error", debug.traceback())
+       minetest.log('error', "WARNING: default.register_falling_node is deprecated")
+       if minetest.registered_nodes[nodename] then
+               minetest.registered_nodes[nodename].groups.falling_node = 1
+       end
+end
+
+function default.spawn_falling_node(p, nodename)
+       spawn_falling_node(p, nodename)
+end
+
+-- Liquids
+WATER_ALPHA = minetest.registered_nodes["default:water_source"].alpha
+WATER_VISC = minetest.registered_nodes["default:water_source"].liquid_viscosity
+LAVA_VISC = minetest.registered_nodes["default:lava_source"].liquid_viscosity
+LIGHT_MAX = default.LIGHT_MAX
+
+-- Formspecs
+default.gui_suvival_form = default.gui_survival_form
index 688ef62fc70e8322c86013ae942024ed5c214e21..87618e3125eca21720427f6f5d5a33b62a05c041 100644 (file)
@@ -98,7 +98,7 @@ minetest.register_on_joinplayer(function(player)
        
        -- set GUI
        if not minetest.setting_getbool("creative_mode") then
-               player:set_inventory_formspec(default.gui_suvival_form)
+               player:set_inventory_formspec(default.gui_survival_form)
        end
        player:hud_set_hotbar_image("gui_hotbar.png")
        player:hud_set_hotbar_selected_image("gui_hotbar_selected.png")