9
0
mirror of https://github.com/Samsuik/Sakura.git synced 2025-12-28 11:19:08 +00:00

fix merge-level none causing an exception

Fixes #33
This commit is contained in:
Samsuik
2025-09-18 23:20:37 +01:00
parent e51c69cebb
commit 65e1048cd0
2 changed files with 14 additions and 10 deletions

View File

@@ -162,8 +162,8 @@ public final class TntExplosion extends SpecialisedExplosion<PrimedTnt> {
entities.createRawIterator();
// iterate over the entityTickList to find entities that are exploding in the same position.
while ((index = entities.advanceRawIterator(index)) != -1) {
Entity foundEntity = entities.getListRaw()[index];
while ((index = entities.advanceRawIterator(index)) != Integer.MAX_VALUE) {
Entity foundEntity = entities.rawGet(index);
if (!(foundEntity instanceof MergeableEntity mergeEntity) || foundEntity.isRemoved() || !foundEntity.compareState(this.cause) || !mergeEntity.isSafeToMergeInto(this.cause, true))
break;
this.level().mergeHandler.mergeEntity(mergeEntity, this.cause);