diff --git a/mods/fl_bottles/README b/mods/fl_bottles/README new file mode 100644 index 0000000..2f2f1a0 --- /dev/null +++ b/mods/fl_bottles/README @@ -0,0 +1,11 @@ +wsor(aka wsor4035)(CC BY-SA 3.0) +dervived from Thomas-S under same license +farlands_bottle_empty.png + +wsor(aka wsor4035)(CC BY-SA 3.0) +derived from D00Med under same license who +derived from Thomas-S under same license +all other farlands_bottle_*.png + +D00Med(CC BY-SA 3.0) +farlands_bubble*.png \ No newline at end of file diff --git a/mods/fl_bottles/init.lua b/mods/fl_bottles/init.lua new file mode 100644 index 0000000..4509a82 --- /dev/null +++ b/mods/fl_bottles/init.lua @@ -0,0 +1,48 @@ +minetest.register_craftitem("fl_bottles:water", { + description = "bottle with water", + inventory_image = "farlands_bottle_blue.png", + groups = {bottle = 1, vessel = 1}, +}) + +minetest.register_craftitem("fl_bottles:river_water", { + description = "bottle with river water", + inventory_image = "farlands_bottle_aqua.png", + groups = {bottle = 1, vessel = 1}, +}) + +minetest.register_craftitem("fl_bottles:bottle", { + description = "empty bottle", + inventory_image = "farlands_bottle_empty.png", + liquids_pointable = true, + on_use = function(itemstack, user, pointed_thing) + if pointed_thing.type ~= "node" then return end + + local node = minetest.get_node(pointed_thing.under) + local node_def = minetest.registered_nodes[node.name] + + if user and not user:get_player_control().sneak then + if node_def.on_rightclick then + return node_def.on_rightclick(pointed_thing.under, node, user, itemstack) + end + end + + if node_def._bottle_item == nil then + return itemstack + else + if user:get_wielded_item():get_count() > 1 then + local inv = user:get_inventory() + if inv:room_for_item("main", {name=node_def._bottle_item}) then + inv:add_item("main", node_def._bottle_item) + else + local pos = user:get_pos() + pos.y = math.floor(pos.y + 0.5) + minetest.add_item(pos, node_def._bottle_item) + end + itemstack:take_item() + return itemstack + end + return ItemStack(node_def._bottle_item) + end + end, + groups = {bottle = 1, vessel = 1}, +}) \ No newline at end of file diff --git a/mods/fl_bottles/textures/farlands_bottle_aqua.png b/mods/fl_bottles/textures/farlands_bottle_aqua.png new file mode 100644 index 0000000..617b21d Binary files /dev/null and b/mods/fl_bottles/textures/farlands_bottle_aqua.png differ diff --git a/mods/fl_bottles/textures/farlands_bottle_blue.png b/mods/fl_bottles/textures/farlands_bottle_blue.png new file mode 100644 index 0000000..40d556c Binary files /dev/null and b/mods/fl_bottles/textures/farlands_bottle_blue.png differ diff --git a/mods/fl_bottles/textures/farlands_bottle_brown.png b/mods/fl_bottles/textures/farlands_bottle_brown.png new file mode 100644 index 0000000..9202257 Binary files /dev/null and b/mods/fl_bottles/textures/farlands_bottle_brown.png differ diff --git a/mods/fl_bottles/textures/farlands_bottle_cyan.png b/mods/fl_bottles/textures/farlands_bottle_cyan.png new file mode 100644 index 0000000..8ce31e3 Binary files /dev/null and b/mods/fl_bottles/textures/farlands_bottle_cyan.png differ diff --git a/mods/fl_bottles/textures/farlands_bottle_darkpurple.png b/mods/fl_bottles/textures/farlands_bottle_darkpurple.png new file mode 100644 index 0000000..f70aa02 Binary files /dev/null and b/mods/fl_bottles/textures/farlands_bottle_darkpurple.png differ diff --git a/mods/fl_bottles/textures/farlands_bottle_empty.png b/mods/fl_bottles/textures/farlands_bottle_empty.png new file mode 100644 index 0000000..b969500 Binary files /dev/null and b/mods/fl_bottles/textures/farlands_bottle_empty.png differ diff --git a/mods/fl_bottles/textures/farlands_bottle_gcyan.png b/mods/fl_bottles/textures/farlands_bottle_gcyan.png new file mode 100644 index 0000000..605a23a Binary files /dev/null and b/mods/fl_bottles/textures/farlands_bottle_gcyan.png differ diff --git a/mods/fl_bottles/textures/farlands_bottle_ggreen.png b/mods/fl_bottles/textures/farlands_bottle_ggreen.png new file mode 100644 index 0000000..1c25c78 Binary files /dev/null and b/mods/fl_bottles/textures/farlands_bottle_ggreen.png differ diff --git a/mods/fl_bottles/textures/farlands_bottle_gold.png b/mods/fl_bottles/textures/farlands_bottle_gold.png new file mode 100644 index 0000000..511e0dc Binary files /dev/null and b/mods/fl_bottles/textures/farlands_bottle_gold.png differ diff --git a/mods/fl_bottles/textures/farlands_bottle_gpurple.png b/mods/fl_bottles/textures/farlands_bottle_gpurple.png new file mode 100644 index 0000000..d3262bb Binary files /dev/null and b/mods/fl_bottles/textures/farlands_bottle_gpurple.png differ diff --git a/mods/fl_bottles/textures/farlands_bottle_gred.png b/mods/fl_bottles/textures/farlands_bottle_gred.png new file mode 100644 index 0000000..7fa4a10 Binary files /dev/null and b/mods/fl_bottles/textures/farlands_bottle_gred.png differ diff --git a/mods/fl_bottles/textures/farlands_bottle_green.png b/mods/fl_bottles/textures/farlands_bottle_green.png new file mode 100644 index 0000000..04af759 Binary files /dev/null and b/mods/fl_bottles/textures/farlands_bottle_green.png differ diff --git a/mods/fl_bottles/textures/farlands_bottle_grey.png b/mods/fl_bottles/textures/farlands_bottle_grey.png new file mode 100644 index 0000000..be6e33c Binary files /dev/null and b/mods/fl_bottles/textures/farlands_bottle_grey.png differ diff --git a/mods/fl_bottles/textures/farlands_bottle_lightblue.png b/mods/fl_bottles/textures/farlands_bottle_lightblue.png new file mode 100644 index 0000000..9708bab Binary files /dev/null and b/mods/fl_bottles/textures/farlands_bottle_lightblue.png differ diff --git a/mods/fl_bottles/textures/farlands_bottle_limegreen.png b/mods/fl_bottles/textures/farlands_bottle_limegreen.png new file mode 100644 index 0000000..4388893 Binary files /dev/null and b/mods/fl_bottles/textures/farlands_bottle_limegreen.png differ diff --git a/mods/fl_bottles/textures/farlands_bottle_magenta.png b/mods/fl_bottles/textures/farlands_bottle_magenta.png new file mode 100644 index 0000000..4dc45c2 Binary files /dev/null and b/mods/fl_bottles/textures/farlands_bottle_magenta.png differ diff --git a/mods/fl_bottles/textures/farlands_bottle_orange.png b/mods/fl_bottles/textures/farlands_bottle_orange.png new file mode 100644 index 0000000..8157a2b Binary files /dev/null and b/mods/fl_bottles/textures/farlands_bottle_orange.png differ diff --git a/mods/fl_bottles/textures/farlands_bottle_purple.png b/mods/fl_bottles/textures/farlands_bottle_purple.png new file mode 100644 index 0000000..f0aab5b Binary files /dev/null and b/mods/fl_bottles/textures/farlands_bottle_purple.png differ diff --git a/mods/fl_bottles/textures/farlands_bottle_red.png b/mods/fl_bottles/textures/farlands_bottle_red.png new file mode 100644 index 0000000..3abb848 Binary files /dev/null and b/mods/fl_bottles/textures/farlands_bottle_red.png differ diff --git a/mods/fl_bottles/textures/farlands_bottle_redbrown.png b/mods/fl_bottles/textures/farlands_bottle_redbrown.png new file mode 100644 index 0000000..954f8c6 Binary files /dev/null and b/mods/fl_bottles/textures/farlands_bottle_redbrown.png differ diff --git a/mods/fl_bottles/textures/farlands_bottle_silver.png b/mods/fl_bottles/textures/farlands_bottle_silver.png new file mode 100644 index 0000000..d3df3d7 Binary files /dev/null and b/mods/fl_bottles/textures/farlands_bottle_silver.png differ diff --git a/mods/fl_bottles/textures/farlands_bottle_yellow.png b/mods/fl_bottles/textures/farlands_bottle_yellow.png new file mode 100644 index 0000000..26d9686 Binary files /dev/null and b/mods/fl_bottles/textures/farlands_bottle_yellow.png differ diff --git a/mods/fl_bottles/textures/farlands_bottle_yellowgreen.png b/mods/fl_bottles/textures/farlands_bottle_yellowgreen.png new file mode 100644 index 0000000..38d5d56 Binary files /dev/null and b/mods/fl_bottles/textures/farlands_bottle_yellowgreen.png differ diff --git a/mods/fl_bottles/textures/farlands_bubble_green.png b/mods/fl_bottles/textures/farlands_bubble_green.png new file mode 100644 index 0000000..8d35ee2 Binary files /dev/null and b/mods/fl_bottles/textures/farlands_bubble_green.png differ diff --git a/mods/fl_bottles/textures/farlands_bubbles_pink.png b/mods/fl_bottles/textures/farlands_bubbles_pink.png new file mode 100644 index 0000000..45c34ff Binary files /dev/null and b/mods/fl_bottles/textures/farlands_bubbles_pink.png differ diff --git a/mods/fl_bottles/textures/farlands_bubbles_white.png b/mods/fl_bottles/textures/farlands_bubbles_white.png new file mode 100644 index 0000000..183c30d Binary files /dev/null and b/mods/fl_bottles/textures/farlands_bubbles_white.png differ diff --git a/mods/fl_liquids/init.lua b/mods/fl_liquids/init.lua index 9d8a38d..c74d0bb 100644 --- a/mods/fl_liquids/init.lua +++ b/mods/fl_liquids/init.lua @@ -51,6 +51,7 @@ minetest.register_node(":fl_terrain:water_source", { liquid_viscosity = 1, post_effect_color = {a = 103, r = 30, g = 60, b = 90}, groups = {water = 3, liquid = 3, cools_lava = 1}, + _bottle_item = "fl_bottles:water", }) minetest.register_node(":fl_terrain:water_flowing", { @@ -144,6 +145,7 @@ minetest.register_node(":fl_terrain:river_water_source", { liquid_range = 2, post_effect_color = {a = 103, r = 30, g = 76, b = 90}, groups = {water = 3, liquid = 3, cools_lava = 1}, + _bottle_item = "fl_bottles:river_water", }) minetest.register_node(":fl_terrain:river_water_flowing", { diff --git a/mods/fl_storage/init.lua b/mods/fl_storage/init.lua index adc5fcb..7e56164 100644 --- a/mods/fl_storage/init.lua +++ b/mods/fl_storage/init.lua @@ -95,8 +95,6 @@ minetest.register_node("fl_storage:wood_chest", { end, }) ---add allow_metadata_inventory_put = function(pos, listname, index, stack, player) --- to limit for vessels and books type shelfs local function shelf_nodes(name) local overlays = {"book", "empty", "multi", "vessel"} @@ -184,6 +182,15 @@ local function shelf_nodes(name) local shelf_formspec = table.concat(formspec, "") minetest.show_formspec(clicker:get_player_name(), "fl_wildlife:trader_formspec", shelf_formspec) end, + allow_metadata_inventory_put = function(pos, listname, index, stack, player) + if overlay == "vessel" or overlay == "book" then + if minetest.get_item_group(stack:get_name(), overlay) ~= 0 then + return stack:get_count() + end + return 0 + end + return stack:get_count() + end, on_dig = function(pos, node, digger) local inv = minetest.get_inventory({type="node", pos=pos}) for _, item in ipairs(inv:get_list("main")) do