Fix style issues with previous commit
This commit is contained in:
parent
271d5b1147
commit
a45c1c915a
@ -29,7 +29,6 @@ function xdecor.tablecopy(T)
|
|||||||
return new
|
return new
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Return true if a def is accepting for stair
|
|
||||||
function xdecor.stairs_valid_def(def)
|
function xdecor.stairs_valid_def(def)
|
||||||
return (def.drawtype == "normal" or def.drawtype:sub(1,5) == "glass") and
|
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
|
||||||
|
@ -46,15 +46,13 @@ function xdecor.register(name, def)
|
|||||||
local function xdecor_stairs_alternative(nodename, def)
|
local function xdecor_stairs_alternative(nodename, def)
|
||||||
local mod, name = nodename:match("(.*):(.*)")
|
local mod, name = nodename:match("(.*):(.*)")
|
||||||
for groupname, value in pairs(def.groups) do
|
for groupname, value in pairs(def.groups) do
|
||||||
if groupname ~= "cracky" and
|
if groupname ~= "cracky" and groupname ~= "choppy" and
|
||||||
groupname ~= "choppy" and
|
groupname ~= "flammable" and groupname ~= "crumbly" and
|
||||||
groupname ~= "flammable" and
|
groupname ~= "snappy" then
|
||||||
groupname ~= "crumbly" and
|
|
||||||
groupname ~= "snappy"
|
|
||||||
then
|
|
||||||
def.groups.groupname = nil
|
def.groups.groupname = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if minetest.get_modpath("moreblocks") then
|
if minetest.get_modpath("moreblocks") then
|
||||||
stairsplus:register_all(
|
stairsplus:register_all(
|
||||||
mod,
|
mod,
|
||||||
@ -77,6 +75,7 @@ function xdecor.register(name, def)
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def.drawtype = def.drawtype or (def.mesh and "mesh") or (def.node_box and "nodebox")
|
def.drawtype = def.drawtype or (def.mesh and "mesh") or (def.node_box and "nodebox")
|
||||||
def.sounds = def.sounds or default.node_sound_defaults()
|
def.sounds = def.sounds or default.node_sound_defaults()
|
||||||
|
|
||||||
|
12
init.lua
12
init.lua
@ -2,19 +2,16 @@
|
|||||||
xdecor = {}
|
xdecor = {}
|
||||||
local modpath = minetest.get_modpath("xdecor")
|
local modpath = minetest.get_modpath("xdecor")
|
||||||
|
|
||||||
-- Handlers.
|
|
||||||
dofile(modpath.."/handlers/animations.lua")
|
dofile(modpath.."/handlers/animations.lua")
|
||||||
dofile(modpath.."/handlers/helpers.lua")
|
dofile(modpath.."/handlers/helpers.lua")
|
||||||
dofile(modpath.."/handlers/nodeboxes.lua")
|
dofile(modpath.."/handlers/nodeboxes.lua")
|
||||||
dofile(modpath.."/handlers/registration.lua")
|
dofile(modpath.."/handlers/registration.lua")
|
||||||
|
|
||||||
-- Node and others
|
|
||||||
dofile(modpath.."/src/alias.lua")
|
dofile(modpath.."/src/alias.lua")
|
||||||
dofile(modpath.."/src/nodes.lua")
|
dofile(modpath.."/src/nodes.lua")
|
||||||
dofile(modpath.."/src/recipes.lua")
|
dofile(modpath.."/src/recipes.lua")
|
||||||
|
|
||||||
-- Elements
|
local subpart = {
|
||||||
local submod = {
|
|
||||||
"chess",
|
"chess",
|
||||||
"cooking",
|
"cooking",
|
||||||
"enchanting",
|
"enchanting",
|
||||||
@ -26,12 +23,11 @@ local submod = {
|
|||||||
"workbench"
|
"workbench"
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, name in ipairs(submod) do
|
for _, name in pairs(subpart) do
|
||||||
local enable = not(minetest.settings:get_bool("disable_xdecor_"..name))
|
local enable = minetest.settings:get_bool("enable_xdecor_"..name)
|
||||||
if enable then
|
if enable or enable == nil then
|
||||||
dofile(modpath.."/src/"..name..".lua")
|
dofile(modpath.."/src/"..name..".lua")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--print(string.format("[xdecor] loaded in %.2f ms", (os.clock()-t)*1000))
|
--print(string.format("[xdecor] loaded in %.2f ms", (os.clock()-t)*1000))
|
||||||
|
@ -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
|
enable_xdecor_chess (Enable Chess) bool true
|
||||||
disable_xdecor_cooking (Disable element Cooking) bool false
|
enable_xdecor_cooking (Enable Cooking) bool true
|
||||||
disable_xdecor_enchanting (Disable element Enchanting) bool false
|
enable_xdecor_enchanting (Enable Enchanting) bool true
|
||||||
disable_xdecor_hive (Disable element Hive) bool false
|
enable_xdecor_hive (Enable Hive) bool true
|
||||||
disable_xdecor_itemframe (Disable element Itemframe) bool false
|
enable_xdecor_itemframe (Enable Itemframe) bool true
|
||||||
disable_xdecor_mailbox (Disable element Mailbox) bool false
|
enable_xdecor_mailbox (Enable Mailbox) bool true
|
||||||
disable_xdecor_mechanisms (Disable element Mechanisms) bool false
|
enable_xdecor_mechanisms (Enable Mechanisms) bool true
|
||||||
disable_xdecor_rope (Disable element Rope) bool false
|
enable_xdecor_rope (Enable Rope) bool true
|
||||||
disable_xdecor_workbench (Disable element Workbench) bool false
|
enable_xdecor_workbench (Enable Workbench) bool true
|
@ -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
|
-- Recipes
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user