Merge branch 'development'

This commit is contained in:
Brianna 2020-05-09 18:05:24 -04:00
commit d1203a1933
11 changed files with 25 additions and 22 deletions

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>EpicBosses</artifactId>
<groupId>com.songoda.epicbosses</groupId>
<version>1.2.11</version>
<version>1.2.12</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>EpicBosses</artifactId>
<groupId>com.songoda.epicbosses</groupId>
<version>1.2.11</version>
<version>1.2.12</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>EpicBosses</artifactId>
<groupId>com.songoda.epicbosses</groupId>
<version>1.2.11</version>
<version>1.2.12</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>EpicBosses</artifactId>
<groupId>com.songoda.epicbosses</groupId>
<version>1.2.11</version>
<version>1.2.12</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>EpicBosses</artifactId>
<groupId>com.songoda.epicbosses</groupId>
<version>1.2.11</version>
<version>1.2.12</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -60,7 +60,6 @@ public class EpicBosses extends SongodaPlugin implements IReloadable {
private BossHookManager bossHookManager;
private AutoSpawnManager autoSpawnManager;
private PlaceholderManager placeholderManager;
private MinionMechanicManager minionMechanicManager;
private MinionEntityContainer minionEntityContainer;
@ -135,10 +134,8 @@ public class EpicBosses extends SongodaPlugin implements IReloadable {
this.autoSpawnManager = new AutoSpawnManager(this);
if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
this.placeholderManager = new PlaceholderManager(this);
this.placeholderManager.register();
}
if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI"))
new PlaceholderManager(this).register();
createFiles();
reloadFiles();
@ -198,6 +195,11 @@ public class EpicBosses extends SongodaPlugin implements IReloadable {
this.autoSpawnManager.startIntervalSystems();
if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")) {
System.out.println("hiiiit");
new PlaceholderManager(this).register();
}
ServerUtils.get().logDebug("Loaded all fields and managers, saved messages and plugin is initialized and ready to go. (took " + (System.currentTimeMillis() - beginMs) + "ms).");
}
@ -349,10 +351,6 @@ public class EpicBosses extends SongodaPlugin implements IReloadable {
return this.autoSpawnManager;
}
public PlaceholderManager getPlaceholderManager() {
return this.placeholderManager;
}
public MinionMechanicManager getMinionMechanicManager() {
return this.minionMechanicManager;
}

View File

@ -73,7 +73,8 @@ public class ActiveMinionHolder implements IActiveHolder {
// this.livingEntityMap.clear();
// grab list of all valid entities by UUID that can be removed
Map<Integer, Entity> toRemove = this.livingEntityMap.entrySet().stream().filter(Objects::nonNull)
Map<Integer, Entity> toRemove = this.livingEntityMap.entrySet().stream()
.filter(e -> e != null && e.getValue() != null && ServerUtils.get().getEntity(e.getValue()) != null)
.collect(Collectors.toMap(Map.Entry::getKey, e -> ServerUtils.get().getEntity(e.getValue())))
.entrySet().stream()
.filter(e -> e.getValue() != null && e.getValue().getWorld().isChunkLoaded(

View File

@ -101,7 +101,7 @@ public class BossSkillListener implements Listener {
String customMessage = skill.getCustomMessage();
if (customMessage != null)
masterMessage = Arrays.asList(skill.getCustomMessage());
masterMessage = BossAPI.getStoredMessages(skill.getCustomMessage());
List<LivingEntity> targettedEntities = this.bossSkillManager.getTargetedEntities(activeBossHolder, skill, activeBossHolder.getLivingEntity().getLocation(), damagingEntity);

View File

@ -8,7 +8,7 @@ import org.bukkit.OfflinePlayer;
public class PlaceholderManager extends PlaceholderExpansion {
private AutoSpawnManager autoSpawnManager;
private final AutoSpawnManager autoSpawnManager;
public PlaceholderManager(EpicBosses plugin) {
this.autoSpawnManager = plugin.getAutoSpawnManager();
@ -24,10 +24,14 @@ public class PlaceholderManager extends PlaceholderExpansion {
ActiveIntervalAutoSpawnHolder intervalAutoSpawnHolder = (ActiveIntervalAutoSpawnHolder) autoSpawnHolder;
long duration = (long) (intervalAutoSpawnHolder.getRemainingMs() / 1000D);
String formattedIdentifier = intervalAutoSpawnHolder.getIntervalSpawnElement().getPlaceholder() + "_formatted";
String placeHolder = intervalAutoSpawnHolder.getIntervalSpawnElement().getPlaceholder()
.replace("{", "")
.replace("}", "");
String formattedIdentifier = placeHolder + "_formatted";
if (identifier.equalsIgnoreCase(formattedIdentifier)) {
return this.getTimeFormatted(duration);
} else if (identifier.equals(intervalAutoSpawnHolder.getIntervalSpawnElement().getPlaceholder())) {
} else if (identifier.equals(placeHolder)) {
return String.valueOf((int) (intervalAutoSpawnHolder.getRemainingMs() / 1000D));
}
}

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>EpicBosses</artifactId>
<groupId>com.songoda.epicbosses</groupId>
<version>1.2.11</version>
<version>1.2.12</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -4,7 +4,7 @@
<groupId>com.songoda.epicbosses</groupId>
<artifactId>EpicBosses</artifactId>
<packaging>pom</packaging>
<version>1.2.11</version>
<version>1.2.12</version>
<modules>
<module>api-modules/FactionsM</module>
@ -16,7 +16,7 @@
</modules>
<properties>
<plugin.version>1.2.11</plugin.version>
<plugin.version>1.2.12</plugin.version>
<plugin.name>EpicBosses</plugin.name>
<plugin.main>com.songoda.epicbosses.EpicBosses</plugin.main>
<plugin.author>Songoda</plugin.author>