develop #24

Merged
milan merged 4 commits from develop into master 2020-12-30 10:35:09 +01:00
69 changed files with 447 additions and 332 deletions

View File

@ -416,6 +416,12 @@ end
armor.damage = function(self, player, index, stack, use)
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)
self:run_callbacks("on_damage", player, index, stack)
self:set_inventory_stack(player, index, stack)

View File

@ -5,3 +5,4 @@ pova?
fire?
ethereal?
bakedclay?
moreores?

View File

@ -389,13 +389,20 @@ if armor.config.drop == true or armor.config.destroy == true then
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
if armor.config.punch_damage == true then
minetest.register_on_punchplayer(function(player, hitter,
time_from_last_punch, tool_capabilities)
local name = player:get_player_name()
if name then
local hit_ip = hitter:is_player()
if name and hit_ip and minetest.is_protected(player:get_pos(), "") then
return
elseif name then
armor:punch(player, hitter, time_from_last_punch, tool_capabilities)
last_punch_time[name] = minetest.get_gametime()
end

View File

@ -12,39 +12,39 @@
Admin Boots=Botas de admin
Admin Chestplate=Peto de admin
Admin Helmet=Casco de admin
Admin Leggings=Polainas de admin
Admin Leggings=Grebas de admin
Bronze Boots=Botas de bronce
Bronze Chestplate=Peto de bronce
Bronze Helmet=Casco de bronce
Bronze Leggings=Polainas de bronce
Bronze Leggings=Grebas de bronce
Cactus Boots=Botas de cactus
Cactus Chestplate=Peto de cactus
Cactus Helmet=Casco de cactus
Cactus Leggings=Polainas de cactus
Cactus Leggings=Grebas de cactus
Crystal Boots=Botas de cristal
Crystal Chestplate=Peto de cristal
Crystal Helmet=Casco de cristal
Crystal Leggings=Polainas de cristal
Crystal Leggings=Grebas de cristal
Diamond Boots=Botas de diamante
Diamond Chestplate=Peto de diamante
Diamond Helmet=Casco de diamante
Diamond Leggings=Polainas de diamante
Diamond Leggings=Grebas de diamante
Gold Boots=Botas de oro
Gold Chestplate=Peto de oro
Gold Helmet=Casco de oro
Gold Leggings=Polainas de oro
Gold Leggings=Grebas de oro
Mithril Boots=Botas de mitrilo
Mithril Chestplate=Peto de mitrilo
Mithril Helmet=Casco de mitrilo
Mithril Leggings=Polainas de mitrilo
Mithril Leggings=Grebas de mitrilo
Steel Boots=Botas de acero
Steel Chestplate=Peto de acero
Steel Helmet=Casco de acero
Steel Leggings=Polainas de acero
Steel Leggings=Grebas de acero
Wood Boots=Botas de madera
Wood Chestplate=Peto de madera
Wood Helmet=Casco de madera
Wood Leggings=Polainas de madera
Wood Leggings=Grebas de madera
### init.lua ###
@ -54,54 +54,5 @@ Heal=Salud
Level=Nivel
Radiation=Radiación
Your @1 got destroyed!=¡Tu @1 fue destruído!
Your @1 is almost broken!=
Your @1 is almost broken!=¡Tu @1 esta a punto de romperse!
[3d_armor] Fire Nodes disabled=[3d_armor] Nodos de fuego desabilitados
##### not used anymore #####
3d_armor: Player inventory is nil @1=3d_armor: El inventario del jugador es nulo @1
3d_armor_ip: Mod loaded but unused.=3d_armor_ip: Mod cargado, pero sin ser usado.
Back=Volver
Armor=Armadura
3d_armor_sfinv: Mod loaded but unused.=3d_armor_sfinv: Mod cargado, pero sin ser usado.
Armor stand top=Parte arriba maniquí armadura
Armor stand=Maniquí para armadura
Armor Stand=Maniquí para armadura
Locked Armor stand=Maniquí para armadura (bloqueado)
Armor Stand (owned by @1)=Maniquí para armadura (propiedad de @1)
3d_armor_ui: Mod loaded but unused.=3d_armor_ui: Mod cargado, pero sin ser usado.
3d Armor=Armadura 3d
Armor not initialized!=¡Armadura no inicializada!
hazmat_suit: Mod loaded but unused.=hazmat_suit: Mod cargado, pero sin ser usado.
Hazmat Helmet=Casco de hazmat
Hazmat Chestplate=Peto de hazmat
Hazmat Sleeve=Manga de hazmat
Hazmat Leggins=Polainas de hazmat
Hazmat Boots=Botas de hazmat
Hazmat Suit=Traje de hazmat
Admin Shield=Escudo de admin
Wooden Shield=Escudo de madera
Enhanced Wood Shield=Escudo de madera mejorado
Cactus Shield=Escudo de cactus
Enhanced Cactus Shield=Escudo de cactus mejorado
Steel Shield=Escudo de acero
Bronze Shield=Escudo de bronce
Diamond Shield=Escudo de diamante
Gold Shield=Escudo de oro
Mithril Shield=Escudo de mitrilo
Crystal Shield=Escudo de cristal
technic_armor: Mod loaded but unused.=technic_armor: Mod cargado, pero no usado.
Lead=Plomo
Brass=Latón
Cast Iron=Hierro fundido
Carbon Steel=Acero carbono
Stainless Steel=Acero inoxidable
Tin=Estaño
Silver=Plata
Helmet=Casco
Chestplate=Peto
Leggins=Polainas
Boots=Botas
Shield=Escudo
@1 @2=@2 de @1

View File

@ -1,4 +1,4 @@
name = 3d_armor
depends = default
optional_depends = player_monoids, armor_monoid, pova, fire, ethereal, bakedclay
optional_depends = player_monoids, armor_monoid, pova, fire, ethereal, bakedclay, moreores
description = Adds craftable armor that is visible to other players.

View File

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

View File

@ -129,11 +129,13 @@ local get_ambience = function(player, tod, name)
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
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

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
--
-- FUNCTIONS
--
local floor = math.floor
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 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})
end
end
--
-- NODES
--
minetest.register_node("bees:extractor", {
description = S("Honey Extractor"),
@ -77,11 +81,11 @@ minetest.register_node("bees:extractor", {
tubedevice_receiver = 1
},
on_construct = function(pos, node)
on_construct = function(pos)
local meta = minetest.get_meta(pos)
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_emptied", 1)
@ -90,22 +94,23 @@ minetest.register_node("bees:extractor", {
inv:set_size("wax", 1)
meta:set_string("formspec", "size[8,9]"
--input
-- input
.. "list[nodemeta:"..pos..";frames_filled;2,1;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..";wax;5,2;1,1;]"
.. "list[nodemeta:"..pos..";bottles_full;5,3.5;1,1;]"
--player inventory
-- player inventory
.. "list[current_player;main;0,5;8,4;]"
)
end,
on_timer = function(pos, node)
on_timer = function(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local timer = minetest.get_node_timer(pos)
if not inv:contains_item("frames_filled", "bees:frame_full")
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("bottles_full", "bees:bottle_honey") then
--add to output
-- add to output
inv:add_item("frames_emptied", "bees:frame_empty")
inv:add_item("wax", "bees:wax")
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("frames_filled", "bees:frame_full")
local p = {
x = pos.x + random() - 0.5,
y = pos.y + random() - 0.5,
z = pos.z + random() - 0.5
}
--wax flying all over the place
-- wax flying all over the place
minetest.add_particle({
pos = {x = pos.x, y = pos.y, z = pos.z},
vel = {
velocity = {
x = random(-1, 1),
y = random(4),
z = random(-1, 1)
},
acc = {x = 0, y = -6, z = 0},
acceleration = {x = 0, y = -6, z = 0},
expirationtime = 2,
size = random(1, 3),
collisiondetection = false,
texture = "bees_wax_particle.png",
})
local timer = minetest.get_node_timer(pos)
timer:start(5)
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,
tube = {
insert_object = function(pos, node, stack, direction)
insert_object = function(pos, _, stack)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
@ -183,18 +178,18 @@ minetest.register_node("bees:extractor", {
return stack
end,
can_insert = function(pos,node,stack,direction)
can_insert = function(pos, _, stack)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
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
return inv:room_for_item("bottles_empty",stack)
return inv:room_for_item("bottles_empty", stack)
end
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}
},
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 meta = minetest.get_meta(pos)
@ -217,7 +212,7 @@ minetest.register_node("bees:extractor", {
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")
or (listname == "frames_filled" and stack:get_name() == "bees:frame_full") then
@ -227,11 +222,11 @@ minetest.register_node("bees:extractor", {
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
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
return 0
@ -247,14 +242,12 @@ minetest.register_node("bees:bees", {
drawtype = "plantlike",
paramtype = "light",
groups = {not_in_creative_inventory = 1},
tiles = {
{
name = "bees_strip.png",
animation = {
type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 2.0
}
tiles = {{
name = "bees_strip.png",
animation = {
type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 2.0
}
},
}},
damage_per_second = 1,
walkable = false,
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)
end,
})
@ -274,7 +266,7 @@ minetest.register_node("bees:bees", {
minetest.register_node("bees:hive_wild", {
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_bottom.png"
},
@ -284,17 +276,17 @@ minetest.register_node("bees:hive_wild", {
drop = {
max_items = 6,
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},
node_box = { --VanessaE's wild hive nodebox contribution
node_box = { -- VanessaE's wild hive nodebox contribution
type = "fixed",
fixed = {
{-0.250000,-0.500000,-0.250000,0.250000,0.375000,0.250000}, --NodeBox 2
{-0.312500,-0.375000,-0.312500,0.312500,0.250000,0.312500}, --NodeBox 4
{-0.375000,-0.250000,-0.375000,0.375000,0.125000,0.375000}, --NodeBox 5
{-0.062500,-0.500000,-0.062500,0.062500,0.500000,0.062500}, --NodeBox 6
{-0.25, -0.5, -0.25, 0.25, 0.375, 0.25},
{-0.3125, -0.375, -0.3125, 0.3125, 0.25, 0.3125},
{-0.375, -0.25, -0.375, 0.375, 0.125, 0.375},
{-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")
for k, v in pairs(stacks) do
for k, _ in pairs(stacks) do
if inv:get_stack("combs", k):is_empty() then
@ -339,7 +331,7 @@ minetest.register_node("bees:hive_wild", {
return
end
end
--what to do if all combs are filled
-- what to do if all combs are filled
end,
on_construct = function(pos)
@ -363,7 +355,7 @@ minetest.register_node("bees:hive_wild", {
end
end,
on_punch = function(pos, node, puncher)
on_punch = function(pos, _, puncher)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
@ -374,7 +366,7 @@ minetest.register_node("bees:hive_wild", {
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 inv = meta:get_inventory()
@ -388,7 +380,7 @@ minetest.register_node("bees:hive_wild", {
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)
@ -397,9 +389,9 @@ minetest.register_node("bees:hive_wild", {
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
return 1
else
@ -407,7 +399,7 @@ minetest.register_node("bees:hive_wild", {
end
end,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
on_rightclick = function(pos, _, clicker, itemstack)
minetest.show_formspec(clicker:get_player_name(),
"bees:hive_artificial",
@ -426,7 +418,7 @@ minetest.register_node("bees:hive_wild", {
end
end,
can_dig = function(pos,player)
can_dig = function(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
@ -438,10 +430,9 @@ minetest.register_node("bees:hive_wild", {
end
end,
after_dig_node = function(pos, oldnode, oldmetadata, user)
after_dig_node = function(_, _, _, user)
local wielded
if user:get_wielded_item() ~= nil then
wielded = user:get_wielded_item()
else
@ -488,7 +479,6 @@ minetest.register_node("bees:hive_artificial", {
on_construct = function(pos)
local timer = minetest.get_node_timer(pos)
local meta = minetest.get_meta(pos)
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"))
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
end
minetest.show_formspec(clicker:get_player_name(),
minetest.show_formspec(player_name,
"bees:hive_artificial",
hive_artificial(pos)
)
@ -523,7 +515,7 @@ minetest.register_node("bees:hive_artificial", {
end
end,
on_timer = function(pos,elapsed)
on_timer = function(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
@ -555,7 +547,7 @@ minetest.register_node("bees:hive_artificial", {
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
@ -578,7 +570,7 @@ minetest.register_node("bees:hive_artificial", {
end
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
on_metadata_inventory_take = function(pos, listname)
if listname == "queen" then
@ -591,7 +583,7 @@ minetest.register_node("bees:hive_artificial", {
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()
@ -607,7 +599,7 @@ minetest.register_node("bees:hive_artificial", {
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 inv = meta:get_inventory()
@ -627,7 +619,7 @@ minetest.register_node("bees:hive_artificial", {
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
@ -648,7 +640,10 @@ minetest.register_node("bees:hive_artificial", {
end,
})
-- ABMS
--
-- ABMs
--
minetest.register_abm({
nodenames = {"bees:hive_artificial", "bees:hive_wild", "bees:hive_industrial"},
@ -660,12 +655,12 @@ minetest.register_abm({
-- Bee particle
minetest.add_particle({
pos = {x = pos.x, y = pos.y, z = pos.z},
vel = {
velocity = {
x = (random() - 0.5) * 5,
y = (random() - 0.5) * 5,
z = (random() - 0.5) * 5
},
acc = {
acceleration = {
x = random() - 0.5,
y = 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({
nodenames = {"group:leaves"},
neighbors = {"air"},
interval = 800,--1600,
chance = 10,--20,
interval = 800,
chance = 10,
action = function(pos, node)
action = function(pos)
if floor(pos.x / 40) ~= pos.x / 40
or floor(pos.z / 40) ~= pos.z / 40
@ -725,7 +720,7 @@ minetest.register_abm({
interval = 30,
chance = 4,
action = function(pos, node, _, _)
action = function(pos)
local p = {
x = pos.x + random(-5, 5),
@ -746,13 +741,15 @@ minetest.register_abm({
interval = 30,
chance = 5,
action = function(pos, node, _, _)
action = function(pos)
minetest.remove_node(pos)
end,
})
--
-- ITEMS
--
minetest.register_craftitem("bees:frame_empty", {
description = S("Empty hive frame"),
@ -794,7 +791,9 @@ minetest.register_craftitem("bees:queen", {
})
--
-- CRAFTS
--
minetest.register_craft({
output = "bees:extractor",
@ -852,7 +851,9 @@ if minetest.get_modpath("bushes_classic") then
end
--
-- TOOLS
--
minetest.register_tool("bees:smoker", {
description = S("smoker"),
@ -863,7 +864,7 @@ minetest.register_tool("bees:smoker", {
damage_groups = {fleshy = 2},
},
on_use = function(itemstack, user, pointed_thing)
on_use = function(itemstack, _, pointed_thing)
if pointed_thing.type ~= "node" then
return
@ -879,8 +880,8 @@ minetest.register_tool("bees:smoker", {
y = pos.y,
z = pos.z + random() - 0.5
},
vel = {x = 0, y = 0.5 + random(), z = 0},
acc = {x = 0, y = 0, z = 0},
velocity = {x = 0, y = 0.5 + random(), z = 0},
acceleration = {x = 0, y = 0, z = 0},
expirationtime = 2 + random(2.5),
size = random(3),
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
minetest.register_alias("bees:honey_extractor", "bees:extractor")
@ -952,7 +956,9 @@ minetest.register_lbm({
})
--
-- PIPEWORKS
--
if minetest.get_modpath("pipeworks") then
@ -967,7 +973,7 @@ if minetest.get_modpath("pipeworks") then
sounds = default.node_sound_wood_defaults(),
tube = {
insert_object = function(pos, node, stack, direction)
insert_object = function(pos, _, stack)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
@ -996,7 +1002,7 @@ if minetest.get_modpath("pipeworks") then
return stack
end,
can_insert = function(pos,node,stack,direction)
can_insert = function(pos, _, stack)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
@ -1016,7 +1022,7 @@ if minetest.get_modpath("pipeworks") then
return false
end,
can_remove = function(pos,node,stack,direction)
can_remove = function(_, _, stack)
if stack:get_name() == "bees:frame_full" then
return 1
@ -1032,7 +1038,6 @@ if minetest.get_modpath("pipeworks") then
on_construct = function(pos)
local timer = minetest.get_node_timer(pos)
local meta = minetest.get_meta(pos)
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"))
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
end
minetest.show_formspec(clicker:get_player_name(),
minetest.show_formspec(player_name,
"bees:hive_artificial",
hive_artificial(pos)
)
@ -1067,7 +1074,7 @@ if minetest.get_modpath("pipeworks") then
end
end,
on_timer = function(pos,elapsed)
on_timer = function(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
@ -1097,7 +1104,7 @@ if minetest.get_modpath("pipeworks") then
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
@ -1120,7 +1127,7 @@ if minetest.get_modpath("pipeworks") then
end
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
on_metadata_inventory_take = function(pos, listname)
if listname == "queen" then
@ -1133,7 +1140,7 @@ if minetest.get_modpath("pipeworks") then
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()
@ -1149,7 +1156,7 @@ if minetest.get_modpath("pipeworks") then
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 inv = meta:get_inventory()
@ -1169,7 +1176,7 @@ if minetest.get_modpath("pipeworks") then
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
@ -1203,17 +1210,18 @@ if minetest.get_modpath("pipeworks") then
end
--
-- LUCKY BLOCKS
--
if minetest.get_modpath("lucky_block") then
local add_bees = function(pos, player)
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(),
violet .. S("Bees! Bees for all!"))
minetest.colorize("violet", S("Bees! Bees for all!")))
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

@ -19,6 +19,7 @@ for _, color in pairs(bridger_colors) do
end
local bridger_error1 = {
"block_",
"step_",
"suspension_top_",
"suspension_cable_",

View File

@ -1,24 +1,31 @@
# claycrafter
Minetest clay crafter mod. Adds a way to craft clay out of compressed dirt.
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:
Dependencies:
Default
Vessels
Bucket
**Claycrafter:** Used to convert compressed dirt into clay.
claycrafter.lua is derivated from furnace.lua (minetest_game) by PilzAdam and Amaz1.
Edited by everamzah to work for this mod.
**Compressed dirt:** Just 9 dirt, compressed, useful for saving storage space, too!
(Not present if moreblocks is installed, use moreblocks:dirt_compressed instead)
#####License for Code
**Glass of water:** Used as fuel for the Claycrafter. Placeable.
Dragonop (LGPLv3)
For extra info look at the [Forum Thread](https://forum.minetest.net/viewtopic.php?f=11&t=13992)
#####License for Media
Textures created or modified by Dragonop (CC-BY-SA 4.0)
##### Dependencies:
Default
Vessels
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)
##### Optional dependencies:
moreblocks
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)
##### License for Code
Dragonop (LGPLv3)
Arrow textures by Blockmen, from minetest game's default, distributed under (CC-BY-SA 3.0)
##### License for Media
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)
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)
##### Special thanks to everamzah

View File

@ -203,8 +203,16 @@ minetest.register_abm({
local cooktime = minetest.get_item_group(inv:get_stack("fuel", 1):get_name(), "h2o")
local cookable = true
if inv:get_stack("src", 1):get_name() ~= "claycrafter:compressed_dirt" then
cookable = false
if minetest.get_modpath("moreblocks") ~= nil then
if inv:get_stack("src", 1):get_name() ~= "moreblocks:dirt_compressed" then
cookable = false
end
else
if inv:get_stack("src", 1):get_name() ~= "claycrafter:compressed_dirt" then
cookable = false
end
end
-- Check if we have enough fuel to burn

View File

@ -3,5 +3,4 @@ local modpath = minetest.get_modpath("claycrafter")
-- TODO: Investigate function to automatically get mod name.
dofile(modpath .. "/items.lua")
dofile(modpath .. "/recipes.lua")
dofile(modpath .. "/claycrafter.lua")

View File

@ -1,9 +1,31 @@
minetest.register_node("claycrafter:compressed_dirt", {
--compressed dirt
local moreblocks = minetest.get_modpath("moreblocks")
if moreblocks ~= nil then
minetest.register_alias("claycrafter:compressed_dirt","moreblocks:dirt_compressed")
else
minetest.register_craft({
output = "claycrafter:compressed_dirt",
recipe = {
{"default:dirt", "default:dirt", "default:dirt"},
{"default:dirt", "default:dirt", "default:dirt"},
{"default:dirt", "default:dirt", "default:dirt"}
}
})
minetest.register_node("claycrafter:compressed_dirt", {
description = "Compressed Dirt",
tiles = {"claycrafter_compressed_dirt.png"},
groups = {crumbly = 1, oddly_breakable_by_hand = 1, soil = 1, cracky =1}
})
groups = {crumbly = 1, oddly_breakable_by_hand = 1, soil = 1, cracky =1},
sounds = default.node_sound_dirt_defaults(),
})
minetest.register_craft({
output = "default:dirt 9",
recipe = {{"claycrafter:compressed_dirt"}}
})
minetest.register_alias("moreblocks:dirt_compressed","claycrafter:compressed_dirt")
end
--nodes
minetest.register_node("claycrafter:glass_of_water", {
description = ("Glass of Water"),
drawtype = "plantlike",
@ -19,3 +41,25 @@ minetest.register_node("claycrafter:glass_of_water", {
on_use = minetest.item_eat(0,"vessels:drinking_glass"),
sounds = default.node_sound_glass_defaults(),
})
--recipes
minetest.register_craft({
output = "claycrafter:glass_of_water 8",
recipe = {
{"vessels:drinking_glass", "vessels:drinking_glass", "vessels:drinking_glass"},
{"vessels:drinking_glass", "bucket:bucket_water", "vessels:drinking_glass"},
{"vessels:drinking_glass", "vessels:drinking_glass", "vessels:drinking_glass"}
},
replacements = {
{"bucket:bucket_water", "bucket:bucket_empty"},
}
})
minetest.register_craft({
output = "claycrafter:claycrafter",
recipe = {
{"group:wood", "default:steel_ingot", "group:wood"},
{"group:wood", "default:glass", "group:wood"},
{"default:stick", "bucket:bucket_water", "default:stick"}
}
})

View File

@ -1,4 +1,5 @@
name = claycrafter
description = This mod introduces the Claycrafter, which converts Compressed Dirt to Clay using Glasses of Water.
depends = vessels, default, bucket
depends = vessels, default
optional_depends = moreblocks
author = Dragonop

View File

@ -1,34 +0,0 @@
minetest.register_craft({
output = "claycrafter:compressed_dirt",
recipe = {
{"default:dirt", "default:dirt", "default:dirt"},
{"default:dirt", "default:dirt", "default:dirt"},
{"default:dirt", "default:dirt", "default:dirt"}
}
})
minetest.register_craft({
output = "default:dirt 9",
recipe = {{"claycrafter:compressed_dirt"}}
})
minetest.register_craft({
output = "claycrafter:glass_of_water 8",
recipe = {
{"vessels:drinking_glass", "vessels:drinking_glass", "vessels:drinking_glass"},
{"vessels:drinking_glass", "bucket:bucket_water", "vessels:drinking_glass"},
{"vessels:drinking_glass", "vessels:drinking_glass", "vessels:drinking_glass"}
},
replacements = {
{"bucket:bucket_water", "bucket:bucket_empty"},
}
})
minetest.register_craft({
output = "claycrafter:claycrafter",
recipe = {
{"group:wood", "default:steel_ingot", "group:wood"},
{"group:wood", "default:glass", "group:wood"},
{"default:stick", "bucket:bucket_water", "default:stick"}
}
})

BIN
mods/doors/screenshot.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]
### Fixed
- [Fixed strange placement behavior for non-default Stairs+ nodes.](https://github.com/minetest-mods/moreblocks/pull/168)
- [Fixed stairs placement over oddly-shaped nodes.](https://github.com/minetest-mods/moreblocks/pull/166)
## [2.1.0] - 2020-12-14
### Added

View File

@ -30,16 +30,25 @@ local wall_right_dirmap = {9, 18, 7, 12}
local wall_left_dirmap = {11, 16, 5, 14}
local ceil_dirmap = {20, 23, 22, 21}
-- extract the stairsplus category from a node name
-- assumes the name is in the form mod_name:category_original_ndoe_name
local function name_to_category(name)
local colon = name:find(":") or 0
colon = colon + 1
local under = name:find("_", colon)
return name:sub(colon, under)
end
stairsplus.rotate_node_aux = function(itemstack, placer, pointed_thing)
local sneak = placer and placer:get_player_control().sneak
local aux = placer and placer:get_player_control().aux1
-- namestring for what we are placing, up to the first _ (exclusive)
local item_prefix = itemstack:get_name():gsub("_.*$", "")
-- namestring for what we are placing against
-- category for what we are placing
local item_prefix = name_to_category(itemstack:get_name())
-- category for what we are placing against
local under = pointed_thing.under
local under_node = minetest.get_node(under)
local under_prefix = under_node and under_node.name:gsub("_.*$", "")
local under_prefix = under_node and name_to_category(under_node.name)
local same_cat = item_prefix == under_prefix
@ -51,7 +60,10 @@ stairsplus.rotate_node_aux = function(itemstack, placer, pointed_thing)
-- and in general for sneak placement
local face_pos = minetest.pointed_thing_to_face_pos(placer, pointed_thing)
local face_off = vector.subtract(face_pos, under)
local wallmounted = minetest.dir_to_wallmounted(face_off)
-- we cannot trust face_off to tell us the correct directionif the
-- under node has a non-standard shape, so use the distance between under and above
local wallmounted = minetest.dir_to_wallmounted(vector.subtract(pointed_thing.above, under))
if same_cat and not aux then
p2 = under_node.param2

View File

@ -25,7 +25,7 @@ function stairsplus:prepare_groups(groups)
local result = {}
if groups then
for k, v in pairs(groups) do
if k ~= "wood" and k ~= "stone" then
if k ~= "wood" and k ~= "stone" and k ~= "wool" and k ~= "tree" then
result[k] = v
end
end

View File

@ -106,9 +106,6 @@ if minetest.get_modpath("wool") then
local ndef = table.copy(minetest.registered_nodes[nodename])
ndef.sunlight_propagates = true
-- Prevent dye+cut wool recipy from creating a full wool block.
ndef.groups.wool = nil
stairsplus:register_all(mod, name, nodename, ndef)
end
end

View File

@ -65,7 +65,7 @@ end
-- check for member name
local is_member = function (meta, name)
local is_member = function(meta, name)
if factions_available
and meta:get_int("faction_members") == 1 then
@ -81,11 +81,15 @@ local is_member = function (meta, name)
else
-- is member if player and owner share at least one faction
local owner_factions = factions.get_player_factions(name)
local owner = meta:get_string("owner")
for _, f in ipairs(owner_factions) do
if owner_factions ~= nil and owner_factions ~= false then
if factions.player_is_in_faction(f, owner) then
return true
for _, f in ipairs(owner_factions) do
if factions.player_is_in_faction(f, owner) then
return true
end
end
end
end
@ -173,8 +177,10 @@ local protector_formspec = function(meta)
checkbox_faction = true
end
else
if next(factions.get_player_faction(meta:get_string("owner"))) then
checkbox_faction = true
if factions.get_player_factions(meta:get_string("owner")) ~= nil then
if next(factions.get_player_faction(meta:get_string("owner"))) then
checkbox_faction = true
end
end
end
end
@ -444,6 +450,19 @@ local check_overlap = function(itemstack, placer, pointed_thing)
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
local player_pos = {}
@ -521,34 +540,32 @@ minetest.register_node("protector:protect", {
on_blast = function() end,
after_destruct = function(pos, oldnode)
local objects = minetest.get_objects_inside_radius(pos, 0.5)
for _, v in ipairs(objects) do
v:remove()
end
end,
after_destruct = del_display
})
-- default recipe and alternative for MineClone2
if protector_recipe then
if minetest.registered_items["default:stone"] then
minetest.register_craft({
output = "protector:protect",
recipe = {
{"default:stone", "default:stone", "default:stone"},
{"default:stone", "default:gold_ingot", "default:stone"},
{"default:stone", "default:stone", "default:stone"},
}
})
minetest.register_craft({
output = "protector:protect",
recipe = {
{"default:stone", "default:stone", "default:stone"},
{"default:stone", "default:gold_ingot", "default:stone"},
{"default:stone", "default:stone", "default:stone"},
}
})
else
minetest.register_craft({
output = "protector:protect",
recipe = {
{"mcl_core:stone", "mcl_core:stone", "mcl_core:stone"},
{"mcl_core:stone", "mcl_core:gold_ingot", "mcl_core:stone"},
{"mcl_core:stone", "mcl_core:stone", "mcl_core:stone"},
}
})
minetest.register_craft({
output = "protector:protect",
recipe = {
{"mcl_core:stone", "mcl_core:stone", "mcl_core:stone"},
{"mcl_core:stone", "mcl_core:gold_ingot", "mcl_core:stone"},
{"mcl_core:stone", "mcl_core:stone", "mcl_core:stone"},
}
})
end
end
@ -627,12 +644,7 @@ minetest.register_node("protector:protect2", {
on_blast = function() end,
after_destruct = function(pos, oldnode)
local objects = minetest.get_objects_inside_radius(pos, 0.5)
for _, v in ipairs(objects) do
v:remove()
end
end,
after_destruct = del_display
})
-- 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:orange", "ethereal:orange_leaves")
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")
end)

View File

@ -24,3 +24,4 @@ Changelog
- 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.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

View File

@ -1,6 +1,27 @@
# Release Notes for ModPack TechPack [techpack]
## V2.04.01 (2020-12-18)
### Additions
### Removals
### Changes
- Suggestion to check replanting against commonly plantable nodes
instead of quarry-able GroundNodes (pull request #60 from oversword)
- Add a on_blast callback to tubes so they update after being destroyed
(pull request #58 from oversword)
- Disallow non-fuel items to be accepted as fuel quarries and harvesters
(pull request #57 from oversword)
- Check harvester protection for each node it attempts to harvest
(pull request #59 from oversword)
### Fixes
- Warehouse voiding items when both pushing in and pulling out
(issue #61, fixed by oversword)
## V2.04.00 (2020-11-20)

View File

@ -132,7 +132,7 @@ tubelib.register_node(NODE_NAME,
on_push_item = function(pos, side, item)
local meta = M(pos)
meta:set_string("push_dir", wh.Turn180[side])
local num = wh.numbers_to_shift(Box, meta, item)
local num = wh.inv_add_item(Box, meta, item)
if num > 0 then
item:set_count(num)
return tubelib.put_item(meta, "shift", item)
@ -146,7 +146,14 @@ tubelib.register_node(NODE_NAME,
return tubelib.get_item(M(pos), "main")
end,
on_unpull_item = function(pos, side, item)
return tubelib.put_item(M(pos), "main", item)
local meta = M(pos)
local num = wh.inv_add_item(Box, meta, item)
if num > 0 then
-- this should never happen, but better safe than sorry
item:set_count(num)
return tubelib.put_item(meta, "shift", item)
end
return true
end,
on_recv_message = function(pos, topic, payload)

View File

@ -132,7 +132,7 @@ tubelib.register_node(NODE_NAME,
on_push_item = function(pos, side, item)
local meta = M(pos)
meta:set_string("push_dir", wh.Turn180[side])
local num = wh.numbers_to_shift(Box, meta, item)
local num = wh.inv_add_item(Box, meta, item)
if num > 0 then
item:set_count(num)
return tubelib.put_item(meta, "shift", item)
@ -146,7 +146,14 @@ tubelib.register_node(NODE_NAME,
return tubelib.get_item(M(pos), "main")
end,
on_unpull_item = function(pos, side, item)
return tubelib.put_item(M(pos), "main", item)
local meta = M(pos)
local num = wh.inv_add_item(Box, meta, item)
if num > 0 then
-- this should never happen, but better safe than sorry
item:set_count(num)
return tubelib.put_item(meta, "shift", item)
end
return true
end,
on_recv_message = function(pos, topic, payload)

View File

@ -132,7 +132,7 @@ tubelib.register_node(NODE_NAME,
on_push_item = function(pos, side, item)
local meta = M(pos)
meta:set_string("push_dir", wh.Turn180[side])
local num = wh.numbers_to_shift(Box, meta, item)
local num = wh.inv_add_item(Box, meta, item)
if num > 0 then
item:set_count(num)
return tubelib.put_item(meta, "shift", item)
@ -146,7 +146,14 @@ tubelib.register_node(NODE_NAME,
return tubelib.get_item(M(pos), "main")
end,
on_unpull_item = function(pos, side, item)
return tubelib.put_item(M(pos), "main", item)
local meta = M(pos)
local num = wh.inv_add_item(Box, meta, item)
if num > 0 then
-- this should never happen, but better safe than sorry
item:set_count(num)
return tubelib.put_item(meta, "shift", item)
end
return true
end,
on_recv_message = function(pos, topic, payload)

View File

@ -24,8 +24,6 @@ local COUNTDOWN_TICKS = 2
local CYCLE_TIME = 2
local Cache = {}
techpack_warehouse.Box = {}
techpack_warehouse.Turn180 = {F="B", L="R", B="F", R="L", U="D", D="U"}
@ -169,39 +167,33 @@ function techpack_warehouse.Box:new(attr)
return o
end
function techpack_warehouse.numbers_to_shift(self, meta, item)
-- check cache
local number = meta:get_string("tubelib_number")
local item_name = item:get_name()
if not Cache[number] then
local inv = meta:get_inventory()
Cache[number] = {}
for idx,items in ipairs(inv:get_list("filter")) do
Cache[number][idx] = items:get_name()
end
end
-- determine number to shift
-- We can't use the standard function "inv:add_item()" because this function
-- would not allow to add more than the default 99 items per stack.
function techpack_warehouse.inv_add_item(self, meta, item)
local num_items = item:get_count()
local inv_size = meta:get_int("inv_size")
local item_name = item:get_name()
local inv = meta:get_inventory()
local main_list = inv:get_list("main")
for idx, name in ipairs(Cache[number]) do
if item_name == name then
local stack_size = inv:get_stack("main", idx):get_count()
if stack_size == self.inv_size then -- full?
Cache[number][idx] = "" -- delete for searching
elseif (stack_size + num_items) > self.inv_size then -- limit will be reached?
inv:set_stack("main", idx, ItemStack({name = item_name, count = self.inv_size}))
Cache[number][idx] = "" -- delete for searching
-- search with the rest for further slots
num_items = num_items - (self.inv_size - stack_size)
else
inv:set_stack("main", idx, ItemStack({name = item_name, count = stack_size + num_items}))
return 0
for idx, stack in ipairs(main_list) do
-- If item configured
if item_name == inv:get_stack("filter", idx):get_name() then
local stack_size = stack:get_count()
-- If there is some space for further items
if stack_size < self.inv_size then
local new_stack_size = math.min(self.inv_size, stack_size + num_items)
main_list[idx] = ItemStack({name = item_name, count = new_stack_size})
-- calc new number of items
num_items = num_items - (new_stack_size - stack_size)
-- If everything is distributed
if num_items == 0 then
break
end
end
end
end
inv:set_list("main", main_list)
return num_items
end
@ -219,8 +211,6 @@ function techpack_warehouse.allow_metadata_inventory_put(self, pos, listname, in
if listname == "input" and item_name == stack:get_name() then
return math.min(stack:get_count(), self.inv_size - main_stack:get_count())
elseif listname == "filter" and item_name == main_stack:get_name() then
local number = M(pos):get_string("tubelib_number")
Cache[number] = nil
return 1
elseif listname == "shift" then
return stack:get_count()
@ -230,8 +220,6 @@ end
function techpack_warehouse.on_metadata_inventory_put(pos, listname, index, stack, player)
if listname == "input" then
local number = M(pos):get_string("tubelib_number")
Cache[number] = nil
minetest.after(0.5, move_to_main, pos, index)
end
end
@ -242,16 +230,12 @@ function techpack_warehouse.allow_metadata_inventory_take(pos, listname, index,
end
local inv = M(pos):get_inventory()
local main_stack = inv:get_stack("main", index)
local number = M(pos):get_string("tubelib_number")
if listname == "main" then
Cache[number] = nil
minetest.after(0.1, move_to_player_inv, player:get_player_name(), pos, index)
return 0
elseif listname == "filter" and main_stack:is_empty() then
Cache[number] = nil
return 1
elseif listname == "shift" then
Cache[number] = nil
return stack:get_count()
end
return 0
@ -265,8 +249,6 @@ function techpack_warehouse.on_receive_fields(self, pos, formname, fields, playe
if minetest.is_protected(pos, player:get_player_name()) then
return
end
local number = M(pos):get_string("tubelib_number")
Cache[number] = nil
self.State:state_button_event(pos, fields)
end

View File

@ -84,12 +84,14 @@ function Tube:get_node_lvm(pos)
local data = vm:get_data()
local param2_data = vm:get_param2_data()
local area = VoxelArea:new({MinEdge = MinEdge, MaxEdge = MaxEdge})
local idx = area:index(pos.x, pos.y, pos.z)
node = {
name = minetest.get_name_from_content_id(data[idx]),
param2 = param2_data[idx]
}
return node
local idx = area:indexp(pos)
if data[idx] and param2_data[idx] then
return {
name = minetest.get_name_from_content_id(data[idx]),
param2 = param2_data[idx]
}
end
return {name="ignore", param2=0}
end
-- Read param2 from a primary node at the given position.

View File

@ -59,11 +59,13 @@ function tubelib2.get_node_lvm(pos)
local param2_data = vm:get_param2_data()
local area = VoxelArea:new({MinEdge = MinEdge, MaxEdge = MaxEdge})
local idx = area:indexp(pos)
node = {
name = minetest.get_name_from_content_id(data[idx]),
param2 = param2_data[idx]
}
return node
if data[idx] and param2_data[idx] then
return {
name = minetest.get_name_from_content_id(data[idx]),
param2 = param2_data[idx]
}
end
return {name="ignore", param2=0}
end
local function update1(self, pos, dir)

View File

@ -73,6 +73,7 @@ World position=世界位置
Name=名称
HUD text color=HUD文本颜色
#new
Reset search and display everything=重置搜索并显示所有物品
Any item belonging to the @1 group=属于@1组的任何项目
Any item belonging to the groups @1=属于组@1的任何项目

View File

@ -73,6 +73,7 @@ World position=世界位置
Name=名稱
HUD text color=HUD文本顏色
#new
Reset search and display everything=重置搜索並顯示所有物品
Any item belonging to the @1 group=屬於@1組的任何項目
Any item belonging to the groups @1=屬於組@1的任何項目

View File

@ -26,8 +26,9 @@ Change log:
- 1.6 - Added bottle of Mead, Cider and Mint-Julep (textures by Darkstalker),
re-arranged code, tweaked lucky blocks, updated translations
- 1.7 - Added more uses for blue agave (fuel, paper, food, agave syrup)
- 1.8 - Added glass and bottles for Champagne, Brandy and Coffee Liquor (thanks Felfa)
Lucky Blocks: 15
Lucky Blocks: 18
Wine Mod API

View File

@ -72,7 +72,9 @@ local ferment = {
{"farming:wheat", "wine:glass_wheat_beer"},
{"farming:rice", "wine:glass_sake"},
{"farming:corn", "wine:glass_bourbon"},
{"farming:baked_potato", "wine:glass_vodka"}
{"farming:baked_potato", "wine:glass_vodka"},
{"farming:coffee_beans", "wine:glass_coffee_liquor"},
{"wine:glass_champagne_raw", "wine:glass_champagne"}
}
if mcl then
@ -125,7 +127,10 @@ local beverages = {
{"vodka", "Vodka", true, 2, 3},
{"cider", "Cider", true, 2, 6},
{"mead", "Honey-Mead", true, 4, 5},
{"mint", "Mint Julep", true, 4, 3}
{"mint", "Mint Julep", true, 4, 3},
{"brandy", "Brandy", true, 3, 4},
{"coffee_liquor", "Coffee Liquor", true, 3, 4},
{"champagne", "Champagne", true, 4, 5}
}
@ -213,7 +218,36 @@ for n = 1, #beverages do
end
-- override to add food group to wine glass
-- brandy recipe
minetest.register_craft({
type = "cooking",
cooktime = 15,
output = "wine:glass_brandy",
recipe = "wine:glass_wine"
})
-- Raw champagne
if minetest.get_modpath("farming")
and farming.mod and (farming.mod == "undo" or farming.mod == "redo") then
minetest.register_craftitem("wine:glass_champagne_raw", {
description = "Raw Champagne",
inventory_image = "wine_champagne_raw_glass.png",
groups = {vessel = 1, flammable = 3}
})
minetest.register_craft({
type = "shapeless",
output = "wine:glass_champagne_raw",
recipe = {
"wine:glass_wine", "farming:sugar"
}
})
end
-- override to add food group to wine and brandy glass
minetest.override_item("wine:glass_wine", {
groups = {
food_wine = 1, vessel = 1, dig_immediate = 3,
@ -221,6 +255,13 @@ minetest.override_item("wine:glass_wine", {
}
})
minetest.override_item("wine:glass_brandy", {
groups = {
food_brandy = 1, vessel = 1, dig_immediate = 3,
attached_node = 1, alcohol = 1, drink = 1
}
})
-- blue agave
minetest.register_node("wine:blue_agave", {
@ -351,7 +392,7 @@ end
-- Mint Julep recipe
if minetest.get_modpath("farming")
and farming.mod and farming.mod == "redo"then
and farming.mod and (farming.mod == "redo" or farming.mod == "undo") then
minetest.register_craft({
type = "shapeless",
@ -622,6 +663,9 @@ if minetest.get_modpath("lucky_block") then
{"dro", {"wine:glass_bourbon"}, 5},
{"dro", {"wine:glass_vodka"}, 5},
{"dro", {"wine:glass_mint"}, 5},
{"dro", {"wine:glass_coffee_liquor"}, 5},
{"dro", {"wine:glass_brandy"}, 5},
{"dro", {"wine:glass_champagne"}, 5},
{"dro", {"wine:wine_barrel"}, 1},
{"tel", 5, 1},
{"nod", "default:chest", 0, {
@ -637,6 +681,9 @@ if minetest.get_modpath("lucky_block") then
{name = "wine:bottle_mead", max = 1},
{name = "wine:bottle_beer", max = 1},
{name = "wine:bottle_wheat_beer", max = 1},
{name = "wine:bottle_coffee_liquor", max = 1},
{name = "wine:bottle_brandy", max = 1},
{name = "wine:bottle_champagne", max = 1},
{name = "wine:blue_agave", max = 4}}},
})
end

View File

@ -37,3 +37,8 @@ Textures by Darkstalker (cc-by-3.0 license)
wine_mead_bottle.png
wine_mint_bottle.png
wine_mint_glass.png
Textures by Felfa (CC0)
wine_champagne*.png
wine_coffee*.png
wine_brandy*.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 B

View File

@ -24,10 +24,8 @@ White Knight=weißes Pferd
White Pawn=weißer Bauer
White Queen=weiße Dame
White Rook=weißer Turm
You can't dig the chessboard, a game has been started791234567. Reset it first if you're a current player, or dig it again in @1=Das Schachbrett ist während eines Schachspieles nicht abbaubar. Setze das Spiel zurück, falls du ein Mitspieler bist oder versuche es in @1 erneut.
791234567
You can't reset the chessboard, a game has been started. If you aren't a current player, try again in @1=Das Schachbrett kann nicht zurückgesetzt werdenm da ein Spiel im Gang ist. Versuche es in @1 erneut, falls du kein Mitspieler bist.
You can't dig the chessboard, a game has been started. Reset it first if you're a current player, or dig it again in @1=Das Schachbrett ist während eines Schachspieles nicht abbaubar. Setze das Spiel zurück, falls du ein Mitspieler bist oder versuche es in @1 erneut.
You can't reset the chessboard, a game has been started. If you aren't a current player, try again in @1=Das Schachbrett kann nicht zurückgesetzt werden, da ein Spiel im Gang ist. Versuche es in @1 erneut, falls du kein Mitspieler bist.
check=Schach
@ -118,8 +116,8 @@ Potted Geranium=Geranien im Topf
Potted Rose=Rosen im Topf
Potted Tulip=Tulpen im Topf
Potted Viola=Veilchen im Topf
Potted White Dandelion=weiße Löwenzahn im Topf
Potted Yellow Dandelion=gelbe Löwenzahn im Topf
Potted White Dandelion=weißer Löwenzahn im Topf
Potted Yellow Dandelion=gelber Löwenzahn im Topf
Prison Door=Verliestür
Red Curtain=roter Vorhang
Runestone=Runensteinblock