Jump to content

Recommended Posts

Posted (edited)

Trying to start off with modding. Can't figure out how to solve this error.

 

Full crash log attached.

My code:

 

  Reveal hidden contents

 

Thanks in advance!

 

crash-2017-08-03_16.21.21-client.txtFetching info...

Edited by Buudeluu
Posted

Am I not doing this here?

 

  Reveal hidden contents


 

 

Posted

Right, I think this is where I'm setting it. Java gives me some headaches. :D


 

  Reveal hidden contents

 

Posted

I am looking for what I'm doing wrong. I'm new at java and modding and I would appreciate it if someone with more experience could help me out here since I can't resolve this issue myself.

 

But thanks for your replies already.

Posted

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.

Posted
  On 8/3/2017 at 3:20 PM, Buudeluu said:

I'm new at java

Expand  

Admitting that here is just begging to get your thread locked (see Draco's signature). Go find yourself some Java resources and lean on them until nobody here can detect a lack of Java awareness in your work or questions. Do the same for Eclipse if that's new too.

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

Posted

If you are still lost, maybe this method will be a bit more helpfull. Take all your blocks, put them in a list. When registering itemblocks, take that list and by using for put "setRegistryName()" on the end.

This is how it should look like. I hope really this helps ;-)

public class BlockHandler {
    public static List<Block> BLOCKS = new ArrayList<Block>();
    public static Block test_block = new BlockTestBlock(Material.ROCK, "test_block", CreativeTabHandler.tabMW, 5f, 15f, 3, "pickaxe");
    
    @SubscribeEvent
    public static void registerBlocks(RegistryEvent.Register<Block> event){
        BLOCKS.add(test_block);

        for(Block block : BLOCKS){
            event.getRegistry().register(block);
        }
    }
  
    @SubscribeEvent
    public static void registerItemBlocks(RegistryEvent.Register<Item> event){

        for(Block block: BLOCKS){
            event.getRegistry().register(new ItemBlock(block).setRegistryName(block.getRegistryName()));
        }
    }
}

 

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.