Jump to content

Recommended Posts

Posted

I am trying to register a block, Here is the registry class:

@EventBusSubscriber
public class BlockInit {
	
	public static final ArrayList<Block> blocks = new ArrayList<Block>();
	
    public static final Block theblock = new Block(Material.ROCK).setUnlocalizedName("test").setRegistryName("modid:test");
      
	@SubscribeEvent
	public void registerBlocks(RegistryEvent.Register<Block> event) {
		for (Block block : blocks) {
			System.out.println("Registering block!");
      		event.getRegistry().register(block);
		}
	}

	@SubscribeEvent
	public void registerItemBlocks(RegistryEvent.Register<Item> event) {
		for (Block block : blocks) {
			event.getRegistry().register(
					Item.getItemFromBlock(block)
							.setRegistryName(
									new ModelResourceLocation(block
											.getRegistryName(), "Inventory"))
							.setUnlocalizedName(
									block.getUnlocalizedName() + "_item"));
		}
	}
	
	@SubscribeEvent
	public void modelRegister(ModelRegistryEvent event) {
		for (Block block : blocks) {
				block.registerModels();
		}
	}
}

But it never outprints "Registering block!"

I have my proxies but I do not think they need a line for this to work

I can usually do this but now I just can't for some reason

P.S. the mod loads correctly, no errors no outprints.

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.