Jump to content

[1.8] No texture on block items?


mooL

Recommended Posts

I made a tile entity block, and it has textures when i place it down, but it doesnt when im holding the block. what am i doing wrong?

{
    "parent": "block/cube_all",
    "textures": {
        "all": "tm:blocks/inventory_block"
    }
}

 

{
    "parent": "tm:block/inventory_block",
    "display": {
        "thirdperson": {
            "rotation": [ 10, -45, 170 ],
            "translation": [ 0, 1.5, -2.75 ],
            "scale": [ 0.375, 0.375, 0.375 ]
        }
    }
}

 

tell me if there is other code needed

Link to comment
Share on other sites

package com.merel.teleportmod.init;

import static com.merel.teleportmod.Reference.*;

import com.merel.teleportmod.extender.specific.BlockCoordTransporter;
import com.merel.teleportmod.extender.specific.BlockInventory;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class TeleportBlocks {

public static Block tp_block;
public static Block inventory_block;

public static void init() {
	tp_block = new BlockCoordTransporter(Material.glass, "tp_block", MODTAB);
	inventory_block = new BlockInventory("inventory_block", MODTAB);
}

public static void register() {
	looper(tp_block);
	looper(inventory_block);
}

public static void looper(Block regBlock) {
	GameRegistry.registerBlock(regBlock, regBlock.getUnlocalizedName().substring(5));
}

public static void registerRenders() {
	registerRender(tp_block);
	registerRender(inventory_block);
}

public static void registerRender(Block block) {
	Item item = Item.getItemFromBlock(block);
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0,
			new ModelResourceLocation(MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory"));

}
}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.