diff options
author | TenPlus1 <kinsellaja@yahoo.com> | 2015-07-05 10:54:18 +0100 |
---|---|---|
committer | TenPlus1 <kinsellaja@yahoo.com> | 2015-07-05 10:54:18 +0100 |
commit | 16cc62a1d4d7c02a84b2ddc1538f5e81404b415c (patch) | |
tree | 529f3a26bdc2d8e71427771e3516a334d9a9d909 /pumpkin.lua | |
parent | 6e4fa56475b4375655befc61ef868bd39a1f2a5d (diff) |
Code tidy and tweak
Diffstat (limited to 'pumpkin.lua')
-rw-r--r-- | pumpkin.lua | 100 |
1 files changed, 72 insertions, 28 deletions
diff --git a/pumpkin.lua b/pumpkin.lua index 5339290..60f0175 100644 --- a/pumpkin.lua +++ b/pumpkin.lua @@ -3,11 +3,18 @@ minetest.register_node("farming:pumpkin", { description = "Pumpkin", - tiles = {"farming_pumpkin_top.png", "farming_pumpkin_top.png", "farming_pumpkin_side.png"}, - groups = {choppy=1,oddly_breakable_by_hand=1,flammable=2,plant=1}, + tiles = { + "farming_pumpkin_top.png", + "farming_pumpkin_top.png", + "farming_pumpkin_side.png" + }, + groups = { + choppy = 1, oddly_breakable_by_hand = 1, + flammable = 2, plant = 1 + }, drop = { items = { - {items = {'farming:pumpkin_slice 9'},rarity=1}, + {items = {'farming:pumpkin_slice 9'}, rarity = 1}, } }, sounds = default.node_sound_wood_defaults(), @@ -41,9 +48,16 @@ minetest.register_craft({ -- Jack 'O Lantern minetest.register_node("farming:jackolantern", { description = "Jack 'O Lantern", - tiles = {"farming_pumpkin_top.png", "farming_pumpkin_top.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_face_off.png"}, + tiles = { + "farming_pumpkin_top.png", + "farming_pumpkin_top.png", + "farming_pumpkin_side.png", + "farming_pumpkin_side.png", + "farming_pumpkin_side.png", + "farming_pumpkin_face_off.png" + }, paramtype2 = "facedir", - groups = {choppy=1,oddly_breakable_by_hand=1,flammable=2}, + groups = {choppy = 1, oddly_breakable_by_hand = 1, flammable = 2}, sounds = default.node_sound_wood_defaults(), on_punch = function(pos, node, puncher) node.name = "farming:jackolantern_on" @@ -53,10 +67,17 @@ minetest.register_node("farming:jackolantern", { minetest.register_node("farming:jackolantern_on", { description = "Jack 'O Lantern", - tiles = {"farming_pumpkin_top.png", "farming_pumpkin_top.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_face_on.png"}, - light_source = 14, + tiles = { + "farming_pumpkin_top.png", + "farming_pumpkin_top.png", + "farming_pumpkin_side.png", + "farming_pumpkin_side.png", + "farming_pumpkin_side.png", + "farming_pumpkin_face_on.png" + }, + light_source = default.LIGHT_MAX - 1, paramtype2 = "facedir", - groups = {choppy=1,oddly_breakable_by_hand=1,flammable=2}, + groups = {choppy = 1, oddly_breakable_by_hand = 1, flammable = 2}, sounds = default.node_sound_wood_defaults(), drop = "farming:jackolantern", on_punch = function(pos, node, puncher) @@ -110,8 +131,11 @@ minetest.register_node("farming:pumpkin_1", { walkable = false, buildable_to = true, drop = "", - selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},}, - groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1}, + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, sounds = default.node_sound_leaves_defaults(), }) @@ -124,8 +148,11 @@ minetest.register_node("farming:pumpkin_2", { walkable = false, buildable_to = true, drop = "", - selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},}, - groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1}, + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory =1, growing = 1 + }, sounds = default.node_sound_leaves_defaults(), }) @@ -138,8 +165,11 @@ minetest.register_node("farming:pumpkin_3", { walkable = false, buildable_to = true, drop = "", - selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},}, - groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1}, + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, sounds = default.node_sound_leaves_defaults(), }) @@ -152,8 +182,11 @@ minetest.register_node("farming:pumpkin_4", { walkable = false, buildable_to = true, drop = "", - selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},}, - groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1}, + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, sounds = default.node_sound_leaves_defaults(), }) @@ -166,8 +199,11 @@ minetest.register_node("farming:pumpkin_5", { walkable = false, buildable_to = true, drop = "", - selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},}, - groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1}, + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, sounds = default.node_sound_leaves_defaults(), }) @@ -179,8 +215,11 @@ minetest.register_node("farming:pumpkin_6", { walkable = false, buildable_to = true, drop = "", - selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},}, - groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1}, + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, sounds = default.node_sound_leaves_defaults(), }) @@ -191,12 +230,15 @@ minetest.register_node("farming:pumpkin_7", { walkable = false, buildable_to = true, drop = "", - selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},}, - groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1}, + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, sounds = default.node_sound_leaves_defaults(), }) --- Last stage of Pumpkin growth does not have growing=1 so abm never has to check these +-- Last stage of growth does not have growing group so abm never checks these minetest.register_node("farming:pumpkin_8", { drawtype = "plantlike", @@ -204,13 +246,15 @@ minetest.register_node("farming:pumpkin_8", { paramtype = "light", walkable = false, buildable_to = true, - is_ground_content = true, drop = { items = { - {items = {'farming:pumpkin_slice 9'},rarity=1}, + {items = {'farming:pumpkin_slice 9'}, rarity = 1}, } }, - selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},}, - groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1}, + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1 + }, sounds = default.node_sound_defaults(), -}) +})
\ No newline at end of file |