mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2025-03-11 06:07:44 +01:00
Merge pull request 'Fix pulling partial stacks from double chests with hopper minecart' (#4850) from fix-chest-hopper-pulling into master
Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4850 Reviewed-by: kno10 <kno10@noreply.git.minetest.land>
This commit is contained in:
commit
d441262c8e
2 changed files with 8 additions and 3 deletions
mods
|
@ -165,10 +165,15 @@ mod.register_minecart({
|
|||
local above_pos = vector.offset(pos,0,1,0)
|
||||
mcl_util.hopper_pull_to_inventory(inv, 'main', above_pos, pos)
|
||||
|
||||
staticdata.hopper_delay = (staticdata.hopper_delay or 0) + (1/20)
|
||||
staticdata.hopper_delay = (staticdata.hopper_delay or 0) + 0.25
|
||||
end,
|
||||
_mcl_minecarts_on_step = function(self, dtime)
|
||||
hopper_take_item(self, dtime)
|
||||
|
||||
local staticdata = self._staticdata
|
||||
local pos = mcl_minecarts.get_cart_position(staticdata) or self.object:get_pos()
|
||||
|
||||
self._mcl_minecarts_on_enter(self, pos, staticdata)
|
||||
end,
|
||||
creative = true
|
||||
})
|
||||
|
|
|
@ -422,12 +422,12 @@ end
|
|||
local function hopper_pull_double(side) return function(pos, hop_pos, hop_inv, hop_list)
|
||||
local top_inv, bottom_inv = get_chest_inventories(pos, side)
|
||||
|
||||
local stack_id = mcl_util.select_stack(top_inv, "main", hop_inv, hop_list)
|
||||
local stack_id = mcl_util.select_stack(top_inv, "main", hop_inv, hop_list, nil, 1)
|
||||
if stack_id ~= nil then
|
||||
return top_inv, "main", stack_id
|
||||
end
|
||||
|
||||
stack_id = mcl_util.select_stack(bottom_inv, "main", hop_inv, hop_list)
|
||||
stack_id = mcl_util.select_stack(bottom_inv, "main", hop_inv, hop_list, nil, 1)
|
||||
return bottom_inv, "main", stack_id
|
||||
end end
|
||||
|
||||
|
|
Loading…
Reference in a new issue