This commit is contained in:
root 2020-12-26 22:23:48 +01:00
parent 1ddd08b39f
commit 877f03b698
36 changed files with 196 additions and 158 deletions

View file

@ -416,6 +416,12 @@ end
armor.damage = function(self, player, index, stack, use) armor.damage = function(self, player, index, stack, use)
local old_stack = ItemStack(stack) local old_stack = ItemStack(stack)
local worn_armor = armor:get_weared_armor_elements(player)
local armor_worn_cnt = 0
for k,v in pairs(worn_armor) do
armor_worn_cnt = armor_worn_cnt + 1
end
use = math.ceil(use/armor_worn_cnt)
stack:add_wear(use) stack:add_wear(use)
self:run_callbacks("on_damage", player, index, stack) self:run_callbacks("on_damage", player, index, stack)
self:set_inventory_stack(player, index, stack) self:set_inventory_stack(player, index, stack)

View file

@ -389,14 +389,18 @@ if armor.config.drop == true or armor.config.destroy == true then
end) end)
end end
end) end)
else -- reset un-dropped armor and it's effects
minetest.register_on_respawnplayer(function(player)
armor:set_player_armor(player)
end)
end end
if armor.config.punch_damage == true then if armor.config.punch_damage == true then
minetest.register_on_punchplayer(function(player, hitter, minetest.register_on_punchplayer(function(player, hitter,
time_from_last_punch, tool_capabilities) time_from_last_punch, tool_capabilities)
local name = player:get_player_name() local name = player:get_player_name()
local name2 = hitter:get_player_name() local hit_ip = hitter:is_player()
if name and name2 and minetest.is_protected(player:get_pos(), "") then if name and hit_ip and minetest.is_protected(player:get_pos(), "") then
return return
elseif name then elseif name then
armor:punch(player, hitter, time_from_last_punch, tool_capabilities) armor:punch(player, hitter, time_from_last_punch, tool_capabilities)

View file

@ -17,8 +17,6 @@ end
if minetest.global_exists("armor") and armor.elements then if minetest.global_exists("armor") and armor.elements then
table.insert(armor.elements, "shield") table.insert(armor.elements, "shield")
local mult = armor.config.level_multiplier or 1
armor.config.level_multiplier = mult * 0.9
end end
-- Regisiter Shields -- Regisiter Shields

View file

@ -129,11 +129,13 @@ local get_ambience = function(player, tod, name)
pos.y = pos.y + 1.4 -- head level pos.y = pos.y + 1.4 -- head level
local nod_head = pplus and playerplus[name].nod_head or minetest.get_node(pos).name local nod_head = pplus and name and playerplus[name].nod_head or
minetest.get_node(pos).name
pos.y = pos.y - 1.2 -- foot level pos.y = pos.y - 1.2 -- foot level
local nod_feet = pplus and playerplus[name].nod_feet or minetest.get_node(pos).name local nod_feet = pplus and name and playerplus[name].nod_feet or
minetest.get_node(pos).name
pos.y = pos.y - 0.2 -- reset pos pos.y = pos.y - 0.2 -- reset pos

View file

@ -1 +1 @@
This mod adds bees and beehives into minetest This mod adds bees and hives to Minetest

View file

@ -14,7 +14,9 @@ else
end end
--
-- FUNCTIONS -- FUNCTIONS
--
local floor = math.floor local floor = math.floor
local random = math.random local random = math.random
@ -55,15 +57,17 @@ local polinate_flower = function(pos, flower)
} }
local floor_pos = {x = spawn_pos.x, y = spawn_pos.y - 1, z = spawn_pos.z} local floor_pos = {x = spawn_pos.x, y = spawn_pos.y - 1, z = spawn_pos.z}
local spawn = minetest.get_node(spawn_pos).name local spawn = minetest.get_node(spawn_pos).name
local floor = minetest.get_node(floor_pos).name local floorn = minetest.get_node(floor_pos).name
if floor == "group:soil" and spawn == "air" then if floorn == "group:soil" and spawn == "air" then
minetest.set_node(spawn_pos, {name = flower}) minetest.set_node(spawn_pos, {name = flower})
end end
end end
--
-- NODES -- NODES
--
minetest.register_node("bees:extractor", { minetest.register_node("bees:extractor", {
description = S("Honey Extractor"), description = S("Honey Extractor"),
@ -77,11 +81,11 @@ minetest.register_node("bees:extractor", {
tubedevice_receiver = 1 tubedevice_receiver = 1
}, },
on_construct = function(pos, node) on_construct = function(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
local pos = pos.x .. "," .. pos.y .. "," .. pos.z pos = pos.x .. "," .. pos.y .. "," .. pos.z
inv:set_size("frames_filled", 1) inv:set_size("frames_filled", 1)
inv:set_size("frames_emptied", 1) inv:set_size("frames_emptied", 1)
@ -90,22 +94,23 @@ minetest.register_node("bees:extractor", {
inv:set_size("wax", 1) inv:set_size("wax", 1)
meta:set_string("formspec", "size[8,9]" meta:set_string("formspec", "size[8,9]"
--input -- input
.. "list[nodemeta:"..pos..";frames_filled;2,1;1,1;]" .. "list[nodemeta:"..pos..";frames_filled;2,1;1,1;]"
.. "list[nodemeta:"..pos..";bottles_empty;2,3;1,1;]" .. "list[nodemeta:"..pos..";bottles_empty;2,3;1,1;]"
--output -- output
.. "list[nodemeta:"..pos..";frames_emptied;5,0.5;1,1;]" .. "list[nodemeta:"..pos..";frames_emptied;5,0.5;1,1;]"
.. "list[nodemeta:"..pos..";wax;5,2;1,1;]" .. "list[nodemeta:"..pos..";wax;5,2;1,1;]"
.. "list[nodemeta:"..pos..";bottles_full;5,3.5;1,1;]" .. "list[nodemeta:"..pos..";bottles_full;5,3.5;1,1;]"
--player inventory -- player inventory
.. "list[current_player;main;0,5;8,4;]" .. "list[current_player;main;0,5;8,4;]"
) )
end, end,
on_timer = function(pos, node) on_timer = function(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
local timer = minetest.get_node_timer(pos)
if not inv:contains_item("frames_filled", "bees:frame_full") if not inv:contains_item("frames_filled", "bees:frame_full")
or not inv:contains_item("bottles_empty", "vessels:glass_bottle") then or not inv:contains_item("bottles_empty", "vessels:glass_bottle") then
@ -116,48 +121,38 @@ minetest.register_node("bees:extractor", {
and inv:room_for_item("wax", "bees:wax") and inv:room_for_item("wax", "bees:wax")
and inv:room_for_item("bottles_full", "bees:bottle_honey") then and inv:room_for_item("bottles_full", "bees:bottle_honey") then
--add to output -- add to output
inv:add_item("frames_emptied", "bees:frame_empty") inv:add_item("frames_emptied", "bees:frame_empty")
inv:add_item("wax", "bees:wax") inv:add_item("wax", "bees:wax")
inv:add_item("bottles_full", "bees:bottle_honey") inv:add_item("bottles_full", "bees:bottle_honey")
--remove from input -- remove from input
inv:remove_item("bottles_empty", "vessels:glass_bottle") inv:remove_item("bottles_empty", "vessels:glass_bottle")
inv:remove_item("frames_filled", "bees:frame_full") inv:remove_item("frames_filled", "bees:frame_full")
local p = { -- wax flying all over the place
x = pos.x + random() - 0.5,
y = pos.y + random() - 0.5,
z = pos.z + random() - 0.5
}
--wax flying all over the place
minetest.add_particle({ minetest.add_particle({
pos = {x = pos.x, y = pos.y, z = pos.z}, pos = {x = pos.x, y = pos.y, z = pos.z},
vel = { velocity = {
x = random(-1, 1), x = random(-1, 1),
y = random(4), y = random(4),
z = random(-1, 1) z = random(-1, 1)
}, },
acc = {x = 0, y = -6, z = 0}, acceleration = {x = 0, y = -6, z = 0},
expirationtime = 2, expirationtime = 2,
size = random(1, 3), size = random(1, 3),
collisiondetection = false, collisiondetection = false,
texture = "bees_wax_particle.png", texture = "bees_wax_particle.png",
}) })
local timer = minetest.get_node_timer(pos)
timer:start(5) timer:start(5)
else else
local timer = minetest.get_node_timer(pos) timer:start(5) -- try again in 5 seconds (was 1)
timer:start(5) -- Try again in 5 seconds (was 1)
end end
end, end,
tube = { tube = {
insert_object = function(pos, node, stack, direction) insert_object = function(pos, _, stack)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
@ -183,18 +178,18 @@ minetest.register_node("bees:extractor", {
return stack return stack
end, end,
can_insert = function(pos,node,stack,direction) can_insert = function(pos, _, stack)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
if stack:get_name() == "bees:frame_full" then if stack:get_name() == "bees:frame_full" then
return inv:room_for_item("frames_filled",stack) return inv:room_for_item("frames_filled", stack)
elseif stack:get_name() == "vessels:glass_bottle" then elseif stack:get_name() == "vessels:glass_bottle" then
return inv:room_for_item("bottles_empty",stack) return inv:room_for_item("bottles_empty", stack)
end end
return false return false
@ -205,7 +200,7 @@ minetest.register_node("bees:extractor", {
connect_sides = {left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1} connect_sides = {left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1}
}, },
on_metadata_inventory_put = function(pos, listname, index, stack, player) on_metadata_inventory_put = function(pos, listname, _, stack)
local timer = minetest.get_node_timer(pos) local timer = minetest.get_node_timer(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
@ -217,7 +212,7 @@ minetest.register_node("bees:extractor", {
end end
end, end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player) allow_metadata_inventory_put = function(_, listname, _, stack)
if (listname == "bottles_empty" and stack:get_name() == "vessels:glass_bottle") if (listname == "bottles_empty" and stack:get_name() == "vessels:glass_bottle")
or (listname == "frames_filled" and stack:get_name() == "bees:frame_full") then or (listname == "frames_filled" and stack:get_name() == "bees:frame_full") then
@ -227,11 +222,11 @@ minetest.register_node("bees:extractor", {
end end
end, end,
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) allow_metadata_inventory_move = function()
return 0 return 0
end, end,
allow_metadata_inventory_take = function(pos, listname, index, stack, player) allow_metadata_inventory_take = function(pos, _, _, stack, player)
if player and minetest.is_protected(pos, player:get_player_name()) then if player and minetest.is_protected(pos, player:get_player_name()) then
return 0 return 0
@ -247,14 +242,12 @@ minetest.register_node("bees:bees", {
drawtype = "plantlike", drawtype = "plantlike",
paramtype = "light", paramtype = "light",
groups = {not_in_creative_inventory = 1}, groups = {not_in_creative_inventory = 1},
tiles = { tiles = {{
{
name = "bees_strip.png", name = "bees_strip.png",
animation = { animation = {
type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 2.0 type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 2.0
} }
} }},
},
damage_per_second = 1, damage_per_second = 1,
walkable = false, walkable = false,
buildable_to = true, buildable_to = true,
@ -265,8 +258,7 @@ minetest.register_node("bees:bees", {
} }
}, },
on_punch = function(pos, node, puncher) on_punch = function(_, _, puncher)
puncher:set_hp(puncher:get_hp() - 2) puncher:set_hp(puncher:get_hp() - 2)
end, end,
}) })
@ -274,7 +266,7 @@ minetest.register_node("bees:bees", {
minetest.register_node("bees:hive_wild", { minetest.register_node("bees:hive_wild", {
description = S("Wild Bee Hive"), description = S("Wild Bee Hive"),
tiles = { --Neuromancer"s base texture tiles = { -- Neuromancer's base texture
"bees_hive_wild.png", "bees_hive_wild.png", "bees_hive_wild.png", "bees_hive_wild.png", "bees_hive_wild.png", "bees_hive_wild.png",
"bees_hive_wild.png", "bees_hive_wild_bottom.png" "bees_hive_wild.png", "bees_hive_wild_bottom.png"
}, },
@ -284,17 +276,17 @@ minetest.register_node("bees:hive_wild", {
drop = { drop = {
max_items = 6, max_items = 6,
items = { items = {
{ items = {"bees:honey_comb"}, rarity = 5} {items = {"bees:honey_comb"}, rarity = 5}
} }
}, },
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, attached_node = 1}, groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, attached_node = 1},
node_box = { --VanessaE's wild hive nodebox contribution node_box = { -- VanessaE's wild hive nodebox contribution
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.250000,-0.500000,-0.250000,0.250000,0.375000,0.250000}, --NodeBox 2 {-0.25, -0.5, -0.25, 0.25, 0.375, 0.25},
{-0.312500,-0.375000,-0.312500,0.312500,0.250000,0.312500}, --NodeBox 4 {-0.3125, -0.375, -0.3125, 0.3125, 0.25, 0.3125},
{-0.375000,-0.250000,-0.375000,0.375000,0.125000,0.375000}, --NodeBox 5 {-0.375, -0.25, -0.375, 0.375, 0.125, 0.375},
{-0.062500,-0.500000,-0.062500,0.062500,0.500000,0.062500}, --NodeBox 6 {-0.0625, -0.5, -0.0625, 0.0625, 0.5, 0.0625},
} }
}, },
@ -328,7 +320,7 @@ minetest.register_node("bees:hive_wild", {
local stacks = inv:get_list("combs") local stacks = inv:get_list("combs")
for k, v in pairs(stacks) do for k, _ in pairs(stacks) do
if inv:get_stack("combs", k):is_empty() then if inv:get_stack("combs", k):is_empty() then
@ -339,7 +331,7 @@ minetest.register_node("bees:hive_wild", {
return return
end end
end end
--what to do if all combs are filled -- what to do if all combs are filled
end, end,
on_construct = function(pos) on_construct = function(pos)
@ -363,7 +355,7 @@ minetest.register_node("bees:hive_wild", {
end end
end, end,
on_punch = function(pos, node, puncher) on_punch = function(pos, _, puncher)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
@ -374,7 +366,7 @@ minetest.register_node("bees:hive_wild", {
end end
end, end,
on_metadata_inventory_take = function(pos, listname, index, stack, taker) on_metadata_inventory_take = function(pos, listname, _, _, taker)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
@ -388,7 +380,7 @@ minetest.register_node("bees:hive_wild", {
end end
end, end,
on_metadata_inventory_put = function(pos, listname, index, stack, taker) on_metadata_inventory_put = function(pos)
local timer = minetest.get_node_timer(pos) local timer = minetest.get_node_timer(pos)
@ -397,9 +389,9 @@ minetest.register_node("bees:hive_wild", {
end end
end, end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player) allow_metadata_inventory_put = function(_, listname, _, stack)
--restart the colony by adding a queen -- restart the colony by adding a queen
if listname == "queen" and stack:get_name() == "bees:queen" then if listname == "queen" and stack:get_name() == "bees:queen" then
return 1 return 1
else else
@ -407,7 +399,7 @@ minetest.register_node("bees:hive_wild", {
end end
end, end,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) on_rightclick = function(pos, _, clicker, itemstack)
minetest.show_formspec(clicker:get_player_name(), minetest.show_formspec(clicker:get_player_name(),
"bees:hive_artificial", "bees:hive_artificial",
@ -426,7 +418,7 @@ minetest.register_node("bees:hive_wild", {
end end
end, end,
can_dig = function(pos,player) can_dig = function(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
@ -438,10 +430,9 @@ minetest.register_node("bees:hive_wild", {
end end
end, end,
after_dig_node = function(pos, oldnode, oldmetadata, user) after_dig_node = function(_, _, _, user)
local wielded local wielded
if user:get_wielded_item() ~= nil then if user:get_wielded_item() ~= nil then
wielded = user:get_wielded_item() wielded = user:get_wielded_item()
else else
@ -488,7 +479,6 @@ minetest.register_node("bees:hive_artificial", {
on_construct = function(pos) on_construct = function(pos)
local timer = minetest.get_node_timer(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
@ -500,13 +490,15 @@ minetest.register_node("bees:hive_artificial", {
meta:set_string("infotext", S("Requires Queen bee to function")) meta:set_string("infotext", S("Requires Queen bee to function"))
end, end,
on_rightclick = function(pos, node, clicker, itemstack) on_rightclick = function(pos, _, clicker)
if minetest.is_protected(pos, clicker:get_player_name()) then local player_name = clicker:get_player_name()
if minetest.is_protected(pos, player_name) then
return return
end end
minetest.show_formspec(clicker:get_player_name(), minetest.show_formspec(player_name,
"bees:hive_artificial", "bees:hive_artificial",
hive_artificial(pos) hive_artificial(pos)
) )
@ -523,7 +515,7 @@ minetest.register_node("bees:hive_artificial", {
end end
end, end,
on_timer = function(pos,elapsed) on_timer = function(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
@ -555,7 +547,7 @@ minetest.register_node("bees:hive_artificial", {
local stacks = inv:get_list("frames") local stacks = inv:get_list("frames")
for k, v in pairs(stacks) do for k, _ in pairs(stacks) do
if inv:get_stack("frames", k):get_name() == "bees:frame_empty" then if inv:get_stack("frames", k):get_name() == "bees:frame_empty" then
@ -578,7 +570,7 @@ minetest.register_node("bees:hive_artificial", {
end end
end, end,
on_metadata_inventory_take = function(pos, listname, index, stack, player) on_metadata_inventory_take = function(pos, listname)
if listname == "queen" then if listname == "queen" then
@ -591,7 +583,7 @@ minetest.register_node("bees:hive_artificial", {
end end
end, end,
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) allow_metadata_inventory_move = function(pos, from_list, _, to_list, to_index)
local inv = minetest.get_meta(pos):get_inventory() local inv = minetest.get_meta(pos):get_inventory()
@ -607,7 +599,7 @@ minetest.register_node("bees:hive_artificial", {
end end
end, end,
on_metadata_inventory_put = function(pos, listname, index, stack, player) on_metadata_inventory_put = function(pos, listname, _, stack)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
@ -627,7 +619,7 @@ minetest.register_node("bees:hive_artificial", {
end end
end, end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player) allow_metadata_inventory_put = function(pos, listname, index, stack)
if not minetest.get_meta(pos):get_inventory():get_stack(listname, index):is_empty() then return 0 end if not minetest.get_meta(pos):get_inventory():get_stack(listname, index):is_empty() then return 0 end
@ -648,7 +640,10 @@ minetest.register_node("bees:hive_artificial", {
end, end,
}) })
-- ABMS
--
-- ABMs
--
minetest.register_abm({ minetest.register_abm({
nodenames = {"bees:hive_artificial", "bees:hive_wild", "bees:hive_industrial"}, nodenames = {"bees:hive_artificial", "bees:hive_wild", "bees:hive_industrial"},
@ -660,12 +655,12 @@ minetest.register_abm({
-- Bee particle -- Bee particle
minetest.add_particle({ minetest.add_particle({
pos = {x = pos.x, y = pos.y, z = pos.z}, pos = {x = pos.x, y = pos.y, z = pos.z},
vel = { velocity = {
x = (random() - 0.5) * 5, x = (random() - 0.5) * 5,
y = (random() - 0.5) * 5, y = (random() - 0.5) * 5,
z = (random() - 0.5) * 5 z = (random() - 0.5) * 5
}, },
acc = { acceleration = {
x = random() - 0.5, x = random() - 0.5,
y = random() - 0.5, y = random() - 0.5,
z = random() - 0.5 z = random() - 0.5
@ -692,14 +687,14 @@ minetest.register_abm({
}) })
-- spawn abm. This should be changed to a more realistic type of spawning -- spawn ABM. This should be changed to a more realistic type of spawning
minetest.register_abm({ minetest.register_abm({
nodenames = {"group:leaves"}, nodenames = {"group:leaves"},
neighbors = {"air"}, neighbors = {"air"},
interval = 800,--1600, interval = 800,
chance = 10,--20, chance = 10,
action = function(pos, node) action = function(pos)
if floor(pos.x / 40) ~= pos.x / 40 if floor(pos.x / 40) ~= pos.x / 40
or floor(pos.z / 40) ~= pos.z / 40 or floor(pos.z / 40) ~= pos.z / 40
@ -725,7 +720,7 @@ minetest.register_abm({
interval = 30, interval = 30,
chance = 4, chance = 4,
action = function(pos, node, _, _) action = function(pos)
local p = { local p = {
x = pos.x + random(-5, 5), x = pos.x + random(-5, 5),
@ -746,13 +741,15 @@ minetest.register_abm({
interval = 30, interval = 30,
chance = 5, chance = 5,
action = function(pos, node, _, _) action = function(pos)
minetest.remove_node(pos) minetest.remove_node(pos)
end, end,
}) })
--
-- ITEMS -- ITEMS
--
minetest.register_craftitem("bees:frame_empty", { minetest.register_craftitem("bees:frame_empty", {
description = S("Empty hive frame"), description = S("Empty hive frame"),
@ -794,7 +791,9 @@ minetest.register_craftitem("bees:queen", {
}) })
--
-- CRAFTS -- CRAFTS
--
minetest.register_craft({ minetest.register_craft({
output = "bees:extractor", output = "bees:extractor",
@ -852,7 +851,9 @@ if minetest.get_modpath("bushes_classic") then
end end
--
-- TOOLS -- TOOLS
--
minetest.register_tool("bees:smoker", { minetest.register_tool("bees:smoker", {
description = S("smoker"), description = S("smoker"),
@ -863,7 +864,7 @@ minetest.register_tool("bees:smoker", {
damage_groups = {fleshy = 2}, damage_groups = {fleshy = 2},
}, },
on_use = function(itemstack, user, pointed_thing) on_use = function(itemstack, _, pointed_thing)
if pointed_thing.type ~= "node" then if pointed_thing.type ~= "node" then
return return
@ -879,8 +880,8 @@ minetest.register_tool("bees:smoker", {
y = pos.y, y = pos.y,
z = pos.z + random() - 0.5 z = pos.z + random() - 0.5
}, },
vel = {x = 0, y = 0.5 + random(), z = 0}, velocity = {x = 0, y = 0.5 + random(), z = 0},
acc = {x = 0, y = 0, z = 0}, acceleration = {x = 0, y = 0, z = 0},
expirationtime = 2 + random(2.5), expirationtime = 2 + random(2.5),
size = random(3), size = random(3),
collisiondetection = false, collisiondetection = false,
@ -909,7 +910,10 @@ minetest.register_tool("bees:grafting_tool", {
}) })
-- COMPATIBILTY --remove after all has been updated --
-- COMPATIBILTY
-- remove after all has been updated
--
-- ALIASES -- ALIASES
minetest.register_alias("bees:honey_extractor", "bees:extractor") minetest.register_alias("bees:honey_extractor", "bees:extractor")
@ -952,7 +956,9 @@ minetest.register_lbm({
}) })
--
-- PIPEWORKS -- PIPEWORKS
--
if minetest.get_modpath("pipeworks") then if minetest.get_modpath("pipeworks") then
@ -967,7 +973,7 @@ if minetest.get_modpath("pipeworks") then
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
tube = { tube = {
insert_object = function(pos, node, stack, direction) insert_object = function(pos, _, stack)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
@ -996,7 +1002,7 @@ if minetest.get_modpath("pipeworks") then
return stack return stack
end, end,
can_insert = function(pos,node,stack,direction) can_insert = function(pos, _, stack)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
@ -1016,7 +1022,7 @@ if minetest.get_modpath("pipeworks") then
return false return false
end, end,
can_remove = function(pos,node,stack,direction) can_remove = function(_, _, stack)
if stack:get_name() == "bees:frame_full" then if stack:get_name() == "bees:frame_full" then
return 1 return 1
@ -1032,7 +1038,6 @@ if minetest.get_modpath("pipeworks") then
on_construct = function(pos) on_construct = function(pos)
local timer = minetest.get_node_timer(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
@ -1044,13 +1049,15 @@ if minetest.get_modpath("pipeworks") then
meta:set_string("infotext", S("Requires Queen bee to function")) meta:set_string("infotext", S("Requires Queen bee to function"))
end, end,
on_rightclick = function(pos, node, clicker, itemstack) on_rightclick = function(pos, _, clicker)
if minetest.is_protected(pos, clicker:get_player_name()) then local player_name = clicker:get_player_name()
if minetest.is_protected(pos, player_name) then
return return
end end
minetest.show_formspec(clicker:get_player_name(), minetest.show_formspec(player_name,
"bees:hive_artificial", "bees:hive_artificial",
hive_artificial(pos) hive_artificial(pos)
) )
@ -1067,7 +1074,7 @@ if minetest.get_modpath("pipeworks") then
end end
end, end,
on_timer = function(pos,elapsed) on_timer = function(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
@ -1097,7 +1104,7 @@ if minetest.get_modpath("pipeworks") then
local stacks = inv:get_list("frames") local stacks = inv:get_list("frames")
for k, v in pairs(stacks) do for k, _ in pairs(stacks) do
if inv:get_stack("frames", k):get_name() == "bees:frame_empty" then if inv:get_stack("frames", k):get_name() == "bees:frame_empty" then
@ -1120,7 +1127,7 @@ if minetest.get_modpath("pipeworks") then
end end
end, end,
on_metadata_inventory_take = function(pos, listname, index, stack, player) on_metadata_inventory_take = function(pos, listname)
if listname == "queen" then if listname == "queen" then
@ -1133,7 +1140,7 @@ if minetest.get_modpath("pipeworks") then
end end
end, end,
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) allow_metadata_inventory_move = function(pos, from_list, _, to_list, to_index)
local inv = minetest.get_meta(pos):get_inventory() local inv = minetest.get_meta(pos):get_inventory()
@ -1149,7 +1156,7 @@ if minetest.get_modpath("pipeworks") then
end end
end, end,
on_metadata_inventory_put = function(pos, listname, index, stack, player) on_metadata_inventory_put = function(pos, listname, _, stack)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
@ -1169,7 +1176,7 @@ if minetest.get_modpath("pipeworks") then
end end
end, end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player) allow_metadata_inventory_put = function(pos, listname, index, stack)
if not minetest.get_meta(pos):get_inventory():get_stack(listname, index):is_empty() then if not minetest.get_meta(pos):get_inventory():get_stack(listname, index):is_empty() then
return 0 return 0
@ -1203,17 +1210,18 @@ if minetest.get_modpath("pipeworks") then
end end
--
-- LUCKY BLOCKS -- LUCKY BLOCKS
--
if minetest.get_modpath("lucky_block") then if minetest.get_modpath("lucky_block") then
local add_bees = function(pos, player) local add_bees = function(pos, player)
local objs = minetest.get_objects_inside_radius(pos, 15) local objs = minetest.get_objects_inside_radius(pos, 15)
local violet = minetest.get_color_escape_sequence("#ff00ff")
minetest.chat_send_player(player:get_player_name(), minetest.chat_send_player(player:get_player_name(),
violet .. S("Bees! Bees for all!")) minetest.colorize("violet", S("Bees! Bees for all!")))
for n = 1, #objs do for n = 1, #objs do

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 460 B

After

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 628 B

After

Width:  |  Height:  |  Size: 170 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 366 B

After

Width:  |  Height:  |  Size: 133 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 445 B

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 642 B

After

Width:  |  Height:  |  Size: 210 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 543 B

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 200 B

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 477 B

After

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 346 B

After

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 465 B

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 582 B

After

Width:  |  Height:  |  Size: 241 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 B

After

Width:  |  Height:  |  Size: 84 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 200 B

After

Width:  |  Height:  |  Size: 103 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 202 B

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 378 B

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 697 B

After

Width:  |  Height:  |  Size: 303 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 336 B

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 502 B

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 B

After

Width:  |  Height:  |  Size: 150 B

View file

@ -2,11 +2,15 @@
Minetest clay crafter mod. Minetest clay crafter mod.
Adds a way for players to obtain clay other than mining, out of a common material: dirt. It adds three new nodes: Adds a way for players to obtain clay other than mining, out of a common material: dirt. It adds three new nodes:
Claycrafter: Used to convert compressed dirt into clay. **Claycrafter:** Used to convert compressed dirt into clay.
Compressed dirt: Just 9 dirt, compressed, useful for saving storage space, too! (Not present if moreblocks is installed, use moreblocks:dirt_compressed instead) **Compressed dirt:** Just 9 dirt, compressed, useful for saving storage space, too!
(Not present if moreblocks is installed, use moreblocks:dirt_compressed instead)
**Glass of water:** Used as fuel for the Claycrafter. Placeable.
For extra info look at the [Forum Thread](https://forum.minetest.net/viewtopic.php?f=11&t=13992)
Glass of water: Used as fuel for the Claycrafter. Placeable.
##### Dependencies: ##### Dependencies:
Default Default
@ -15,18 +19,13 @@ Vessels
##### Optional dependencies: ##### Optional dependencies:
moreblocks moreblocks
Special thanks to everamzah
##### License for Code ##### License for Code
Dragonop (LGPLv3) Dragonop (LGPLv3)
##### License for Media ##### License for Media
Textures created or modified by Dragonop (CC-BY-SA 4.0) Textures created or modified by Dragonop (CC-BY-SA 4.0)
Glass of water derived from the Drinking Glass texture from the vessels mod made by Thomas-S which is distributed as (CC-BY-SA 3.0) Glass of water derived from the Drinking Glass texture from the vessels mod made by Thomas-S which is distributed as (CC-BY-SA 3.0)
Compressed dirt derived from the minetest's game default dirt texture made by Neuromancer and later modified by random-geek which is distributed as (CC-BY-SA 3.0) Compressed dirt derived from the minetest's game default dirt texture made by Neuromancer and later modified by random-geek which is distributed as (CC-BY-SA 3.0)
Arrow textures by Blockmen, from minetest game's default, distributed under (CC-BY-SA 3.0) Arrow textures by Blockmen, from minetest game's default, distributed under (CC-BY-SA 3.0)
##### Special thanks to everamzah

BIN
mods/doors/screenshot.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View file

@ -65,7 +65,7 @@ end
-- check for member name -- check for member name
local is_member = function (meta, name) local is_member = function(meta, name)
if factions_available if factions_available
and meta:get_int("faction_members") == 1 then and meta:get_int("faction_members") == 1 then
@ -81,6 +81,9 @@ local is_member = function (meta, name)
else else
-- is member if player and owner share at least one faction -- is member if player and owner share at least one faction
local owner_factions = factions.get_player_factions(name) local owner_factions = factions.get_player_factions(name)
local owner = meta:get_string("owner")
if owner_factions ~= nil and owner_factions ~= false then
for _, f in ipairs(owner_factions) do for _, f in ipairs(owner_factions) do
@ -90,6 +93,7 @@ local is_member = function (meta, name)
end end
end end
end end
end
for _, n in pairs(get_member_list(meta)) do for _, n in pairs(get_member_list(meta)) do
@ -173,11 +177,13 @@ local protector_formspec = function(meta)
checkbox_faction = true checkbox_faction = true
end end
else else
if factions.get_player_factions(meta:get_string("owner")) ~= nil then
if next(factions.get_player_faction(meta:get_string("owner"))) then if next(factions.get_player_faction(meta:get_string("owner"))) then
checkbox_faction = true checkbox_faction = true
end end
end end
end end
end
if checkbox_faction then if checkbox_faction then
formspec = formspec .. "checkbox[0,5;faction_members;" formspec = formspec .. "checkbox[0,5;faction_members;"
@ -444,6 +450,19 @@ local check_overlap = function(itemstack, placer, pointed_thing)
end end
-- remove protector display entities
local del_display = function(pos)
local objects = minetest.get_objects_inside_radius(pos, 0.5)
for _, v in ipairs(objects) do
if v:get_luaentity().name == "protector:display" then
v:remove()
end
end
end
-- temporary pos store -- temporary pos store
local player_pos = {} local player_pos = {}
@ -521,17 +540,14 @@ minetest.register_node("protector:protect", {
on_blast = function() end, on_blast = function() end,
after_destruct = function(pos, oldnode) after_destruct = del_display
local objects = minetest.get_objects_inside_radius(pos, 0.5)
for _, v in ipairs(objects) do
v:remove()
end
end,
}) })
-- default recipe and alternative for MineClone2 -- default recipe and alternative for MineClone2
if protector_recipe then if protector_recipe then
if minetest.registered_items["default:stone"] then if minetest.registered_items["default:stone"] then
minetest.register_craft({ minetest.register_craft({
output = "protector:protect", output = "protector:protect",
recipe = { recipe = {
@ -541,6 +557,7 @@ if protector_recipe then
} }
}) })
else else
minetest.register_craft({ minetest.register_craft({
output = "protector:protect", output = "protector:protect",
recipe = { recipe = {
@ -627,12 +644,7 @@ minetest.register_node("protector:protect2", {
on_blast = function() end, on_blast = function() end,
after_destruct = function(pos, oldnode) after_destruct = del_display
local objects = minetest.get_objects_inside_radius(pos, 0.5)
for _, v in ipairs(objects) do
v:remove()
end
end,
}) })
-- recipes to switch between protectors -- recipes to switch between protectors

View file

@ -78,6 +78,8 @@ minetest.after(0.1, function()
regrow.add_fruit("ethereal:banana", "ethereal:bananaleaves") regrow.add_fruit("ethereal:banana", "ethereal:bananaleaves")
regrow.add_fruit("ethereal:orange", "ethereal:orange_leaves") regrow.add_fruit("ethereal:orange", "ethereal:orange_leaves")
regrow.add_fruit("ethereal:coconut", "ethereal:palmleaves") regrow.add_fruit("ethereal:coconut", "ethereal:palmleaves")
regrow.add_fruit("ethereal:lemon", "ethereal:lemon_leaves")
regrow.add_fruit("ethereal:olive", "ethereal:olive_leaves")
-- regrow.add_fruit("ethereal:golden_apple", "ethereal:yellowleaves") -- regrow.add_fruit("ethereal:golden_apple", "ethereal:yellowleaves")
end) end)

View file

@ -24,3 +24,4 @@ Changelog
- 0.2 - Add checks for player placed fruit and tree's nearby. - 0.2 - Add checks for player placed fruit and tree's nearby.
- 0.3 - Make add_fruit a global function for other mods to use. - 0.3 - Make add_fruit a global function for other mods to use.
- 0.4 - Add check for fruit tree leaf type before re-growing. - 0.4 - Add check for fruit tree leaf type before re-growing.
- 0.5 - Ethereal Lemons and Olives can now regrow.

BIN
mods/regrow/screenshot.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

View file

@ -0,0 +1,3 @@
Goebbels
Goebbels
CC BY-SA 3.0

View file

@ -0,0 +1,3 @@
Thinky
Thinky
CC BY-SA 3.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 878 B