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
@@ -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;
}
}
@@ -28,6 +28,7 @@ import net.minecraft.item.ItemHoe;
import net.minecraft.item.ItemPickaxe;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.item.ItemTool;
import net.minecraft.stats.AchievementList;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent;
@@ -119,7 +120,7 @@ public class AppEngCraftingSlot extends AppEngSlot
this.thePlayer.addStat( AchievementList.bakeCake, 1 );
}
if( par1ItemStack.getItem() instanceof ItemPickaxe && ( (ItemPickaxe) par1ItemStack.getItem() ).func_150913_i() != Item.ToolMaterial.WOOD )
if( par1ItemStack.getItem() instanceof ItemPickaxe && ( (ItemTool) par1ItemStack.getItem() ).func_150913_i() != Item.ToolMaterial.WOOD )
{
this.thePlayer.addStat( AchievementList.buildBetterPickaxe, 1 );
}