Advertisement
WackoMcGoose

TheDarkKnight wall render

Feb 7th, 2012
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.17 KB | None | 0 0
  1.   public boolean RenderWall(Block block, int i, int j, int k, RenderBlocks renderblocks)
  2.     {
  3.         boolean flag = renderblocks.blockAccess.getBlockId(i, j, k - 1) == mod_EvilMinecraft.WallWood.blockID;
  4.         boolean flag1 = renderblocks.blockAccess.getBlockId(i - 1, j, k) == mod_EvilMinecraft.WallWood.blockID;
  5.         boolean flag2 = renderblocks.blockAccess.getBlockId(i + 1, j, k) == mod_EvilMinecraft.WallWood.blockID;
  6.         boolean flag3 = renderblocks.blockAccess.getBlockId(i, j, k + 1) == mod_EvilMinecraft.WallWood.blockID;
  7.         boolean flag4 = renderblocks.blockAccess.getBlockId(i, j, k - 1) == 0;
  8.         boolean flag5 = renderblocks.blockAccess.getBlockId(i - 1, j, k) == 0;
  9.         boolean flag6 = renderblocks.blockAccess.getBlockId(i + 1, j, k) == 0;
  10.         boolean flag7 = renderblocks.blockAccess.getBlockId(i, j, k + 1) == 0;
  11.     //Stuff for checking adjacent block pairs
  12.     boolean matchingBlocksNS;
  13.     boolean matchingBlocksEW;
  14.     int northMetadata = renderblocks.blockAccess.getBlockMetadata(i, j, k + 1);
  15.     int southMetadata = renderblocks.blockAccess.getBlockMetadata(i, j, k - 1);
  16.     int eastMetadata = renderblocks.blockAccess.getBlockMetadata(i + 1, j, k);
  17.     int westMetadata = renderblocks.blockAccess.getBlockMetadata(i - 1, j, k);
  18.     //.................
  19.         int l = renderblocks.blockAccess.getBlockMetadata(i, j, k);  
  20.         Tessellator tessellator = Tessellator.instance;
  21.         tessellator.setBrightness(block.getMixedBrightnessForBlock(renderblocks.blockAccess, i, j, k));    
  22.     //Actual checking block pairs
  23.     if(flag3 && northMetadata == l && flag && southMetadata == l)
  24.     {
  25.         matchingBlocksNS = true;
  26.     }
  27.     if(flag2 && eastMetadata == l && flag1 && westMetadata == l)
  28.     {
  29.         matchingBlocksEW = true;
  30.     }
  31.     if(matchingBlocksNS && !matchingBlocksEW)
  32.     {
  33.         //Render stuff for matching north and south blocks
  34.     }
  35.     if(!matchingBlocksNS && matchingBlocksEW)
  36.     {
  37.         //Render stuff for matching east and west blocks
  38.     }
  39.     //............................
  40.         if(l == 0)
  41.         {
  42.             block.setBlockBounds(0.8F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
  43.             renderblocks.overrideBlockTexture = -1;        
  44.             renderblocks.renderStandardBlock(block, i, j, k);          
  45.            
  46.             block.setBlockBounds(0.8F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);          
  47.         }
  48.         if(l == 1)
  49.         {
  50.             block.setBlockBounds(0.0F, 0.0F, 0.8F, 1.0F, 1.0F, 1.0F);
  51.             renderblocks.overrideBlockTexture = -1;        
  52.             renderblocks.renderStandardBlock(block, i, j, k);
  53.            
  54.             block.setBlockBounds(0.0F, 0.0F, 0.8F, 1.0F, 1.0F, 1.0F);
  55.         }
  56.         if(l == 2)
  57.         {
  58.             block.setBlockBounds(0.0F, 0.0F, 0.0F, 0.2F, 1.0F, 1.0F);
  59.             renderblocks.overrideBlockTexture = -1;        
  60.             renderblocks.renderStandardBlock(block, i, j, k);      
  61.            
  62.             block.setBlockBounds(0.0F, 0.0F, 0.0F, 0.2F, 1.0F, 1.0F);          
  63.         }
  64.         if(l == 3)
  65.         {
  66.             block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.2F);
  67.             renderblocks.overrideBlockTexture = -1;        
  68.             renderblocks.renderStandardBlock(block, i, j, k);
  69.            
  70.             block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.2F);
  71.         }      
  72.         return true;      
  73.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement