Advertisement
Guest User

Untitled

a guest
Mar 17th, 2017
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. package mymod.blocks;
  2.  
  3. import java.util.Random;
  4.  
  5. import mymod.Main_Dim;
  6. import net.minecraft.block.Block;
  7. import net.minecraft.block.material.Material;
  8. import net.minecraft.client.renderer.texture.IconRegister;
  9. import net.minecraft.creativetab.CreativeTabs;
  10. import net.minecraft.entity.player.EntityPlayer;
  11. import net.minecraft.world.World;
  12.  
  13. public class PlaceholderBlock_1 extends Block {
  14. private String texturePath = "mydimensionmod:";
  15. private int thisBlockID;
  16. public PlaceholderBlock_1 (int par1, Material blockMaterial, String textureName) {
  17.  
  18. super(par1, blockMaterial);
  19. this.setUnlocalizedName(textureName);
  20. Block replaceBlock = Block.stone;
  21.  
  22. getRandomBlock(replaceBlock);
  23.  
  24. replaceTheBlock(replaceBlock);
  25.  
  26. texturePath += textureName;
  27. thisBlockID = par1;
  28. }
  29.  
  30.  
  31.  
  32. private Block replaceTheBlock(Block block) {
  33. // what would I put here?
  34. return null;
  35. }
  36.  
  37. private Block getRandomBlock(Block block) {
  38. Random rand = new Random();
  39. int random = rand.nextInt(7);
  40. switch (random) {
  41. case 0:
  42. block = Block.oreCoal;
  43. break;
  44. case 1:
  45. block = Block.oreDiamond;
  46. break;
  47. case 2:
  48. block = Block.oreEmerald;
  49. break;
  50. case 3:
  51. block = Block.oreGold;
  52. break;
  53. case 4:
  54. block = Block.oreIron;
  55. break;
  56. case 5:
  57. block = Block.oreLapis;
  58. break;
  59. case 6:
  60. block = Block.oreNetherQuartz;
  61. break;
  62. case 7:
  63. block = Block.oreRedstone;
  64. break;
  65. default:
  66. block = Block.stone;
  67. break;
  68. }
  69. return block;
  70. }
  71.  
  72.  
  73. public int idDropped(int par1, Random par2Random, int par3)
  74. {
  75. return thisBlockID;
  76. }
  77.  
  78. public int quantityDropped(Random random)
  79. {
  80. return 1;
  81. }
  82.  
  83. public void registerIcons(IconRegister iconRegister)
  84. {
  85. this.blockIcon = iconRegister.registerIcon(texturePath);
  86. }
  87.  
  88. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement