From 11b399e471aa550823ed084858819dbe2a4f4205 Mon Sep 17 00:00:00 2001 From: flux <25628292+fluxionary@users.noreply.github.com> Date: Tue, 16 May 2023 15:25:41 -0700 Subject: [PATCH] put teleport tube logging bethind a setting --- settingtypes.txt | 3 +++ teleport_tube.lua | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/settingtypes.txt b/settingtypes.txt index ba25914..6d8e3ad 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -84,3 +84,6 @@ pipeworks_use_real_entities (Use Real Entities) bool true #A high value may cause issues with tube entity visuals. #A value 0.2 or above may cause issues with accelerator tubes. pipeworks_entity_update_interval (Entity Update Interval) float 0 0 0.8 + +# if set to true, items passing through teleport tubes will log log where they came from and where they went. +pipeworks_log_teleport_tubes (Log Teleport Tubes) bool false diff --git a/teleport_tube.lua b/teleport_tube.lua index 0f675c5..2833358 100644 --- a/teleport_tube.lua +++ b/teleport_tube.lua @@ -246,9 +246,11 @@ local function can_go(pos, node, velocity, stack) local src_owner = src_meta:get_string("owner") local dst_meta = minetest.get_meta(pos) local dst_owner = dst_meta:get_string("owner") - minetest.log("action", string.format("[pipeworks] %s teleported from %s (owner=%s) to %s (owner=%s) via %s", - stack:to_string(), minetest.pos_to_string(pos), src_owner, minetest.pos_to_string(target), dst_owner, channel - )) + if minetest.settings:get_bool("pipeworks_log_teleport_tubes", false) then + minetest.log("action", string.format("[pipeworks] %s teleported from %s (owner=%s) to %s (owner=%s) via %s", + stack:to_string(), minetest.pos_to_string(pos), src_owner, minetest.pos_to_string(target), dst_owner, channel + )) + end pos.x = target.x pos.y = target.y pos.z = target.z