Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package be.slypi.skydef;
- import java.util.ArrayList;
- import java.util.List;
- import java.util.Random;
- import org.bukkit.Bukkit;
- import org.bukkit.Location;
- import org.bukkit.World;
- import org.bukkit.entity.Player;
- import org.bukkit.plugin.PluginManager;
- import org.bukkit.plugin.java.JavaPlugin;
- import be.slypi.skydef.commands.Commands;
- import be.slypi.skydef.listeners.GPlayerListeners;
- public class GMain extends JavaPlugin {
- private List<Player> players = new ArrayList<>();
- public static List<Location> spawns = new ArrayList<>();
- private static GMain instance;
- protected GState state;
- @Override
- public void onEnable() {
- setState(GState.WAITING);
- instance = this;
- PluginManager pm = getServer().getPluginManager();
- pm.registerEvents(new GPlayerListeners(this), this);
- getCommand("start").setExecutor(new Commands(this));
- //spawns
- World world = Bukkit.getWorld("Skydef");
- spawns.add(new Location(world, -300.300, 144.500, -312.077, 1.5f, 4.0f));
- spawns.add(new Location(world, -300.495, 144.500, -287.722, 179.8f, 0.1f));
- spawns.add(new Location(world, -439.684, 91.500, -451.625, 1.5f, 4.0f));
- spawns.add(new Location(world, 133.465, 64.500, 176.279, 1.5f, 4.0f));
- spawns.add(new Location(world, -543.717, 76.500, -160.367, 1.5f, 4.0f));
- spawns.add(new Location(world, -507.700, 102.500, -147.636, 1.5f, 4.0f));
- spawns.add(new Location(world, -559.470, 79.500, -457.719, 1.5f, 4.0f));
- }
- static Random r = new Random();
- public static int valeur = r.nextInt(spawns.size());
- public void setState(GState state) {
- this.state = state;
- }
- public boolean getState(GState state) {
- return this.state == state;
- }
- public boolean isState(GState state) {
- return this.state == state;
- }
- public List<Player> getPlayers(){
- return players;
- }
- public static GMain getInstance(){
- return instance;
- }
- public Location getValeurs(Location valeur) {
- return valeur;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement