Work around Forge logging bug
Closes SpongePowered/SpongeCommon#1236
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.FMLLog;
+import net.minecraftforge.fml.relauncher.FMLRelaunchLog;
+import org.apache.logging.log4j.Level;
import org.spongepowered.api.world.PortalAgent;
import org.spongepowered.api.world.PortalAgentTypes;
import org.spongepowered.asm.mixin.Mixin;
@@ -250,7 +252,8 @@ public static boolean canEntitySpawnHere(EntityLiving entityLiving, IEntityLivin
@Overwrite
public static void onEntityError(Entity entity, CrashReport crashReport) {
if (ForgeModContainer.removeErroringEntities) {
- FMLLog.severe(crashReport.getCompleteReport());
+ // Sponge - fix https://github.com/MinecraftForge/MinecraftForge/issues/3713
+ FMLRelaunchLog.log.getLogger().log(Level.ERROR, crashReport.getCompleteReport());
entity.getEntityWorld().removeEntity(entity);
} else {
throw new ReportedException(crashReport);
@@ -260,7 +263,8 @@ public static void onEntityError(Entity entity, CrashReport crashReport) {
@Overwrite
public static void onTileEntityError(TileEntity tileEntity, CrashReport crashReport) {
if (ForgeModContainer.removeErroringTileEntities) {
- FMLLog.severe(crashReport.getCompleteReport());
+ // Sponge - fix https://github.com/MinecraftForge/MinecraftForge/issues/3713
+ FMLRelaunchLog.log.getLogger().log(Level.ERROR, crashReport.getCompleteReport());
tileEntity.invalidate();
tileEntity.getWorld().removeTileEntity(tileEntity.getPos());
} else {
