If an IO exception comes from the datawatcher, spew it all over the console

don't discard it silently. Should stop pixelmon blaming forge for their mistakes.
This commit is contained in:
Christian 2014-07-29 21:33:19 -02:30
parent 522b648185
commit 03174602f6
1 changed files with 7 additions and 1 deletions

View File

@ -6,11 +6,16 @@ import io.netty.buffer.Unpooled;
import java.io.IOException;
import java.util.List;
import org.apache.logging.log4j.Level;
import com.google.common.base.Throwables;
import net.minecraft.entity.DataWatcher;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.network.PacketBuffer;
import net.minecraft.util.MathHelper;
import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.common.ModContainer;
import cpw.mods.fml.common.network.ByteBufUtils;
import cpw.mods.fml.common.registry.EntityRegistry.EntityRegistration;
@ -189,7 +194,8 @@ public abstract class FMLMessage {
entity.getDataWatcher().func_151509_a(pb);
} catch (IOException e)
{
// Sigh
FMLLog.log(Level.FATAL,e,"Encountered fatal exception trying to send entity spawn data watchers");
throw Throwables.propagate(e);
}
buf.writeBytes(tmpBuf);