mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-30 13:58:42 +00:00
Fix #719
This commit is contained in:
parent
d00465125d
commit
bf8f4fba52
@ -28,11 +28,11 @@ public class ScriptMonsterSpawnService {
|
|||||||
onMonsterCreatedListener.add(consumer);
|
onMonsterCreatedListener.add(consumer);
|
||||||
}
|
}
|
||||||
public void addMonsterDeadListener(Consumer<EntityMonster> consumer){
|
public void addMonsterDeadListener(Consumer<EntityMonster> consumer){
|
||||||
onMonsterCreatedListener.add(consumer);
|
onMonsterDeadListener.add(consumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onMonsterDead(EntityMonster entityMonster){
|
public void onMonsterDead(EntityMonster entityMonster){
|
||||||
onMonsterCreatedListener.stream().forEach(l -> l.accept(entityMonster));
|
onMonsterDeadListener.forEach(l -> l.accept(entityMonster));
|
||||||
}
|
}
|
||||||
public void spawnMonster(int groupId, SceneMonster monster) {
|
public void spawnMonster(int groupId, SceneMonster monster) {
|
||||||
if(monster == null){
|
if(monster == null){
|
||||||
|
@ -66,9 +66,9 @@ public class ScriptMonsterTideService {
|
|||||||
if(this.monsterTideCount.get() > 0){
|
if(this.monsterTideCount.get() > 0){
|
||||||
// add more
|
// add more
|
||||||
this.sceneScriptManager.getScriptMonsterSpawnService().spawnMonster(this.currentGroup.id, getNextMonster());
|
this.sceneScriptManager.getScriptMonsterSpawnService().spawnMonster(this.currentGroup.id, getNextMonster());
|
||||||
}else if(this.monsterAlive.get() == 0){
|
|
||||||
// spawn the last turn of monsters
|
|
||||||
this.sceneScriptManager.callEvent(EventType.EVENT_MONSTER_TIDE_DIE, new ScriptArgs(this.monsterKillCount.get()));
|
|
||||||
}
|
}
|
||||||
|
// spawn the last turn of monsters
|
||||||
|
// fix the 5-2
|
||||||
|
this.sceneScriptManager.callEvent(EventType.EVENT_MONSTER_TIDE_DIE, new ScriptArgs(this.monsterKillCount.get()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user