Advertisement
Olivki

Swager

Feb 28th, 2013
482
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.92 KB | None | 0 0
  1.     @Override
  2.     public void onEvent(Event event) {
  3.         if(getState()) {
  4.             if(event instanceof EventChatSend) {
  5.                 for(ArrayHelper<String, String> friend : getLoadedFriends()) {
  6.                     ((EventChatSend)event).setMessage(((EventChatSend)event).getMessage().replace(((String)friend.getObject()[1]),
  7.                             ((String)friend.getObject()[0])));
  8.                 }
  9.             } if(event instanceof EventStringRendered) {
  10.                 for(ArrayHelper<String, String> friend : getLoadedFriends()) {
  11.                     ((EventStringRendered)event).setString(((EventStringRendered)event).getString().replaceAll(((String)friend.getObject()[0]),
  12.                             Colours.DARK_AQUA + ((String)friend.getObject()[1]) + Colours.RESET));
  13.                 }
  14.             } if(event instanceof EventAttackEntity) {
  15.                 if(((EventAttackEntity)event).getTarget() instanceof EntityPlayer) {
  16.                     ((EventAttackEntity)event).setCancelled(isFriend(((EntityPlayer)((EventAttackEntity)event).getTarget()).username));
  17.                 }
  18.             }
  19.         }
  20.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement