From 3ce47a167f1ce968c03eeba68e4c2ce66b0b2d70 Mon Sep 17 00:00:00 2001 From: thatsIch Date: Mon, 29 Sep 2014 09:42:50 +0200 Subject: [PATCH] Removes not needed casts --- .../appeng/client/render/AppEngRenderItem.java | 2 +- .../implementations/ContainerCraftingCPU.java | 2 +- .../implementations/ContainerSecurity.java | 4 ++-- src/main/java/appeng/debug/ToolDebugCard.java | 2 +- .../appeng/hooks/DispenserBehaviorTinyTNT.java | 2 +- .../appeng/integration/modules/CraftGuide.java | 14 +++++++------- src/main/java/appeng/parts/AEBasePart.java | 6 +++--- .../appeng/tile/spatial/TileSpatialIOPort.java | 2 +- src/main/java/appeng/util/Platform.java | 6 +++--- src/main/java/appeng/util/item/ItemList.java | 2 +- 10 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/main/java/appeng/client/render/AppEngRenderItem.java b/src/main/java/appeng/client/render/AppEngRenderItem.java index c61bda4e..4ac2a551 100644 --- a/src/main/java/appeng/client/render/AppEngRenderItem.java +++ b/src/main/java/appeng/client/render/AppEngRenderItem.java @@ -30,7 +30,7 @@ public class AppEngRenderItem extends RenderItem @Override public void renderItemOverlayIntoGUI(FontRenderer par1FontRenderer, TextureManager par2RenderEngine, ItemStack par3ItemStack, int par4, int par5) { - this.renderItemOverlayIntoGUI( par1FontRenderer, par2RenderEngine, par3ItemStack, par4, par5, (String) null ); + this.renderItemOverlayIntoGUI( par1FontRenderer, par2RenderEngine, par3ItemStack, par4, par5, null ); } @Override diff --git a/src/main/java/appeng/container/implementations/ContainerCraftingCPU.java b/src/main/java/appeng/container/implementations/ContainerCraftingCPU.java index 3db93e63..8290dc33 100644 --- a/src/main/java/appeng/container/implementations/ContainerCraftingCPU.java +++ b/src/main/java/appeng/container/implementations/ContainerCraftingCPU.java @@ -80,7 +80,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH if ( c instanceof CraftingCPUCluster ) { - cpuName = ((CraftingCPUCluster) c).getName(); + cpuName = c.getName(); monitor = (CraftingCPUCluster) c; if ( monitor != null ) diff --git a/src/main/java/appeng/container/implementations/ContainerSecurity.java b/src/main/java/appeng/container/implementations/ContainerSecurity.java index ace788f1..2a99a832 100644 --- a/src/main/java/appeng/container/implementations/ContainerSecurity.java +++ b/src/main/java/appeng/container/implementations/ContainerSecurity.java @@ -137,8 +137,8 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE for (int i = 0; i < this.crafters.size(); ++i) { ICrafting icrafting = (ICrafting) this.crafters.get( i ); - ((EntityPlayerMP) icrafting).sendSlotContents( this, wirelessIn.slotNumber, wirelessIn.getStack() ); - ((EntityPlayerMP) icrafting).sendSlotContents( this, wirelessOut.slotNumber, wirelessOut.getStack() ); + icrafting.sendSlotContents( this, wirelessIn.slotNumber, wirelessIn.getStack() ); + icrafting.sendSlotContents( this, wirelessOut.slotNumber, wirelessOut.getStack() ); } } diff --git a/src/main/java/appeng/debug/ToolDebugCard.java b/src/main/java/appeng/debug/ToolDebugCard.java index 0b6f3ce5..02874865 100644 --- a/src/main/java/appeng/debug/ToolDebugCard.java +++ b/src/main/java/appeng/debug/ToolDebugCard.java @@ -117,7 +117,7 @@ public class ToolDebugCard extends AEBaseItem outputMsg( player, "Freq: " + ((PartP2PTunnel) center.getMachine()).freq ); } - TickManagerCache tmc = (TickManagerCache) g.getCache( ITickManager.class ); + TickManagerCache tmc = g.getCache( ITickManager.class ); for (Class c : g.getMachineClasses()) { int o = 0; diff --git a/src/main/java/appeng/hooks/DispenserBehaviorTinyTNT.java b/src/main/java/appeng/hooks/DispenserBehaviorTinyTNT.java index effbd851..7e582fc8 100644 --- a/src/main/java/appeng/hooks/DispenserBehaviorTinyTNT.java +++ b/src/main/java/appeng/hooks/DispenserBehaviorTinyTNT.java @@ -21,7 +21,7 @@ final public class DispenserBehaviorTinyTNT extends BehaviorDefaultDispenseItem int j = dispenser.getYInt() + enumfacing.getFrontOffsetY(); int k = dispenser.getZInt() + enumfacing.getFrontOffsetZ(); EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( world, i + 0.5F, j + 0.5F, - k + 0.5F, (EntityLiving) null ); + k + 0.5F, null ); world.spawnEntityInWorld( primedTinyTNTEntity ); --dispensedItem.stackSize; return dispensedItem; diff --git a/src/main/java/appeng/integration/modules/CraftGuide.java b/src/main/java/appeng/integration/modules/CraftGuide.java index 4eb78b6c..e259ff82 100644 --- a/src/main/java/appeng/integration/modules/CraftGuide.java +++ b/src/main/java/appeng/integration/modules/CraftGuide.java @@ -337,22 +337,22 @@ public class CraftGuide extends CraftGuideAPIObject implements IIntegrationModul { if ( recipe instanceof ShapelessRecipe ) { - List items = (List) ReflectionHelper.getPrivateValue( ShapelessRecipe.class, (ShapelessRecipe) recipe, "input" ); - return getCraftingShapelessRecipe( items, ((ShapelessRecipe) recipe).getRecipeOutput() ); + List items = ReflectionHelper.getPrivateValue( ShapelessRecipe.class, (ShapelessRecipe) recipe, "input" ); + return getCraftingShapelessRecipe( items, recipe.getRecipeOutput() ); } else if ( recipe instanceof ShapedRecipe ) { - int width = (Integer) ReflectionHelper.getPrivateValue( ShapedRecipe.class, (ShapedRecipe) recipe, "width" ); - int height = (Integer) ReflectionHelper.getPrivateValue( ShapedRecipe.class, (ShapedRecipe) recipe, "height" ); - Object[] items = (Object[]) ReflectionHelper.getPrivateValue( ShapedRecipe.class, (ShapedRecipe) recipe, "input" ); + int width = ReflectionHelper.getPrivateValue( ShapedRecipe.class, (ShapedRecipe) recipe, "width" ); + int height = ReflectionHelper.getPrivateValue( ShapedRecipe.class, (ShapedRecipe) recipe, "height" ); + Object[] items = ReflectionHelper.getPrivateValue( ShapedRecipe.class, (ShapedRecipe) recipe, "input" ); if ( allowSmallGrid && width < 3 && height < 3 ) { - return getSmallShapedRecipe( width, height, items, ((ShapedRecipe) recipe).getRecipeOutput() ); + return getSmallShapedRecipe( width, height, items, recipe.getRecipeOutput() ); } else { - return getCraftingShapedRecipe( width, height, items, ((ShapedRecipe) recipe).getRecipeOutput() ); + return getCraftingShapedRecipe( width, height, items, recipe.getRecipeOutput() ); } } diff --git a/src/main/java/appeng/parts/AEBasePart.java b/src/main/java/appeng/parts/AEBasePart.java index 3dc064f7..15e3d15f 100644 --- a/src/main/java/appeng/parts/AEBasePart.java +++ b/src/main/java/appeng/parts/AEBasePart.java @@ -301,7 +301,7 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea { if ( compound != null ) { - IConfigManager cm = ((IConfigurableObject) this).getConfigManager(); + IConfigManager cm = this.getConfigManager(); if ( cm != null ) cm.readFromNBT( compound ); } @@ -312,7 +312,7 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea pHost.setPriority( compound.getInteger( "priority" ) ); } - IInventory inv = ((ISegmentedInventory) this).getInventoryByName( "config" ); + IInventory inv = this.getInventoryByName( "config" ); if ( inv != null && inv instanceof AppEngInternalAEInventory ) { AppEngInternalAEInventory target = (AppEngInternalAEInventory) inv; @@ -343,7 +343,7 @@ public class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradea output.setInteger( "priority", pHost.getPriority() ); } - IInventory inv = ((ISegmentedInventory) this).getInventoryByName( "config" ); + IInventory inv = this.getInventoryByName( "config" ); if ( inv != null && inv instanceof AppEngInternalAEInventory ) { ((AppEngInternalAEInventory) inv).writeToNBT( output, "config" ); diff --git a/src/main/java/appeng/tile/spatial/TileSpatialIOPort.java b/src/main/java/appeng/tile/spatial/TileSpatialIOPort.java index e2479d1a..08bbb034 100644 --- a/src/main/java/appeng/tile/spatial/TileSpatialIOPort.java +++ b/src/main/java/appeng/tile/spatial/TileSpatialIOPort.java @@ -96,7 +96,7 @@ public class TileSpatialIOPort extends AENetworkInvTile implements Callable ItemSpatialStorageCell sc = (ItemSpatialStorageCell) cell.getItem(); - SpatialPylonCache spc = (SpatialPylonCache) gi.getCache( ISpatialCache.class ); + SpatialPylonCache spc = gi.getCache( ISpatialCache.class ); if ( spc.hasRegion() && spc.isValidRegion() ) { double req = spc.requiredPower(); diff --git a/src/main/java/appeng/util/Platform.java b/src/main/java/appeng/util/Platform.java index 5011c763..b1df7f84 100644 --- a/src/main/java/appeng/util/Platform.java +++ b/src/main/java/appeng/util/Platform.java @@ -856,7 +856,7 @@ public class Platform if ( willAdd == null ) return false; IAETagCompound tag = willAdd.getTagCompound(); - if ( tag != null && ((AESharedNBT) tag).getSpecialComparison() != null ) + if ( tag != null && tag.getSpecialComparison() != null ) return true; return false; } @@ -1548,7 +1548,7 @@ public class Platform if ( grid == null ) return false; - IEnergyGrid eg = (IEnergyGrid) grid.getCache( IEnergyGrid.class ); + IEnergyGrid eg = grid.getCache( IEnergyGrid.class ); return eg.isNetworkPowered(); } @@ -1557,7 +1557,7 @@ public class Platform if ( grid == null ) return false; - ISecurityGrid gs = (ISecurityGrid) grid.getCache( ISecurityGrid.class ); + ISecurityGrid gs = grid.getCache( ISecurityGrid.class ); if ( gs == null ) return false; diff --git a/src/main/java/appeng/util/item/ItemList.java b/src/main/java/appeng/util/item/ItemList.java index 719703e3..45fd020a 100644 --- a/src/main/java/appeng/util/item/ItemList.java +++ b/src/main/java/appeng/util/item/ItemList.java @@ -119,7 +119,7 @@ public final class ItemList implements IItemList