Jump to content

[1.8] Custom Reed Error


KansasToYou

Recommended Posts

I really haphazardly put together this code, taking code from Sugar Cane and seeing if it works. I got it so it works exactly like Sugar Cane, but it doesn't have any textures to it. I know I'm missing a part where I label each texture for each age of it, but I have no idea how to do that. So if you can help me out it'd be appreciated.

 

BlockBeans.java

package com.kansastoyou.mod.blocks;

import java.util.Random;

import com.kansastoyou.mod.init.RandomItems;

import net.minecraft.block.BlockReed;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.util.EnumWorldBlockLayer;
import net.minecraft.world.World;

public class BlockBeans extends BlockReed {

public BlockBeans(Material materialIn) {
	super();
	this.setHardness(0.3F);
	this.setResistance(3);
	this.setStepSound(this.soundTypeGrass);
}

@Override
public boolean isOpaqueCube()
{
	return false;
}

    public Item getItemDropped(IBlockState state, Random rand, int fortune)
    {
        return RandomItems.beans_harvested_item;
    }

    public int quantityDropped()
    {
        return 1;
    }

@Override
public EnumWorldBlockLayer getBlockLayer()
{
	return EnumWorldBlockLayer.CUTOUT;
}

}

 

It also says that i'm missing this in the console.

 

[09:23:14] [Client thread/ERROR] [FML]: Model definition for location rm:beans_block#age=10 not found
[09:23:14] [Client thread/ERROR] [FML]: Model definition for location rm:beans_block#age=7 not found
[09:23:14] [Client thread/ERROR] [FML]: Model definition for location rm:beans_block#age=6 not found
[09:23:14] [Client thread/ERROR] [FML]: Model definition for location rm:beans_block#age=15 not found
[09:23:14] [Client thread/ERROR] [FML]: Model definition for location rm:beans_block#age=5 not found
[09:23:14] [Client thread/ERROR] [FML]: Model definition for location rm:beans_block#age=4 not found
[09:23:14] [Client thread/ERROR] [FML]: Model definition for location rm:beans_block#age=12 not found
[09:23:14] [Client thread/ERROR] [FML]: Model definition for location rm:beans_block#age=11 not found
[09:23:14] [Client thread/ERROR] [FML]: Model definition for location rm:beans_block#age=14 not found
[09:23:14] [Client thread/ERROR] [FML]: Model definition for location rm:beans_block#age=9 not found
[09:23:14] [Client thread/ERROR] [FML]: Model definition for location rm:beans_block#age=13 not found
[09:23:14] [Client thread/ERROR] [FML]: Model definition for location rm:beans_block#age=8 not found
[09:23:14] [Client thread/ERROR] [FML]: Model definition for location rm:beans_block#age=3 not found
[09:23:14] [Client thread/ERROR] [FML]: Model definition for location rm:beans_block#age=2 not found
[09:23:14] [Client thread/ERROR] [FML]: Model definition for location rm:beans_block#age=1 not found
[09:23:14] [Client thread/ERROR] [FML]: Model definition for location rm:beans_block#age=0 not found

 

Screenshots:

 

XF1qsu1.png

Link to comment
Share on other sites

In your blockstate json file for this block you have to state a model for each age it has.

 

{
    "variants": {
        "age=0": {"model": "MODID:REED_0"},
        "age=1": {"model": "MODID:REED_1"},
        "age=2": {"model": "MODID:REED_2"},
        "age=3": {"model": "MODID:REED_3"},
        "age=4": {"model": "MODID:REED_4"},
        "age=5": {"model": "MODID:REED_5"},
        
    }
}

add ages up to the ages you have set for your reed.

 

You can also refer to the same model for each age.

 

{
    "variants": {
        "age=0": {"model": "MODID:REED"},
        "age=1": {"model": "MODID:REED"},
        "age=2": {"model": "MODID:REED"},
        "age=3": {"model": "MODID:REED"},
        "age=4": {"model": "MODID:REED"},
        "age=5": {"model": "MODID:REED"},
        
    }
}

Link to comment
Share on other sites

In your blockstate json file for this block you have to state a model for each age it has.

 

{
    "variants": {
        "age=0": {"model": "MODID:REED_0"},
        "age=1": {"model": "MODID:REED_1"},
        "age=2": {"model": "MODID:REED_2"},
        "age=3": {"model": "MODID:REED_3"},
        "age=4": {"model": "MODID:REED_4"},
        "age=5": {"model": "MODID:REED_5"},
        
    }
}

add ages up to the ages you have set for your reed.

 

You can also refer to the same model for each age.

 

{
    "variants": {
        "age=0": {"model": "MODID:REED"},
        "age=1": {"model": "MODID:REED"},
        "age=2": {"model": "MODID:REED"},
        "age=3": {"model": "MODID:REED"},
        "age=4": {"model": "MODID:REED"},
        "age=5": {"model": "MODID:REED"},
        
    }
}

 

I added that to my Blockstate and It's still not working. I didn't add anything really to my BlockBeans.java that tells it to act anything like Sugar Cane except it extending BlockReed. Where/how would I set up the ages in the Block class?

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.