2022-12-29 19:16:48 +01:00
|
|
|
---
|
|
|
|
--- Generated by EmmyLua(https://github.com/EmmyLua)
|
|
|
|
--- Created by michieal.
|
|
|
|
--- DateTime: 12/29/22 12:33 PM -- Restructure Date
|
2023-01-09 05:08:12 +01:00
|
|
|
--- Copyright (C) 2022 - 2023, Michieal. See License.txt
|
2022-12-29 19:16:48 +01:00
|
|
|
|
2023-01-06 23:40:35 +01:00
|
|
|
-- CONSTS
|
|
|
|
local DOUBLE_DROP_CHANCE = 8
|
|
|
|
-- Used everywhere. Often this is just the name, but it makes sense to me as BAMBOO, because that's how I think of it...
|
|
|
|
-- "BAMBOO" goes here.
|
|
|
|
local BAMBOO = "mcl_bamboo:bamboo"
|
|
|
|
local BAMBOO_ENDCAP_NAME = "mcl_bamboo:bamboo_endcap"
|
2023-01-07 00:07:30 +01:00
|
|
|
local BAMBOO_PLANK = BAMBOO .. "_plank"
|
2023-01-06 23:40:35 +01:00
|
|
|
|
2022-12-29 19:16:48 +01:00
|
|
|
-- LOCALS
|
|
|
|
local modname = minetest.get_current_modname()
|
|
|
|
local S = minetest.get_translator(modname)
|
|
|
|
local node_sound = mcl_sounds.node_sound_wood_defaults()
|
2023-01-03 07:38:12 +01:00
|
|
|
local pr = PseudoRandom((os.time() + 15766) * 12) -- switched from math.random() to PseudoRandom because the random wasn't very random.
|
2022-12-29 19:16:48 +01:00
|
|
|
|
2023-01-02 09:54:26 +01:00
|
|
|
local on_rotate
|
|
|
|
if minetest.get_modpath("screwdriver") then
|
|
|
|
on_rotate = screwdriver.disallow
|
|
|
|
end
|
|
|
|
|
2022-12-29 19:16:48 +01:00
|
|
|
-- basic bamboo nodes.
|
|
|
|
local bamboo_def = {
|
|
|
|
description = "Bamboo",
|
|
|
|
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},
|
|
|
|
sounds = node_sound,
|
|
|
|
|
|
|
|
drop = {
|
|
|
|
max_items = 1,
|
2023-01-07 00:07:30 +01:00
|
|
|
-- From the API:
|
|
|
|
-- max_items: Maximum number of item lists to drop.
|
2022-12-29 19:16:48 +01:00
|
|
|
-- The entries in 'items' are processed in order. For each:
|
|
|
|
-- Item filtering is applied, chance of drop is applied, if both are
|
|
|
|
-- successful the entire item list is dropped.
|
|
|
|
-- Entry processing continues until the number of dropped item lists
|
|
|
|
-- equals 'max_items'.
|
|
|
|
-- Therefore, entries should progress from low to high drop chance.
|
|
|
|
items = {
|
|
|
|
-- Examples:
|
|
|
|
{
|
2023-01-07 00:07:30 +01:00
|
|
|
-- 1 in DOUBLE_DROP_CHANCE chance of dropping.
|
2022-12-29 19:16:48 +01:00
|
|
|
-- Default rarity is '1'.
|
|
|
|
rarity = DOUBLE_DROP_CHANCE,
|
2023-01-06 23:40:35 +01:00
|
|
|
items = {BAMBOO .. " 2"},
|
2022-12-29 19:16:48 +01:00
|
|
|
},
|
|
|
|
{
|
2023-01-07 00:07:30 +01:00
|
|
|
-- 1 in 1 chance of dropping. (Note: this means that it will drop 100% of the time.)
|
2022-12-29 19:16:48 +01:00
|
|
|
-- Default rarity is '1'.
|
|
|
|
rarity = 1,
|
2023-01-06 23:40:35 +01:00
|
|
|
items = {BAMBOO},
|
2022-12-29 19:16:48 +01:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
inventory_image = "mcl_bamboo_bamboo_shoot.png",
|
|
|
|
wield_image = "mcl_bamboo_bamboo_shoot.png",
|
|
|
|
_mcl_blast_resistance = 1,
|
|
|
|
_mcl_hardness = 1.5,
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.175, -0.5, -0.195, 0.05, 0.5, 0.030},
|
|
|
|
}
|
|
|
|
},
|
2023-01-02 08:19:33 +01:00
|
|
|
collision_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.175, -0.5, -0.195, 0.05, 0.5, 0.030},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.175, -0.5, -0.195, 0.05, 0.5, 0.030},
|
|
|
|
}
|
|
|
|
},
|
2023-01-04 17:28:09 +01:00
|
|
|
node_placement_prediction = "",
|
2022-12-29 19:16:48 +01:00
|
|
|
|
2023-01-02 09:54:26 +01:00
|
|
|
on_rotate = on_rotate,
|
|
|
|
|
2022-12-29 19:16:48 +01:00
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
|
|
|
if pointed_thing.type ~= "node" then
|
|
|
|
return itemstack
|
|
|
|
end
|
|
|
|
local node = minetest.get_node(pointed_thing.under)
|
|
|
|
local pos = pointed_thing.under
|
2023-01-11 13:16:12 +01:00
|
|
|
local nodename = node.name -- intentional use of nodename.
|
2023-01-02 09:54:26 +01:00
|
|
|
|
2023-01-03 07:38:12 +01:00
|
|
|
mcl_bamboo.mcl_log("Node placement data:")
|
|
|
|
mcl_bamboo.mcl_log(dump(pointed_thing))
|
2023-01-06 23:40:35 +01:00
|
|
|
mcl_bamboo.mcl_log("node name: " .. nodename)
|
2022-12-29 19:16:48 +01:00
|
|
|
|
2023-01-03 07:38:12 +01:00
|
|
|
mcl_bamboo.mcl_log("Checking for protected placement of bamboo.")
|
2022-12-29 19:16:48 +01:00
|
|
|
if mcl_bamboo.is_protected(pos, placer) then
|
|
|
|
return
|
|
|
|
end
|
2023-01-03 07:38:12 +01:00
|
|
|
mcl_bamboo.mcl_log("placement of bamboo is not protected.")
|
|
|
|
|
2022-12-29 19:16:48 +01:00
|
|
|
-- Use pointed node's on_rightclick function first, if present
|
|
|
|
if placer and not placer:get_player_control().sneak then
|
|
|
|
if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].on_rightclick then
|
2023-01-11 13:16:12 +01:00
|
|
|
mcl_bamboo.mcl_log("Attempting targeted node's on_rightclick.")
|
2022-12-29 19:16:48 +01:00
|
|
|
return minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer, itemstack) or itemstack
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2023-01-06 23:40:35 +01:00
|
|
|
if mcl_bamboo.is_bamboo(nodename) == false and nodename ~= BAMBOO_ENDCAP_NAME then
|
2022-12-29 19:16:48 +01:00
|
|
|
-- not bamboo...
|
2023-01-11 13:16:12 +01:00
|
|
|
mcl_bamboo.mcl_log("not bamboo...")
|
2023-01-02 09:54:26 +01:00
|
|
|
if nodename ~= "mcl_flowerpots:flower_pot" then
|
2023-01-04 00:40:40 +01:00
|
|
|
if mcl_bamboo.is_dirt(nodename) == false then
|
|
|
|
mcl_bamboo.mcl_log("bamboo dirt node not found; node name: " .. nodename)
|
2023-01-03 07:38:12 +01:00
|
|
|
return
|
2022-12-29 19:16:48 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2023-01-03 07:38:12 +01:00
|
|
|
mcl_bamboo.mcl_log("placing bamboo directly.")
|
|
|
|
|
2023-01-03 04:36:09 +01:00
|
|
|
local dir = vector.subtract(pointed_thing.under, pointed_thing.above)
|
|
|
|
local wdir = minetest.dir_to_wallmounted(dir)
|
|
|
|
local fdir = minetest.dir_to_facedir(dir)
|
|
|
|
if wdir ~= 1 then
|
|
|
|
return
|
|
|
|
end
|
2023-01-02 08:19:33 +01:00
|
|
|
|
2023-01-03 21:57:58 +01:00
|
|
|
local place_item = ItemStack(itemstack) -- make a copy so that we don't indirectly mess with the original.
|
2023-01-04 00:40:40 +01:00
|
|
|
|
2023-01-11 13:16:12 +01:00
|
|
|
local bamboo_node = mcl_bamboo.is_bamboo(nodename) or 0
|
2023-01-06 23:40:35 +01:00
|
|
|
mcl_bamboo.mcl_log("node name: " .. nodename .. "\nbamboo_node: " .. bamboo_node)
|
2023-01-04 00:40:40 +01:00
|
|
|
|
2023-01-11 08:22:30 +01:00
|
|
|
local rand_height
|
|
|
|
local BAMBOO_MAX_HEIGHT = 16 -- maximum height of 16, per wiki.
|
|
|
|
local first_shoot
|
|
|
|
local meta
|
|
|
|
|
2023-01-11 13:16:12 +01:00
|
|
|
if bamboo_node and bamboo_node > 0 then
|
2023-01-04 00:40:40 +01:00
|
|
|
place_item = ItemStack(mcl_bamboo.bamboo_index[bamboo_node])
|
2023-01-11 00:48:03 +01:00
|
|
|
|
2023-01-11 08:22:30 +01:00
|
|
|
-- height check for placing bamboo nodes. because... lmfao bamboo stalk to the sky.
|
|
|
|
-- variables used in more than one spot.
|
|
|
|
local chk_pos
|
|
|
|
local node_name = ""
|
|
|
|
local dist = 0
|
|
|
|
local height = -1
|
|
|
|
|
|
|
|
local BAMBOO_SOIL_DIST = BAMBOO_MAX_HEIGHT * -1
|
|
|
|
-- -------------------
|
|
|
|
for py = -1, BAMBOO_SOIL_DIST, -1 do
|
|
|
|
chk_pos = vector.offset(pos, 0, py, 0)
|
|
|
|
node_name = minetest.get_node(chk_pos).name
|
|
|
|
if mcl_bamboo.is_dirt(node_name) then
|
|
|
|
first_shoot = vector.offset(chk_pos, 0, 1, 0)
|
2023-01-11 00:48:03 +01:00
|
|
|
break
|
2023-01-11 13:16:12 +01:00
|
|
|
end
|
|
|
|
if mcl_bamboo.is_bamboo(node_name) == false then
|
|
|
|
break
|
2023-01-11 00:48:03 +01:00
|
|
|
end
|
|
|
|
end
|
2023-01-11 08:22:30 +01:00
|
|
|
-- requires knowing where the soil node is.
|
|
|
|
if first_shoot == nil then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
meta = minetest.get_meta(first_shoot)
|
|
|
|
if meta then
|
|
|
|
height = meta:get_int("height", -1)
|
|
|
|
end
|
2023-01-11 00:48:03 +01:00
|
|
|
|
2023-01-11 08:22:30 +01:00
|
|
|
dist = vector.distance(first_shoot, pos) + 1 -- +1 for the ground offset.
|
|
|
|
mcl_bamboo.mcl_log("Distance: " .. dist .. " Height: " .. height .. " Bamboo to place: " .. mcl_bamboo.bamboo_index[bamboo_node])
|
|
|
|
-- okay, so don't go beyond max height...
|
|
|
|
-- Height is determined when the first node grows or is placed.
|
|
|
|
-- here, it's not found, so let them do 4-5 nodes up. (should help it grow.)
|
|
|
|
if dist < 5 and height < 5 then
|
|
|
|
-- allow
|
|
|
|
else
|
|
|
|
-- else, it's complicated.
|
|
|
|
if dist > 5 and height < 5 then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
2023-01-11 00:48:03 +01:00
|
|
|
|
2023-01-11 08:22:30 +01:00
|
|
|
if dist > height - 1 then
|
|
|
|
-- height found. here, we let them do it until they reach where the endcap will go.
|
|
|
|
return
|
|
|
|
end
|
|
|
|
else
|
|
|
|
local placed_type = pr:next(1, 4) -- randomly choose which one to place.
|
|
|
|
mcl_bamboo.mcl_log("Place_Bamboo_Shoot--Type: " .. placed_type)
|
|
|
|
place_item = ItemStack(mcl_bamboo.bamboo_index[placed_type])
|
|
|
|
rand_height = pr:next(BAMBOO_MAX_HEIGHT - 4, BAMBOO_MAX_HEIGHT)
|
2023-01-11 00:48:03 +01:00
|
|
|
end
|
|
|
|
|
2023-01-12 09:27:17 +01:00
|
|
|
local node_above_name = minetest.get_node(pointed_thing.above).name
|
2023-01-16 21:07:57 +01:00
|
|
|
mcl_bamboo.mcl_log("\n\n\nnode_above name: " .. node_above_name)
|
2023-01-12 09:47:13 +01:00
|
|
|
if node_above_name ~= "mcl_core:water_source" and node_above_name ~= "mcl_core:lava_source"
|
|
|
|
and node_above_name ~= "mcl_nether:nether_lava_source" then
|
2023-01-12 09:27:17 +01:00
|
|
|
local _, position = minetest.item_place(place_item, placer, pointed_thing, fdir)
|
|
|
|
if not minetest.is_creative_enabled(placer:get_player_name()) then
|
|
|
|
itemstack:take_item(1)
|
|
|
|
end
|
|
|
|
if rand_height and rand_height > 1 then
|
|
|
|
if position then
|
|
|
|
mcl_bamboo.mcl_log("Setting Height Data...")
|
|
|
|
meta = minetest.get_meta(position)
|
|
|
|
if meta then
|
|
|
|
meta:set_int("height", rand_height)
|
|
|
|
end
|
2023-01-11 13:16:12 +01:00
|
|
|
end
|
2023-01-11 08:22:30 +01:00
|
|
|
end
|
2023-01-12 09:27:17 +01:00
|
|
|
return itemstack, pointed_thing.under
|
|
|
|
else
|
|
|
|
return
|
2023-01-11 00:48:03 +01:00
|
|
|
end
|
2022-12-29 19:16:48 +01:00
|
|
|
end,
|
|
|
|
|
|
|
|
on_destruct = function(pos)
|
|
|
|
-- Node destructor; called before removing node.
|
|
|
|
local new_pos = vector.offset(pos, 0, 1, 0)
|
|
|
|
local node_above = minetest.get_node(new_pos)
|
2023-01-12 09:27:17 +01:00
|
|
|
local bamboo_node = mcl_bamboo.is_bamboo(node_above.name) or 0
|
2023-01-06 23:40:35 +01:00
|
|
|
local istack = ItemStack(BAMBOO)
|
2023-01-02 08:19:33 +01:00
|
|
|
local sound_params = {
|
|
|
|
pos = new_pos,
|
|
|
|
gain = 1.0, -- default
|
|
|
|
max_hear_distance = 10, -- default, uses a Euclidean metric
|
|
|
|
}
|
2022-12-29 19:16:48 +01:00
|
|
|
|
2023-01-12 09:27:17 +01:00
|
|
|
if node_above and ((bamboo_node and bamboo_node > 0) or node_above.name == BAMBOO_ENDCAP_NAME) then
|
2022-12-29 19:16:48 +01:00
|
|
|
minetest.remove_node(new_pos)
|
|
|
|
minetest.sound_play(node_sound.dug, sound_params, true)
|
2023-01-02 08:19:33 +01:00
|
|
|
if pr:next(1, DOUBLE_DROP_CHANCE) == 1 then
|
2022-12-29 19:16:48 +01:00
|
|
|
minetest.add_item(new_pos, istack)
|
|
|
|
end
|
|
|
|
minetest.add_item(new_pos, istack)
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
}
|
2023-01-06 23:40:35 +01:00
|
|
|
minetest.register_node(BAMBOO, bamboo_def)
|
2022-12-29 19:16:48 +01:00
|
|
|
|
|
|
|
local bamboo_top = table.copy(bamboo_def)
|
|
|
|
bamboo_top.groups = {not_in_creative_inventory = 1, handy = 1, axey = 1, choppy = 1, flammable = 3}
|
2023-01-03 07:38:12 +01:00
|
|
|
bamboo_top.tiles = {"mcl_bamboo_endcap.png"}
|
|
|
|
bamboo_top.drawtype = "plantlike_rooted" --"plantlike"
|
|
|
|
--bamboo_top.paramtype2 = "meshoptions"
|
|
|
|
--bamboo_top.param2 = 2
|
2023-01-11 13:16:12 +01:00
|
|
|
-- bamboo_top.waving = 2
|
2023-01-03 07:38:12 +01:00
|
|
|
bamboo_top.special_tiles = {{name = "mcl_bamboo_endcap.png"}}
|
2022-12-29 19:16:48 +01:00
|
|
|
bamboo_top.nodebox = nil
|
2023-01-06 07:22:18 +01:00
|
|
|
bamboo_top.selection_box = nil
|
|
|
|
bamboo_top.collision_box = nil
|
2022-12-29 19:16:48 +01:00
|
|
|
|
|
|
|
bamboo_top.on_place = function(itemstack, _, _)
|
|
|
|
-- Should never occur... but, if it does, then nix it.
|
2023-01-06 23:40:35 +01:00
|
|
|
itemstack:set_name(BAMBOO)
|
2022-12-29 19:16:48 +01:00
|
|
|
return itemstack
|
|
|
|
end
|
|
|
|
|
2023-01-06 23:40:35 +01:00
|
|
|
minetest.register_node(BAMBOO_ENDCAP_NAME, bamboo_top)
|
2022-12-29 19:16:48 +01:00
|
|
|
|
|
|
|
local bamboo_block_def = {
|
|
|
|
description = "Bamboo Block",
|
|
|
|
tiles = {"mcl_bamboo_bamboo_bottom.png", "mcl_bamboo_bamboo_bottom.png", "mcl_bamboo_bamboo_block.png"},
|
|
|
|
groups = {handy = 1, building_block = 1, axey = 1, flammable = 2, material_wood = 1, bamboo_block = 1, fire_encouragement = 5, fire_flammability = 5},
|
|
|
|
sounds = node_sound,
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
drops = "mcl_bamboo:bamboo_block",
|
|
|
|
_mcl_blast_resistance = 3,
|
|
|
|
_mcl_hardness = 2,
|
|
|
|
_mcl_stripped_variant = "mcl_bamboo:bamboo_block_stripped", -- this allows us to use the built in Axe's strip block.
|
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
|
|
|
|
|
|
|
local pos = pointed_thing.under
|
|
|
|
|
|
|
|
if mcl_bamboo.is_protected(pos, placer) then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
-- Use pointed node's on_rightclick function first, if present
|
|
|
|
local node = minetest.get_node(pointed_thing.under)
|
|
|
|
if placer and not placer:get_player_control().sneak then
|
|
|
|
if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].on_rightclick then
|
|
|
|
return minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer, itemstack) or itemstack
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
local bamboo_stripped_block = table.copy(bamboo_block_def)
|
|
|
|
bamboo_stripped_block.on_rightclick = nil
|
|
|
|
bamboo_stripped_block.description = S("Stripped Bamboo Block")
|
2023-01-19 21:51:49 +01:00
|
|
|
bamboo_stripped_block.tiles = {"mcl_bamboo_bamboo_bottom_stripped.png", "mcl_bamboo_bamboo_bottom_stripped.png",
|
2023-01-03 07:38:12 +01:00
|
|
|
"mcl_bamboo_bamboo_block_stripped.png"}
|
2022-12-29 19:16:48 +01:00
|
|
|
minetest.register_node("mcl_bamboo:bamboo_block_stripped", bamboo_stripped_block)
|
|
|
|
minetest.register_node("mcl_bamboo:bamboo_plank", {
|
|
|
|
description = S("Bamboo Plank"),
|
|
|
|
_doc_items_longdesc = S("Bamboo Plank"),
|
|
|
|
_doc_items_hidden = false,
|
|
|
|
tiles = {"mcl_bamboo_bamboo_plank.png"},
|
|
|
|
stack_max = 64,
|
|
|
|
is_ground_content = false,
|
|
|
|
groups = {handy = 1, axey = 1, flammable = 3, wood = 1, building_block = 1, material_wood = 1, fire_encouragement = 5, fire_flammability = 20},
|
|
|
|
sounds = mcl_sounds.node_sound_wood_defaults(),
|
|
|
|
_mcl_blast_resistance = 3,
|
|
|
|
_mcl_hardness = 2,
|
|
|
|
})
|
|
|
|
|
2023-01-03 07:38:12 +01:00
|
|
|
-- Bamboo Part 2 Base nodes.
|
|
|
|
-- Bamboo Mosaic
|
2023-01-07 00:07:30 +01:00
|
|
|
local bamboo_mosaic = table.copy(minetest.registered_nodes[BAMBOO_PLANK])
|
2023-01-10 21:36:17 +01:00
|
|
|
bamboo_mosaic.tiles = {"mcl_bamboo_bamboo_plank_mosaic.png"}
|
2023-01-03 07:38:12 +01:00
|
|
|
bamboo_mosaic.groups = {handy = 1, axey = 1, flammable = 3, fire_encouragement = 5, fire_flammability = 20}
|
|
|
|
bamboo_mosaic.description = S("Bamboo Mosaic Plank")
|
|
|
|
bamboo_mosaic._doc_items_longdesc = S("Bamboo Mosaic Plank")
|
|
|
|
minetest.register_node("mcl_bamboo:bamboo_mosaic", bamboo_mosaic)
|
|
|
|
|
|
|
|
--[[ Bamboo alternative node types. Note that the table.copy's are very important! if you use a common node def and
|
|
|
|
make changes, even after registering them, the changes overwrite the previous node definitions, and in this case,
|
|
|
|
you will end up with 4 nodes all being type 3. --]]
|
|
|
|
|
2023-01-02 09:54:26 +01:00
|
|
|
local bamboo_one_def = table.copy(bamboo_def)
|
|
|
|
bamboo_one_def.node_box = {
|
2022-12-29 19:16:48 +01:00
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.05, -0.5, 0.285, -0.275, 0.5, 0.06},
|
|
|
|
}
|
|
|
|
}
|
2023-01-02 09:54:26 +01:00
|
|
|
bamboo_one_def.collision_box = {
|
2023-01-02 08:19:33 +01:00
|
|
|
-- see [Node boxes] for possibilities
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.05, -0.5, 0.285, -0.275, 0.5, 0.06},
|
|
|
|
}
|
|
|
|
}
|
2023-01-02 09:54:26 +01:00
|
|
|
bamboo_one_def.selection_box = {
|
2023-01-02 08:19:33 +01:00
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.05, -0.5, 0.285, -0.275, 0.5, 0.06},
|
|
|
|
}
|
|
|
|
}
|
2023-01-12 09:47:13 +01:00
|
|
|
bamboo_one_def.groups = {not_in_creative_inventory = 1, handy = 1, axey = 1, choppy = 1, flammable = 3}
|
2023-01-06 02:27:52 +01:00
|
|
|
mcl_bamboo.mcl_log(dump(mcl_bamboo.bamboo_index))
|
2023-01-04 17:28:09 +01:00
|
|
|
minetest.register_node(mcl_bamboo.bamboo_index[2], bamboo_one_def)
|
2023-01-02 09:54:26 +01:00
|
|
|
local bamboo_two_def = table.copy(bamboo_def)
|
2022-12-29 19:16:48 +01:00
|
|
|
|
2023-01-02 09:54:26 +01:00
|
|
|
bamboo_two_def.node_box = {
|
2022-12-29 19:16:48 +01:00
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{0.25, -0.5, 0.325, 0.025, 0.5, 0.100},
|
|
|
|
}
|
|
|
|
}
|
2023-01-02 09:54:26 +01:00
|
|
|
bamboo_two_def.collision_box = {
|
2023-01-02 08:19:33 +01:00
|
|
|
-- see [Node boxes] for possibilities
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{0.25, -0.5, 0.325, 0.025, 0.5, 0.100},
|
|
|
|
}
|
|
|
|
}
|
2023-01-02 09:54:26 +01:00
|
|
|
bamboo_two_def.selection_box = {
|
2023-01-02 08:19:33 +01:00
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{0.25, -0.5, 0.325, 0.025, 0.5, 0.100},
|
|
|
|
}
|
|
|
|
}
|
2023-01-12 09:47:13 +01:00
|
|
|
bamboo_two_def.groups = {not_in_creative_inventory = 1, handy = 1, axey = 1, choppy = 1, flammable = 3}
|
2023-01-04 17:28:09 +01:00
|
|
|
minetest.register_node(mcl_bamboo.bamboo_index[3], bamboo_two_def)
|
2023-01-02 09:54:26 +01:00
|
|
|
local bamboo_three_def = table.copy(bamboo_def)
|
2022-12-29 19:16:48 +01:00
|
|
|
|
2023-01-02 09:54:26 +01:00
|
|
|
bamboo_three_def.node_box = {
|
2022-12-29 19:16:48 +01:00
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.125, -0.5, 0.125, -0.3125, 0.5, 0.3125},
|
|
|
|
}
|
|
|
|
}
|
2023-01-02 09:54:26 +01:00
|
|
|
bamboo_three_def.collision_box = {
|
2023-01-02 08:19:33 +01:00
|
|
|
-- see [Node boxes] for possibilities
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.125, -0.5, 0.125, -0.3125, 0.5, 0.3125},
|
|
|
|
}
|
|
|
|
}
|
2023-01-02 09:54:26 +01:00
|
|
|
bamboo_three_def.selection_box = {
|
2023-01-02 08:19:33 +01:00
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.125, -0.5, 0.125, -0.3125, 0.5, 0.3125},
|
|
|
|
}
|
|
|
|
}
|
2023-01-12 09:47:13 +01:00
|
|
|
bamboo_three_def.groups = {not_in_creative_inventory = 1, handy = 1, axey = 1, choppy = 1, flammable = 3}
|
2023-01-04 17:28:09 +01:00
|
|
|
minetest.register_node(mcl_bamboo.bamboo_index[4], bamboo_three_def)
|