1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-10-01 00:26:48 +02:00

2nd sweep over Essentials Chat, to implement 2.8 changes.

Formatting cache still needs reimplemented.
This commit is contained in:
KHobbits
2012-01-24 23:20:00 +00:00
parent 38a9327284
commit df061749dd
6 changed files with 34 additions and 36 deletions

View File

@@ -83,18 +83,21 @@ public abstract class EssentialsChatPlayer implements Listener
}
String group = user.getGroup();
String world = user.getWorld().getName();
IGroups groupSettings = ess.getGroups();
groupSettings.acquireReadLock();
try
{
event.setFormat(groupSettings.getChatFormat(user).format(new Object[] {group, world, world.substring(0, 1).toUpperCase(Locale.ENGLISH)}));
{
event.setFormat(groupSettings.getChatFormat(user).format(new Object[]
{
group, world, world.substring(0, 1).toUpperCase(Locale.ENGLISH)
}));
}
finally
{
groupSettings.unlock();
}
}
//TODO: Flesh this out - '?' trigger is too easily accidentally triggered
@@ -105,7 +108,7 @@ public abstract class EssentialsChatPlayer implements Listener
case '!':
return "shout";
//case '?':
//return "question";
//return "question";
//case '@':
// return "admin";
default:
@@ -126,8 +129,13 @@ public abstract class EssentialsChatPlayer implements Listener
{
settings.unlock();
}
if (radius < 1)
{
return;
}
radius *= radius;
chatStore.setRadius(radius);
final IUser user = chatStore.getUser();
@@ -154,7 +162,7 @@ public abstract class EssentialsChatPlayer implements Listener
}
event.setCancelled(true);
final EssentialsLocalChatEvent localChat = new EssentialsLocalChatEvent(event, chatStore);
final EssentialsLocalChatEvent localChat = new EssentialsLocalChatEvent(event, radius);
ess.getServer().getPluginManager().callEvent(localChat);
}
}