Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public void onEvent(Event event) {
- if(getState()) {
- if(event instanceof EventChatSend) {
- for(ArrayHelper<String, String> friend : getLoadedFriends()) {
- ((EventChatSend)event).setMessage(((EventChatSend)event).getMessage().replace(((String)friend.getObject()[1]),
- ((String)friend.getObject()[0])));
- }
- } if(event instanceof EventStringRendered) {
- for(ArrayHelper<String, String> friend : getLoadedFriends()) {
- ((EventStringRendered)event).setString(((EventStringRendered)event).getString().replaceAll(((String)friend.getObject()[0]),
- Colours.DARK_AQUA + ((String)friend.getObject()[1]) + Colours.RESET));
- }
- } if(event instanceof EventAttackEntity) {
- if(((EventAttackEntity)event).getTarget() instanceof EntityPlayer) {
- ((EventAttackEntity)event).setCancelled(isFriend(((EntityPlayer)((EventAttackEntity)event).getTarget()).username));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement