mirror of
https://github.com/garbagemule/MobArena.git
synced 2024-11-30 06:33:55 +01:00
Reuse removePotionEffects() in ArenaImpl.
This commit also rearranges the method, placing it closer to the cleanup methods.
This commit is contained in:
parent
cbf18ff720
commit
ae3b394b46
@ -1033,12 +1033,6 @@ public class ArenaImpl implements Arena
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removePotionEffects(Player p) {
|
|
||||||
for (PotionEffect effect : p.getActivePotionEffects()) {
|
|
||||||
p.removePotionEffect(effect.getType());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void startSpawner() {
|
private void startSpawner() {
|
||||||
// Set the spawn flags to enable monster spawning.
|
// Set the spawn flags to enable monster spawning.
|
||||||
world.setSpawnFlags(true, true);
|
world.setSpawnFlags(true, true);
|
||||||
@ -1171,10 +1165,7 @@ public class ArenaImpl implements Arena
|
|||||||
}
|
}
|
||||||
|
|
||||||
InventoryManager.clearInventory(p);
|
InventoryManager.clearInventory(p);
|
||||||
p.getActivePotionEffects().stream()
|
removePotionEffects(p);
|
||||||
.map(PotionEffect::getType)
|
|
||||||
.forEach(p::removePotionEffect);
|
|
||||||
|
|
||||||
arenaPlayer.setArenaClass(arenaClass);
|
arenaPlayer.setArenaClass(arenaClass);
|
||||||
arenaClass.grantItems(p);
|
arenaClass.grantItems(p);
|
||||||
|
|
||||||
@ -1343,6 +1334,12 @@ public class ArenaImpl implements Arena
|
|||||||
p.recalculatePermissions();
|
p.recalculatePermissions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void removePotionEffects(Player p) {
|
||||||
|
p.getActivePotionEffects().stream()
|
||||||
|
.map(PotionEffect::getType)
|
||||||
|
.forEach(p::removePotionEffect);
|
||||||
|
}
|
||||||
|
|
||||||
private void cleanup() {
|
private void cleanup() {
|
||||||
removeMonsters();
|
removeMonsters();
|
||||||
removeBlocks();
|
removeBlocks();
|
||||||
|
Loading…
Reference in New Issue
Block a user