forked from nalc/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
|
||||
|
||||
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").."/tables.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
|
||||
end
|
||||
|
||||
local unified_inventory = minetest.get_modpath("unified_inventory")
|
||||
|
||||
-- Yellow
|
||||
|
||||
minetest.register_node('homedecor:glowlight_thick_yellow', {
|
||||
|
@ -59,8 +57,7 @@ minetest.register_node('homedecor:glowlight_thick_yellow', {
|
|||
else
|
||||
minetest.env:add_node(above, {name = 'homedecor:glowlight_thick_yellow'})
|
||||
end
|
||||
print("get_stack_max() of homedecor:glowlight_thick_yellow = "..itemstack:get_stack_max())
|
||||
if not minetest.setting_getbool("creative_mode") or unified_inventory then
|
||||
if not homedecor_expect_infinite_stacks then
|
||||
itemstack:take_item()
|
||||
return itemstack
|
||||
end
|
||||
|
@ -114,7 +111,7 @@ minetest.register_node('homedecor:glowlight_thick_yellow_wall', {
|
|||
else
|
||||
minetest.env:add_node(above, {name = 'homedecor:glowlight_thick_yellow'})
|
||||
end
|
||||
if not minetest.setting_getbool("creative_mode") or unified_inventory then
|
||||
if not homedecor_expect_infinite_stacks then
|
||||
itemstack:take_item()
|
||||
return itemstack
|
||||
end
|
||||
|
@ -169,7 +166,7 @@ minetest.register_node('homedecor:glowlight_thin_yellow', {
|
|||
else
|
||||
minetest.env:add_node(above, {name = 'homedecor:glowlight_thin_yellow'})
|
||||
end
|
||||
if not minetest.setting_getbool("creative_mode") or unified_inventory then
|
||||
if not homedecor_expect_infinite_stacks then
|
||||
itemstack:take_item()
|
||||
return itemstack
|
||||
end
|
||||
|
@ -223,7 +220,7 @@ minetest.register_node('homedecor:glowlight_thin_yellow_wall', {
|
|||
else
|
||||
minetest.env:add_node(above, {name = 'homedecor:glowlight_thin_yellow'})
|
||||
end
|
||||
if not minetest.setting_getbool("creative_mode") or unified_inventory then
|
||||
if not homedecor_expect_infinite_stacks then
|
||||
itemstack:take_item()
|
||||
return itemstack
|
||||
end
|
||||
|
@ -278,7 +275,7 @@ minetest.register_node('homedecor:glowlight_small_cube_yellow', {
|
|||
else
|
||||
minetest.env:add_node(above, {name = 'homedecor:glowlight_small_cube_yellow'})
|
||||
end
|
||||
if not minetest.setting_getbool("creative_mode") or unified_inventory then
|
||||
if not homedecor_expect_infinite_stacks then
|
||||
itemstack:take_item()
|
||||
return itemstack
|
||||
end
|
||||
|
@ -327,11 +324,11 @@ minetest.register_node('homedecor:glowlight_small_cube_yellow_ceiling', {
|
|||
if node.name ~= "air" then return end
|
||||
|
||||
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
|
||||
minetest.env:add_node(above, {name = 'homedecor:glowlight_small_cube_white'})
|
||||
minetest.env:add_node(above, {name = 'homedecor:glowlight_small_cube_yellow'})
|
||||
end
|
||||
if not minetest.setting_getbool("creative_mode") or unified_inventory then
|
||||
if not homedecor_expect_infinite_stacks then
|
||||
itemstack:take_item()
|
||||
return itemstack
|
||||
end
|
||||
|
@ -388,7 +385,7 @@ minetest.register_node('homedecor:glowlight_thick_white', {
|
|||
else
|
||||
minetest.env:add_node(above, {name = 'homedecor:glowlight_thick_white'})
|
||||
end
|
||||
if not minetest.setting_getbool("creative_mode") or unified_inventory then
|
||||
if not homedecor_expect_infinite_stacks then
|
||||
itemstack:take_item()
|
||||
return itemstack
|
||||
end
|
||||
|
@ -442,7 +439,7 @@ minetest.register_node('homedecor:glowlight_thick_white_wall', {
|
|||
else
|
||||
minetest.env:add_node(above, {name = 'homedecor:glowlight_thick_white'})
|
||||
end
|
||||
if not minetest.setting_getbool("creative_mode") or unified_inventory then
|
||||
if not homedecor_expect_infinite_stacks then
|
||||
itemstack:take_item()
|
||||
return itemstack
|
||||
end
|
||||
|
@ -497,7 +494,7 @@ minetest.register_node('homedecor:glowlight_thin_white', {
|
|||
else
|
||||
minetest.env:add_node(above, {name = 'homedecor:glowlight_thin_white'})
|
||||
end
|
||||
if not minetest.setting_getbool("creative_mode") or unified_inventory then
|
||||
if not homedecor_expect_infinite_stacks then
|
||||
itemstack:take_item()
|
||||
return itemstack
|
||||
end
|
||||
|
@ -551,7 +548,7 @@ minetest.register_node('homedecor:glowlight_thin_white_wall', {
|
|||
else
|
||||
minetest.env:add_node(above, {name = 'homedecor:glowlight_thin_white'})
|
||||
end
|
||||
if not minetest.setting_getbool("creative_mode") or unified_inventory then
|
||||
if not homedecor_expect_infinite_stacks then
|
||||
itemstack:take_item()
|
||||
return itemstack
|
||||
end
|
||||
|
@ -605,7 +602,7 @@ minetest.register_node('homedecor:glowlight_small_cube_white', {
|
|||
else
|
||||
minetest.env:add_node(above, {name = 'homedecor:glowlight_small_cube_white'})
|
||||
end
|
||||
if not minetest.setting_getbool("creative_mode") or unified_inventory then
|
||||
if not homedecor_expect_infinite_stacks then
|
||||
itemstack:take_item()
|
||||
return itemstack
|
||||
end
|
||||
|
@ -658,7 +655,7 @@ minetest.register_node('homedecor:glowlight_small_cube_white_ceiling', {
|
|||
else
|
||||
minetest.env:add_node(above, {name = 'homedecor:glowlight_small_cube_white'})
|
||||
end
|
||||
if not minetest.setting_getbool("creative_mode") or unified_inventory then
|
||||
if not homedecor_expect_infinite_stacks then
|
||||
itemstack:take_item()
|
||||
return itemstack
|
||||
end
|
||||
|
|
16
tables.lua
16
tables.lua
|
@ -79,7 +79,7 @@ for i in ipairs(materials) do
|
|||
else
|
||||
minetest.env:add_node(above, {name = 'homedecor:'..m..'_table_small_square_b'})
|
||||
end
|
||||
if not minetest.setting_getbool("creative_mode") or unified_inventory then
|
||||
if not homedecor_expect_infinite_stacks then
|
||||
itemstack:take_item()
|
||||
return itemstack
|
||||
end
|
||||
|
@ -125,12 +125,12 @@ for i in ipairs(materials) do
|
|||
description = S(d.." Table (Small, Square)"),
|
||||
drawtype = 'nodebox',
|
||||
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_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,
|
||||
paramtype = 'light',
|
||||
|
@ -207,7 +207,7 @@ for i in ipairs(materials) do
|
|||
else
|
||||
minetest.env:add_node(above, {name = 'homedecor:'..m..'_table_small_round_b'})
|
||||
end
|
||||
if not minetest.setting_getbool("creative_mode") or unified_inventory then
|
||||
if not homedecor_expect_infinite_stacks then
|
||||
itemstack:take_item()
|
||||
return itemstack
|
||||
end
|
||||
|
@ -334,7 +334,7 @@ for i in ipairs(materials) do
|
|||
else
|
||||
minetest.env:add_node(above, {name = 'homedecor:'..m..'_table_large_b'})
|
||||
end
|
||||
if not minetest.setting_getbool("creative_mode") or unified_inventory then
|
||||
if not homedecor_expect_infinite_stacks then
|
||||
itemstack:take_item()
|
||||
return itemstack
|
||||
end
|
||||
|
@ -371,6 +371,7 @@ for i in ipairs(materials) do
|
|||
type = "fixed",
|
||||
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', {
|
||||
|
@ -400,6 +401,7 @@ for i in ipairs(materials) do
|
|||
type = "fixed",
|
||||
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')
|
||||
|
|
Loading…
Reference in New Issue
Block a user