mirror of
https://github.com/garbagemule/MobArena.git
synced 2024-11-27 04:55:25 +01:00
Grant 'after' rewards when the next wave is about to spawn. Fixes #393
This commit is contained in:
parent
5d1ec8eb56
commit
3b82cf12a4
@ -98,8 +98,8 @@ public class MASpawnThread implements Runnable
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Grant rewards (if any) for the wave about to spawn
|
// Grant rewards (if any) for the wave that just ended
|
||||||
grantRewards(nextWave);
|
grantRewards(nextWave - 1);
|
||||||
|
|
||||||
// Check if this is the final wave, in which case, end instead of spawn
|
// Check if this is the final wave, in which case, end instead of spawn
|
||||||
if (nextWave > 1 && (nextWave - 1) == waveManager.getFinalWave()) {
|
if (nextWave > 1 && (nextWave - 1) == waveManager.getFinalWave()) {
|
||||||
@ -292,7 +292,7 @@ public class MASpawnThread implements Runnable
|
|||||||
|
|
||||||
private void grantRewards(int wave) {
|
private void grantRewards(int wave) {
|
||||||
for (Map.Entry<Integer, List<ItemStack>> entry : arena.getEveryWaveEntrySet()) {
|
for (Map.Entry<Integer, List<ItemStack>> entry : arena.getEveryWaveEntrySet()) {
|
||||||
if (wave % entry.getKey() == 0) {
|
if (wave > 0 && wave % entry.getKey() == 0) {
|
||||||
addReward(entry.getValue());
|
addReward(entry.getValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user