mirror of
https://github.com/essentials/Essentials.git
synced 2025-10-01 00:26:48 +02:00
Modified BetterLocation, and new Permission-System
This commit is contained in:
@@ -8,6 +8,7 @@ import com.earth2me.essentials.api.IEssentials;
|
||||
import com.earth2me.essentials.api.IGroups;
|
||||
import com.earth2me.essentials.api.ISettings;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import com.earth2me.essentials.perm.Permissions;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Logger;
|
||||
@@ -77,7 +78,7 @@ public abstract class EssentialsChatPlayer implements Listener
|
||||
protected void formatChat(final PlayerChatEvent event, final ChatStore chatStore)
|
||||
{
|
||||
final IUser user = chatStore.getUser();
|
||||
if (user.isAuthorized("essentials.chat.color"))
|
||||
if (Permissions.CHAT_COLOR.isAuthorized(user))
|
||||
{
|
||||
event.setMessage(Util.stripColor(event.getMessage()));
|
||||
}
|
||||
@@ -141,10 +142,7 @@ public abstract class EssentialsChatPlayer implements Listener
|
||||
|
||||
if (event.getMessage().length() > 1 && chatStore.getType().length() > 0)
|
||||
{
|
||||
final StringBuilder permission = new StringBuilder();
|
||||
permission.append("essentials.chat.").append(chatStore.getType());
|
||||
|
||||
if (user.isAuthorized(permission.toString()))
|
||||
if (ChatPermissions.getPermission(chatStore.getType()).isAuthorized(user))
|
||||
{
|
||||
final StringBuilder format = new StringBuilder();
|
||||
format.append(chatStore.getType()).append("Format");
|
||||
|
Reference in New Issue
Block a user