Skip to content

Instantly share code, notes, and snippets.

@PaulBGD
Created October 14, 2013 02:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PaulBGD/6969964 to your computer and use it in GitHub Desktop.
Save PaulBGD/6969964 to your computer and use it in GitHub Desktop.
ArenaTutorial Resource 2
package me.ultimate.Arena;
import org.bukkit.Location;
import org.bukkit.plugin.java.JavaPlugin;
public class ArenaTutorial extends JavaPlugin {
// Stores instance to be used later
public static ArenaTutorial instance;
@Override
public void onEnable() {
/*
* Not the best way to do it, but this stores the instance to be used by
* other classes
*/
instance = this;
// Loop through all of our arenas when the plugin starts
for (String s : getConfig().getConfigurationSection("Arenas").getKeys(false)) {
String path = "Arenas." + s + ".";
// We'll put our Arena variables here for now.
String name = s;
Location l1 = LocationUtils.toLocation(getConfig().getString(path + "l1"));
Location l2 = LocationUtils.toLocation(getConfig().getString(path + "l2"));
Location start = LocationUtils.toLocation(getConfig().getString(path + "start"));
Location stop = LocationUtils.toLocation(getConfig().getString(path + "stop"));
// Not too bad huh? Here comes the actual arena.
Arena arena = new Arena(name, l1, l2, start, stop);
ArenaManager.addArena(arena);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment