Skip to content

Commit

Permalink
Merge pull request #5 from PoutineQc/Update
Browse files Browse the repository at this point in the history
Arena Loading Fix
  • Loading branch information
ChagnonSebastien committed May 27, 2016
2 parents 64c43ac + a7376f8 commit 493b15b
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Bukkit_1.8/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: CubeRunner
main : me.poutineqc.cuberunner.CubeRunner
version: 1.0
version: 2.0.1
description: A little minigame to avoid falling blocks
load: postworld
author: PoutineQc
Expand Down
1 change: 0 additions & 1 deletion Bukkit_1.8/src/me/poutineqc/cuberunner/ArenaData.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public ArenaData(CubeRunner plugin) {
Bukkit.getServer().getLogger().severe(ChatColor.RED + "Could not create arenaData.ylm.");
}
}
loadArenaData();
}

public void loadArenaData() {
Expand Down
11 changes: 9 additions & 2 deletions Bukkit_1.8/src/me/poutineqc/cuberunner/CubeRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.logging.Logger;

import org.bukkit.Bukkit;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.RegisteredServiceProvider;
Expand Down Expand Up @@ -35,7 +36,7 @@ public class CubeRunner extends JavaPlugin {
private JoinGUI joinGui;
private ColorGUI colorGUI;
private PlayerCommands playerCommands;

private static Economy economy;

public void onEnable() {
Expand All @@ -62,6 +63,12 @@ public void onEnable() {
enableListeners();
getCommand("cuberunner").setExecutor(playerCommands);

Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
public void run() {
arenaData.loadArenaData();
}
}, 1L);

logger.info(pdfFile.getName() + " has been enabled (v" + pdfFile.getVersion() + ")");
}

Expand Down Expand Up @@ -211,7 +218,7 @@ public PlayerCommands getPlayerCommands() {
public Achievements getAchievements() {
return achievements;
}

public TopManager getTopManager() {
return topManager;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ public boolean onCommand(CommandSender sender, Command cmd, String cmdValue, Str
if (command.getCommandName().equalsIgnoreCase("setcolor")) {
if (!Permissions.hasPermission(command, player, true))
return true;

colorGUI.openColorGUI(player, arena);
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion Bukkit_1.9/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: CubeRunner
main : me.poutineqc.cuberunner.CubeRunner
version: 1.0
version: 2.0.1
description: A little minigame to avoid falling blocks
load: postworld
author: PoutineQc
Expand Down
1 change: 0 additions & 1 deletion Bukkit_1.9/src/me/poutineqc/cuberunner/ArenaData.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public ArenaData(CubeRunner plugin) {
Bukkit.getServer().getLogger().severe(ChatColor.RED + "Could not create arenaData.ylm.");
}
}
loadArenaData();
}

public void loadArenaData() {
Expand Down
11 changes: 9 additions & 2 deletions Bukkit_1.9/src/me/poutineqc/cuberunner/CubeRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.logging.Logger;

import org.bukkit.Bukkit;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.RegisteredServiceProvider;
Expand Down Expand Up @@ -35,7 +36,7 @@ public class CubeRunner extends JavaPlugin {
private JoinGUI joinGui;
private ColorGUI colorGUI;
private PlayerCommands playerCommands;

private static Economy economy;

public void onEnable() {
Expand All @@ -62,6 +63,12 @@ public void onEnable() {
enableListeners();
getCommand("cuberunner").setExecutor(playerCommands);

Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
public void run() {
arenaData.loadArenaData();
}
}, 1L);

logger.info(pdfFile.getName() + " has been enabled (v" + pdfFile.getVersion() + ")");
}

Expand Down Expand Up @@ -211,7 +218,7 @@ public PlayerCommands getPlayerCommands() {
public Achievements getAchievements() {
return achievements;
}

public TopManager getTopManager() {
return topManager;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public void updateAll() {

private List<TopManager> updateTop(String lookup) {
List<TopManager> tempList = new ArrayList<TopManager>();

if (playerData.getData().contains("players")) {
for (String uuid : playerData.getData().getConfigurationSection("players").getKeys(false)) {
String name = playerData.getData().getString("players." + uuid + ".name", "unknown");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ public boolean onCommand(CommandSender sender, Command cmd, String cmdValue, Str
if (command.getCommandName().equalsIgnoreCase("setcolor")) {
if (!Permissions.hasPermission(command, player, true))
return true;

colorGUI.openColorGUI(player, arena);
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion Bukkit_1.9/src/me/poutineqc/cuberunner/games/Arena.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public static void loadExistingArenas() {
} else {
if (!arenaData.getData().contains("arenas"))
return;

for (String arenaName : arenaData.getData().getConfigurationSection("arenas").getKeys(false)) {
World world = Bukkit.getServer()
.getWorld(arenaData.getData().getString("arenas." + arenaName + ".world"));
Expand Down

0 comments on commit 493b15b

Please sign in to comment.