Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.rtn.cee;/*
- * CommandExecutorExample
- * Copyright (C) 2017 RapidTheNerd
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- import org.bukkit.ChatColor;
- import org.bukkit.entity.Player;
- import org.bukkit.event.Listener;
- import org.bukkit.event.player.AsyncPlayerChatEvent;
- public class staffChat implements Listener {
- private static final String STAFF_CHAT_PREIFX = ChatColor.translateAlternateColorCodes('&', "&8[&eSC&8] &b");
- private static final String NO_PERMISSION = ChatColor.RED + "You do not have permission to use this command";
- private static final String PERMISSION_NODE = "litechat.staffchat";
- public static void messageStaff(AsyncPlayerChatEvent event){
- Player player = event.getPlayer();
- if(player.hasPermission(PERMISSION_NODE)){
- event.setCancelled(true);
- player.sendMessage(STAFF_CHAT_PREIFX + event.getMessage());
- } else {
- player.sendMessage(NO_PERMISSION);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement