Prevent potion effect filter when the list is empty

This commit is contained in:
TheMode 2021-04-24 15:03:27 +02:00
parent a6314abbad
commit 7d4e04bc66

View File

@ -678,7 +678,7 @@ public class Entity implements Viewable, Tickable, EventHandler, DataContainer,
callEvent(EntityTickEvent.class, tickEvent); // reuse tickEvent to avoid recreating it each tick
// remove expired effects
{
if (!effects.isEmpty()) {
this.effects.removeIf(timedPotion -> {
final long potionTime = (long) timedPotion.getPotion().getDuration() * MinecraftServer.TICK_MS;
// Remove if the potion should be expired