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
not def.mesecons and
def.description and
def.description ~= "" and
- def.light_source == 0
+ def.light_source == 0
end
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,
)
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()
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
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",
"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))
-#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
}
})
-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({