Ported to 1.7
This commit is contained in:
@@ -9,7 +9,7 @@ import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
@@ -123,15 +123,15 @@ public class RenderBlockCharger extends BaseBlockRender
|
||||
GL11.glScalef( 1.0f / 1.1f, 1.0f / 1.1f, 1.0f / 1.1f );
|
||||
GL11.glScalef( 1.0f, 1.0f, 1.0f );
|
||||
|
||||
int k = sis.itemID;
|
||||
if ( sis.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d( Block.blocksList[k].getRenderType() ) )
|
||||
Block blk = Block.getBlockFromItem( sis.getItem() );
|
||||
if ( sis.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d( blk.getRenderType() ) )
|
||||
{
|
||||
GL11.glRotatef( 25.0f, 1.0f, 0.0f, 0.0f );
|
||||
GL11.glRotatef( 15.0f, 0.0f, 1.0f, 0.0f );
|
||||
GL11.glRotatef( 30.0f, 0.0f, 1.0f, 0.0f );
|
||||
}
|
||||
|
||||
int light = tile.worldObj.getLightBrightnessForSkyBlocks( tile.xCoord, tile.yCoord, tile.zCoord, 0 );
|
||||
int light = tile.getWorldObj().getLightBrightnessForSkyBlocks( tile.xCoord, tile.yCoord, tile.zCoord, 0 );
|
||||
int br = light;// << 20 | light << 4;
|
||||
int var11 = br % 65536;
|
||||
int var12 = br / 65536;
|
||||
|
||||
@@ -19,9 +19,9 @@ public class RenderBlockController extends BaseBlockRender
|
||||
public boolean renderInWorld(AEBaseBlock blk, IBlockAccess world, int x, int y, int z, RenderBlocks renderer)
|
||||
{
|
||||
|
||||
boolean xx = world.getBlockTileEntity( x - 1, y, z ) instanceof TileController && world.getBlockTileEntity( x + 1, y, z ) instanceof TileController;
|
||||
boolean yy = world.getBlockTileEntity( x, y - 1, z ) instanceof TileController && world.getBlockTileEntity( x, y + 1, z ) instanceof TileController;
|
||||
boolean zz = world.getBlockTileEntity( x, y, z - 1 ) instanceof TileController && world.getBlockTileEntity( x, y, z + 1 ) instanceof TileController;
|
||||
boolean xx = world.getTileEntity( x - 1, y, z ) instanceof TileController && world.getTileEntity( x + 1, y, z ) instanceof TileController;
|
||||
boolean yy = world.getTileEntity( x, y - 1, z ) instanceof TileController && world.getTileEntity( x, y + 1, z ) instanceof TileController;
|
||||
boolean zz = world.getTileEntity( x, y, z - 1 ) instanceof TileController && world.getTileEntity( x, y, z + 1 ) instanceof TileController;
|
||||
|
||||
int meta = world.getBlockMetadata( x, y, z );
|
||||
boolean hasPower = meta > 0;
|
||||
|
||||
@@ -7,7 +7,7 @@ import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@@ -69,7 +69,7 @@ public class RenderBlockCrank extends BaseBlockRender
|
||||
tess.setTranslation( -tc.xCoord, -tc.yCoord, -tc.zCoord );
|
||||
tess.startDrawingQuads();
|
||||
rbinstance.renderAllFaces = true;
|
||||
rbinstance.blockAccess = tc.worldObj;
|
||||
rbinstance.blockAccess = tc.getWorldObj();
|
||||
|
||||
rbinstance.setRenderBounds( 0.5D - 0.05, 0.5D - 0.5, 0.5D - 0.05, 0.5D + 0.05, 0.5D + 0.1, 0.5D + 0.05 );
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@ 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.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
@@ -39,7 +39,7 @@ public class RenderBlockWireless extends BaseBlockRender
|
||||
|
||||
renderer.renderAllFaces = true;
|
||||
|
||||
Icon r = CableBusTextures.PartMonitorSidesStatus.getIcon();
|
||||
IIcon r = CableBusTextures.PartMonitorSidesStatus.getIcon();
|
||||
ri.setTemporaryRenderIcons( r, r, CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), r, r );
|
||||
renderBlockBounds( renderer, 5, 5, 0, 11, 11, 1, ForgeDirection.EAST, ForgeDirection.UP, ForgeDirection.SOUTH );
|
||||
renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, tess, 0xffffff, renderer );
|
||||
@@ -107,7 +107,7 @@ public class RenderBlockWireless extends BaseBlockRender
|
||||
|
||||
renderer.renderAllFaces = true;
|
||||
|
||||
Icon r = CableBusTextures.PartMonitorSidesStatus.getIcon();
|
||||
IIcon r = CableBusTextures.PartMonitorSidesStatus.getIcon();
|
||||
ri.setTemporaryRenderIcons( r, r, CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), r, r );
|
||||
renderBlockBounds( renderer, 5, 5, 0, 11, 11, 1, fdx, fdy, fdz );
|
||||
super.renderInWorld( blk, world, x, y, z, renderer );
|
||||
@@ -193,8 +193,8 @@ public class RenderBlockWireless extends BaseBlockRender
|
||||
|
||||
private void renderTorchAtAngle(RenderBlocks renderer, ForgeDirection x, ForgeDirection y, ForgeDirection z)
|
||||
{
|
||||
Icon r = (hasChan ? CableBusTextures.BlockWirelessOn.getIcon() : blk.getIcon( 0, 0 ));
|
||||
Icon sides = new OffsetIcon( r, 0.0f, -2.0f );
|
||||
IIcon r = (hasChan ? CableBusTextures.BlockWirelessOn.getIcon() : blk.getIcon( 0, 0 ));
|
||||
IIcon sides = new OffsetIcon( r, 0.0f, -2.0f );
|
||||
|
||||
switch (z)
|
||||
{
|
||||
|
||||
@@ -5,9 +5,9 @@ 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.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.texture.ExtraTextures;
|
||||
@@ -44,7 +44,7 @@ public class RenderDrive extends BaseBlockRender
|
||||
boolean result = super.renderInWorld( imb, world, x, y, z, renderer );
|
||||
Tessellator tess = Tessellator.instance;
|
||||
|
||||
Icon ico = ExtraTextures.MEStorageCellTextures.getIcon();
|
||||
IIcon ico = ExtraTextures.MEStorageCellTextures.getIcon();
|
||||
|
||||
int b = world.getLightBrightnessForSkyBlocks( x + forward.offsetX, y + forward.offsetY, z + forward.offsetZ, 0 );
|
||||
|
||||
@@ -236,7 +236,7 @@ public class RenderDrive extends BaseBlockRender
|
||||
|
||||
if ( stat != 0 )
|
||||
{
|
||||
Icon wico = ExtraTextures.White.getIcon();
|
||||
IIcon wico = ExtraTextures.White.getIcon();
|
||||
u1 = wico.getInterpolatedU( (spin % 4 < 2) ? 1 : 6 );
|
||||
u2 = wico.getInterpolatedU( ((spin + 1) % 4 < 2) ? 1 : 6 );
|
||||
u3 = wico.getInterpolatedU( ((spin + 2) % 4 < 2) ? 1 : 6 );
|
||||
|
||||
@@ -5,9 +5,9 @@ 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.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.storage.ICellHandler;
|
||||
import appeng.block.AEBaseBlock;
|
||||
@@ -108,7 +108,7 @@ public class RenderMEChest extends BaseBlockRender
|
||||
renderer.setRenderBounds( 0, 0, 0, 1, 1, 1 );
|
||||
|
||||
ICellHandler ch = AEApi.instance().registries().cell().getHander( sp.getStorageType() );
|
||||
Icon ico = ch == null ? null : ch.getTopTexture();
|
||||
IIcon ico = ch == null ? null : ch.getTopTexture();
|
||||
renderFace( x, y, z, imb, ico == null ? ExtraTextures.MEChest.getIcon() : ico, renderer, up );
|
||||
|
||||
renderer.overrideBlockTexture = null;
|
||||
|
||||
@@ -6,9 +6,9 @@ import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.api.util.AEColoredItemDefinition;
|
||||
@@ -20,7 +20,7 @@ import appeng.tile.qnb.TileQuantumBridge;
|
||||
public class RenderQNB extends BaseBlockRender
|
||||
{
|
||||
|
||||
public void renderCableAt(double Thickness, IBlockAccess world, int x, int y, int z, AEBaseBlock block, RenderBlocks renderer, Icon texture, double pull,
|
||||
public void renderCableAt(double Thickness, IBlockAccess world, int x, int y, int z, AEBaseBlock block, RenderBlocks renderer, IIcon texture, double pull,
|
||||
EnumSet<ForgeDirection> connections)
|
||||
{
|
||||
block.getRendererInstance().setTemporaryRenderIcon( texture );
|
||||
|
||||
@@ -5,7 +5,7 @@ import java.util.Random;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
@@ -36,8 +36,8 @@ public class RenderQuartzGlass extends BaseBlockRender
|
||||
|
||||
boolean isGlass(AEBaseBlock imb, IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
return world.getBlockId( x, y, z ) == AEApi.instance().blocks().blockQuartzGlass.block().blockID
|
||||
|| world.getBlockId( x, y, z ) == AEApi.instance().blocks().blockQuartzVibrantGlass.block().blockID;
|
||||
return world.getBlock( x, y, z ) == AEApi.instance().blocks().blockQuartzGlass.block()
|
||||
|| world.getBlock( x, y, z ) == AEApi.instance().blocks().blockQuartzVibrantGlass.block();
|
||||
}
|
||||
|
||||
void renderEdge(AEBaseBlock imb, IBlockAccess world, int x, int y, int z, RenderBlocks renderer, ForgeDirection side, ForgeDirection direction)
|
||||
|
||||
@@ -2,12 +2,12 @@ package appeng.client.render.blocks;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.util.IOrientable;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.misc.BlockQuartzTorch;
|
||||
@@ -51,7 +51,7 @@ public class RenderQuartzTorch extends BaseBlockRender
|
||||
|
||||
renderInvBlock( EnumSet.allOf( ForgeDirection.class ), blk, tess, 0xffffff, renderer );
|
||||
|
||||
blk.getRendererInstance().setTemporaryRenderIcon( Block.hopperBlock.getIcon( 0, 0 ) );
|
||||
blk.getRendererInstance().setTemporaryRenderIcon( Blocks.hopper.getIcon( 0, 0 ) );
|
||||
renderer.renderAllFaces = true;
|
||||
|
||||
renderer.setRenderBounds( Point2 + xOff, bottom + yOff, Point2 + zOff, Point13 + xOff, top + yOff, Point3 + zOff );
|
||||
@@ -125,7 +125,7 @@ public class RenderQuartzTorch extends BaseBlockRender
|
||||
super.renderInWorld( block, world, x, y, z, renderer );
|
||||
}
|
||||
|
||||
blk.getRendererInstance().setTemporaryRenderIcon( Block.hopperBlock.getIcon( 0, 0 ) );
|
||||
blk.getRendererInstance().setTemporaryRenderIcon( Blocks.hopper.getIcon( 0, 0 ) );
|
||||
|
||||
renderer.setRenderBounds( Point2 + xOff, bottom + yOff, Point2 + zOff, Point13 + xOff, top + yOff, Point3 + zOff );
|
||||
boolean out = renderer.renderStandardBlock( blk, x, y, z );
|
||||
|
||||
@@ -3,9 +3,9 @@ package appeng.client.render.blocks;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.render.BlockRenderInfo;
|
||||
@@ -149,7 +149,7 @@ public class RenderSpatialPylon extends BaseBlockRender
|
||||
return result;
|
||||
}
|
||||
|
||||
private Icon getBlockTextureFromSideOutside(AEBaseBlock blk, TileSpatialPylon sp, int displayBits, ForgeDirection ori, ForgeDirection dir)
|
||||
private IIcon getBlockTextureFromSideOutside(AEBaseBlock blk, TileSpatialPylon sp, int displayBits, ForgeDirection ori, ForgeDirection dir)
|
||||
{
|
||||
|
||||
if ( ori.equals( dir ) || ori.getOpposite().equals( dir ) )
|
||||
@@ -167,7 +167,7 @@ public class RenderSpatialPylon extends BaseBlockRender
|
||||
return blk.getIcon( 0, 0 );
|
||||
}
|
||||
|
||||
private Icon getBlockTextureFromSideInside(AEBaseBlock blk, TileSpatialPylon sp, int displayBits, ForgeDirection ori, ForgeDirection dir)
|
||||
private IIcon getBlockTextureFromSideInside(AEBaseBlock blk, TileSpatialPylon sp, int displayBits, ForgeDirection ori, ForgeDirection dir)
|
||||
{
|
||||
boolean good = (displayBits & sp.DISPLAY_ENABLED) == sp.DISPLAY_ENABLED;
|
||||
|
||||
|
||||
@@ -48,9 +48,8 @@ public class RenderStorageMonitor extends BaseBlockRender
|
||||
GL11.glScalef( 1.0f / 1.5f, 1.0f / 1.5f, 1.0f / 1.5f );
|
||||
GL11.glScalef( 1.0f, -1.0f, 0.005f );
|
||||
|
||||
int k = sis.itemID;
|
||||
Block block = (k < Block.blocksList.length ? Block.blocksList[k] : null);
|
||||
if ( sis.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d( Block.blocksList[k].getRenderType() ) )
|
||||
Block block = Block.getBlockFromItem( sis.getItem() );
|
||||
if ( sis.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d( block.getRenderType() ) )
|
||||
{
|
||||
GL11.glRotatef( 25.0f, 1.0f, 0.0f, 0.0f );
|
||||
GL11.glRotatef( 15.0f, 0.0f, 1.0f, 0.0f );
|
||||
|
||||
@@ -5,9 +5,9 @@ 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.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.client.render.BaseBlockRender;
|
||||
import appeng.client.texture.ExtraTextures;
|
||||
@@ -55,7 +55,7 @@ public class RendererSecurity extends BaseBlockRender
|
||||
Tessellator.instance.setColorOpaque_I( 0xffffff );
|
||||
renderer.setRenderBounds( 0, 0, 0, 1, 1, 1 );
|
||||
|
||||
Icon ico = sp.isActive() ? ExtraTextures.BlockMESecurityOn.getIcon() : ExtraTextures.MEChest.getIcon();
|
||||
IIcon ico = sp.isActive() ? ExtraTextures.BlockMESecurityOn.getIcon() : ExtraTextures.MEChest.getIcon();
|
||||
renderFace( x, y, z, imb, ico, renderer, up );
|
||||
|
||||
renderer.overrideBlockTexture = null;
|
||||
|
||||
Reference in New Issue
Block a user