reduces overly strong type cast

This commit is contained in:
thatsIch
2015-05-09 00:00:52 +02:00
parent b8f22202d4
commit 7c9b734948
18 changed files with 48 additions and 39 deletions
+12 -12
View File
@@ -527,22 +527,22 @@ public class Platform
}
case 1: // ( A instanceof NBTTagByte )
return ( (NBTTagByte) left ).func_150287_d() == ( (NBTTagByte) right ).func_150287_d();
return ( (NBTBase.NBTPrimitive) left ).func_150287_d() == ( (NBTBase.NBTPrimitive) right ).func_150287_d();
case 4: // else if ( A instanceof NBTTagLong )
return ( (NBTTagLong) left ).func_150291_c() == ( (NBTTagLong) right ).func_150291_c();
return ( (NBTBase.NBTPrimitive) left ).func_150291_c() == ( (NBTBase.NBTPrimitive) right ).func_150291_c();
case 8: // else if ( A instanceof NBTTagString )
return ( (NBTTagString) left ).func_150285_a_().equals( ( (NBTTagString) right ).func_150285_a_() ) || ( (NBTTagString) left ).func_150285_a_().equals( ( (NBTTagString) right ).func_150285_a_() );
case 6: // else if ( A instanceof NBTTagDouble )
return ( (NBTTagDouble) left ).func_150286_g() == ( (NBTTagDouble) right ).func_150286_g();
return ( (NBTBase.NBTPrimitive) left ).func_150286_g() == ( (NBTBase.NBTPrimitive) right ).func_150286_g();
case 5: // else if ( A instanceof NBTTagFloat )
return ( (NBTTagFloat) left ).func_150288_h() == ( (NBTTagFloat) right ).func_150288_h();
return ( (NBTBase.NBTPrimitive) left ).func_150288_h() == ( (NBTBase.NBTPrimitive) right ).func_150288_h();
case 3: // else if ( A instanceof NBTTagInt )
return ( (NBTTagInt) left ).func_150287_d() == ( (NBTTagInt) right ).func_150287_d();
return ( (NBTBase.NBTPrimitive) left ).func_150287_d() == ( (NBTBase.NBTPrimitive) right ).func_150287_d();
default:
return left.equals( right );
@@ -628,22 +628,22 @@ public class Platform
}
case 1: // ( A instanceof NBTTagByte )
return hash + ( (NBTTagByte) nbt ).func_150290_f();
return hash + ( (NBTBase.NBTPrimitive) nbt ).func_150290_f();
case 4: // else if ( A instanceof NBTTagLong )
return hash + (int) ( (NBTTagLong) nbt ).func_150291_c();
return hash + (int) ( (NBTBase.NBTPrimitive) nbt ).func_150291_c();
case 8: // else if ( A instanceof NBTTagString )
return hash + ( (NBTTagString) nbt ).func_150285_a_().hashCode();
case 6: // else if ( A instanceof NBTTagDouble )
return hash + (int) ( (NBTTagDouble) nbt ).func_150286_g();
return hash + (int) ( (NBTBase.NBTPrimitive) nbt ).func_150286_g();
case 5: // else if ( A instanceof NBTTagFloat )
return hash + (int) ( (NBTTagFloat) nbt ).func_150288_h();
return hash + (int) ( (NBTBase.NBTPrimitive) nbt ).func_150288_h();
case 3: // else if ( A instanceof NBTTagInt )
return hash + ( (NBTTagInt) nbt ).func_150287_d();
return hash + ( (NBTBase.NBTPrimitive) nbt ).func_150287_d();
default:
return hash;
@@ -855,7 +855,7 @@ public class Platform
return teA;
}
return new InventoryLargeChest( "", teA, (TileEntityChest) teB );
return new InventoryLargeChest( "", teA, (IInventory) teB );
}
public static boolean isModLoaded( String modid )
@@ -991,7 +991,7 @@ public class Platform
{
if( AESharedNBT.isShared( willAdd.getTagCompound() ) )
{
if( ( (AESharedNBT) willAdd.getTagCompound() ).getSpecialComparison() != null )
if( ( (IAETagCompound) willAdd.getTagCompound() ).getSpecialComparison() != null )
{
return true;
}
@@ -30,6 +30,7 @@ import io.netty.buffer.ByteBuf;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompressedStreamTools;
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
@@ -37,6 +38,7 @@ import net.minecraftforge.fluids.FluidStack;
import appeng.api.config.FuzzyMode;
import appeng.api.storage.StorageChannel;
import appeng.api.storage.data.IAEFluidStack;
import appeng.api.storage.data.IAEStack;
import appeng.api.storage.data.IAETagCompound;
import appeng.util.Platform;
@@ -100,7 +102,7 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
}
if( a instanceof AEFluidStack )
{
( (AEFluidStack) a ).copy();
( (IAEStack<IAEFluidStack>) a ).copy();
}
if( a instanceof FluidStack )
{
@@ -214,7 +216,7 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
if( this.tagCompound != null )
{
i.setTag( "tag", (NBTTagCompound) this.tagCompound );
i.setTag( "tag", (NBTBase) this.tagCompound );
}
else
{