- Баллы
- 46
- Имя в Minecraft
- MySoulIsCry
не могу понять как правильно юзать поток у меня есть класс
что мне вставить в Bukkit.getScheduler().runTaskLater(Что тут?, r, 15);
пытался this и plugin не работает.
Код:
public class RandomTutorial {
private Main plugin;
public RandomTutorial(Main main) {
this.plugin = plugin;
}
public static void random(int x, int y, int z, Location loc, Player p) {
int d = (int) (Math.random() * 11);
p.sendMessage("§cчисло: " + d);
p.spawnParticle(Particle.CLOUD, new Location(p.getWorld(), (x+0.5) + Math.random(), (y+0.5)+ Math.random(), (z+0.5)+ Math.random()), (int) 0.99999);
p.spawnParticle(Particle.CLOUD, new Location(p.getWorld(), (x+0.5) - Math.random(), (y+0.5)- Math.random(), (z+0.5)- Math.random()), (int) 0.99999);
p.spawnParticle(Particle.CLOUD, new Location(p.getWorld(), (x+0.5) - Math.random(), (y+0.5)- Math.random(), (z+0.5)+ Math.random()), (int) 0.99999);
p.spawnParticle(Particle.CLOUD, new Location(p.getWorld(), (x+0.5) + Math.random(), (y+0.5)- Math.random(), (z+0.5)- Math.random()), (int) 0.99999);
Runnable r = new Runnable() {
@Override
public void run() {
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "setblock " +x+ " " +y+ " " +z+ " minecraft:oak_log");
}
};
Bukkit.getScheduler().runTaskLater(Что тут?, r, 15);
}
}
пытался this и plugin не работает.
