From 0076010f35edde62bc5f45f132b945d9d92a135f Mon Sep 17 00:00:00 2001 From: VorTechnix <45538536+VorTechnix@users.noreply.github.com> Date: Thu, 17 Oct 2024 08:50:57 -0700 Subject: [PATCH] WE compatibility for Notify --- worldeditadditions_core/utils/notify/notify.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/worldeditadditions_core/utils/notify/notify.lua b/worldeditadditions_core/utils/notify/notify.lua index 373058f..617eb71 100644 --- a/worldeditadditions_core/utils/notify/notify.lua +++ b/worldeditadditions_core/utils/notify/notify.lua @@ -1,4 +1,5 @@ --- A player notification system for worldeditadditions. +-- @module worldeditadditions_core.notify local wea_c = worldeditadditions_core -- Helper functions @@ -162,10 +163,11 @@ function Notify.suppress_for_function(name, func) end --- WorldEdit compatibility --- if worldedit and type(worldedit.player_notify) == "function" then --- worldedit.player_notify = function(name, message, ntype) --- Notify(name, ntype, message) --- end --- end +if worldedit and type(worldedit.player_notify) == "function" then + worldedit.player_notify = function(name, message, ntype) + if not ntype then ntype = "info" end + Notify(name, ntype, message) + end +end return Notify \ No newline at end of file