1
0
Fork 0

Merge pull request 'Bamboo Piston Fix.' (#3424) from Bamboo_Piston_fix into master

Reviewed-on: MineClone2/MineClone2#3424
Reviewed-by: ancientmarinerdev <ancientmariner_dev@proton.me>
This commit is contained in:
ancientmarinerdev 2023-02-10 03:49:40 +00:00
commit 6b8226dae3
7 changed files with 109 additions and 38 deletions

View File

@ -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_brown")
mesecon.register_mvps_unsticky("mcl_colorblocks:glazed_terracotta_light_blue") mesecon.register_mvps_unsticky("mcl_colorblocks:glazed_terracotta_light_blue")
mesecon.register_mvps_unsticky("mcl_colorblocks:glazed_terracotta_pink") 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 -- Beds
mesecon.register_mvps_unsticky("mcl_beds:bed_black_top") mesecon.register_mvps_unsticky("mcl_beds:bed_black_top")
mesecon.register_mvps_unsticky("mcl_beds:bed_black_bottom") mesecon.register_mvps_unsticky("mcl_beds:bed_black_bottom")

View File

@ -29,7 +29,7 @@ local bamboo_def = {
tiles = {"mcl_bamboo_bamboo_bottom.png", "mcl_bamboo_bamboo_bottom.png", "mcl_bamboo_bamboo.png"}, tiles = {"mcl_bamboo_bamboo_bottom.png", "mcl_bamboo_bamboo_bottom.png", "mcl_bamboo_bamboo.png"},
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", 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, sounds = node_sound,
drop = { 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))) return minetest.item_place(itemstack, placer, pointed_thing, minetest.dir_to_facedir(vector.direction(pointed_thing.above, pointed_thing.under)))
end, end,
} }
minetest.register_node("mcl_bamboo:bamboo_block", bamboo_block_def) minetest.register_node("mcl_bamboo:bamboo_block", bamboo_block_def)

View File

@ -279,7 +279,7 @@ minetest.register_node(SCAFFOLDING_NAME, {
climbable = true, climbable = true,
physical = true, physical = true,
node_placement_prediction = "", 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(), sounds = mcl_sounds.node_sound_wood_defaults(),
_mcl_blast_resistance = 0, _mcl_blast_resistance = 0,
_mcl_hardness = 0, _mcl_hardness = 0,

View File

@ -67,6 +67,32 @@ end
local BAMBOO_ENDCAP_NAME = "mcl_bamboo:bamboo_endcap" local BAMBOO_ENDCAP_NAME = "mcl_bamboo:bamboo_endcap"
-- For when I learn more about the pistons...
function mcl_bamboo.break_orphaned(pos)
mcl_bamboo.mcl_log("Break_Orphaned called.")
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) function mcl_bamboo.grow_bamboo(pos, bonemeal_applied)
local node_above = minetest.get_node(vector.offset(pos, 0, 1, 0)) local node_above = minetest.get_node(vector.offset(pos, 0, 1, 0))
mcl_bamboo.mcl_log("Grow bamboo called; bonemeal: " .. tostring(bonemeal_applied)) mcl_bamboo.mcl_log("Grow bamboo called; bonemeal: " .. tostring(bonemeal_applied))

View File

@ -26,6 +26,7 @@ dofile(minetest.get_modpath(modname) .. "/recipes.lua")
--ABMs --ABMs
minetest.register_abm({ minetest.register_abm({
label = "Bamboo Grow",
nodenames = mcl_bamboo.bamboo_index, nodenames = mcl_bamboo.bamboo_index,
interval = 10, interval = 10,
chance = 20, chance = 20,
@ -34,6 +35,38 @@ minetest.register_abm({
end, end,
}) })
--[[ TODO: Figure out how to make this work:
local function dropper_call(node, pushdir, stack, stackid)
mcl_bamboo.mcl_log("mvps_dropper call for bamboo:")
-- mcl_bamboo.break_orphaned()
mcl_bamboo.mcl_log(dump(node))
end
if minetest.get_modpath("mesecons_mvps") then
if mesecon then
mcl_bamboo.mcl_log("registering mvps_dropper for bamboo:")
for x = 1, #mcl_bamboo.bamboo_index do
mesecon.register_mvps_dropper(mcl_bamboo.bamboo_index[x],dropper_call)
mcl_bamboo.mcl_log("registering: " .. mcl_bamboo.bamboo_index[x])
end
end
else
end
--]]
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,
})
-- Base Aliases. -- Base Aliases.
local SCAFFOLDING_NAME = "mcl_bamboo:scaffolding" local SCAFFOLDING_NAME = "mcl_bamboo:scaffolding"
minetest.register_alias("bamboo_block", "mcl_bamboo:bamboo_block") minetest.register_alias("bamboo_block", "mcl_bamboo:bamboo_block")

View File

@ -1,4 +1,4 @@
name = mcl_bamboo name = mcl_bamboo
depends = mcl_core, mcl_sounds, mcl_tools 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 author = Michieal

View File

@ -45,8 +45,8 @@ minetest.register_craft({
minetest.register_craft({ minetest.register_craft({
output = BAMBOO .. "_mosaic", output = BAMBOO .. "_mosaic",
recipe = { recipe = {
{"mcl_stair:slab_bamboo_plank"}, {"mcl_stairs:slab_bamboo_plank"},
{"mcl_stair:slab_bamboo_plank"}, {"mcl_stairs:slab_bamboo_plank"},
} }
}) })