Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[SOLVED][1.8] Fighting the dreaded 1.8 block JSON issues


jabelar
 Share

Recommended Posts

Okay, I expect there is a simple typo somewhere, but basically the loader isn't finding any of my block or item model definitions.

 

Here is the error report:

 

[17:20:45] [Client thread/INFO]: Created: 512x512 textures-atlas

[17:20:45] [Client thread/ERROR] [FML]: Model definition for location magicbeans:tile.magicbeanstalk#age=1 not found

[17:20:45] [Client thread/ERROR] [FML]: Model definition for location magicbeans:tile.magicbeanstalk#age=0 not found

[17:20:45] [Client thread/ERROR] [FML]: Model definition for location magicbeans:tile.magicbeanscloud#normal not found

[17:20:45] [Client thread/ERROR] [FML]: Model definition for location magicbeans:item.golden_goose_meat#inventory not found

[17:20:45] [Client thread/ERROR] [FML]: Model definition for location magicbeans:item.magicbeans#inventory not found

[17:20:45] [Client thread/ERROR] [FML]: Model definition for location magicbeans:item.spawn_egg_mysterious stranger#inventory not found

[17:20:45] [Client thread/ERROR] [FML]: Model definition for location magicbeans:item.golden_egg#inventory not found

[17:20:45] [Client thread/ERROR] [FML]: Model definition for location magicbeans:tile.magicbeanstalk#age=7 not found

[17:20:45] [Client thread/ERROR] [FML]: Model definition for location magicbeans:tile.magicbeanstalk#age=6 not found

[17:20:45] [Client thread/ERROR] [FML]: Model definition for location magicbeans:tile.magicbeanstalk#age=5 not found

[17:20:45] [Client thread/ERROR] [FML]: Model definition for location magicbeans:item.spawn_egg_family cow#inventory not found

[17:20:45] [Client thread/ERROR] [FML]: Model definition for location magicbeans:tile.magicbeanstalk#age=4 not found

[17:20:45] [Client thread/ERROR] [FML]: Model definition for location magicbeans:tile.magicbeanscloud#inventory not found

[17:20:45] [Client thread/ERROR] [FML]: Model definition for location magicbeans:tile.magicbeanstalk#age=3 not found

[17:20:45] [Client thread/ERROR] [FML]: Model definition for location magicbeans:tile.magicbeanstalk#inventory not found

[17:20:45] [Client thread/ERROR] [FML]: Model definition for location magicbeans:item.spawn_egg_giant#inventory not found

[17:20:45] [Client thread/ERROR] [FML]: Model definition for location magicbeans:tile.magicbeanstalk#age=2 not found

[17:20:45] [Client thread/ERROR] [FML]: Model definition for location magicbeans:item.boots_safe_falling#inventory not found

 

 

 

Now I think I have my JSONs in correct assets directories:

LlcyPFo.png

 

And I think I understand the idea -- the blockstates maps the variants to the models based on BlockState properties.  For the magicbeanstalk.json I have the following (note the repetition of the stages is intentional):

{
    "variants": {
        "age=0": { "model": "magicbeans:magicbeanstalk_stage_0" },
        "age=1": { "model": "magicbeans:magicbeanstalk_stage_0" },
        "age=2": { "model": "magicbeans:magicbeanstalk_stage_1" },
        "age=3": { "model": "magicbeans:magicbeanstalk_stage_1" },
        "age=4": { "model": "magicbeans:magicbeanstalk_stage_2" },
        "age=5": { "model": "magicbeans:magicbeanstalk_stage_2" },
        "age=6": { "model": "magicbeans:magicbeanstalk_stage_3" },
        "age=7": { "model": "magicbeans:magicbeanstalk_stage_3" },
    }
}

 

And for magicbeanstalk_stage_0.json I have:

{
    "parent": "block/cross",
    "textures": {
        "cross": "magicbeans:blocks/magicbeanstalk_stage_0"
    }
}

 

And I think the actual textures are matching in name and are in right location:

yoRWBcb.png

 

And my modid I think is correct and consistent throughout -- here is the code for MODID in my main class:

@Mod(modid = 
      MagicBeans.MODID, 
      name = MagicBeans.MODNAME, 
      version = MagicBeans.MODVERSION,
      guiFactory = "com.blogspot.jabelarminecraft."+MagicBeans.MODID+".gui.GuiFactoryMagicBeans")
public class MagicBeans
{
    public static final String MODID = "magicbeans";
    public static final String MODNAME = "Magic Beans";
    public static final String MODVERSION = "1.0.0";

 

Lastly, I think the block has proper property "age" set up with values 0 to 7. Here is the relevant code from the block's class:

public class BlockCropMagicBeans extends BlockBush implements IGrowable
{
//    @SideOnly(Side.CLIENT)
//    protected IIcon[] iconArray;

    public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 7);

    protected boolean isFullyGrown = false;

    public BlockCropMagicBeans()
    {
    	super();
        // Basic block setup
        setTickRandomly(true);
        setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
        setCreativeTab((CreativeTabs)null);
        setHardness(0.0F);
        setStepSound(soundTypeGrass);
        disableStats();
        setDefaultState(blockState.getBaseState().withProperty(AGE, Integer.valueOf(0)));
    }

 

The launcher is obviously reading my variants JSON in the blockstates because the error log shows it looking for the right assets associated with the property.

 

So what am I doing wrong?  I know it is probably a simple typo somewhere, but I've been staring at this all week...

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

Okay, I solved it.  In order to avoid cut and paste types I used unlocalized name in several places (like when registering the renderers) but forgot that the getUnlocalizedName() method prepends a "tile." or "item." to the name -- I hate it when setter and getter methods are not reciprocal!

 

Anyway, by adding .substring(5) to each name it strips that off and now it works!

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

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
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.

 Share



×
×
  • Create New...

Important Information

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