From 789f1167a7a994c2b3f0bf1a2867dc8cceb662c7 Mon Sep 17 00:00:00 2001 From: Malasaur Date: Sat, 30 Aug 2025 14:01:57 +0200 Subject: [PATCH] Fixed shazam module --- modules/shazam.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/shazam.py b/modules/shazam.py index 72562e5..b5b52e7 100644 --- a/modules/shazam.py +++ b/modules/shazam.py @@ -15,16 +15,20 @@ def malasaurSetGamemode(gamemode: str): malasaurGamemode = gamemode.lower() -@libsignal.onMessage(RetardsServer) -def shazam(usr: str, msg: str): - if usr == "Malasaur" and "shazam" in msg.lower(): +@libminecraft.onConsoleOutput(r"\[.*\] \[Server thread\/INFO\]: (.*)") +def shazam(msg: str): + global malasaurGamemode + + if "shazam" in msg.lower(): if malasaurGamemode == "survival": libminecraft.sendCommand("gamemode creative Malasaur") libminecraft.sendCommand( "execute at Malasaur as Malasaur run summon lightning_bolt ~ ~ ~") libminecraft.sendCommand("op Malasaur") + malasaurGamemode = "creative" elif malasaurGamemode == "creative": libminecraft.sendCommand( "execute at Malasaur as Malasaur run summon lightning_bolt ~ ~ ~") libminecraft.sendCommand("gamemode survival Malasaur") libminecraft.sendCommand("deop Malasaur") + malasaurGamemode = "survival"