From 73c98009acbfc86f5e86cc2caf81d230e11de7e5 Mon Sep 17 00:00:00 2001 From: Oth3r Date: Mon, 30 Sep 2024 14:15:34 -0500 Subject: [PATCH] count amount of entities purged and display in purge message --- src/main/java/one/oth3r/sit/utl/Utl.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main/java/one/oth3r/sit/utl/Utl.java b/src/main/java/one/oth3r/sit/utl/Utl.java index 4e2a3ac..2159530 100644 --- a/src/main/java/one/oth3r/sit/utl/Utl.java +++ b/src/main/java/one/oth3r/sit/utl/Utl.java @@ -323,15 +323,22 @@ public class Utl { .getEntitiesByType(TypeFilter.instanceOf(DisplayEntity.TextDisplayEntity.class), entity -> entity.getName().getString().equals(Data.ENTITY_NAME)); - // remove each one + // amount of sit entities purged + int count = 0; + + // remove each one & count for (DisplayEntity.TextDisplayEntity entity : list) { remove(entity); + count++; } // send a message if needed if (message) { - // todo maybe a count for the message for debuging - player.sendMessage(Utl.lang("msg.purged")); + player.sendMessage(messageTag().append(Utl.lang("msg.purged",Utl.lang("msg.purged.total",count).styled( + style -> style.withColor(Colors.LIGHT_GRAY).withItalic(true) + )).styled( + style -> style.withColor(Colors.GREEN) + ))); } } }