If workbench disabling.
And setting for disabling:
- Chess
- Cooking
- Enchanting
- Hive
- Itemframe
- Mailbox
- Mechanisms
- Rope
- Workbench
By default all active.
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
+ not def.on_construct and
+ not def.after_place_node and
+ not def.on_rightclick and
+ not def.on_blast and
+ not def.allow_metadata_inventory_take and
+ not (def.groups.not_in_creative_inventory == 1) and
+ not (def.groups.not_cuttable == 1) and
+ not def.groups.wool and
+ (def.tiles and type(def.tiles[1]) == "string" and not
+ def.tiles[1]:find("default_mineral")) and
+ not def.mesecons and
+ def.description and
+ def.description ~= "" and
+ def.light_source == 0
+end
end
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
+ def.groups.groupname = nil
+ end
+ end
+ if minetest.get_modpath("moreblocks") then
+ stairsplus:register_all(
+ mod,
+ name,
+ nodename,
+ {
+ description = def.description,
+ tiles = def.tiles,
+ groups = def.groups,
+ sounds = def.sounds,
+ }
+ )
+ elseif minetest.get_modpath("stairs") then
+ stairs.register_stair_and_slab(name,nodename,
+ def.groups,
+ def.tiles,
+ ("%s Stair"):format(def.description),
+ ("%s Slab"):format(def.description),
+ def.sounds
+ )
+ 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
+ if xdecor.stairs_valid_def(def) then
+ xdecor_stairs_alternative("xdecor:"..name, def)
+ end
+ end
end
dofile(modpath.."/handlers/nodeboxes.lua")
dofile(modpath.."/handlers/registration.lua")
--- Item files.
-dofile(modpath.."/src/chess.lua")
-dofile(modpath.."/src/cooking.lua")
-dofile(modpath.."/src/craftitems.lua")
-dofile(modpath.."/src/enchanting.lua")
-dofile(modpath.."/src/hive.lua")
-dofile(modpath.."/src/itemframe.lua")
-dofile(modpath.."/src/mailbox.lua")
-dofile(modpath.."/src/mechanisms.lua")
+-- Node and others
+dofile(modpath.."/src/alias.lua")
dofile(modpath.."/src/nodes.lua")
dofile(modpath.."/src/recipes.lua")
-dofile(modpath.."/src/rope.lua")
-dofile(modpath.."/src/workbench.lua")
+
+-- Elements
+local submod = {
+ "chess",
+ "cooking",
+ "enchanting",
+ "hive",
+ "itemframe",
+ "mailbox",
+ "mechanisms",
+ "rope",
+ "workbench"
+}
+
+for _, name in ipairs(submod) do
+ local enable = not(minetest.settings:get_bool("disable_xdecor_"..name))
+ if enable then
+ dofile(modpath.."/src/"..name..".lua")
+ end
+end
+
+
--print(string.format("[xdecor] loaded in %.2f ms", (os.clock()-t)*1000))
--- /dev/null
+#For disabling a element in xdecor.
+
+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
--- /dev/null
+minetest.register_alias("xdecor:crafting_guide", "craftguide:book")
register_piece("queen")
register_piece("king")
+-- Recipes
+
+minetest.register_craft({
+ output = "realchess:chessboard",
+ recipe = {
+ {"dye:black", "dye:white", "dye:black"},
+ {"stairs:slab_wood", "stairs:slab_wood", "stairs:slab_wood"}
+ }
+})
end
})
+-- Craft items
+
+minetest.register_craftitem("xdecor:bowl", {
+ description = "Bowl",
+ inventory_image = "xdecor_bowl.png",
+ wield_image = "xdecor_bowl.png"
+})
+
+minetest.register_craftitem("xdecor:bowl_soup", {
+ description = "Bowl of soup",
+ inventory_image = "xdecor_bowl_soup.png",
+ wield_image = "xdecor_bowl_soup.png",
+ groups = {not_in_creative_inventory=1},
+ stack_max = 1,
+ on_use = minetest.item_eat(30, "xdecor:bowl")
+})
+
+-- Recipes
+
+minetest.register_craft({
+ output = "xdecor:bowl 3",
+ recipe = {
+ {"group:wood", "", "group:wood"},
+ {"", "group:wood", ""}
+ }
+})
+
+minetest.register_craft({
+ output = "xdecor:cauldron_empty",
+ recipe = {
+ {"default:iron_lump", "", "default:iron_lump"},
+ {"default:iron_lump", "", "default:iron_lump"},
+ {"default:iron_lump", "default:iron_lump", "default:iron_lump"}
+ }
+})
\ No newline at end of file
+++ /dev/null
-minetest.register_craftitem("xdecor:bowl", {
- description = "Bowl",
- inventory_image = "xdecor_bowl.png",
- wield_image = "xdecor_bowl.png"
-})
-
-minetest.register_craftitem("xdecor:bowl_soup", {
- description = "Bowl of soup",
- inventory_image = "xdecor_bowl_soup.png",
- wield_image = "xdecor_bowl_soup.png",
- groups = {not_in_creative_inventory=1},
- stack_max = 1,
- on_use = minetest.item_eat(30, "xdecor:bowl")
-})
-
-minetest.register_tool("xdecor:hammer", {
- description = "Hammer",
- inventory_image = "xdecor_hammer.png",
- wield_image = "xdecor_hammer.png",
- on_use = function() do return end end
-})
-
-minetest.register_craftitem("xdecor:honey", {
- description = "Honey",
- inventory_image = "xdecor_honey.png",
- wield_image = "xdecor_honey.png",
- groups = {not_in_creative_inventory=1},
- on_use = minetest.item_eat(2)
-})
-
-minetest.register_alias("xdecor:crafting_guide", "craftguide:book")
sword = {enchants = "sharp"}
}
})
+
+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({
+ output = "xdecor:enchantment_table",
+ recipe = {
+ {"", "default:book", ""},
+ {"default:diamond", "default:obsidian", "default:diamond"},
+ {"default:obsidian", "default:obsidian", "default:obsidian"}
+ }
+})
\ No newline at end of file
end
})
+-- Craft items
+
+minetest.register_craftitem("xdecor:honey", {
+ description = "Honey",
+ inventory_image = "xdecor_honey.png",
+ wield_image = "xdecor_honey.png",
+ groups = {not_in_creative_inventory=1},
+ on_use = minetest.item_eat(2)
+})
+
+-- Recipes
+
+minetest.register_craft({
+ output = "xdecor:hive",
+ recipe = {
+ {"group:stick", "group:stick", "group:stick"},
+ {"default:paper", "default:paper", "default:paper"},
+ {"group:stick", "group:stick", "group:stick"}
+ }
+})
\ No newline at end of file
end
})
+-- Recipes
+
+minetest.register_craft({
+ output = "xdecor:itemframe",
+ recipe = {
+ {"group:stick", "group:stick", "group:stick"},
+ {"group:stick", "default:paper", "group:stick"},
+ {"group:stick", "group:stick", "group:stick"}
+ }
+})
\ No newline at end of file
allow_metadata_inventory_put = mailbox.put,
after_place_node = mailbox.after_place_node
})
+
+-- Recipes
+
+minetest.register_craft({
+ output = "xdecor:mailbox",
+ recipe = {
+ {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
+ {"dye:red", "default:paper", "dye:red"},
+ {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}
+ }
+})
\ No newline at end of file
drop = "xdecor:lever_off"
})
+-- Recipes
+
+minetest.register_craft({
+ output = "xdecor:pressure_stone_off",
+ type = "shapeless",
+ recipe = {"group:stone", "group:stone"}
+})
+
+minetest.register_craft({
+ output = "xdecor:pressure_wood_off",
+ type = "shapeless",
+ recipe = {"group:wood", "group:wood"}
+})
+
+minetest.register_craft({
+ output = "xdecor:lever_off",
+ recipe = {
+ {"group:stick"},
+ {"group:stone"}
+ }
+})
\ No newline at end of file
}
})
-minetest.register_craft({
- output = "xdecor:bowl 3",
- recipe = {
- {"group:wood", "", "group:wood"},
- {"", "group:wood", ""}
- }
-})
-
minetest.register_craft({
output = "xdecor:candle",
recipe = {
}
})
-minetest.register_craft({
- output = "xdecor:cauldron_empty",
- recipe = {
- {"default:iron_lump", "", "default:iron_lump"},
- {"default:iron_lump", "", "default:iron_lump"},
- {"default:iron_lump", "default:iron_lump", "default:iron_lump"}
- }
-})
-
-minetest.register_craft({
- output = "realchess:chessboard",
- recipe = {
- {"dye:black", "dye:white", "dye:black"},
- {"stairs:slab_wood", "stairs:slab_wood", "stairs:slab_wood"}
- }
-})
-
minetest.register_craft({
output = "xdecor:chair",
recipe = {
}
})
-minetest.register_craft({
- output = "xdecor:enchantment_table",
- recipe = {
- {"", "default:book", ""},
- {"default:diamond", "default:obsidian", "default:diamond"},
- {"default:obsidian", "default:obsidian", "default:obsidian"}
- }
-})
-
-minetest.register_craft({
- output = "xdecor:itemframe",
- recipe = {
- {"group:stick", "group:stick", "group:stick"},
- {"group:stick", "default:paper", "group:stick"},
- {"group:stick", "group:stick", "group:stick"}
- }
-})
-
-minetest.register_craft({
- output = "xdecor:hammer",
- recipe = {
- {"default:steel_ingot", "group:stick", "default:steel_ingot"},
- {"", "group:stick", ""}
- }
-})
-
minetest.register_craft({
output = "xdecor:hard_clay",
recipe = {
}
})
-minetest.register_craft({
- output = "xdecor:hive",
- recipe = {
- {"group:stick", "group:stick", "group:stick"},
- {"default:paper", "default:paper", "default:paper"},
- {"group:stick", "group:stick", "group:stick"}
- }
-})
-
minetest.register_craft({
output = "xdecor:iron_lightbox",
recipe = {
}
})
-minetest.register_craft({
- output = "xdecor:lever_off",
- recipe = {
- {"group:stick"},
- {"group:stone"}
- }
-})
-
-minetest.register_craft({
- output = "xdecor:mailbox",
- recipe = {
- {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
- {"dye:red", "default:paper", "dye:red"},
- {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}
- }
-})
-
minetest.register_craft({
output = "xdecor:moonbrick",
recipe = {
}
})
-minetest.register_craft({
- output = "xdecor:pressure_stone_off",
- type = "shapeless",
- recipe = {"group:stone", "group:stone"}
-})
-
-minetest.register_craft({
- output = "xdecor:pressure_wood_off",
- type = "shapeless",
- recipe = {"group:wood", "group:wood"}
-})
-
-minetest.register_craft({
- output = "xdecor:rope",
- recipe = {
- {"farming:string"},
- {"farming:string"},
- {"farming:string"}
- }
-})
-
minetest.register_craft({
output = "xdecor:stone_tile 2",
recipe = {
}
})
-minetest.register_craft({
- output = "xdecor:workbench",
- recipe = {
- {"group:wood", "group:wood"},
- {"group:wood", "group:wood"}
- }
-})
-
minetest.register_craft({
output = "xdecor:woodframed_glass",
recipe = {
end
end
})
+
+-- Recipes
+
+minetest.register_craft({
+ output = "xdecor:rope",
+ recipe = {
+ {"farming:string"},
+ {"farming:string"},
+ {"farming:string"}
+ }
+})
\ No newline at end of file
-- Only the regular, solid blocks without metas or explosivity can be cut
local nodes = {}
for node, def in pairs(registered_nodes) do
- if (def.drawtype == "normal" or def.drawtype:sub(1,5) == "glass") 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.on_blast and
- not def.allow_metadata_inventory_take and
- not (def.groups.not_in_creative_inventory == 1) and
- not (def.groups.not_cuttable == 1) and
- not def.groups.wool and
- (def.tiles and type(def.tiles[1]) == "string" and not
- def.tiles[1]:find("default_mineral")) and
- not def.mesecons and
- def.description and
- def.description ~= "" and
- def.light_source == 0
- then
+ if xdecor.stairs_valid_def(def) then
nodes[#nodes+1] = node
end
end
end
end
end
+
+-- Craft items
+
+minetest.register_tool("xdecor:hammer", {
+ description = "Hammer",
+ inventory_image = "xdecor_hammer.png",
+ wield_image = "xdecor_hammer.png",
+ on_use = function() do return end end
+})
+
+-- Recipes
+
+minetest.register_craft({
+ output = "xdecor:hammer",
+ recipe = {
+ {"default:steel_ingot", "group:stick", "default:steel_ingot"},
+ {"", "group:stick", ""}
+ }
+})
+
+minetest.register_craft({
+ output = "xdecor:workbench",
+ recipe = {
+ {"group:wood", "group:wood"},
+ {"group:wood", "group:wood"}
+ }
+})