h31ix

Untitled

Feb 4th, 2012
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. @EventHandler
  2. public void onEntityDamage(EntityDamageEvent event)
  3. {
  4. if (event.getEntity() instanceof Player)
  5. {
  6. Player player = (Player)event.getEntity();
  7. if (plugin.blueg.contains(player) || plugin.redg.contains(player))
  8. {
  9. if (player.getLastDamageCause() instanceof Player)
  10. {
  11. Player d = (Player)player.getLastDamageCause().getEntity();
  12. if (d != player)
  13. {
  14. if (plugin.redg.contains(player) && plugin.redg.contains(d))
  15. {
  16. event.setCancelled(true);
  17. }
  18. if (plugin.blueg.contains(player) && plugin.blueg.contains(d))
  19. {
  20. event.setCancelled(true);
  21. }
  22. }
  23. }
  24. }
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment