]> git.lizzy.rs Git - xdecor.git/commitdiff
Fix style issues with previous commit
authorJP Guerrero <jeanpatrick.guerrero@gmail.com>
Thu, 8 Mar 2018 20:12:21 +0000 (21:12 +0100)
committerJP Guerrero <jeanpatrick.guerrero@gmail.com>
Thu, 8 Mar 2018 20:12:21 +0000 (21:12 +0100)
handlers/helpers.lua
handlers/registration.lua
init.lua
settingtypes.txt
src/enchanting.lua

index e6ad8b98267f993a2e322ac5a75c4ee5aeba4184..cbb9113e1fe97726903ecb5c3735b5d9251df17e 100644 (file)
@@ -29,10 +29,9 @@ function xdecor.tablecopy(T)
        return new
 end
 
--- Return true if a def is accepting for stair
 function xdecor.stairs_valid_def(def)
        return (def.drawtype == "normal" or def.drawtype:sub(1,5) == "glass") and
-               (def.groups.cracky or def.groups.choppy) and
+              (def.groups.cracky or def.groups.choppy) and
                not def.on_construct and
                not def.after_place_node and
                not def.on_rightclick and
@@ -46,5 +45,5 @@ function xdecor.stairs_valid_def(def)
                not def.mesecons and
                def.description and
                def.description ~= "" and
-       def.light_source == 0
+               def.light_source == 0
 end
index 0b7f2d62e5ec042b6e0eca3ec5a34ed774a3535f..f0db4fa17d2e6742d211c6a524d5299049f2c649 100644 (file)
@@ -46,15 +46,13 @@ function xdecor.register(name, def)
        local function xdecor_stairs_alternative(nodename, def)
                local mod, name = nodename:match("(.*):(.*)")
                for groupname, value in pairs(def.groups) do
-                       if      groupname ~= "cracky" and
-                               groupname ~= "choppy" and
-                               groupname ~= "flammable" and
-                               groupname ~= "crumbly" and
-                               groupname ~= "snappy" 
-                       then
+                       if groupname ~= "cracky"    and groupname ~= "choppy"  and
+                          groupname ~= "flammable" and groupname ~= "crumbly" and
+                          groupname ~= "snappy"    then
                                def.groups.groupname = nil
                        end
-               end     
+               end
+
                if minetest.get_modpath("moreblocks") then
                        stairsplus:register_all(
                                mod,
@@ -77,6 +75,7 @@ function xdecor.register(name, def)
                        )       
                end     
        end
+
        def.drawtype = def.drawtype or (def.mesh and "mesh") or (def.node_box and "nodebox")
        def.sounds = def.sounds or default.node_sound_defaults()
 
@@ -122,9 +121,9 @@ function xdecor.register(name, def)
        end
 
        minetest.register_node("xdecor:"..name, def)
-       
+
        if minetest.settings:get_bool("disable_xdecor_workbench") and 
-       (minetest.get_modpath("moreblocks") or minetest.get_modpath("stairs")) then
+         (minetest.get_modpath("moreblocks") or minetest.get_modpath("stairs")) then
                if xdecor.stairs_valid_def(def) then
                        xdecor_stairs_alternative("xdecor:"..name, def)
                end
index bab6806c67b06b72559ab85fc7958187b15f0212..bc05030b967188bfb24b945604adfe58784aad0a 100644 (file)
--- a/init.lua
+++ b/init.lua
@@ -2,19 +2,16 @@
 xdecor = {}
 local modpath = minetest.get_modpath("xdecor")
 
--- Handlers.
 dofile(modpath.."/handlers/animations.lua")
 dofile(modpath.."/handlers/helpers.lua")
 dofile(modpath.."/handlers/nodeboxes.lua")
 dofile(modpath.."/handlers/registration.lua")
 
--- Node and others
 dofile(modpath.."/src/alias.lua")
 dofile(modpath.."/src/nodes.lua")
 dofile(modpath.."/src/recipes.lua")
 
--- Elements
-local submod = {
+local subpart = {
        "chess",
        "cooking",
        "enchanting",
@@ -26,12 +23,11 @@ local submod = {
        "workbench"
 }
 
-for _, name in ipairs(submod) do
-       local enable = not(minetest.settings:get_bool("disable_xdecor_"..name))
-       if enable then
+for _, name in pairs(subpart) do
+       local enable = minetest.settings:get_bool("enable_xdecor_"..name)
+       if enable or enable == nil then
                dofile(modpath.."/src/"..name..".lua")
        end
 end
 
-
 --print(string.format("[xdecor] loaded in %.2f ms", (os.clock()-t)*1000))
index a477bcc8f190f4920c4efb60ac7cafd51663f689..f75d75c626a22112181038b844d65697e8b4ada9 100644 (file)
@@ -1,11 +1,11 @@
-#For disabling a element in xdecor.
+#For enabling a subpart of X-Decor.
 
-disable_xdecor_chess           (Disable element Chess)                 bool false
-disable_xdecor_cooking         (Disable element Cooking)               bool false
-disable_xdecor_enchanting      (Disable element Enchanting)    bool false
-disable_xdecor_hive            (Disable element Hive)                  bool false
-disable_xdecor_itemframe       (Disable element Itemframe)     bool false
-disable_xdecor_mailbox                 (Disable element Mailbox)               bool false
-disable_xdecor_mechanisms      (Disable element Mechanisms)    bool false
-disable_xdecor_rope            (Disable element Rope)                  bool false
-disable_xdecor_workbench       (Disable element Workbench)     bool false
\ No newline at end of file
+enable_xdecor_chess            (Enable Chess)          bool true
+enable_xdecor_cooking          (Enable Cooking)        bool true
+enable_xdecor_enchanting       (Enable Enchanting)     bool true
+enable_xdecor_hive             (Enable Hive)           bool true
+enable_xdecor_itemframe        (Enable Itemframe)      bool true
+enable_xdecor_mailbox          (Enable Mailbox)        bool true
+enable_xdecor_mechanisms       (Enable Mechanisms)     bool true
+enable_xdecor_rope             (Enable Rope)           bool true
+enable_xdecor_workbench        (Enable Workbench)      bool true
\ No newline at end of file
index 53ee21776eaf4d4f96d28c5dccc1668c934b3000..620264d72f7a36dc1c51045dbd047ed4c61ac7f4 100644 (file)
@@ -282,16 +282,6 @@ enchanting:register_tools("default", {
        }
 })
 
-enchanting:register_tools("3d_armor", {
-       materials = "steel, bronze, gold, diamond",
-       tools = {
-               boots      = {enchants = "strong, speed"},
-               chestplate = {enchants = "strong"},
-               helmet     = {enchants = "strong"},
-               leggings   = {enchants = "strong"}
-       }
-})
-
 -- Recipes
 
 minetest.register_craft({