Posted December 4, 20168 yr 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(); } }
December 4, 20168 yr Show your common proxy. 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.
December 4, 20168 yr Author Show your common proxy. package com.modding.WillyWonka.proxy; public interface CommonProxy { public void init(); }
December 4, 20168 yr Author Why are you registering your Blocks in your client proxy? You never call ModBlocks.registerRenders You should be using ModelLoader.setCustomModelResourceLocation to set your models. If I do not register the block in client proxy, the client does not start
December 4, 20168 yr You should register it in common code. Either: a) main class b) common proxy c) the registration event 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.
December 4, 20168 yr Author I've already tried all that, and nothing that lets me create the block I can pass the folder "src"
December 4, 20168 yr I've already tried all that, and nothing that lets me create the block I can pass the folder "src" You also need to register an ItemBlock item for your blocks. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
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.