Fix toilet crashing

master
KaylebJay 2019-09-27 23:10:21 -06:00 committed by GitHub
parent ecb71dbac3
commit aedc8f0d65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 34 additions and 170 deletions

204
nodes.lua
View File

@ -1,4 +1,5 @@
--[[
Modifed: 28.09.2019 Sokomine (see README)
3D Forniture
Copyright 2012 Tonyka
@ -19,20 +20,13 @@
MA 02110-1301, USA.
Contributors:
InfinityProject
suggested creating bathroom kit.
cosarara97
code.
]]--
-- replacement
--nodes
-- Deco Home
@ -143,9 +137,15 @@
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}
})
--Table Lamp
minetest.register_node("3dforniture:table_lamp_off",
{ description = 'Table Lamp',
lamp_states = {"off", "low", "med", "hi", "max"}
light_level = 0
-- not_in_creative_inventory will be set to this value (we only want the FIRST lamp there)
nocr = 0
for i, state in ipairs(lamp_states) do
minetest.register_node("3dforniture:table_lamp_"..state,
{ description = 'Table Lamp ('..state..')',
drawtype = "nodebox",
tiles = {
"forniture_table_lamp_s.png",
@ -178,165 +178,19 @@
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5,0.5, 0.5},
},
groups = {cracky=2,oddly_breakable_by_hand=1,},
drop = "3dforniture:table_lamp_off",
})
minetest.register_node("3dforniture:table_lamp_low",
{ description = 'Table Lamp',
drawtype = "nodebox",
tiles = {
"forniture_table_lamp_s.png",
"forniture_table_lamp_s.png",
"forniture_table_lamp_l.png",
},
paramtype = 'light',
paramtype2 == 'facedir',
node_box = {
type = "fixed",
fixed = {
--Lamp Base
{-0.15,-0.5,-0.15, 0.15,-0.45,0.15},
{-0.05,-0.45,-0.05, 0.05,-0.4,0.05},
{-0.025,-0.4,-0.025, 0.025,-0.1,0.025},
{-0.0125,-0.125,-0.2, 0.0125,-0.1,0.2},
{-0.2,-0.125,-0.0125, 0.2,-0.1,0.0125},
--Lamp Shade
{-0.2,-0.1,-0.2, -0.175,0.3,0.2},
{0.175,-0.1,-0.2, 0.2,0.3,0.2},
{-0.175,-0.1,-0.2, 0.175,0.3,-0.175},
{-0.175,-0.1,0.175, 0.175,0.3,0.2},
},
},
sunlight_propagates = true,
walkable = false,
light_source = 4,
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5,0.5, 0.5},
},
groups = {cracky=2,oddly_breakable_by_hand=1,},
drop = "3dforniture:table_lamp_off",
})
minetest.register_node("3dforniture:table_lamp_med",
{ description = 'Table Lamp',
drawtype = "nodebox",
tiles = {
"forniture_table_lamp_s.png",
"forniture_table_lamp_s.png",
"forniture_table_lamp_l.png",
},
paramtype = 'light',
paramtype2 == 'facedir',
node_box = {
type = "fixed",
fixed = {
--Lamp Base
{-0.15,-0.5,-0.15, 0.15,-0.45,0.15},
{-0.05,-0.45,-0.05, 0.05,-0.4,0.05},
{-0.025,-0.4,-0.025, 0.025,-0.1,0.025},
{-0.0125,-0.125,-0.2, 0.0125,-0.1,0.2},
{-0.2,-0.125,-0.0125, 0.2,-0.1,0.0125},
--Lamp Shade
{-0.2,-0.1,-0.2, -0.175,0.3,0.2},
{0.175,-0.1,-0.2, 0.2,0.3,0.2},
{-0.175,-0.1,-0.2, 0.175,0.3,-0.175},
{-0.175,-0.1,0.175, 0.175,0.3,0.2},
},
},
sunlight_propagates = true,
walkable = false,
light_source = 8,
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5,0.5, 0.5},
},
groups = {cracky=2,oddly_breakable_by_hand=1,},
drop = "3dforniture:table_lamp_off",
})
minetest.register_node("3dforniture:table_lamp_hi",
{ description = 'Table Lamp',
drawtype = "nodebox",
tiles = {
"forniture_table_lamp_s.png",
"forniture_table_lamp_s.png",
"forniture_table_lamp_l.png",
},
paramtype = 'light',
paramtype2 == 'facedir',
node_box = {
type = "fixed",
fixed = {
--Lamp Base
{-0.15,-0.5,-0.15, 0.15,-0.45,0.15},
{-0.05,-0.45,-0.05, 0.05,-0.4,0.05},
{-0.025,-0.4,-0.025, 0.025,-0.1,0.025},
{-0.0125,-0.125,-0.2, 0.0125,-0.1,0.2},
{-0.2,-0.125,-0.0125, 0.2,-0.1,0.0125},
--Lamp Shade
{-0.2,-0.1,-0.2, -0.175,0.3,0.2},
{0.175,-0.1,-0.2, 0.2,0.3,0.2},
{-0.175,-0.1,-0.2, 0.175,0.3,-0.175},
{-0.175,-0.1,0.175, 0.175,0.3,0.2},
},
},
sunlight_propagates = true,
walkable = false,
light_source = 12,
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5,0.5, 0.5},
},
groups = {cracky=2},
drop = "3dforniture:table_lamp_off",
})
minetest.register_node("3dforniture:table_lamp_max",
{ description = 'Table Lamp',
drawtype = "nodebox",
tiles = {
"forniture_table_lamp_s.png",
"forniture_table_lamp_s.png",
"forniture_table_lamp_l.png",
},
paramtype = 'light',
paramtype2 == 'facedir',
node_box = {
type = "fixed",
fixed = {
--Lamp Base
{-0.15,-0.5,-0.15, 0.15,-0.45,0.15},
{-0.05,-0.45,-0.05, 0.05,-0.4,0.05},
{-0.025,-0.4,-0.025, 0.025,-0.1,0.025},
{-0.0125,-0.125,-0.2, 0.0125,-0.1,0.2},
{-0.2,-0.125,-0.0125, 0.2,-0.1,0.0125},
--Lamp Shade
{-0.2,-0.1,-0.2, -0.175,0.3,0.2},
{0.175,-0.1,-0.2, 0.2,0.3,0.2},
{-0.175,-0.1,-0.2, 0.175,0.3,-0.175},
{-0.175,-0.1,0.175, 0.175,0.3,0.2},
},
},
sunlight_propagates = true,
walkable = false,
light_source = 16,
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5,0.5, 0.5},
},
groups = {cracky=2,oddly_breakable_by_hand=1,},
groups = {cracky=2,oddly_breakable_by_hand=1, not_in_creative_inventory=nocr},
drop = "3dforniture:table_lamp_off",
light_source = light_level,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
minetest.swap_node(pos,
{name="3dforniture:table_lamp_"..lamp_states[i%#lamp_states +1]})
end,
})
light_level = light_level + 4
nocr = 1
end
-- Bathroom Kit
@ -364,7 +218,10 @@
},
},
drop ="3dforniture:toilet",
groups = {cracky=3,}
groups = {cracky=3, not_in_creative_inventory=1},
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
minetest.swap_node(pos, {name="3dforniture:toilet_open", param2=node.param2})
end,
})
minetest.register_node("3dforniture:toilet_open",
@ -396,8 +253,15 @@
},
},
drop = "3dforniture:toilet",
groups = {cracky = 3,},
sounds = {dig = "3dforniture_dig_toilet", gain=0.5},
groups = {cracky = 3, not_in_creative_inventory=1},
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
minetest.swap_node(pos, {name="3dforniture:toilet", param2=node.param2})
minetest.sound_play("3dforniture_dig_toilet", {
pos=pos,
max_hear_distance = 10,
gain = 0.5,
})
end,
})
--Sink
@ -705,7 +569,7 @@
groups = {cracky=1}
})
--Torch Wakll
--Torch Wall
minetest.register_node("3dforniture:torch_wall",
{ description = 'Torch Wall',
drawtype = "nodebox",