Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.nichlasm1.kitpvp;
- import java.io.File;
- import org.bukkit.Bukkit;
- import org.bukkit.Location;
- import org.bukkit.Material;
- import org.bukkit.block.Sign;
- import org.bukkit.configuration.file.FileConfiguration;
- import org.bukkit.configuration.file.YamlConfiguration;
- import org.bukkit.event.Listener;
- public class timer implements Listener{
- public timer(Main plugin) {
- plugin.getServer().getPluginManager().registerEvents(this, plugin);
- }
- public static void bar() {
- File f = new File("plugins/KitPvP/Locations.yml");
- FileConfiguration cfg = YamlConfiguration.loadConfiguration(f);
- instance.getinstance().getServer().getScheduler().scheduleSyncRepeatingTask(instance.getinstance(), new Runnable() {
- public void run() {
- double x = cfg.getDouble("skilt" + ".x");
- double y = cfg.getDouble("skilt" + ".y");
- double z = cfg.getDouble("skilt" + ".z");
- Location l = new Location(Bukkit.getWorld("world"), x, y, z);
- if (l.getBlock().getType() == Material.WALL_SIGN || l.getBlock().getType() == Material.SIGN_POST) {
- Sign sign = (Sign) l.getBlock().getState();
- sign.getChunk().load();
- sign.setLine(3, Main.colors("&c" + Bukkit.getWorld("kitpvp").getPlayers().size()));
- sign.update();
- }
- }
- }, 20L, 20L);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement