Lisenochek

Untitled

Sep 22nd, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. package com.realistic.signals;
  2.  
  3. import org.bukkit.ChatColor;
  4. import org.bukkit.Location;
  5. import org.bukkit.block.Block;
  6. import org.bukkit.entity.Player;
  7. import org.bukkit.event.EventHandler;
  8. import org.bukkit.event.Listener;
  9. import org.bukkit.event.block.BlockPlaceEvent;
  10.  
  11. import com.realistic.api.MessageManager;
  12. import com.realistic.api.MessageManager.MsgType;
  13. import com.realistic.config.configMessage;
  14. import com.realistic.list.MinecraftList;
  15.  
  16. public class Handler_DonaterSignal implements Listener {
  17.  
  18. public static Location donaterSignalLocation;
  19. public static Block donaterSignalBlock;
  20.  
  21. @SuppressWarnings("deprecation")
  22. @EventHandler
  23. public void dropDonater(BlockPlaceEvent e) {
  24.  
  25. Player p = e.getPlayer();
  26. Block b = e.getBlockPlaced();
  27. donaterSignalLocation = b.getLocation();
  28. donaterSignalBlock = b;
  29.  
  30. if (e.isCancelled()) {
  31. return;
  32. }
  33.  
  34. if (e.getBlockPlaced().getTypeId() == 76) {
  35.  
  36. if (p.getItemInHand().getItemMeta().getDisplayName() != null
  37. && p.getItemInHand().getItemMeta().getDisplayName()
  38. .equalsIgnoreCase(ChatColor.GOLD + ChatColor.BOLD.toString() + "Особая сигнальная шашка")) {
  39.  
  40. MessageManager.getManager().msg(p, MsgType.SUCCESS,
  41. configMessage.messageConfig.getString("signal_enable"));
  42.  
  43. MinecraftList.donaterSignal.add(p);
  44. }
  45. }
  46. }
  47. }
Add Comment
Please, Sign In to add comment