Apply 1.1.8 changes

This commit is contained in:
Esophose 2019-03-20 23:34:45 -06:00
parent f1f4fd9c49
commit cce5ccfdf3
7 changed files with 17 additions and 10 deletions

3
TODO
View File

@ -6,6 +6,3 @@
01:00 -> Wilderness - Button to change max coords, boss that autospawn applies to, maxActiveBosses, spawnChance 01:00 -> Wilderness - Button to change max coords, boss that autospawn applies to, maxActiveBosses, spawnChance
01:00 -> Spawner - Button to change max coords, boss that autospawn applies to, maxActiveBosses, spawnChance 01:00 -> Spawner - Button to change max coords, boss that autospawn applies to, maxActiveBosses, spawnChance
01:00 -> Biome - Button to change max bosses per biome, boss that autospawn applies to, spawnChance 01:00 -> Biome - Button to change max bosses per biome, boss that autospawn applies to, spawnChance
-----------
8:45 hrs

View File

@ -7,6 +7,7 @@ import com.songoda.epicbosses.autospawns.IAutoSpawnCustomSettingsHandler;
import com.songoda.epicbosses.autospawns.handlers.IntervalSpawnHandler; import com.songoda.epicbosses.autospawns.handlers.IntervalSpawnHandler;
import com.songoda.epicbosses.autospawns.settings.AutoSpawnSettings; import com.songoda.epicbosses.autospawns.settings.AutoSpawnSettings;
import com.songoda.epicbosses.entity.BossEntity; import com.songoda.epicbosses.entity.BossEntity;
import com.songoda.epicbosses.events.BossSpawnEvent;
import com.songoda.epicbosses.holder.ActiveBossHolder; import com.songoda.epicbosses.holder.ActiveBossHolder;
import com.songoda.epicbosses.holder.autospawn.ActiveIntervalAutoSpawnHolder; import com.songoda.epicbosses.holder.autospawn.ActiveIntervalAutoSpawnHolder;
import com.songoda.epicbosses.listeners.IBossDeathHandler; import com.songoda.epicbosses.listeners.IBossDeathHandler;
@ -90,6 +91,9 @@ public class IntervalSpawnElement implements IAutoSpawnCustomSettingsHandler {
activeBossHolder.getPostBossDeathHandlers().add(bossDeathHandler); activeBossHolder.getPostBossDeathHandlers().add(bossDeathHandler);
activeAutoSpawnHolder.getActiveBossHolders().add(activeBossHolder); activeAutoSpawnHolder.getActiveBossHolders().add(activeBossHolder);
BossSpawnEvent bossSpawnEvent = new BossSpawnEvent(activeBossHolder, true);
ServerUtils.get().callEvent(bossSpawnEvent);
} }
if(customSpawnMessage && spawnMessage != null) { if(customSpawnMessage && spawnMessage != null) {

View File

@ -14,10 +14,12 @@ public class BossDeathEvent extends Event {
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
@Getter private ActiveBossHolder activeBossHolder; @Getter private final ActiveBossHolder activeBossHolder;
@Getter private final boolean autoSpawn;
public BossDeathEvent(ActiveBossHolder activeBossHolder) { public BossDeathEvent(ActiveBossHolder activeBossHolder, boolean autoSpawn) {
this.activeBossHolder = activeBossHolder; this.activeBossHolder = activeBossHolder;
this.autoSpawn = autoSpawn;
} }
@Override @Override

View File

@ -14,10 +14,12 @@ public class BossSpawnEvent extends Event {
private static final HandlerList handlers = new HandlerList(); private static final HandlerList handlers = new HandlerList();
@Getter private ActiveBossHolder activeBossHolder; @Getter private final ActiveBossHolder activeBossHolder;
@Getter private final boolean autoSpawn;
public BossSpawnEvent(ActiveBossHolder activeBossHolder) { public BossSpawnEvent(ActiveBossHolder activeBossHolder, boolean autoSpawn) {
this.activeBossHolder = activeBossHolder; this.activeBossHolder = activeBossHolder;
this.autoSpawn = autoSpawn;
} }
@Override @Override

View File

@ -140,10 +140,12 @@ public class BossDeathListener implements Listener {
} }
}); });
boolean autoSpawn = !activeBossHolder.getPostBossDeathHandlers().isEmpty();
activeBossHolder.getPostBossDeathHandlers().forEach(handler -> handler.onPreDeath(event)); activeBossHolder.getPostBossDeathHandlers().forEach(handler -> handler.onPreDeath(event));
DeadBossHolder deadBossHolder = new DeadBossHolder(bossEntity, location, mapOfDamage, mapOfPercent); DeadBossHolder deadBossHolder = new DeadBossHolder(bossEntity, location, mapOfDamage, mapOfPercent);
BossDeathEvent bossDeathEvent = new BossDeathEvent(activeBossHolder); BossDeathEvent bossDeathEvent = new BossDeathEvent(activeBossHolder, autoSpawn);
DropTable dropTable = this.bossEntityManager.getDropTable(bossEntity); DropTable dropTable = this.bossEntityManager.getDropTable(bossEntity);
if(dropTable == null) { if(dropTable == null) {

View File

@ -141,7 +141,7 @@ public class BossSpawnListener implements Listener {
activeBossHolder.getTargetHandler().runTargetCycle(); activeBossHolder.getTargetHandler().runTargetCycle();
this.bossTauntManager.handleTauntSystem(activeBossHolder); this.bossTauntManager.handleTauntSystem(activeBossHolder);
BossSpawnEvent bossSpawnEvent = new BossSpawnEvent(activeBossHolder); BossSpawnEvent bossSpawnEvent = new BossSpawnEvent(activeBossHolder, false);
ServerUtils.get().callEvent(bossSpawnEvent); ServerUtils.get().callEvent(bossSpawnEvent);
} }

View File

@ -19,7 +19,7 @@
</modules> </modules>
<properties> <properties>
<plugin.version>1.0.8-U1</plugin.version> <plugin.version>maven-version-number</plugin.version>
<plugin.name>EpicBosses</plugin.name> <plugin.name>EpicBosses</plugin.name>
<plugin.main>com.songoda.epicbosses.CustomBosses</plugin.main> <plugin.main>com.songoda.epicbosses.CustomBosses</plugin.main>
<plugin.author>AMinecraftDev</plugin.author> <plugin.author>AMinecraftDev</plugin.author>