1
0
Fork 0

Clean up hopper minecart

This commit is contained in:
ancientmarinerdev 2022-11-12 18:19:49 +00:00 committed by cora
parent ce457eb351
commit 9065170b1c
3 changed files with 7 additions and 23 deletions

View File

@ -2,15 +2,10 @@ mcl_entity_invs = {}
local open_invs = {} local open_invs = {}
local LOGGING_ON = minetest.settings:get_bool("mcl_logging_default",false)
local LOG_MODULE = "[Entity Invs]"
local function mcl_log (message) local function mcl_log (message)
if LOGGING_ON and message then mcl_util.mcl_log (message, "[Entity Invs]")
minetest.log(LOG_MODULE .. " " .. message)
end
end end
local function check_distance(inv,player,count) local function check_distance(inv,player,count)
for _,o in pairs(minetest.get_objects_inside_radius(player:get_pos(),5)) do for _,o in pairs(minetest.get_objects_inside_radius(player:get_pos(),5)) do
local l = o:get_luaentity() local l = o:get_luaentity()

View File

@ -7,11 +7,10 @@ local pool = {}
local tick = false local tick = false
local LOGGING_ON = minetest.settings:get_bool("mcl_logging_default",false) local LOGGING_ON = minetest.settings:get_bool("mcl_logging_item_entities",false)
local LOG_MODULE = "[Item entities]"
local function mcl_log (message) local function mcl_log (message)
if LOGGING_ON and message then if LOGGING_ON then
minetest.log(LOG_MODULE .. " " .. message) mcl_util.mcl_log (message, "[Item Entities]", true)
end end
end end
@ -388,17 +387,7 @@ end
local function hopper_take_item (self, pos) local function hopper_take_item (self, pos)
--mcl_log("self.itemstring: ".. self.itemstring) --mcl_log("self.itemstring: ".. self.itemstring)
--local current_itemstack = nil
--if self.itemstring then
-- mcl_log("there is an itemstring")
-- current_itemstack = ItemStack(self.itemstring)
--else
-- mcl_log("no item string")
--end
--mcl_log("self.itemstring: ".. minetest.pos_to_string(pos)) --mcl_log("self.itemstring: ".. minetest.pos_to_string(pos))
--minetest.get_node(pos).name
local objs = minetest.get_objects_inside_radius(pos, 2) local objs = minetest.get_objects_inside_radius(pos, 2)
@ -445,7 +434,7 @@ local function hopper_take_item (self, pos)
if not taken_items then if not taken_items then
local items_remaining = current_itemstack:get_count() local items_remaining = current_itemstack:get_count()
-- This will take pat of a floating item stack -- This will take part of a floating item stack if no slot can hold the full amount
for i = 1, ent._inv_size,1 do for i = 1, ent._inv_size,1 do
local stack1 = inv:get_stack("main", i) local stack1 = inv:get_stack("main", i)

View File

@ -311,9 +311,9 @@ function mcl_beds.get_bed_top (pos)
local bed_top = minetest.get_node(bed_top_pos) local bed_top = minetest.get_node(bed_top_pos)
if bed_top then if bed_top then
mcl_log("Has a bed top") --mcl_log("Has a bed top")
else else
mcl_log("No bed top") --mcl_log("No bed top")
end end
return bed_top_pos return bed_top_pos
end end