From da7ac66bf83e04946d7426312b6252fa29729173 Mon Sep 17 00:00:00 2001 From: neveix Date: Fri, 14 Aug 2026 14:38:41 +0500 Subject: [PATCH] move shareinv logic into inventory_utils --- res/layouts/inventory.xml | 4 ++-- res/layouts/inventory.xml.lua | 13 +------------ 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/res/layouts/inventory.xml b/res/layouts/inventory.xml index 4291ab4d3..7a33b054f 100644 --- a/res/layouts/inventory.xml +++ b/res/layouts/inventory.xml @@ -1,4 +1,4 @@ - - + + diff --git a/res/layouts/inventory.xml.lua b/res/layouts/inventory.xml.lua index 9f836223d..5c79db6ff 100644 --- a/res/layouts/inventory.xml.lua +++ b/res/layouts/inventory.xml.lua @@ -1,12 +1 @@ -function inventory_share_func(invid, slotid) - local blockinv = hud.get_block_inventory() - if blockinv ~= 0 then - inventory.move(invid, slotid, blockinv) - elseif rules.get("allow-content-access") then - inventory.set(invid, slotid, 0, 0) - elseif slotid < 10 then - inventory.move_range(invid, slotid, invid, 10) - else - inventory.move_range(invid, slotid, invid, 0, 9) - end -end +share_func = require("core:inventory_utils").share_default_func