Help! The blocks do not load
Upgrade from 1.10.2 to 1.11 and everything else works fine, except blocks, they are not registered
init/ModBlocks.java :
package com.modding.WillyWonka.init;
import com.modding.WillyWonka.blocks.BlockChocolate;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.fml.common.registry.GameRegistry;
public class ModBlocks {
public static Block chocolate;
public static void init() {
chocolate = new BlockChocolate();
}
public static void register() {
GameRegistry.register(chocolate);
}
public static void registerRenders() {
registerRender(chocolate);
}
private static void registerRender(Block block){
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(block), 0, new ModelResourceLocation(block.getRegistryName(), "inventory"));}
}
Blocks/BlockChocolate.java
package com.modding.WillyWonka.blocks;
import com.ibm.icu.text.DisplayContext.Type;
import com.modding.WillyWonka.Reference;
import com.modding.WillyWonka.WillyWonka;
import com.modding.WillyWonka.WillyWonkaTab;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.client.audio.Sound;
public class BlockChocolate extends Block {
public BlockChocolate() {
super(Material.ROCK);
this.setUnlocalizedName(Reference.WillyWonkanBlocks.CHOCOLATE.getUnlocalizedName());
this.setRegistryName(Reference.WillyWonkanBlocks.CHOCOLATE.getRegistryName());
this.setCreativeTab(WillyWonka.CREATIVE_TAB);
this.setHardness(3.0F);
this.setResistance(5.0F);
this.setSoundType(SoundType.STONE);
}
}
REFERENCES
public static enum WillyWonkanBlocks {
CHOCOLATE("chocolate", "BlockChocolate");
private String unlocalizedName;
private String registryName;
WillyWonkanBlocks(String unlocalizedName, String registryName) {
this.unlocalizedName = unlocalizedName;
this.registryName = registryName;
}
public String getUnlocalizedName() {
return unlocalizedName;
}
public String getRegistryName() {
return registryName;
}
}
CLIENTPROXY
package com.modding.WillyWonka.proxy;
import com.modding.WillyWonka.init.ModBlocks;
import com.modding.WillyWonka.init.ModCrafting;
import com.modding.WillyWonka.init.ModItems;
public class ClientProxy implements CommonProxy {
@Override
public void init() {
ModItems.registerRenders();
ModCrafting.register();
ModBlocks.register();
}
}