Jump to content

[1.11] Blocks dont load


angjosar

Recommended Posts

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();

}

}

 

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

I've already tried all that, and nothing that lets me create the block

 

2jb1i4j.png

 

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.

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.