forked from mtcontrib/homedecor_modpack
Moved detection of infinite creative-mode stacks to init.lua, changed lights and tables to use it. Fixed tables properly. Fixed missing drops in large square tables. Fixed incorrect texture placement on on-side small square glass and wood tables.
This commit is contained in:
parent
44dd0bd82d
commit
04999af13d
6
init.lua
6
init.lua
@ -59,6 +59,12 @@ function homedecor_node_is_owned(pos, placer)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if minetest.get_modpath("unified_inventory") or not minetest.setting_getbool("creative_mode") then
|
||||||
|
homedecor_expect_infinite_stacks = false
|
||||||
|
else
|
||||||
|
homedecor_expect_infinite_stacks = true
|
||||||
|
end
|
||||||
|
|
||||||
dofile(minetest.get_modpath("homedecor").."/nodes.lua") -- the catch-all for all misc nodes
|
dofile(minetest.get_modpath("homedecor").."/nodes.lua") -- the catch-all for all misc nodes
|
||||||
dofile(minetest.get_modpath("homedecor").."/tables.lua")
|
dofile(minetest.get_modpath("homedecor").."/tables.lua")
|
||||||
dofile(minetest.get_modpath("homedecor").."/electronics.lua")
|
dofile(minetest.get_modpath("homedecor").."/electronics.lua")
|
||||||
|
31
lighting.lua
31
lighting.lua
@ -10,8 +10,6 @@ else
|
|||||||
S = function ( s ) return s end
|
S = function ( s ) return s end
|
||||||
end
|
end
|
||||||
|
|
||||||
local unified_inventory = minetest.get_modpath("unified_inventory")
|
|
||||||
|
|
||||||
-- Yellow
|
-- Yellow
|
||||||
|
|
||||||
minetest.register_node('homedecor:glowlight_thick_yellow', {
|
minetest.register_node('homedecor:glowlight_thick_yellow', {
|
||||||
@ -59,8 +57,7 @@ minetest.register_node('homedecor:glowlight_thick_yellow', {
|
|||||||
else
|
else
|
||||||
minetest.env:add_node(above, {name = 'homedecor:glowlight_thick_yellow'})
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_thick_yellow'})
|
||||||
end
|
end
|
||||||
print("get_stack_max() of homedecor:glowlight_thick_yellow = "..itemstack:get_stack_max())
|
if not homedecor_expect_infinite_stacks then
|
||||||
if not minetest.setting_getbool("creative_mode") or unified_inventory then
|
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
@ -114,7 +111,7 @@ minetest.register_node('homedecor:glowlight_thick_yellow_wall', {
|
|||||||
else
|
else
|
||||||
minetest.env:add_node(above, {name = 'homedecor:glowlight_thick_yellow'})
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_thick_yellow'})
|
||||||
end
|
end
|
||||||
if not minetest.setting_getbool("creative_mode") or unified_inventory then
|
if not homedecor_expect_infinite_stacks then
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
@ -169,7 +166,7 @@ minetest.register_node('homedecor:glowlight_thin_yellow', {
|
|||||||
else
|
else
|
||||||
minetest.env:add_node(above, {name = 'homedecor:glowlight_thin_yellow'})
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_thin_yellow'})
|
||||||
end
|
end
|
||||||
if not minetest.setting_getbool("creative_mode") or unified_inventory then
|
if not homedecor_expect_infinite_stacks then
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
@ -223,7 +220,7 @@ minetest.register_node('homedecor:glowlight_thin_yellow_wall', {
|
|||||||
else
|
else
|
||||||
minetest.env:add_node(above, {name = 'homedecor:glowlight_thin_yellow'})
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_thin_yellow'})
|
||||||
end
|
end
|
||||||
if not minetest.setting_getbool("creative_mode") or unified_inventory then
|
if not homedecor_expect_infinite_stacks then
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
@ -278,7 +275,7 @@ minetest.register_node('homedecor:glowlight_small_cube_yellow', {
|
|||||||
else
|
else
|
||||||
minetest.env:add_node(above, {name = 'homedecor:glowlight_small_cube_yellow'})
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_small_cube_yellow'})
|
||||||
end
|
end
|
||||||
if not minetest.setting_getbool("creative_mode") or unified_inventory then
|
if not homedecor_expect_infinite_stacks then
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
@ -327,11 +324,11 @@ minetest.register_node('homedecor:glowlight_small_cube_yellow_ceiling', {
|
|||||||
if node.name ~= "air" then return end
|
if node.name ~= "air" then return end
|
||||||
|
|
||||||
if above.x == under.x and above.z == under.z and pitch > 0 then
|
if above.x == under.x and above.z == under.z and pitch > 0 then
|
||||||
minetest.env:add_node(above, {name = 'homedecor:glowlight_small_cube_white_ceiling'})
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_small_cube_yellow_ceiling'})
|
||||||
else
|
else
|
||||||
minetest.env:add_node(above, {name = 'homedecor:glowlight_small_cube_white'})
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_small_cube_yellow'})
|
||||||
end
|
end
|
||||||
if not minetest.setting_getbool("creative_mode") or unified_inventory then
|
if not homedecor_expect_infinite_stacks then
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
@ -388,7 +385,7 @@ minetest.register_node('homedecor:glowlight_thick_white', {
|
|||||||
else
|
else
|
||||||
minetest.env:add_node(above, {name = 'homedecor:glowlight_thick_white'})
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_thick_white'})
|
||||||
end
|
end
|
||||||
if not minetest.setting_getbool("creative_mode") or unified_inventory then
|
if not homedecor_expect_infinite_stacks then
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
@ -442,7 +439,7 @@ minetest.register_node('homedecor:glowlight_thick_white_wall', {
|
|||||||
else
|
else
|
||||||
minetest.env:add_node(above, {name = 'homedecor:glowlight_thick_white'})
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_thick_white'})
|
||||||
end
|
end
|
||||||
if not minetest.setting_getbool("creative_mode") or unified_inventory then
|
if not homedecor_expect_infinite_stacks then
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
@ -497,7 +494,7 @@ minetest.register_node('homedecor:glowlight_thin_white', {
|
|||||||
else
|
else
|
||||||
minetest.env:add_node(above, {name = 'homedecor:glowlight_thin_white'})
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_thin_white'})
|
||||||
end
|
end
|
||||||
if not minetest.setting_getbool("creative_mode") or unified_inventory then
|
if not homedecor_expect_infinite_stacks then
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
@ -551,7 +548,7 @@ minetest.register_node('homedecor:glowlight_thin_white_wall', {
|
|||||||
else
|
else
|
||||||
minetest.env:add_node(above, {name = 'homedecor:glowlight_thin_white'})
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_thin_white'})
|
||||||
end
|
end
|
||||||
if not minetest.setting_getbool("creative_mode") or unified_inventory then
|
if not homedecor_expect_infinite_stacks then
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
@ -605,7 +602,7 @@ minetest.register_node('homedecor:glowlight_small_cube_white', {
|
|||||||
else
|
else
|
||||||
minetest.env:add_node(above, {name = 'homedecor:glowlight_small_cube_white'})
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_small_cube_white'})
|
||||||
end
|
end
|
||||||
if not minetest.setting_getbool("creative_mode") or unified_inventory then
|
if not homedecor_expect_infinite_stacks then
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
@ -658,7 +655,7 @@ minetest.register_node('homedecor:glowlight_small_cube_white_ceiling', {
|
|||||||
else
|
else
|
||||||
minetest.env:add_node(above, {name = 'homedecor:glowlight_small_cube_white'})
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_small_cube_white'})
|
||||||
end
|
end
|
||||||
if not minetest.setting_getbool("creative_mode") or unified_inventory then
|
if not homedecor_expect_infinite_stacks then
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
|
16
tables.lua
16
tables.lua
@ -79,7 +79,7 @@ for i in ipairs(materials) do
|
|||||||
else
|
else
|
||||||
minetest.env:add_node(above, {name = 'homedecor:'..m..'_table_small_square_b'})
|
minetest.env:add_node(above, {name = 'homedecor:'..m..'_table_small_square_b'})
|
||||||
end
|
end
|
||||||
if not minetest.setting_getbool("creative_mode") or unified_inventory then
|
if not homedecor_expect_infinite_stacks then
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
@ -125,12 +125,12 @@ for i in ipairs(materials) do
|
|||||||
description = S(d.." Table (Small, Square)"),
|
description = S(d.." Table (Small, Square)"),
|
||||||
drawtype = 'nodebox',
|
drawtype = 'nodebox',
|
||||||
tiles = {
|
tiles = {
|
||||||
|
'homedecor_'..m..'_table_small_square_edges.png',
|
||||||
|
'homedecor_'..m..'_table_small_square_edges.png',
|
||||||
|
'homedecor_'..m..'_table_small_square_edges.png',
|
||||||
|
'homedecor_'..m..'_table_small_square_edges.png',
|
||||||
'homedecor_'..m..'_table_small_square_tb.png',
|
'homedecor_'..m..'_table_small_square_tb.png',
|
||||||
'homedecor_'..m..'_table_small_square_tb.png',
|
'homedecor_'..m..'_table_small_square_tb.png',
|
||||||
'homedecor_'..m..'_table_small_square_edges.png',
|
|
||||||
'homedecor_'..m..'_table_small_square_edges.png',
|
|
||||||
'homedecor_'..m..'_table_small_square_edges.png',
|
|
||||||
'homedecor_'..m..'_table_small_square_edges.png'
|
|
||||||
},
|
},
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
paramtype = 'light',
|
paramtype = 'light',
|
||||||
@ -207,7 +207,7 @@ for i in ipairs(materials) do
|
|||||||
else
|
else
|
||||||
minetest.env:add_node(above, {name = 'homedecor:'..m..'_table_small_round_b'})
|
minetest.env:add_node(above, {name = 'homedecor:'..m..'_table_small_round_b'})
|
||||||
end
|
end
|
||||||
if not minetest.setting_getbool("creative_mode") or unified_inventory then
|
if not homedecor_expect_infinite_stacks then
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
@ -334,7 +334,7 @@ for i in ipairs(materials) do
|
|||||||
else
|
else
|
||||||
minetest.env:add_node(above, {name = 'homedecor:'..m..'_table_large_b'})
|
minetest.env:add_node(above, {name = 'homedecor:'..m..'_table_large_b'})
|
||||||
end
|
end
|
||||||
if not minetest.setting_getbool("creative_mode") or unified_inventory then
|
if not homedecor_expect_infinite_stacks then
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
@ -371,6 +371,7 @@ for i in ipairs(materials) do
|
|||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = { -0.5, 0.4375, -0.5, 0.5, 0.5, 0.5 },
|
fixed = { -0.5, 0.4375, -0.5, 0.5, 0.5, 0.5 },
|
||||||
},
|
},
|
||||||
|
drop = 'homedecor:'..m..'_table_large_b'
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node('homedecor:'..m..'_table_large_s', {
|
minetest.register_node('homedecor:'..m..'_table_large_s', {
|
||||||
@ -400,6 +401,7 @@ for i in ipairs(materials) do
|
|||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = { -0.5, -0.5, 0.4375, 0.5, 0.5, 0.5 },
|
fixed = { -0.5, -0.5, 0.4375, 0.5, 0.5, 0.5 },
|
||||||
},
|
},
|
||||||
|
drop = 'homedecor:'..m..'_table_large_b'
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_alias('homedecor:'..m..'_table_large', 'homedecor:'..m..'_table_large_b')
|
minetest.register_alias('homedecor:'..m..'_table_large', 'homedecor:'..m..'_table_large_b')
|
||||||
|
Loading…
Reference in New Issue
Block a user