Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //rift
- public class Rift extends Block {
- public static final AxisAlignedBB BOUNDING_BOX = new AxisAlignedBB(0, 0, 0, 1, 0.5, 1);
- public Rift(Material mat) {
- super(mat);
- this.setUnlocalizedName("Rift");
- this.setRegistryName("Rift");;
- this.setLightLevel(1);
- }
- @Override
- public Item getItemDropped(IBlockState state, Random rand, int drop) {
- return ModItems.Essence;
- }
- @Override
- public int quantityDropped(IBlockState state, int drop, Random rand) {
- return 1;
- }
- @Override
- public boolean isFullCube(IBlockState state) {
- return false;
- }
- @Override
- public boolean isOpaqueCube(IBlockState state) {
- return false;
- }
- //blockstates
- {
- "variants": {
- "normal": { "model": "magicrifts:Rift" }
- }
- }
- //model
- {
- "parent": "block/block",
- "textures": {
- "all": "magicrifts:blocks/Rift"
- "particle": "#all"
- },
- "elements": [
- {
- "from": [ 0, 0, 0 ],
- "to": [ 16, 16, 16 ],
- "shade": false,
- "faces": {
- "down": { "texture": "#all", "cullface": "down" },
- "up": { "texture": "#all", "cullface": "up" },
- "north": { "texture": "#all", "cullface": "north" },
- "south": { "texture": "#all", "cullface": "south" },
- "west": { "texture": "#all", "cullface": "west" },
- "east": { "texture": "#all", "cullface": "east" }
- }
- }
- ]
- }
- //blocks
- public class ModBlocks {
- public static Block Rift;
- public static void init() {
- Rift=new Rift(Material.CLOTH);
- }
- public static void register() {
- registerBlock(Rift);
- }
- private static void registerBlock(Block block){
- GameRegistry.register(block);
- ItemBlock item = new ItemBlock(block);
- item.setRegistryName(block.getRegistryName());
- GameRegistry.register(item);
- }
- public static void renders() {
- registerRender(Rift);
- }
- private static void registerRender(Block item) {
- Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(item), 0, new ModelResourceLocation("MagicRifts:"+item.getUnlocalizedName().substring(5), "inventory"));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment