anon-iclr-submission/benchname-bug-localization huggingface dataset:
Repository: spongepowered/sponge
Issue: ChangeBlockEvent cause does not contain who activated TNT

**I am currently running**
- SpongeVanilla version: spongevanilla-1.12.2-7.2.3-RC373

**Issue Description**
This is my test code:
https://gist.github.com/XakepSDK/a0f874facd1349e27a2484968a1897a9

This is results i obtain doing different things with TNT in-game:
I placed 1 TNT, 1 redstone dust and 1 pressure plate, then stand on the plate to activate TNT. I got this output:
https://gist.github.com/XakepSDK/96beb111deac789d4f7861fa2e18c0cc

I activated TNT using flint and steel
https://gist.github.com/XakepSDK/0f769a93a4bafd05f59f33303b29d85a

Is it intended that when TNT explodes, cause does not contain player who activated that TNT?
I thought it would contain TNT explosion as root cause and a Player who activated it.

Changed files:
src/main/java/org/spongepowered/common/mixin/core/world/chunk/ChunkMixin.java

diff --git a/src/main/java/org/spongepowered/common/mixin/core/world/chunk/ChunkMixin.java b/src/main/java/org/spongepowered/common/mixin/core/world/chunk/ChunkMixin.java
index 140ad1f37..62099c0b3 100644
--- a/src/main/java/org/spongepowered/common/mixin/core/world/chunk/ChunkMixin.java
+++ b/src/main/java/org/spongepowered/common/mixin/core/world/chunk/ChunkMixin.java
@@ -545,8 +545,10 @@ public IBlockState setBlockState(final BlockPos pos, final IBlockState state) {
             // Sponge End
             TileEntity tileentity = this.getTileEntity(pos, net.minecraft.world.chunk.Chunk.EnumCreateEntityType.CHECK);
 
-            if (tileentity == null) {
-                // Sponge Start - use SpongeImplHooks for forge compatibility
+            // Sponge Start - Additional check for the tile entity being queued for removal.
+            // if (tileentity == null) { // Sponge
+            if (tileentity == null || (transaction != null && transaction.queuedRemoval != null)) {
+                // Use SpongeImplHooks for forge compatibility
                 // tileentity = ((ITileEntityProvider)block).createNewTileEntity(this.worldObj, block.getMetaFromState(state)); // Sponge
                 tileentity = SpongeImplHooks.createTileEntity(newBlock, this.world, newState);
Repository: spongepowered/sponge
Issue: Mekanism Crash On Launch

### Affected Product(s)

SpongeForge

### Version

spongeforge-1.16.5-36.2.5-8.0.0-RC1073-universal.jar

### Operating System

Windows

### Java Version

Adopt OpenJDK Hotspot 1.8.0_322

### Plugins/Mods

```shell
SpongeForge
Mekanism-1.16.5-10.1.1.456.jar (Latest)
```


### Describe the bug

When both Mekanism and SpongeForge are installed, Minecraft crashes on launch

[latest.log](https://github.com/mekanism/Mekanism/files/8066821/latest.log)
[debug.log](https://github.com/mekanism/Mekanism/files/8066822/debug.log)
[crash-2022-02-15_18.35.43-fml.txt](https://github.com/mekanism/Mekanism/files/8066824/crash-2022-02-15_18.35.43-fml.txt)

### Link to logs

_No response_

Changed files:
forge/src/mixins/java/org/spongepowered/forge/mixin/core/world/entity/item/ItemEntityMixin_Forge.java

diff --git a/forge/src/mixins/java/org/spongepowered/forge/mixin/core/world/entity/item/ItemEntityMixin_Forge.java b/forge/src/mixins/java/org/spongepowered/forge/mixin/core/world/entity/item/ItemEntityMixin_Forge.java
index fb2b502d4..1ad9b4ed9 100644
--- a/forge/src/mixins/java/org/spongepowered/forge/mixin/core/world/entity/item/ItemEntityMixin_Forge.java
+++ b/forge/src/mixins/java/org/spongepowered/forge/mixin/core/world/entity/item/ItemEntityMixin_Forge.java
@@ -42,8 +42,11 @@ public abstract class ItemEntityMixin_Forge {
     // @formatter:on
 
     @Inject(method = "<init>(Lnet/minecraft/world/entity/EntityType;Lnet/minecraft/world/level/Level;)V", at = @At("RETURN"))
-    private void forge$setLifespanFromConfig(EntityType<? extends ItemEntity> type, Level level, CallbackInfo ci) {
-        if (!level.isClientSide) {
+    private void forge$setLifespanFromConfig(final EntityType<? extends ItemEntity> type, final Level level,
+        final CallbackInfo ci
+    ) {
+        // Check the level is not null to avoid an NPE
+        if (level != null && !level.isClientSide) {
             this.lifespan = SpongeGameConfigs.getForWorld(level).get().entity.item.despawnRate;
         }
     }