Guest User

Untitled

a guest
May 24th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.37 KB | None | 0 0
  1. package net.minecraft.src;
  2.  
  3.  
  4.  
  5. import java.util.Random;
  6.  
  7.  
  8.  
  9. public class BlockCobbleGlass extends BlockBreakable
  10.  
  11. {
  12.  
  13.         public BlockCobbleGlass(int x, int y, Material material, boolean flag)
  14.  
  15.         {
  16.  
  17.                 super(x, y, material, flag);
  18.  
  19.         }
  20.  
  21.        
  22.  
  23.         public int quantityDropped(Random random)
  24.  
  25.     {
  26.  
  27.         return 1;  //return 0; if you want nothing to return when you break it
  28.  
  29.     }
  30.  
  31.  
  32.  
  33.     public int getRenderBlockPass()
  34.  
  35.     {
  36.  
  37.         return 0;
  38.  
  39.     }
  40.  
  41.        
  42.  
  43.         public int getBlockTextureFromSide(int i)
  44.  
  45.         {
  46.  
  47.                 Object mod_GlassPass;
  48.                 if(i == 0)
  49.  
  50.                         return mod_GlassPass.InvisCobbleBottom;
  51.  
  52.                 if(i == 1)
  53.  
  54.                         return mod_GlassPass.InvisCobbleTop;
  55.  
  56.                 if(i == 2)
  57.  
  58.                         return mod_GlassPass.InvisCobbleSide;
  59.  
  60.                 if(i == 3)
  61.  
  62.                         return mod_GlassPass.InvisCobbleFront;
  63.  
  64.                 if(i == 4)
  65.  
  66.                         return mod_GlassPass.InvisCobbleSide;
  67.  
  68.                 if(i == 5)
  69.  
  70.                         return mod_GlassPass.InvisCobbleSide;
  71.  
  72.                 return 0;
  73.  
  74.         }
  75.  
  76.  
  77.     public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving)
  78.  
  79.     {
  80.  
  81.         int l = MathHelper.floor_double((double)((entityliving.rotationYaw * 4F) / 360F) + 0.5D) & 3;
  82.  
  83.         if(l == 0)
  84.  
  85.         {
  86.  
  87.             world.setBlockMetadataWithNotify(i, j, k, 2);
  88.  
  89.         }
  90.  
  91.         if(l == 1)
  92.  
  93.         {
  94.  
  95.             world.setBlockMetadataWithNotify(i, j, k, 5);
  96.  
  97.         }
  98.  
  99.         if(l == 2)
  100.  
  101.         {
  102.  
  103.             world.setBlockMetadataWithNotify(i, j, k, 3);
  104.  
  105.         }
  106.  
  107.         if(l == 3)
  108.  
  109.         {
  110.  
  111.             world.setBlockMetadataWithNotify(i, j, k, 4);
  112.  
  113.         }
  114.     }
  115.  
  116.  
  117.     public int getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l)
  118.     {
  119.  
  120.         if(l == 1)
  121.  
  122.         {
  123.  
  124.             return blockIndexInTexture + 17;
  125.  
  126.         }
  127.  
  128.         if(l == 0)
  129.  
  130.         {
  131.  
  132.             return blockIndexInTexture + 17;
  133.  
  134.         }
  135.  
  136.         int i1 = iblockaccess.getBlockMetadata(i, j, k);
  137.  
  138.         if(l != i1)
  139.  
  140.         {
  141.  
  142.             return blockIndexInTexture;
  143.  
  144.         }else
  145.         {
  146.         return blockIndexInTexture - 1;
  147.         }
  148.     }
  149. }
Add Comment
Please, Sign In to add comment