Advertisement
Guest User

code

a guest
Nov 13th, 2018
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.51 KB | None | 0 0
  1. package ru;
  2.  
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.Location;
  5. import org.bukkit.Server;
  6. import org.bukkit.World;
  7. import org.bukkit.configuration.file.YamlConfiguration;
  8. import org.bukkit.plugin.java.JavaPlugin;
  9. import ru.GamePackage.GameClass;
  10.  
  11. import java.io.File;
  12. import java.io.IOException;
  13.  
  14. public class Main extends JavaPlugin {
  15.  
  16.     public static World world;
  17.     public static File folder;
  18.     public static Location spawn;
  19.     public static YamlConfiguration playerData;
  20.     public static Server server;
  21.     public static Main instance;
  22.  
  23.     @Override
  24.     public void onEnable() {
  25.         Commands();
  26.         EventHandlers();
  27.         Configurations();
  28.         Statics();
  29.     }
  30.  
  31.     @Override
  32.     public void onDisable() {
  33.         SaveConfigurations();
  34.     }
  35.  
  36.     private void Statics() {
  37.         world = Bukkit.getWorld("play_world");
  38.         folder = new File("folder");
  39.         spawn = world.getSpawnLocation();
  40.         server = this.getServer();
  41.         instance = this;
  42.     }
  43.  
  44.     private void Configurations() {
  45.         playerData = YamlConfiguration.loadConfiguration(new File(folder, "playerData.yml"));
  46.     }
  47.  
  48.     private void SaveConfigurations() {
  49.         try {
  50.             playerData.save(new File(folder, "playerData.yml"));
  51.         } catch (IOException e) {
  52.             e.printStackTrace();
  53.         }
  54.     }
  55.  
  56.     private void EventHandlers() {
  57.         Bukkit.getPluginManager().registerEvents(new GameClass(), this);
  58.     }
  59.  
  60.     private void Commands() {
  61.  
  62.     }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement