Advertisement
Lisenochek

Untitled

Sep 28th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. package com.realistic.signals;
  2.  
  3. import java.util.Random;
  4.  
  5. import org.bukkit.Bukkit;
  6. import org.bukkit.Location;
  7. import org.bukkit.Material;
  8. import org.bukkit.World;
  9. import org.bukkit.block.Block;
  10. import org.bukkit.entity.Player;
  11.  
  12. import com.realistic.api.MessageManager;
  13. import com.realistic.api.MessageManager.MsgType;
  14. import com.realistic.config.configMessage;
  15. import com.realistic.list.MinecraftList;
  16. import com.realistic.otherAPI.ParticleEffect;
  17.  
  18. public class CommonSignal {
  19.  
  20. private static final Random r = new Random();
  21.  
  22. public static void CommonS() {
  23.  
  24. for (Player p : Bukkit.getOnlinePlayers()) {
  25.  
  26. int radius = 25;
  27. for (int x = -radius; x < radius; x++) {
  28. for (int y = -radius; y < radius; y++) {
  29. for (int z = -radius; z < radius; z++) {
  30.  
  31. World w = p.getWorld();
  32. Location loc = p.getLocation();
  33. Block b = w.getBlockAt(loc.getBlockX() + x, loc.getBlockY() + y, loc.getBlockZ() + z);
  34.  
  35. if (b.getType() != Material.REDSTONE_TORCH_ON) {
  36. continue;
  37. }
  38.  
  39. if (MinecraftList.commonSignal.values().contains(b.getLocation())) {
  40.  
  41. if (r.nextInt(5000) <= 100) {
  42.  
  43. MinecraftList.commonSignalPlayer.add(p);
  44. b.setType(Material.AIR);
  45. MessageManager.getManager().msg(p, MsgType.SUCCESS,
  46. configMessage.messageConfig.getString("signal_success"));
  47. }
  48.  
  49. ParticleEffect.SMOKE_LARGE.display(0, 2, 0, 0, 5, b.getLocation().add(0.5, 3, 0.5), 200);
  50. }
  51. }
  52. }
  53. }
  54. }
  55. }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement