Guest User

Untitled

a guest
Jul 11th, 2016
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. //rift
  2. public class Rift extends Block {
  3.  
  4. public static final AxisAlignedBB BOUNDING_BOX = new AxisAlignedBB(0, 0, 0, 1, 0.5, 1);
  5.  
  6. public Rift(Material mat) {
  7. super(mat);
  8. this.setUnlocalizedName("Rift");
  9. this.setRegistryName("Rift");;
  10. this.setLightLevel(1);
  11.  
  12. }
  13.  
  14. @Override
  15. public Item getItemDropped(IBlockState state, Random rand, int drop) {
  16. return ModItems.Essence;
  17. }
  18. @Override
  19. public int quantityDropped(IBlockState state, int drop, Random rand) {
  20. return 1;
  21. }
  22.  
  23. @Override
  24. public boolean isFullCube(IBlockState state) {
  25. return false;
  26. }
  27.  
  28. @Override
  29. public boolean isOpaqueCube(IBlockState state) {
  30. return false;
  31. }
  32.  
  33. //blockstates
  34. {
  35. "variants": {
  36. "normal": { "model": "magicrifts:Rift" }
  37. }
  38. }
  39.  
  40. //model
  41. {
  42. "parent": "block/block",
  43. "textures": {
  44. "all": "magicrifts:blocks/Rift"
  45. "particle": "#all"
  46. },
  47. "elements": [
  48. {
  49. "from": [ 0, 0, 0 ],
  50. "to": [ 16, 16, 16 ],
  51. "shade": false,
  52. "faces": {
  53. "down": { "texture": "#all", "cullface": "down" },
  54. "up": { "texture": "#all", "cullface": "up" },
  55. "north": { "texture": "#all", "cullface": "north" },
  56. "south": { "texture": "#all", "cullface": "south" },
  57. "west": { "texture": "#all", "cullface": "west" },
  58. "east": { "texture": "#all", "cullface": "east" }
  59. }
  60. }
  61. ]
  62. }
  63.  
  64. //blocks
  65. public class ModBlocks {
  66.  
  67. public static Block Rift;
  68.  
  69. public static void init() {
  70. Rift=new Rift(Material.CLOTH);
  71. }
  72.  
  73. public static void register() {
  74. registerBlock(Rift);
  75. }
  76.  
  77. private static void registerBlock(Block block){
  78. GameRegistry.register(block);
  79. ItemBlock item = new ItemBlock(block);
  80. item.setRegistryName(block.getRegistryName());
  81. GameRegistry.register(item);
  82. }
  83.  
  84. public static void renders() {
  85. registerRender(Rift);
  86. }
  87.  
  88. private static void registerRender(Block item) {
  89. Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(item), 0, new ModelResourceLocation("MagicRifts:"+item.getUnlocalizedName().substring(5), "inventory"));
  90. }
  91. }
Advertisement
Add Comment
Please, Sign In to add comment