Aarilight Posted December 23, 2017 Posted December 23, 2017 (edited) I have a block, "SummonerEmpty" which has variants. They all render correctly in the world, and the ItemBlocks for them seem to function correctly (eg: they place the correct blocks) However, all the ItemBlocks, when in inventory slots, are the "missing texture", while held they are the "missing texture" block. This is my currrent block class: public class SummonerEmpty extends ModBlock { public static final IProperty<EndersteelType> VARIANT = PropertyEnum.create("variant", EndersteelType.class); public SummonerEmpty() { super("summoner_empty", new Material(MapColor.STONE).setTransparent()); setHasItem(); setHardness(5F); setResistance(30F); setHarvestLevel("pickaxe", 1); setSoundType(SoundType.METAL); setDefaultState(getDefaultState().withProperty(VARIANT, EndersteelType.NORMAL)); } @Override protected BlockStateContainer createBlockState() { List<IProperty<?>> props = new ArrayList<>(super.createBlockState().getProperties()); props.add(VARIANT); return new BlockStateContainer(this, props.toArray(new IProperty<?>[0])); } @Override public IBlockState getStateFromMeta(int meta) { return getDefaultState().withProperty(VARIANT, EndersteelType.byMetadata(meta)); } @Override public int getMetaFromState(IBlockState state) { return state.getValue(VARIANT).getMeta(); } @Override public int damageDropped(IBlockState state) { return getMetaFromState(state); } @Override public void getSubBlocks(CreativeTab tab, NonNullList<ItemStack> list) { for (EndersteelType enumType : EndersteelType.values()) { Logger.info("" + enumType.getMeta()); list.add(new ItemStack(this, 1, enumType.getMeta())); } } @Override public ItemBlock getItemBlock() { ItemBlock result = new ItemBlock(this) { @Override public int getMetadata(int damage) { return damage; } }; result.setRegistryName(getRegistryName()); return result; } } And then models/item/summoner_empty.json: { "parent": "soulus:block/summoner" } Which inherits models/block/summoner.json: { "parent": "minecraft:block/cube_all", "textures": { "all": "soulus:blocks/summoner_normal" } } I know this wouldn't work for the variants, because it only specifies the normal texture, but I would have expected this to show that texture for all of them, instead of texture erroring... I'm assuming I'm missing something pretty basic for the variants to work? [solved, this was like 10 billion different issues all rolled into one] Edited December 23, 2017 by Aarilight Quote
IceMetalPunk Posted December 23, 2017 Posted December 23, 2017 Block models are automatically registered, but item models are not. You need to call ModelLoader.setCustomModelResourceLocation for your item if you want the model to load properly. Quote Whatever Minecraft needs, it is most likely not yet another tool tier.
Recommended Posts
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.