Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.realistic.signals;
- import java.util.Random;
- import org.bukkit.Bukkit;
- import org.bukkit.Location;
- import org.bukkit.Material;
- import org.bukkit.World;
- import org.bukkit.block.Block;
- import org.bukkit.entity.Player;
- import com.realistic.api.MessageManager;
- import com.realistic.api.MessageManager.MsgType;
- import com.realistic.config.configMessage;
- import com.realistic.list.MinecraftList;
- import com.realistic.otherAPI.ParticleEffect;
- public class CommonSignal {
- private static final Random r = new Random();
- public static void CommonS() {
- for (Player p : Bukkit.getOnlinePlayers()) {
- int radius = 25;
- for (int x = -radius; x < radius; x++) {
- for (int y = -radius; y < radius; y++) {
- for (int z = -radius; z < radius; z++) {
- World w = p.getWorld();
- Location loc = p.getLocation();
- Block b = w.getBlockAt(loc.getBlockX() + x, loc.getBlockY() + y, loc.getBlockZ() + z);
- if (b.getType() != Material.REDSTONE_TORCH_ON) {
- continue;
- }
- if (MinecraftList.commonSignal.values().contains(b.getLocation())) {
- if (r.nextInt(5000) <= 100) {
- MinecraftList.commonSignalPlayer.add(p);
- b.setType(Material.AIR);
- MessageManager.getManager().msg(p, MsgType.SUCCESS,
- configMessage.messageConfig.getString("signal_success"));
- }
- ParticleEffect.SMOKE_LARGE.display(0, 2, 0, 0, 5, b.getLocation().add(0.5, 3, 0.5), 200);
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement