This commit is contained in:
root 2020-12-21 12:45:26 +01:00
parent 0e3c55ffc3
commit c09773fa0a
25 changed files with 166 additions and 74 deletions

View File

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

View File

@ -395,7 +395,10 @@ 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 name2 = hitter:get_player_name()
if name and name2 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

@ -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

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

View File

@ -51,7 +51,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

@ -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