aboutsummaryrefslogtreecommitdiff
path: root/redefinitions.lua
diff options
context:
space:
mode:
authorCalinou <calinou@opmbx.org>2014-03-09 10:38:18 +0100
committerCalinou <calinou@opmbx.org>2014-03-09 10:38:18 +0100
commit8337a6c192b9961f8947767690c13951696c3c1e (patch)
tree77908db80dd8f13b494030203be725e03f96bea8 /redefinitions.lua
parent396945ed3eaf43404bd117bbf4820ce08584cc4e (diff)
downloadmoreblocks-8337a6c192b9961f8947767690c13951696c3c1e.tar.gz
moreblocks-8337a6c192b9961f8947767690c13951696c3c1e.tar.bz2
moreblocks-8337a6c192b9961f8947767690c13951696c3c1e.zip
Merge ShadowNinja's rewrite.
Diffstat (limited to 'redefinitions.lua')
-rw-r--r--redefinitions.lua189
1 files changed, 26 insertions, 163 deletions
diff --git a/redefinitions.lua b/redefinitions.lua
index 07a28bc..f3aec3d 100644
--- a/redefinitions.lua
+++ b/redefinitions.lua
@@ -70,203 +70,66 @@ minetest.register_craft({
-- Redefinitions of some default nodes
-minetest.register_node(":default:ladder", {
- description = "Ladder",
- drawtype = "signlike",
- tiles = {"default_ladder.png"},
- inventory_image = "default_ladder.png",
- wield_image = "default_ladder.png",
- paramtype = "light",
- sunlight_propagates = true,
- paramtype2 = "wallmounted",
- walkable = false,
- climbable = true,
- selection_box = {
- type = "wallmounted",
- },
- groups = {snappy=1,choppy=2,oddly_breakable_by_hand=3,flammable=2},
- legacy_wallmounted = true,
- sounds = default.node_sound_wood_defaults(),
-})
+-- Don't bother overriding nodes if minetest.override_item isn't available
+if minetest.override_item then
-if wood_facedir == true
-then
-minetest.register_node(":default:wood", {
- description = "Wooden Planks",
- tiles = {"default_wood.png"},
- paramtype2 = "facedir",
- groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
- sounds = default.node_sound_wood_defaults(),
-})
+if moreblocks.config.wood_facedir then
+ minetest.override_item("default:wood", {
+ paramtype2 = "facedir",
+ })
end
-minetest.register_node(":default:sapling", {
- description = "Sapling",
- drawtype = "plantlike",
- visual_scale = 1.0,
- tiles = {"default_sapling.png"},
- inventory_image = "default_sapling.png",
- wield_image = "default_sapling.png",
+-- Let there be light!
+
+minetest.override_item("default:ladder", {
paramtype = "light",
sunlight_propagates = true,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
- },
- groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1},
- sounds = default.node_sound_defaults(),
})
-minetest.register_node(":default:dry_shrub", {
- description = "Dry Shrub",
- drawtype = "plantlike",
- visual_scale = 1.0,
- tiles = {"default_dry_shrub.png"},
- inventory_image = "default_dry_shrub.png",
- wield_image = "default_dry_shrub.png",
+minetest.override_item("default:sapling", {
paramtype = "light",
sunlight_propagates = true,
- walkable = false,
- groups = {snappy=3,flammable=3,attached_node=1},
- sounds = default.node_sound_leaves_defaults(),
- selection_box = {
- type = "fixed",
- fixed = {-1/3, -1/2, -1/3, 1/3, 1/6, 1/3},
- },
})
-minetest.register_node(":default:papyrus", {
- description = "Papyrus",
- drawtype = "plantlike",
- tiles = {"default_papyrus.png"},
- inventory_image = "default_papyrus.png",
- wield_image = "default_papyrus.png",
+minetest.override_item("default:dry_shrub", {
paramtype = "light",
sunlight_propagates = true,
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
- },
- groups = {snappy=3,flammable=2},
- sounds = default.node_sound_leaves_defaults(),
})
-minetest.register_node(":default:fence_wood", {
- description = "Wooden Fence",
- drawtype = "fencelike",
- tiles = {"default_wood.png"},
- inventory_image = "default_fence.png",
- wield_image = "default_fence.png",
+minetest.override_item("default:papyrus", {
paramtype = "light",
sunlight_propagates = true,
- selection_box = {
- type = "fixed",
- fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7},
- },
- groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2},
- sounds = default.node_sound_wood_defaults(),
})
-minetest.register_node(":default:junglegrass", {
- description = "Jungle Grass",
- drawtype = "plantlike",
- visual_scale = 1.3,
- tiles = {"default_junglegrass.png"},
- inventory_image = "default_junglegrass.png",
- wield_image = "default_junglegrass.png",
+minetest.override_item("default:fence_wood", {
paramtype = "light",
- walkable = false,
- buildable_to = true,
- is_ground_content = true,
sunlight_propagates = true,
- drop = {
- max_items = 1,
- items = {
- {items = {'farming:seed_cotton'},rarity = 8},
- {items = {'default:junglegrass'}},
- }
- },
- groups = {snappy=3,flammable=2,flora=1,attached_node=1},
- sounds = default.node_sound_leaves_defaults(),
- selection_box = {
- type = "fixed",
- fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
- },
})
-minetest.register_node(":default:junglesapling", {
- description = "Jungle Sapling",
- drawtype = "plantlike",
+minetest.override_item("default:junglegrass", {
+ paramtype = "light",
sunlight_propagates = true,
- tiles = {"default_junglesapling.png"},
+})
+
+minetest.override_item("default:junglesapling", {
paramtype = "light",
- walkable = false,
- selection_box = {
- type = "fixed",
- fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
- },
- groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1},
- sounds = default.node_sound_defaults(),
+ sunlight_propagates = true,
})
-minetest.register_node(":default:grass_1", {
- description = "Grass",
- drawtype = "plantlike",
- tiles = {"default_grass_1.png"},
- -- use a bigger inventory image
+minetest.override_item("default:grass_1", {
+ -- Use a bigger inventory image
inventory_image = "default_grass_3.png",
wield_image = "default_grass_3.png",
paramtype = "light",
sunlight_propagates = true,
- walkable = false,
- buildable_to = true,
- drop = {
- max_items = 1,
- items = {
- {items = {'farming:seed_wheat'},rarity = 5},
- {items = {'default:grass_1'}},
- }
- },
- groups = {snappy=3,flammable=3,flora=1,attached_node=1},
- sounds = default.node_sound_leaves_defaults(),
- selection_box = {
- type = "fixed",
- fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
- },
- on_place = function(itemstack, placer, pointed_thing)
- -- place a random grass node
- local stack = ItemStack("default:grass_"..math.random(1,5))
- local ret = minetest.item_place(stack, placer, pointed_thing)
- return ItemStack("default:grass_1 "..itemstack:get_count()-(1-ret:get_count()))
- end,
})
-for i=2,5 do
- minetest.register_node(":default:grass_"..i, {
- description = "Grass",
- drawtype = "plantlike",
- tiles = {"default_grass_"..i..".png"},
- inventory_image = "default_grass_"..i..".png",
- wield_image = "default_grass_"..i..".png",
+for i = 2, 5 do
+ minetest.override_item("default:grass_"..i, {
paramtype = "light",
sunlight_propagates = true,
- walkable = false,
- buildable_to = true,
- is_ground_content = true,
- drop = {
- max_items = 1,
- items = {
- {items = {'farming:seed_wheat'},rarity = 5},
- {items = {'default:grass_1'}},
- }
- },
- groups = {snappy=3,flammable=3,flora=1,attached_node=1,not_in_creative_inventory=1},
- sounds = default.node_sound_leaves_defaults(),
- selection_box = {
- type = "fixed",
- fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
- },
})
end
+
+end -- End if minetest.override_item
+