From 0e653683782a1403e56de61ce45cccdf27103951 Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Sun, 16 May 2021 19:57:36 +0200 Subject: [PATCH] Fix chest cart formspec issue --- carts/chest_cart.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/carts/chest_cart.lua b/carts/chest_cart.lua index b225448..b24d686 100644 --- a/carts/chest_cart.lua +++ b/carts/chest_cart.lua @@ -19,6 +19,14 @@ local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end local S2P = minetest.string_to_pos local MP = minetest.get_modpath("minecart") +local function on_rightclick(pos, node, clicker) + if clicker and clicker:is_player() then + if M(pos):get_int("userID") == 0 then + minecart.show_formspec(pos, clicker) + end + end +end + local function formspec() return "size[8,6]".. default.gui_bg.. @@ -78,6 +86,7 @@ minetest.register_node("techage:chest_cart", { on_punch = minecart.on_nodecart_punch, allow_metadata_inventory_put = allow_metadata_inventory_put, allow_metadata_inventory_take = allow_metadata_inventory_take, + on_rightclick = on_rightclick, after_place_node = function(pos, placer) local inv = M(pos):get_inventory()