Fix: setDead() now correctly calls cancel()

This commit is contained in:
mlbv 2025-05-23 01:47:29 +08:00
parent bf2a4b776f
commit 9bb9a56452
4 changed files with 17 additions and 0 deletions

View File

@ -133,6 +133,13 @@ public class EntityNukeExplosionMK5 extends EntityExplosionChunkloading {
}
}
@Override
public void setDead(){
if(explosion != null)
explosion.cancel();
super.setDead();
}
@Override
protected void readEntityFromNBT(NBTTagCompound nbt) {
this.ticksExisted = nbt.getInteger("ticksExisted");

View File

@ -272,6 +272,13 @@ public class ExplosionNukeRayBatched implements IExplosionRay {
processChunk();
}
@Override
public void cancel() {
isAusf3Complete = true;
if (perChunk != null) perChunk.clear();
if (orderedChunks != null) orderedChunks.clear();
}
public class FloatTriplet {
public float xCoord;
public float yCoord;

View File

@ -195,6 +195,7 @@ public class ExplosionNukeRayParallelized implements IExplosionRay {
return collectFinished && destroyFinished;
}
@Override
public void cancel() {
this.collectFinished = true;
this.destroyFinished = true;

View File

@ -6,4 +6,6 @@ public interface IExplosionRay {
void cacheChunksTick(int processTime);
void destructionTick(int processTime);
void cancel();
}