Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.97 KB | None | 0 0
  1. package be.slypi.skydef;
  2.  
  3. import java.util.ArrayList;
  4. import java.util.List;
  5. import java.util.Random;
  6.  
  7. import org.bukkit.Bukkit;
  8. import org.bukkit.Location;
  9. import org.bukkit.World;
  10. import org.bukkit.entity.Player;
  11. import org.bukkit.plugin.PluginManager;
  12. import org.bukkit.plugin.java.JavaPlugin;
  13.  
  14. import be.slypi.skydef.commands.Commands;
  15. import be.slypi.skydef.listeners.GPlayerListeners;
  16.  
  17. public class GMain extends JavaPlugin {
  18.    
  19.    
  20.     private List<Player> players = new ArrayList<>();
  21.     public static List<Location> spawns = new ArrayList<>();
  22.     private static GMain instance; 
  23.     protected GState state;
  24.    
  25.    
  26.    
  27.     @Override
  28.     public void onEnable() {
  29.         setState(GState.WAITING);
  30.         instance = this;
  31.         PluginManager pm = getServer().getPluginManager();
  32.         pm.registerEvents(new GPlayerListeners(this), this);
  33.         getCommand("start").setExecutor(new Commands(this));
  34.        
  35.        
  36.         //spawns
  37.         World world = Bukkit.getWorld("Skydef");
  38.         spawns.add(new Location(world, -300.300, 144.500, -312.077, 1.5f, 4.0f));
  39.         spawns.add(new Location(world, -300.495, 144.500, -287.722, 179.8f, 0.1f));
  40.         spawns.add(new Location(world, -439.684, 91.500, -451.625, 1.5f, 4.0f));
  41.         spawns.add(new Location(world, 133.465, 64.500, 176.279, 1.5f, 4.0f));
  42.         spawns.add(new Location(world, -543.717, 76.500, -160.367, 1.5f, 4.0f));
  43.         spawns.add(new Location(world, -507.700, 102.500, -147.636, 1.5f, 4.0f));
  44.         spawns.add(new Location(world, -559.470, 79.500, -457.719, 1.5f, 4.0f));
  45.        
  46.        
  47.     }
  48.     static Random r = new Random();
  49.     public static int valeur = r.nextInt(spawns.size());
  50.    
  51.     public void setState(GState state) {
  52.         this.state = state;
  53.     }
  54.    
  55.     public boolean getState(GState state) {
  56.         return this.state == state;
  57.     }
  58.    
  59.     public boolean isState(GState state) {
  60.         return this.state == state;
  61.     }
  62.    
  63.     public List<Player> getPlayers(){
  64.     return players;
  65.     }
  66.    
  67.     public static GMain getInstance(){
  68.         return instance;
  69.     }
  70.    
  71.     public Location getValeurs(Location valeur) {
  72.         return valeur;
  73.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement