Ensures do not tick dead entity

This commit is contained in:
Sotr
2019-03-22 04:41:54 +08:00
parent 73003da5c8
commit aaab88b497
2 changed files with 3 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
package io.akarin.server.core;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

View File

@@ -1261,8 +1261,10 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
// CraftBukkit end
try {
if (!entity.dead) { // Akarin start - do not tick dead entity
++entity.ticksLived;
entity.tick();
} // Akarin end
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.a(throwable, "Ticking entity");
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being ticked");