Ported to 1.7

This commit is contained in:
AlgorithmX2
2014-02-08 19:34:52 -06:00
parent 30c1deb8cf
commit d50c7f6312
328 changed files with 2209 additions and 2311 deletions
+21 -21
View File
@@ -1,7 +1,7 @@
package appeng.parts.networking;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import io.netty.buffer.ByteBuf;
import java.io.IOException;
import java.util.EnumSet;
@@ -9,8 +9,8 @@ import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon;
import net.minecraftforge.common.ForgeDirection;
import net.minecraft.util.IIcon;
import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.opengl.GL11;
@@ -60,7 +60,7 @@ public class PartCable extends AEBasePart implements IPartCable
return BusSupport.CABLE;
}
public Icon getGlassTexture(AEColor c)
public IIcon getGlassTexture(AEColor c)
{
switch (c)
{
@@ -102,12 +102,12 @@ public class PartCable extends AEBasePart implements IPartCable
AEApi.instance().parts().partCableGlass.stack( AEColor.Transparent, 1 ) );
}
public Icon getTexture(AEColor c)
public IIcon getTexture(AEColor c)
{
return getGlassTexture( c );
}
public Icon getCoveredTexture(AEColor c)
public IIcon getCoveredTexture(AEColor c)
{
switch (c)
{
@@ -149,7 +149,7 @@ public class PartCable extends AEBasePart implements IPartCable
AEApi.instance().parts().partCableCovered.stack( AEColor.Transparent, 1 ) );
}
public Icon getSmartTexture(AEColor c)
public IIcon getSmartTexture(AEColor c)
{
switch (c)
{
@@ -214,7 +214,7 @@ public class PartCable extends AEBasePart implements IPartCable
}
@Override
public void writeToStream(DataOutputStream data) throws IOException
public void writeToStream(ByteBuf data) throws IOException
{
int cs = 0;
int sideOut = 0;
@@ -273,7 +273,7 @@ public class PartCable extends AEBasePart implements IPartCable
}
@Override
public boolean readFromStream(DataInputStream data) throws IOException
public boolean readFromStream(ByteBuf data) throws IOException
{
int cs = data.readByte();
int sideOut = data.readInt();
@@ -371,7 +371,7 @@ public class PartCable extends AEBasePart implements IPartCable
@SideOnly(Side.CLIENT)
public void rendereGlassConection(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer, ForgeDirection of)
{
TileEntity te = this.tile.worldObj.getBlockTileEntity( x + of.offsetX, y + of.offsetY, z + of.offsetZ );
TileEntity te = this.tile.getWorldObj().getTileEntity( x + of.offsetX, y + of.offsetY, z + of.offsetZ );
IPartHost ccph = te instanceof IPartHost ? (IPartHost) te : null;
IGridHost gh = te instanceof IGridHost ? (IGridHost) te : null;
@@ -479,7 +479,7 @@ public class PartCable extends AEBasePart implements IPartCable
@SideOnly(Side.CLIENT)
public void renderCoveredConection(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer, int channels, ForgeDirection of)
{
TileEntity te = this.tile.worldObj.getBlockTileEntity( x + of.offsetX, y + of.offsetY, z + of.offsetZ );
TileEntity te = this.tile.getWorldObj().getTileEntity( x + of.offsetX, y + of.offsetY, z + of.offsetZ );
IPartHost ccph = te instanceof IPartHost ? (IPartHost) te : null;
IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null;
boolean isSmart = false;
@@ -555,8 +555,8 @@ public class PartCable extends AEBasePart implements IPartCable
if ( isSmart )
{
setSmartConnectionRotations( of, renderer );
Icon defa = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f );
Icon defb = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f );
IIcon defa = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f );
IIcon defb = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f );
if ( of == ForgeDirection.EAST || of == ForgeDirection.WEST )
{
@@ -581,7 +581,7 @@ public class PartCable extends AEBasePart implements IPartCable
@SideOnly(Side.CLIENT)
public void renderSmartConection(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer, int channels, ForgeDirection of)
{
TileEntity te = this.tile.worldObj.getBlockTileEntity( x + of.offsetX, y + of.offsetY, z + of.offsetZ );
TileEntity te = this.tile.getWorldObj().getTileEntity( x + of.offsetX, y + of.offsetY, z + of.offsetZ );
IPartHost ccph = te instanceof IPartHost ? (IPartHost) te : null;
IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null;
boolean isGlass = false;
@@ -623,8 +623,8 @@ public class PartCable extends AEBasePart implements IPartCable
if ( true )
{
setSmartConnectionRotations( of, renderer );
Icon defa = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f );
Icon defb = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f );
IIcon defa = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f );
IIcon defb = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f );
if ( of == ForgeDirection.EAST || of == ForgeDirection.WEST )
{
@@ -684,8 +684,8 @@ public class PartCable extends AEBasePart implements IPartCable
{
setSmartConnectionRotations( of, renderer );
Icon defa = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f );
Icon defb = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f );
IIcon defa = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f );
IIcon defb = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f );
Tessellator.instance.setBrightness( 15 << 20 | 15 << 5 );
Tessellator.instance.setColorOpaque_I( myColor.mediumVariant );
@@ -768,7 +768,7 @@ public class PartCable extends AEBasePart implements IPartCable
}
else if ( connections.contains( dir ) )
{
TileEntity te = this.tile.worldObj.getBlockTileEntity( x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ );
TileEntity te = this.tile.getWorldObj().getTileEntity( x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ );
IPartHost ccph = te instanceof IPartHost ? (IPartHost) te : null;
IGridHost gh = te instanceof IGridHost ? (IGridHost) te : null;
if ( ccph == null && gh != null && gh.getCableConnectionType( dir ) != AECableType.GLASS )
@@ -842,7 +842,7 @@ public class PartCable extends AEBasePart implements IPartCable
}
else
{
Icon def = getTexture( getCableColor() );
IIcon def = getTexture( getCableColor() );
rh.setTexture( def );
for (ForgeDirection of : connections)
+5 -5
View File
@@ -4,8 +4,8 @@ import java.util.EnumSet;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraftforge.common.ForgeDirection;
import net.minecraft.util.IIcon;
import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.opengl.GL11;
@@ -45,7 +45,7 @@ public class PartCableCovered extends PartCable
}
@Override
public Icon getTexture(AEColor c)
public IIcon getTexture(AEColor c)
{
return getCoveredTexture( c );
}
@@ -175,8 +175,8 @@ public class PartCableCovered extends PartCable
}
else
{
Icon def = getTexture( getCableColor() );
Icon off = new OffsetIcon( def, 0, -12 );
IIcon def = getTexture( getCableColor() );
IIcon off = new OffsetIcon( def, 0, -12 );
for (ForgeDirection of : connections)
{
switch (of)
+11 -11
View File
@@ -5,8 +5,8 @@ import java.util.EnumSet;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraftforge.common.ForgeDirection;
import net.minecraft.util.IIcon;
import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.opengl.GL11;
@@ -55,7 +55,7 @@ public class PartCableSmart extends PartCable
}
@Override
public Icon getTexture(AEColor c)
public IIcon getTexture(AEColor c)
{
return getSmartTexture( c );
}
@@ -173,8 +173,8 @@ public class PartCableSmart extends PartCable
rh.renderBlock( x, y, z, renderer );
setSmartConnectionRotations( of, renderer );
Icon defa = new TaughtIcon( getChannelTex( channelsOnSide[of.ordinal()], false ).getIcon(), -0.2f );
Icon defb = new TaughtIcon( getChannelTex( channelsOnSide[of.ordinal()], true ).getIcon(), -0.2f );
IIcon defa = new TaughtIcon( getChannelTex( channelsOnSide[of.ordinal()], false ).getIcon(), -0.2f );
IIcon defb = new TaughtIcon( getChannelTex( channelsOnSide[of.ordinal()], true ).getIcon(), -0.2f );
if ( of == ForgeDirection.EAST || of == ForgeDirection.WEST )
{
@@ -221,14 +221,14 @@ public class PartCableSmart extends PartCable
}
int channels = channelsOnSide[selectedSide.ordinal()];
Icon def = getTexture( getCableColor() );
Icon off = new OffsetIcon( def, 0, -12 );
IIcon def = getTexture( getCableColor() );
IIcon off = new OffsetIcon( def, 0, -12 );
Icon defa = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f );
Icon offa = new OffsetIcon( defa, 0, -12 );
IIcon defa = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f );
IIcon offa = new OffsetIcon( defa, 0, -12 );
Icon defb = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f );
Icon offb = new OffsetIcon( defb, 0, -12 );
IIcon defb = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f );
IIcon offb = new OffsetIcon( defb, 0, -12 );
switch (selectedSide)
{
+17 -17
View File
@@ -6,8 +6,8 @@ import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon;
import net.minecraftforge.common.ForgeDirection;
import net.minecraft.util.IIcon;
import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.opengl.GL11;
@@ -66,7 +66,7 @@ public class PartDenseCable extends PartCable
}
@Override
public Icon getTexture(AEColor c)
public IIcon getTexture(AEColor c)
{
if ( c == AEColor.Transparent )
return AEApi.instance().parts().partCableSmart.stack( AEColor.Transparent, 1 ).getIconIndex();
@@ -172,7 +172,7 @@ public class PartDenseCable extends PartCable
private boolean isDense(ForgeDirection of)
{
TileEntity te = tile.worldObj.getBlockTileEntity( tile.xCoord + of.offsetX, tile.yCoord + of.offsetY, tile.zCoord + of.offsetZ );
TileEntity te = tile.getWorldObj().getTileEntity( tile.xCoord + of.offsetX, tile.yCoord + of.offsetY, tile.zCoord + of.offsetZ );
if ( te instanceof IGridHost )
{
AECableType t = ((IGridHost) te).getCableConnectionType( of.getOpposite() );
@@ -183,7 +183,7 @@ public class PartDenseCable extends PartCable
private boolean isSmart(ForgeDirection of)
{
TileEntity te = tile.worldObj.getBlockTileEntity( tile.xCoord + of.offsetX, tile.yCoord + of.offsetY, tile.zCoord + of.offsetZ );
TileEntity te = tile.getWorldObj().getTileEntity( tile.xCoord + of.offsetX, tile.yCoord + of.offsetY, tile.zCoord + of.offsetZ );
if ( te instanceof IGridHost )
{
AECableType t = ((IGridHost) te).getCableConnectionType( of.getOpposite() );
@@ -195,7 +195,7 @@ public class PartDenseCable extends PartCable
@SideOnly(Side.CLIENT)
public void renderDenseConection(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer, int channels, ForgeDirection of)
{
TileEntity te = this.tile.worldObj.getBlockTileEntity( x + of.offsetX, y + of.offsetY, z + of.offsetZ );
TileEntity te = this.tile.getWorldObj().getTileEntity( x + of.offsetX, y + of.offsetY, z + of.offsetZ );
IPartHost ccph = te instanceof IPartHost ? (IPartHost) te : null;
IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null;
boolean isGlass = false;
@@ -210,8 +210,8 @@ public class PartDenseCable extends PartCable
* 13 ); break; case WEST: rh.setBounds( 0, 3, 3, 4, 13, 13 ); break; default: return; } rh.renderBlock( x, y,
* z, renderer );
*
* if ( true ) { setSmartConnectionRotations( of, renderer ); Icon defa = new TaughtIcon( getChannelTex(
* channels, false ).getIcon(), -0.2f ); Icon defb = new TaughtIcon( getChannelTex( channels, true ).getIcon(),
* if ( true ) { setSmartConnectionRotations( of, renderer ); IIcon defa = new TaughtIcon( getChannelTex(
* channels, false ).getIcon(), -0.2f ); IIcon defb = new TaughtIcon( getChannelTex( channels, true ).getIcon(),
* -0.2f );
*
* if ( of == ForgeDirection.EAST || of == ForgeDirection.WEST ) { AEBaseBlock blk = (AEBaseBlock)
@@ -266,8 +266,8 @@ public class PartDenseCable extends PartCable
{
setSmartConnectionRotations( of, renderer );
Icon defa = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f );
Icon defb = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f );
IIcon defa = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f );
IIcon defb = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f );
Tessellator.instance.setBrightness( 15 << 20 | 15 << 5 );
Tessellator.instance.setColorOpaque_I( myColor.mediumVariant );
@@ -324,14 +324,14 @@ public class PartDenseCable extends PartCable
}
int channels = channelsOnSide[selectedSide.ordinal()];
Icon def = getTexture( getCableColor() );
Icon off = new OffsetIcon( def, 0, -12 );
IIcon def = getTexture( getCableColor() );
IIcon off = new OffsetIcon( def, 0, -12 );
Icon defa = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f );
Icon offa = new OffsetIcon( defa, 0, -12 );
IIcon defa = new TaughtIcon( getChannelTex( channels, false ).getIcon(), -0.2f );
IIcon offa = new OffsetIcon( defa, 0, -12 );
Icon defb = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f );
Icon offb = new OffsetIcon( defb, 0, -12 );
IIcon defb = new TaughtIcon( getChannelTex( channels, true ).getIcon(), -0.2f );
IIcon offb = new OffsetIcon( defb, 0, -12 );
switch (selectedSide)
{
@@ -412,7 +412,7 @@ public class PartDenseCable extends PartCable
rh.setTexture( null );
}
private Icon getDenseTexture(AEColor c)
private IIcon getDenseTexture(AEColor c)
{
switch (c)
{
+3 -3
View File
@@ -8,8 +8,8 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon;
import net.minecraftforge.common.ForgeDirection;
import net.minecraft.util.IIcon;
import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.opengl.GL11;
@@ -97,7 +97,7 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
@SideOnly(Side.CLIENT)
public void renderStatic(int x, int y, int z, IPartRenderHelper rh, RenderBlocks renderer)
{
Icon myIcon = is.getIconIndex();
IIcon myIcon = is.getIconIndex();
rh.setTexture( myIcon );
rh.setBounds( 6, 6, 10, 10, 10, 16 );
rh.renderBlock( x, y, z, renderer );