Created
October 14, 2013 02:53
-
-
Save PaulBGD/6969964 to your computer and use it in GitHub Desktop.
ArenaTutorial Resource 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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