Improved exceptions
Many exceptions got an improvement due to changed class or description or details it is providing. Is not complete, needs to be done in patches in the regions, where it is needed, since some are just swallowed. Removed total usage of pure RuntimeExceptions to 0.
This commit is contained in:
@@ -364,9 +364,6 @@ public class ClientHelper extends ServerHelper
|
||||
|
||||
EntityPlayer player = mc.thePlayer;
|
||||
|
||||
if( player == null )
|
||||
return;
|
||||
|
||||
int x = (int) player.posX;
|
||||
int y = (int) player.posY;
|
||||
int z = (int) player.posZ;
|
||||
|
||||
@@ -79,7 +79,6 @@ import appeng.core.sync.packets.PacketSwapSlots;
|
||||
import appeng.helpers.InventoryAction;
|
||||
import appeng.integration.IntegrationType;
|
||||
import appeng.integration.abstraction.INEI;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public abstract class AEBaseGui extends GuiContainer
|
||||
@@ -744,8 +743,6 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
catch( Exception err )
|
||||
{
|
||||
AELog.warning( "[AppEng] AE prevented crash while drawing slot: " + err.toString() );
|
||||
if( Platform.isDrawing( Tessellator.instance ) )
|
||||
Tessellator.instance.draw();
|
||||
}
|
||||
this.setItemRender( pIR );
|
||||
return;
|
||||
@@ -794,8 +791,6 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
}
|
||||
catch( Exception err )
|
||||
{
|
||||
if( Platform.isDrawing( tessellator ) )
|
||||
tessellator.draw();
|
||||
}
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
@@ -876,15 +871,10 @@ public abstract class AEBaseGui extends GuiContainer
|
||||
{
|
||||
try
|
||||
{
|
||||
// drawSlotInventory
|
||||
// super.func_146977_a( s );r
|
||||
GuiContainer.class.getDeclaredMethod( "func_146977_a_original", Slot.class ).invoke( this, s );
|
||||
}
|
||||
catch( Exception err )
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
if( Platform.isDrawing( tessellator ) )
|
||||
tessellator.draw();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -325,9 +325,6 @@ public class BaseBlockRender
|
||||
|
||||
public void renderInvBlock( EnumSet<ForgeDirection> sides, AEBaseBlock block, ItemStack item, Tessellator tess, int color, RenderBlocks renderer )
|
||||
{
|
||||
if( Platform.isDrawing( tess ) )
|
||||
tess.draw();
|
||||
|
||||
int meta = 0;
|
||||
if( block != null && block.hasSubtypes() && item != null )
|
||||
meta = item.getItemDamage();
|
||||
|
||||
@@ -472,7 +472,7 @@ public final class BusRenderHelper implements IPartRenderHelper
|
||||
return block;
|
||||
}
|
||||
|
||||
throw new MissingDefinition( "Tried to access the multi part block." );
|
||||
throw new MissingDefinition( "Tried to access the multi part block without it being defined." );
|
||||
}
|
||||
|
||||
public void prepareBounds( RenderBlocks renderer )
|
||||
|
||||
@@ -33,7 +33,6 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.core.AELog;
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
@@ -65,9 +64,6 @@ public class TESRWrapper extends TileEntitySpecialRenderer
|
||||
|
||||
Tessellator tess = Tessellator.instance;
|
||||
|
||||
if( Platform.isDrawing( tess ) )
|
||||
return;
|
||||
|
||||
try
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
@@ -76,9 +72,6 @@ public class TESRWrapper extends TileEntitySpecialRenderer
|
||||
this.renderBlocksInstance.blockAccess = te.getWorldObj();
|
||||
this.blkRender.renderTile( (AEBaseBlock) b, (AEBaseTile) te, tess, x, y, z, f, this.renderBlocksInstance );
|
||||
|
||||
if( Platform.isDrawing( tess ) )
|
||||
throw new RuntimeException( "Error during rendering." );
|
||||
|
||||
GL11.glPopAttrib();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
@@ -87,7 +80,7 @@ public class TESRWrapper extends TileEntitySpecialRenderer
|
||||
AELog.severe( "Hi, Looks like there was a crash while rendering something..." );
|
||||
t.printStackTrace();
|
||||
AELog.severe( "MC will now crash ( probably )!" );
|
||||
throw new RuntimeException( t );
|
||||
throw new IllegalStateException( t );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,9 +53,6 @@ public class RenderBlockCraftingCPUMonitor extends RenderBlockCraftingCPU
|
||||
@Override
|
||||
public void renderTile( AEBaseBlock block, AEBaseTile tile, Tessellator tess, double x, double y, double z, float f, RenderBlocks renderer )
|
||||
{
|
||||
if( Platform.isDrawing( tess ) )
|
||||
return;
|
||||
|
||||
if( tile instanceof TileCraftingMonitorTile )
|
||||
{
|
||||
TileCraftingMonitorTile cmt = (TileCraftingMonitorTile) tile;
|
||||
|
||||
@@ -31,9 +31,8 @@ public class FlippableIcon implements IIcon
|
||||
|
||||
public FlippableIcon( IIcon o )
|
||||
{
|
||||
|
||||
if( o == null )
|
||||
throw new RuntimeException( "Cannot create a wrapper icon with a null icon." );
|
||||
throw new IllegalArgumentException( "Cannot create a wrapper icon with a null icon." );
|
||||
|
||||
this.original = o;
|
||||
this.flip_u = false;
|
||||
|
||||
@@ -32,9 +32,8 @@ public class FullIcon implements IIcon
|
||||
|
||||
public FullIcon( IIcon o )
|
||||
{
|
||||
|
||||
if( o == null )
|
||||
throw new RuntimeException( "Cannot create a wrapper icon with a null icon." );
|
||||
throw new IllegalArgumentException( "Cannot create a wrapper icon with a null icon." );
|
||||
|
||||
this.p = o;
|
||||
}
|
||||
|
||||
@@ -35,9 +35,8 @@ public class OffsetIcon implements IIcon
|
||||
|
||||
public OffsetIcon( IIcon o, float x, float y )
|
||||
{
|
||||
|
||||
if( o == null )
|
||||
throw new RuntimeException( "Cannot create a wrapper icon with a null icon." );
|
||||
throw new IllegalArgumentException( "Cannot create a wrapper icon with a null icon." );
|
||||
|
||||
this.p = o;
|
||||
this.offsetX = x;
|
||||
|
||||
@@ -30,28 +30,27 @@ public class TaughtIcon implements IIcon
|
||||
|
||||
final float tightness;
|
||||
|
||||
private final IIcon p;
|
||||
private final IIcon icon;
|
||||
|
||||
public TaughtIcon( IIcon o, float tightness )
|
||||
public TaughtIcon( IIcon icon, float tightness )
|
||||
{
|
||||
if( icon == null )
|
||||
throw new IllegalArgumentException( "Cannot create a wrapper icon with a null icon." );
|
||||
|
||||
if( o == null )
|
||||
throw new RuntimeException( "Cannot create a wrapper icon with a null icon." );
|
||||
|
||||
this.p = o;
|
||||
this.icon = icon;
|
||||
this.tightness = tightness * 0.4f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconWidth()
|
||||
{
|
||||
return this.p.getIconWidth();
|
||||
return this.icon.getIconWidth();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconHeight()
|
||||
{
|
||||
return this.p.getIconHeight();
|
||||
return this.icon.getIconHeight();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -100,7 +99,7 @@ public class TaughtIcon implements IIcon
|
||||
@SideOnly( Side.CLIENT )
|
||||
public String getIconName()
|
||||
{
|
||||
return this.p.getIconName();
|
||||
return this.icon.getIconName();
|
||||
}
|
||||
|
||||
private float v( double d )
|
||||
@@ -109,7 +108,7 @@ public class TaughtIcon implements IIcon
|
||||
d -= this.tightness;
|
||||
if( d > 8 )
|
||||
d += this.tightness;
|
||||
return this.p.getInterpolatedV( Math.min( 16.0, Math.max( 0.0, d ) ) );
|
||||
return this.icon.getInterpolatedV( Math.min( 16.0, Math.max( 0.0, d ) ) );
|
||||
}
|
||||
|
||||
private float u( double d )
|
||||
@@ -118,6 +117,6 @@ public class TaughtIcon implements IIcon
|
||||
d -= this.tightness;
|
||||
if( d > 8 )
|
||||
d += this.tightness;
|
||||
return this.p.getInterpolatedU( Math.min( 16.0, Math.max( 0.0, d ) ) );
|
||||
return this.icon.getInterpolatedU( Math.min( 16.0, Math.max( 0.0, d ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user