mirror of
https://github.com/Oth3r/Sit.git
synced 2025-09-19 16:03:22 +02:00
count amount of entities purged and display in purge message
This commit is contained in:
parent
5de55e0e7a
commit
73c98009ac
1 changed files with 10 additions and 3 deletions
|
@ -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)
|
||||
)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue