|
@@ -230,13 +230,14 @@ public class CustomOreGen extends JavaPlugin {
|
|
* @return the generator config
|
|
* @return the generator config
|
|
*/
|
|
*/
|
|
public GeneratorConfig getGeneratorConfigForPlayer(OfflinePlayer offlinePlayer, String world) {
|
|
public GeneratorConfig getGeneratorConfigForPlayer(OfflinePlayer offlinePlayer, String world) {
|
|
|
|
+
|
|
GeneratorConfig gc = null;
|
|
GeneratorConfig gc = null;
|
|
int id = 0;
|
|
int id = 0;
|
|
|
|
+
|
|
if (offlinePlayer == null) {
|
|
if (offlinePlayer == null) {
|
|
gc = generatorConfigs.get(0);
|
|
gc = generatorConfigs.get(0);
|
|
cacheOreGen(offlinePlayer.getUniqueId(), id);
|
|
cacheOreGen(offlinePlayer.getUniqueId(), id);
|
|
} else {
|
|
} else {
|
|
-
|
|
|
|
int islandLevel = getLevel(offlinePlayer.getUniqueId(), world);
|
|
int islandLevel = getLevel(offlinePlayer.getUniqueId(), world);
|
|
if (offlinePlayer.isOnline()) {
|
|
if (offlinePlayer.isOnline()) {
|
|
Player realP = offlinePlayer.getPlayer();
|
|
Player realP = offlinePlayer.getPlayer();
|
|
@@ -259,9 +260,19 @@ public class CustomOreGen extends JavaPlugin {
|
|
gc = getCachedGeneratorConfig(offlinePlayer.getUniqueId());
|
|
gc = getCachedGeneratorConfig(offlinePlayer.getUniqueId());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
if (id > 0) {
|
|
if (id > 0) {
|
|
cacheOreGen(offlinePlayer.getUniqueId(), id - 1);
|
|
cacheOreGen(offlinePlayer.getUniqueId(), id - 1);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // fail over if there wasn't found any applicable generator but still no permission and level 0
|
|
|
|
+ if (gc == null && generatorConfigs.get(0) != null
|
|
|
|
+ && (generatorConfigs.get(0).permission == ";" || generatorConfigs.get(0).permission == "" || generatorConfigs.get(0).permission.length() == 0)
|
|
|
|
+ && generatorConfigs.get(0).unlock_islandLevel == 0) {
|
|
|
|
+
|
|
|
|
+ gc = generatorConfigs.get(0);
|
|
|
|
+ }
|
|
|
|
+
|
|
return gc;
|
|
return gc;
|
|
}
|
|
}
|
|
|
|
|