Jump to content

Looking for tutorial/guidance for multi-texture models (solved)


Recommended Posts

Posted (edited)

I've been working on a personal mod but I have a *very* basic understanding of Java, at this point in time I've been working on one issue for about 14 hours and have made no progress. I am trying to make a 'cube_column' block, but no idea where I'm going wrong.

 

RockPillar.class

Spoiler

package com.fetrien.elypsis.blocks;

import com.fetrien.elypsis.Main;
import com.fetrien.elypsis.init.ModBlocks;
import com.fetrien.elypsis.init.ModItems;
import com.fetrien.elypsis.util.IHasModel;

import net.minecraft.block.BlockRotatedPillar;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.util.EnumFacing;

public class RockPillars extends BlockRotatedPillar implements IHasModel {

    public RockPillars(String name, Material material) {
        super(material);
        setUnlocalizedName(name);
        setRegistryName(name);
        setHarvestLevel("axe", 0);
        setHardness(2.0F);
        setSoundType(SoundType.STONE);
        setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
        ModBlocks.BLOCKS.add(this);
        ModItems.ITEMS.add(new ItemBlock(this).setRegistryName(this.getRegistryName()));
        this.setDefaultState(this.getDefaultState().withProperty(AXIS, EnumFacing.Axis.Y));
    }

    @Override
    public void registerModels() {
        Main.proxy.registerItemRenderer(Item.getItemFromBlock(this), 0, "inventory");
    }

}

modblocks.java (showing only parts that deal with block itself.)

Spoiler

import com.fetrien.elypsis.blocks.RockPillars;

 

public static final Block CROSS_STONE_BLOCK = new RockPillars("cross_stone_block", Material.ROCK);

Blockstates

Spoiler

{
    "variants": {
        "axis=y":  { "model": "em:cross_stone_block" },
        "axis=z":   { "model": "em:cross_stone_block", "x": 90 },
        "axis=x":   { "model": "em:cross_stone_block", "x": 90, "y": 90 },
        "axis=none": { "model": "em:cross_stone_block" }
    }
}

models/block.json

Spoiler

{
    "credit": "Model by Granny",
    "parent": "block/cube_column",
    "textures": {
        "end": "em:blocks/cross_stone_top",
        "side": "em:blocks/cross_stone_side"
    }
}

models/item.json

Spoiler

{
   "parent": "em:block/cross_stone_block",
 }

 

 

Error has been resolved, thanks everyone

Edited by Kaelym
(solved)
Posted

Well...

1) Your blockstate file does not contain an inventory variant

2) You didn't show your ModelRegistryEvent

 

Related: IHasModel is stupid and pointless (I will beat this out of you cargo cult programmers eventually). ALL items need models and all the information necessary to register a model is public. Code Style #3. Problematic Code #10.

  • Like 1

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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.