Deleted unnecessary casts with Eclipse

This commit is contained in:
Andrew
2014-09-28 11:56:16 -07:00
parent 94d5319038
commit da63aca95c
89 changed files with 348 additions and 360 deletions
@@ -63,7 +63,7 @@ public abstract class InventoryAdaptor implements Iterable<ItemSlot>
}
else if ( te instanceof TileEntityChest )
{
return new AdaptorIInventory( (IInventory) Platform.GetChestInv( te ) );
return new AdaptorIInventory( Platform.GetChestInv( te ) );
}
else if ( isSpecialInventory( te ) )
{
+11 -11
View File
@@ -1212,9 +1212,9 @@ public class Platform
float f = 1.0F;
float f1 = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * f;
float f2 = player.prevRotationYaw + (player.rotationYaw - player.prevRotationYaw) * f;
double d0 = player.prevPosX + (player.posX - player.prevPosX) * (double) f;
double d0 = player.prevPosX + (player.posX - player.prevPosX) * f;
double d1 = eyeOffset;
double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * (double) f;
double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * f;
Vec3 vec3 = Vec3.createVectorHelper( d0, d1, d2 );
float f3 = MathHelper.cos( -f2 * 0.017453292F - (float) Math.PI );
@@ -1229,7 +1229,7 @@ public class Platform
{
d3 = ((EntityPlayerMP) player).theItemInWorldManager.getBlockReachDistance();
}
Vec3 vec31 = vec3.addVector( (double) f7 * d3, (double) f6 * d3, (double) f8 * d3 );
Vec3 vec31 = vec3.addVector( f7 * d3, f6 * d3, f8 * d3 );
return new LookDirection( vec3, vec31 );
}
@@ -1240,9 +1240,9 @@ public class Platform
float f = 1.0F;
float f1 = p.prevRotationPitch + (p.rotationPitch - p.prevRotationPitch) * f;
float f2 = p.prevRotationYaw + (p.rotationYaw - p.prevRotationYaw) * f;
double d0 = p.prevPosX + (p.posX - p.prevPosX) * (double) f;
double d1 = p.prevPosY + (p.posY - p.prevPosY) * (double) f + 1.62D - (double) p.yOffset;
double d2 = p.prevPosZ + (p.posZ - p.prevPosZ) * (double) f;
double d0 = p.prevPosX + (p.posX - p.prevPosX) * f;
double d1 = p.prevPosY + (p.posY - p.prevPosY) * f + 1.62D - p.yOffset;
double d2 = p.prevPosZ + (p.posZ - p.prevPosZ) * f;
Vec3 vec3 = Vec3.createVectorHelper( d0, d1, d2 );
float f3 = MathHelper.cos( -f2 * 0.017453292F - (float) Math.PI );
float f4 = MathHelper.sin( -f2 * 0.017453292F - (float) Math.PI );
@@ -1252,7 +1252,7 @@ public class Platform
float f8 = f3 * f5;
double d3 = 32.0D;
Vec3 vec31 = vec3.addVector( (double) f7 * d3, (double) f6 * d3, (double) f8 * d3 );
Vec3 vec31 = vec3.addVector( f7 * d3, f6 * d3, f8 * d3 );
AxisAlignedBB bb = AxisAlignedBB.getBoundingBox( Math.min( vec3.xCoord, vec31.xCoord ), Math.min( vec3.yCoord, vec31.yCoord ),
Math.min( vec3.zCoord, vec31.zCoord ), Math.max( vec3.xCoord, vec31.xCoord ), Math.max( vec3.yCoord, vec31.yCoord ),
@@ -1278,7 +1278,7 @@ public class Platform
continue;
f1 = 0.3F;
AxisAlignedBB boundingBox = entity1.boundingBox.expand( (double) f1, (double) f1, (double) f1 );
AxisAlignedBB boundingBox = entity1.boundingBox.expand( f1, f1, f1 );
MovingObjectPosition movingObjectPosition = boundingBox.calculateIntercept( vec3, vec31 );
if ( movingObjectPosition != null )
@@ -1603,9 +1603,9 @@ public class Platform
break;
}
player.posX = (float) tile.xCoord + 0.5;
player.posY = (float) tile.yCoord + 0.5;
player.posZ = (float) tile.zCoord + 0.5;
player.posX = tile.xCoord + 0.5;
player.posY = tile.yCoord + 0.5;
player.posZ = tile.zCoord + 0.5;
player.rotationPitch = player.prevCameraPitch = player.cameraPitch = pitch;
player.rotationYaw = player.prevCameraYaw = player.cameraYaw = yaw;
@@ -157,7 +157,7 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
* if ( FluidName != null && FluidName instanceof NBTTagString ) ((NBTTagString) FluidName).data = (String)
* this.fluid.getName(); else
*/
i.setString( "FluidName", (String) this.fluid.getName() );
i.setString( "FluidName", this.fluid.getName() );
/*
* if ( Count != null && Count instanceof NBTTagByte ) ((NBTTagByte) Count).data = (byte) 0; else
@@ -5,7 +5,6 @@ import java.util.List;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTBase;
import appeng.util.Platform;
import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier;
import cpw.mods.fml.relauncher.Side;
@@ -81,7 +80,7 @@ public class AEItemDef
return true;
if ( tagCompound != null && otherStack.hasTagCompound() )
return Platform.NBTEqualityTest( (NBTBase) tagCompound, otherStack.getTagCompound() );
return Platform.NBTEqualityTest( tagCompound, otherStack.getTagCompound() );
return true;
}
@@ -121,7 +121,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
if ( is.getItem() == def.item && is.getItemDamage() == this.def.damageValue )
{
NBTTagCompound ta = (NBTTagCompound) def.tagCompound;
NBTTagCompound ta = def.tagCompound;
NBTTagCompound tb = is.getTagCompound();
if ( ta == tb )
return true;
@@ -203,7 +203,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
i.setShort( "Damage", (short) this.def.damageValue );
if ( def.tagCompound != null )
i.setTag( "tag", (NBTTagCompound) def.tagCompound );
i.setTag( "tag", def.tagCompound );
else
i.removeTag( "tag" );
+6 -6
View File
@@ -95,11 +95,11 @@ public abstract class AEStack<StackType extends IAEStack> implements IAEStack<St
void putPacketValue(ByteBuf tag, long num) throws IOException
{
if ( num <= 255 )
tag.writeByte( (byte) (num + (long) Byte.MIN_VALUE) );
tag.writeByte( (byte) (num + Byte.MIN_VALUE) );
else if ( num <= 65535 )
tag.writeShort( (short) (num + (long) Short.MIN_VALUE) );
tag.writeShort( (short) (num + Short.MIN_VALUE) );
else if ( num <= 4294967295L )
tag.writeInt( (int) (num + (long) Integer.MIN_VALUE) );
tag.writeInt( (int) (num + Integer.MIN_VALUE) );
else
tag.writeLong( num );
}
@@ -109,19 +109,19 @@ public abstract class AEStack<StackType extends IAEStack> implements IAEStack<St
if ( type == 0 )
{
long l = tag.readByte();
l -= (long) Byte.MIN_VALUE;
l -= Byte.MIN_VALUE;
return l;
}
else if ( type == 1 )
{
long l = tag.readShort();
l -= (long) Short.MIN_VALUE;
l -= Short.MIN_VALUE;
return l;
}
else if ( type == 2 )
{
long l = tag.readInt();
l -= (long) Integer.MIN_VALUE;
l -= Integer.MIN_VALUE;
return l;
}
@@ -101,7 +101,7 @@ public class OreHelper
public boolean sameOre(AEItemStack aeItemStack, IAEItemStack is)
{
OreReference a = aeItemStack.def.isOre;
OreReference b = ((AEItemStack) aeItemStack).def.isOre;
OreReference b = aeItemStack.def.isOre;
if ( a == b )
return true;
@@ -25,7 +25,7 @@ public class DefaultPriorityList<T extends IAEStack<T>> implements IPartitionLis
@Override
public Iterable<T> getItems()
{
return (Iterable<T>) nullList;
return nullList;
}
}