fix auto respawns when boss is killed with /minecraft:kill
This commit is contained in:
parent
331fb487e2
commit
fe43bc35b5
|
@ -67,6 +67,9 @@
|
|||
<version>2.3.2</version>
|
||||
<configuration>
|
||||
<showDeprecation>false</showDeprecation>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<encoding>utf8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
|
|
@ -91,6 +91,7 @@ public class IntervalSpawnElement implements IAutoSpawnCustomSettingsHandler {
|
|||
if (activeBossHolder == null) continue;
|
||||
|
||||
activeBossHolder.getPostBossDeathHandlers().add(bossDeathHandler);
|
||||
activeBossHolder.getPostBossDeathRemoveHandlers().add(bossDeathHandler);
|
||||
activeAutoSpawnHolder.getActiveBossHolders().add(activeBossHolder);
|
||||
|
||||
BossSpawnEvent bossSpawnEvent = new BossSpawnEvent(activeBossHolder, true);
|
||||
|
|
|
@ -28,6 +28,7 @@ public class ActiveBossHolder implements IActiveHolder {
|
|||
private Map<Integer, ActiveMinionHolder> activeMinionHolderMap = new HashMap<>();
|
||||
private Map<Integer, UUID> livingEntityMap = new HashMap<>();
|
||||
private List<IBossDeathHandler> postBossDeathHandlers = new ArrayList<>();
|
||||
private List<IBossDeathHandler> postBossDeathRemoveHandlers = new ArrayList<>();
|
||||
private Map<UUID, Double> mapOfDamagingUsers = new HashMap<>();
|
||||
private String spawningPlayerName;
|
||||
|
||||
|
@ -145,6 +146,10 @@ public class ActiveBossHolder implements IActiveHolder {
|
|||
public List<IBossDeathHandler> getPostBossDeathHandlers() {
|
||||
return this.postBossDeathHandlers;
|
||||
}
|
||||
|
||||
public List<IBossDeathHandler> getPostBossDeathRemoveHandlers() {
|
||||
return this.postBossDeathRemoveHandlers;
|
||||
}
|
||||
|
||||
public Map<UUID, Double> getMapOfDamagingUsers() {
|
||||
return this.mapOfDamagingUsers;
|
||||
|
|
|
@ -60,6 +60,7 @@ public class BossDeathListener implements Listener {
|
|||
if (damageCause == EntityDamageEvent.DamageCause.VOID || damageCause == EntityDamageEvent.DamageCause.LAVA
|
||||
|| activeBossHolder.getMapOfDamagingUsers().isEmpty()) {
|
||||
this.bossEntityManager.removeActiveBossHolder(activeBossHolder);
|
||||
activeBossHolder.getPostBossDeathRemoveHandlers().forEach(handler -> handler.onPreDeath(new PreBossDeathEvent(activeBossHolder, location, null)));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue