Here is how my blocks class :
package com.mateus.Morestuff.init;
import net.minecraft.block.Block;
import net.minecraft.block.BlockCrops;
import net.minecraft.block.BlockPotato;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraftforge.fml.common.registry.GameRegistry;
import com.mateus.Morestuff.blocks.AlfaceCrops;
import com.mateus.Morestuff.blocks.Cortador;
import com.mateus.Morestuff.blocks.Lampa;
public class MBlocks {
public static Block cortador;
public static void init() {
cortador = new Cortador();
}
public static void register(){
registerBlock(cortador);
}
private static void registerBlock(Block block){
GameRegistry.register(block);
ItemBlock item = new ItemBlock(block);
item.setRegistryName(block.getRegistryName());
GameRegistry.register(item);
}
public static void registerRenders(){
registerRender(cortador);
}
public static void registerRender(Block block){
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(block), 0, new ModelResourceLocation(block.getRegistryName(), "inventory"));
}
}
And the place where i register the unlocalizedname and registryname :
public static enum MateusBlocks {
CORTADOR("cortador", "Cortador");
private String registryName;
private String unlocalizedName;
MateusBlocks(String unlocalizedName, String registryName) {
this.unlocalizedName = unlocalizedName;
this.registryName = registryName;
}
public String getUnlocalizedName() {
return unlocalizedName;
}
public String getRegistryName() {
return registryName;
}
}
The block model ? didnt i showed it ,
well here is itagain
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"textures": {
"0": "modii:blocks/cortador",
"1": "modii:blocks/cortador_lado"
},
"display": {
"gui": {
"rotation": [ 30, 225, 0 ],
"translation": [ 0, 0, 0],
"scale":[ 0.625, 0.625, 0.625 ]
},
"ground": {
"rotation": [ 0, 0, 0 ],
"translation": [ 0, 3, 0],
"scale":[ 0.25, 0.25, 0.25 ]
},
"fixed": {
"rotation": [ 0, 0, 0 ],
"translation": [ 0, 0, 0],
"scale":[ 0.5, 0.5, 0.5 ]
},
"thirdperson_righthand": {
"rotation": [ 75, 45, 0 ],
"translation": [ 0, 2.5, 0],
"scale": [ 0.375, 0.375, 0.375 ]
},
"firstperson_righthand": {
"rotation": [ 0, 45, 0 ],
"translation": [ 0, 0, 0 ],
"scale": [ 0.40, 0.40, 0.40 ]
},
"firstperson_lefthand": {
"rotation": [ 0, 225, 0 ],
"translation": [ 0, 0, 0 ],
"scale": [ 0.40, 0.40, 0.40 ]
}
},
"elements": [
{
"name": "Cube",
"from": [ 0.0, 0.0, 0.0 ],
"to": [ 16.0, 16.0, 16.0 ],
"faces": {
"north": { "texture": "#0", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
"east": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
"south": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
"west": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
"up": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
"down": { "texture": "#1", "uv": [ 0.0, 0.0, 16.0, 16.0 ] }
}
}
]
}
my model location :
assets/modii/models/block/cortador.json
my blockstate location :
assets/modii/blockstates/Cortador.json