diff options
author | 4Evergreen4 <eljohnson@frontier.com> | 2013-06-21 11:36:55 -0400 |
---|---|---|
committer | 4Evergreen4 <eljohnson@frontier.com> | 2013-06-21 11:36:55 -0400 |
commit | bf6d461b5f8a90b25cd16eea9d36339968a4fb7d (patch) | |
tree | 4ca2ddf0987b9333e098c89c983c4d56952a7220 | |
parent | 2e61072bd90e448a6f8fd6517cfa8a6671ec7244 (diff) |
Added the ability to throw things inside of the trash can(tanks to Zeg9)
-rw-r--r-- | init.lua | 47 |
1 files changed, 31 insertions, 16 deletions
@@ -1,3 +1,5 @@ +--Node Registration + minetest.register_node("trash_can:trash_can_wooden",{ groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3}, tiles = {"trash_can_wooden_top.png", "trash_can_wooden_top.png", "trash_can_wooden.png"}, @@ -54,6 +56,8 @@ minetest.register_node("trash_can:trash_can_wooden",{ end, }) +--Crafting + minetest.register_craft({ output = 'trash_can:trash_can_wooden', recipe = { @@ -63,20 +67,31 @@ minetest.register_craft({ } }) +--Throw In Trash Can Code + +local old_on_step = minetest.registered_entities["__builtin:item"].on_step +minetest.registered_entities["__builtin:item"].on_step = function(self, dtime) + if minetest.env:get_node(self.object:getpos()).name == "trash_can:trash_can_wooden" then + self.object:remove() + return + end + old_on_step(self, dtime) +end + --Unused stuff -minetest.register_node("trash_can:trash_can_full",{ - groups = {choppy=2}, - tiles = {"default_wood.png"}, - drawtype="nodebox", - paramtype = "light", - node_box = { - type = "fixed", - fixed = { - {-0.375000,-0.500000,0.312500,0.375000,0.500000,0.375000}, --NodeBox 1 - {0.312500,-0.500000,-0.375000,0.375000,0.500000,0.375000}, --NodeBox 2 - {-0.375000,-0.500000,-0.375000,0.375000,0.500000,-0.312500}, --NodeBox 3 - {-0.375000,-0.500000,-0.375000,-0.312500,0.500000,0.375000}, --NodeBox 4 - {-0.312500,-0.500000,-0.312500,0.312500,0.375000,0.312500}, --NodeBox 5 - } - } -})
\ No newline at end of file +--minetest.register_node("trash_can:trash_can_full",{ +-- groups = {choppy=2}, +-- tiles = {"default_wood.png"}, +-- drawtype="nodebox", +-- paramtype = "light", +-- node_box = { +-- type = "fixed", +-- fixed = { +-- {-0.375000,-0.500000,0.312500,0.375000,0.500000,0.375000}, --NodeBox 1 +-- {0.312500,-0.500000,-0.375000,0.375000,0.500000,0.375000}, --NodeBox 2 +-- {-0.375000,-0.500000,-0.375000,0.375000,0.500000,-0.312500}, --NodeBox 3 +-- {-0.375000,-0.500000,-0.375000,-0.312500,0.500000,0.375000}, --NodeBox 4 +-- {-0.312500,-0.500000,-0.312500,0.312500,0.375000,0.312500}, --NodeBox 5 +-- } +-- } +--})
\ No newline at end of file |