forked from VoxeLibre/VoxeLibre
Fix merge / rebase crossing massacre.
[Michieal]83bc60722d
Begin: make bamboo dig-able by Pistons for Farm Creation. [Michieal]449cbdb330
Make Bamboo & Bamboo items not sticky for pistons. [Michieal]a44566f863
hijack the ABM to check for orphaned bamboo nodes. [Michieal]5dff9e1994
Fixed the ABM situation so that now bamboo "breaks" when pushed by pistons. Probably not the most elegant, but hey. It works. [Michieal]76507025d9
Cleaned up the global function to match the current ABM. [Michieal]dfa849e19a
Merge branch 'master' into Bamboo-Piston-Dig [Michieal]a5bdc8a166
fix bamboo mosaic recipe. [Michieal]14383d6c6f
update mod.conf to use optional depends mesecons_mvps [Michieal]f81d530912
Update init.lua to register dropper callback.
This commit is contained in:
parent
3c13ce1d6b
commit
6c0525f00e
|
@ -477,6 +477,19 @@ mesecon.register_mvps_unsticky("mcl_colorblocks:glazed_terracotta_black")
|
|||
mesecon.register_mvps_unsticky("mcl_colorblocks:glazed_terracotta_brown")
|
||||
mesecon.register_mvps_unsticky("mcl_colorblocks:glazed_terracotta_light_blue")
|
||||
mesecon.register_mvps_unsticky("mcl_colorblocks:glazed_terracotta_pink")
|
||||
-- Bamboo
|
||||
mesecon.register_mvps_unsticky("mcl_bamboo:bamboo")
|
||||
mesecon.register_mvps_unsticky("mcl_bamboo:bamboo_endcap")
|
||||
|
||||
mesecon.register_mvps_unsticky("mcl_bamboo:bamboo_1")
|
||||
mesecon.register_mvps_unsticky("mcl_bamboo:bamboo_2")
|
||||
mesecon.register_mvps_unsticky("mcl_bamboo:bamboo_3")
|
||||
|
||||
mesecon.register_mvps_unsticky("mcl_bamboo:bamboo_door")
|
||||
mesecon.register_mvps_unsticky("mcl_bamboo:bamboo_trapdoor")
|
||||
mesecon.register_mvps_unsticky("mcl_signs:wall_sign_bamboo")
|
||||
mesecon.register_mvps_unsticky("mcl_bamboo:scaffolding")
|
||||
|
||||
-- Beds
|
||||
mesecon.register_mvps_unsticky("mcl_beds:bed_black_top")
|
||||
mesecon.register_mvps_unsticky("mcl_beds:bed_black_bottom")
|
||||
|
|
|
@ -29,7 +29,7 @@ local bamboo_def = {
|
|||
tiles = {"mcl_bamboo_bamboo_bottom.png", "mcl_bamboo_bamboo_bottom.png", "mcl_bamboo_bamboo.png"},
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
groups = {handy = 1, axey = 1, choppy = 1, flammable = 3},
|
||||
groups = {handy = 1, axey = 1, choppy = 1, dig_by_piston = 1, plant = 1, non_mycelium_plant = 1, flammable = 3},
|
||||
sounds = node_sound,
|
||||
|
||||
drop = {
|
||||
|
@ -293,7 +293,6 @@ local bamboo_block_def = {
|
|||
|
||||
return minetest.item_place(itemstack, placer, pointed_thing, minetest.dir_to_facedir(vector.direction(pointed_thing.above, pointed_thing.under)))
|
||||
end,
|
||||
|
||||
}
|
||||
|
||||
minetest.register_node("mcl_bamboo:bamboo_block", bamboo_block_def)
|
||||
|
|
|
@ -279,7 +279,7 @@ minetest.register_node(SCAFFOLDING_NAME, {
|
|||
climbable = true,
|
||||
physical = true,
|
||||
node_placement_prediction = "",
|
||||
groups = {handy = 1, axey = 1, flammable = 3, building_block = 1, material_wood = 1, fire_encouragement = 5, fire_flammability = 20, falling_node = 1, stack_falling = 1},
|
||||
groups = { handy = 1, axey = 1, flammable = 3, building_block = 1, material_wood = 1, fire_encouragement = 5, fire_flammability = 20, dig_by_piston = 1, falling_node = 1, stack_falling = 1 },
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
_mcl_blast_resistance = 0,
|
||||
_mcl_hardness = 0,
|
||||
|
|
|
@ -67,6 +67,31 @@ end
|
|||
|
||||
local BAMBOO_ENDCAP_NAME = "mcl_bamboo:bamboo_endcap"
|
||||
|
||||
-- For when I learn more about the pistons...
|
||||
function mcl_bamboo.break_orphaned(pos)
|
||||
local node_below = minetest.get_node(vector.offset(pos, 0, -1, 0))
|
||||
local node_name = node_below.name
|
||||
|
||||
-- short circuit checks.
|
||||
if mcl_bamboo.is_dirt(node_name) or mcl_bamboo.is_bamboo(node_name) or mcl_bamboo.is_bamboo(minetest.get_node(pos).name) == false then
|
||||
return
|
||||
end
|
||||
|
||||
-- dig the node.
|
||||
minetest.remove_node(pos) -- if that fails, remove the node
|
||||
local istack = ItemStack("mcl_bamboo:bamboo")
|
||||
local sound_params = {
|
||||
pos = pos,
|
||||
gain = 1.0, -- default
|
||||
max_hear_distance = 10, -- default, uses a Euclidean metric
|
||||
}
|
||||
|
||||
minetest.remove_node(pos)
|
||||
minetest.sound_play(mcl_sounds.node_sound_wood_defaults().dug, sound_params, true)
|
||||
minetest.add_item(pos, istack)
|
||||
end
|
||||
--]]
|
||||
|
||||
function mcl_bamboo.grow_bamboo(pos, bonemeal_applied)
|
||||
local node_above = minetest.get_node(vector.offset(pos, 0, 1, 0))
|
||||
mcl_bamboo.mcl_log("Grow bamboo called; bonemeal: " .. tostring(bonemeal_applied))
|
||||
|
|
|
@ -26,6 +26,7 @@ dofile(minetest.get_modpath(modname) .. "/recipes.lua")
|
|||
|
||||
--ABMs
|
||||
minetest.register_abm({
|
||||
label = "Bamboo Grow",
|
||||
nodenames = mcl_bamboo.bamboo_index,
|
||||
interval = 10,
|
||||
chance = 20,
|
||||
|
@ -34,6 +35,24 @@ minetest.register_abm({
|
|||
end,
|
||||
})
|
||||
|
||||
if minetest.get_modpath("mesecons_mvps") then
|
||||
if mesecons_mvps then
|
||||
for x = 1, #mcl_bamboo.bamboo_index do
|
||||
mesecon.register_mvps_dropper(mcl_bamboo.bamboo_index[x], mcl_bamboo.break_orphaned)
|
||||
end
|
||||
end
|
||||
else
|
||||
minetest.register_abm({
|
||||
label = "Break Orphaned Bamboo",
|
||||
nodenames = mcl_bamboo.bamboo_index,
|
||||
interval = 1.5,
|
||||
chance = 1,
|
||||
action = function(pos, _)
|
||||
mcl_bamboo.break_orphaned(pos)
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
-- Base Aliases.
|
||||
local SCAFFOLDING_NAME = "mcl_bamboo:scaffolding"
|
||||
minetest.register_alias("bamboo_block", "mcl_bamboo:bamboo_block")
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
name = mcl_bamboo
|
||||
depends = mcl_core, mcl_sounds, mcl_tools
|
||||
optional_depends = mcl_flowerpots, mclx_stairs, mcl_doors, mcl_signs, mesecons_pressureplates, mcl_fences, mesecons_button
|
||||
optional_depends = mcl_flowerpots, mclx_stairs, mcl_doors, mcl_signs, mesecons_pressureplates, mcl_fences, mesecons_button, mesecons_mvps
|
||||
author = Michieal
|
|
@ -45,8 +45,8 @@ minetest.register_craft({
|
|||
minetest.register_craft({
|
||||
output = BAMBOO .. "_mosaic",
|
||||
recipe = {
|
||||
{"mcl_stair:slab_bamboo_plank"},
|
||||
{"mcl_stair:slab_bamboo_plank"},
|
||||
{"mcl_stairs:slab_bamboo_plank"},
|
||||
{"mcl_stairs:slab_bamboo_plank"},
|
||||
}
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue