Merge pull request #1426 from thatsIch/e-overly-strong-cast

reduces overly strong type cast
This commit is contained in:
thatsIch
2015-05-09 15:57:47 +02:00
18 changed files with 45 additions and 36 deletions
@@ -44,6 +44,7 @@ import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketMEInventoryUpdate;
import appeng.core.sync.packets.PacketValueConfig;
import appeng.helpers.ICustomNameObject;
import appeng.me.cluster.IAEMultiBlock;
import appeng.me.cluster.implementations.CraftingCPUCluster;
import appeng.tile.crafting.TileCraftingTile;
import appeng.util.Platform;
@@ -74,7 +75,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH
if( te instanceof TileCraftingTile )
{
this.setCPU( (ICraftingCPU) ( (TileCraftingTile) te ).getCluster() );
this.setCPU( (ICraftingCPU) ( (IAEMultiBlock) te ).getCluster() );
}
if( this.network == null && Platform.isServer() )
@@ -45,6 +45,7 @@ import appeng.api.networking.IGrid;
import appeng.api.networking.IGridHost;
import appeng.api.networking.IGridNode;
import appeng.api.networking.energy.IEnergyGrid;
import appeng.api.networking.energy.IEnergySource;
import appeng.api.networking.security.BaseActionSource;
import appeng.api.networking.storage.IBaseMonitor;
import appeng.api.parts.IPart;
@@ -113,11 +114,11 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
if( monitorable instanceof IPortableCell )
{
this.powerSrc = (IPortableCell) monitorable;
this.powerSrc = (IEnergySource) monitorable;
}
else if( monitorable instanceof IMEChest )
{
this.powerSrc = (IMEChest) monitorable;
this.powerSrc = (IEnergySource) monitorable;
}
else if( monitorable instanceof IGridHost )
{
@@ -128,7 +129,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
IGrid g = node.getGrid();
if( g != null )
{
this.powerSrc = new ChannelPowerSrc( this.networkNode, (IEnergyGrid) g.getCache( IEnergyGrid.class ) );
this.powerSrc = new ChannelPowerSrc( this.networkNode, (IEnergySource) g.getCache( IEnergyGrid.class ) );
}
}
}
@@ -32,6 +32,7 @@ import appeng.api.config.Settings;
import appeng.api.config.Upgrades;
import appeng.api.config.YesNo;
import appeng.api.implementations.IUpgradeableHost;
import appeng.api.implementations.guiobjects.IGuiItem;
import appeng.api.parts.IPart;
import appeng.api.util.IConfigManager;
import appeng.container.AEBaseContainer;
@@ -96,7 +97,7 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl
{
this.lockPlayerInventorySlot( x );
this.tbSlot = x;
this.tbInventory = (NetworkToolViewer) ( (ToolNetworkTool) pii.getItem() ).getGuiObject( pii, w, xCoord, yCoord, zCoord );
this.tbInventory = (NetworkToolViewer) ( (IGuiItem) pii.getItem() ).getGuiObject( pii, w, xCoord, yCoord, zCoord );
break;
}
}