Skip to content

Instantly share code, notes, and snippets.

@PaulBGD
Last active December 25, 2015 01:19
Show Gist options
  • Save PaulBGD/6893732 to your computer and use it in GitHub Desktop.
Save PaulBGD/6893732 to your computer and use it in GitHub Desktop.
ArenaTutorial Resource 1
package me.ultimate.Arena;
import org.bukkit.Location;
import org.bukkit.plugin.java.JavaPlugin;
public class ArenaTutorial extends JavaPlugin {
@Override
public void onEnable() {
// 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.
new Arena(name, l1, l2, start, stop);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment