Skip to content

Commit

Permalink
[blocks.lua] Cactus and sugar canes now breaks the blocks above when …
Browse files Browse the repository at this point in the history
…broken.
  • Loading branch information
Unarelith committed Mar 29, 2020
1 parent 2ecef2d commit 5072afd
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion mods/default/blocks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,12 @@ mod:block {

draw_type = "cactus",
bounding_box = {1/16, 1/16, 0, 14/16, 14/16, 1};

on_block_destroyed = function(pos, world)
if world:get_block(pos.x, pos.y, pos.z + 1) == world:get_block(pos.x, pos.y, pos.z) then
world:set_block(pos.x, pos.y, pos.z + 1, 0)
end
end,
}

mod:block {
Expand Down Expand Up @@ -280,9 +286,16 @@ mod:block {
id = "reeds",
name = "Sugar Canes",
tiles = "reeds.png",
inventory_image = "reeds_item.png",

draw_type = "xshape",
hardness = 0.2,
inventory_image = "reeds_item.png"

on_block_destroyed = function(pos, world)
if world:get_block(pos.x, pos.y, pos.z + 1) == world:get_block(pos.x, pos.y, pos.z) then
world:set_block(pos.x, pos.y, pos.z + 1, 0)
end
end,
}

mod:block {
Expand Down

0 comments on commit 5072afd

Please sign in to comment.