Jump to content

load_registry event phase


Recommended Posts

Posted

Hello,

 

I've run into a problem where I get tutorial mod encountered an error during the load_registry event phase. it started right after adding the ore generation portion of my mod (following Harry Talks)

has anyone run into this?

 

Latest Log: https://pastebin.com/gVTzWUkz

Posted
  On 9/17/2019 at 11:03 PM, DrMDGG said:

following Harry Talks

Expand  

I wouldn't use his tutorials.

 

Something is null here.

  Quote
java.lang.NullPointerException

    at drmdgg.tutorialmod.tutorialmod$RegistryEvents.registerItems(tutorialmod.java:79)

Expand  

If you need help with this show your code. Mind you I will probably have a lot for you to change.

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.

Posted
  On 9/17/2019 at 11:27 PM, Animefan8888 said:

I wouldn't use his tutorials.

 

Something is null here.

If you need help with this show your code. Mind you I will probably have a lot for you to change.

Expand  

well, I don't have many options as there are few tutorials for 1.14 atm.

i'd be happy to share my code with you through emails rather than here for my own reasons. PM me your email for the other way around if you're willing to help me.

thank you

Posted
  On 9/17/2019 at 11:31 PM, DrMDGG said:

i'd be happy to share my code with you through emails rather than here for my own reasons.

Expand  

It's not like we are going to steal your code. Plus after you post it and the problem is found you can edit your post and remove your code from here.

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.

Posted
  On 9/17/2019 at 11:33 PM, Animefan8888 said:

It's not like we are going to steal your code. Plus after you post it and the problem is found you can edit your post and remove your code from here.

Expand  

that's not what I meant. I just figured it'd be easier to send you the whole package to take a look at

Posted
  On 9/17/2019 at 11:35 PM, DrMDGG said:

that's not what I meant. I just figured it'd be easier to send you the whole package to take a look at

Expand  

Use github.

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.

Posted
  On 9/17/2019 at 11:52 PM, DrMDGG said:

no thanks, I think i'll just post the main class here.

Expand  

I looks like a copy paste error here, but also I don't know where you initialize BlockList.butane. Do you ever do this?
 

  Quote

ItemList.butane = new BlockItem(BlockList.tblock, new Item.Properties().group(tutorialitems)).setRegistryName(BlockList.butane.getRegistryName()),

Expand  

That might be a typo I'm not sure.

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.

Posted
  On 9/17/2019 at 11:57 PM, Animefan8888 said:

I looks like a copy paste error here, but also I don't know where you initialize BlockList.butane. Do you ever do this?
 

That might be a typo I'm not sure.

Expand  

that was a typo for sure, thanks for catching that.

alas, that is not the problem. I get the same error

Posted
  On 9/18/2019 at 12:02 AM, DrMDGG said:

alas, that is not the problem. I get the same error

Expand  

Is BlockList.butane ever given a value? If it is done in a static initializer don't do that initialize it in the registry event.

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.

Posted
  On 9/18/2019 at 12:05 AM, Animefan8888 said:

Is BlockList.butane ever given a value? If it is done in a static initializer don't do that initialize it in the registry event.

Expand  

now i'm getting "error during the common_setup phase"

Posted
  On 9/18/2019 at 12:19 AM, DrMDGG said:

okay. and now im too lazy to change the code in a text editor:

Expand  
  Quote
java.lang.NullPointerException

    at drmdgg.marijuanacraft.world.OreGeneration.setupOreGeneration(OreGeneration.java:19)

Expand  

 

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.

Posted
  On 9/18/2019 at 12:23 AM, DrMDGG said:

how do I rectify that?

Expand  

Something is null on line 19 I can't tell you what cause I can't see your OreGeneration class.

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.

Posted
  On 9/18/2019 at 12:29 AM, DrMDGG said:

I removed that line and the game ran. but I doubt the ore was there.

Expand  

I didn't ask to see OreGenConfig I asked to see OreGeneration.

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.

Posted
  On 9/18/2019 at 12:33 AM, DrMDGG said:

my bad.

Expand  

Do you ever call OreGenConfig.init? If you don't then the values you set in there are always null.

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.

Posted
  On 9/18/2019 at 12:37 AM, Animefan8888 said:

Do you ever call OreGenConfig.init? If you don't then the values you set in there are always null.

Expand  

call it in the main class?

...sorry

Posted
  On 9/18/2019 at 12:42 AM, DrMDGG said:

call it in the main class?

Expand  

This is how I have mine set up.
 

	public static CrystalConfig CONFIG;
	
	public CrystalMod() {
		Pair<CrystalConfig, ForgeConfigSpec> pair = new ForgeConfigSpec.Builder().configure(CrystalConfig::new);
		CONFIG = pair.getLeft();
		ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, pair.getRight(), "modid.toml");
    }

// Where CrystalConfig is a class that looks like this.
	public CrystalConfig(ForgeConfigSpec.Builder builder) {
		// DO config stuff.
	}

 

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.

Posted
  On 9/18/2019 at 12:45 AM, Animefan8888 said:

This is how I have mine set up.
 

	public static CrystalConfig CONFIG;
	
	public CrystalMod() {
		Pair<CrystalConfig, ForgeConfigSpec> pair = new ForgeConfigSpec.Builder().configure(CrystalConfig::new);
		CONFIG = pair.getLeft();
		ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, pair.getRight(), "modid.toml");
    }

// Where CrystalConfig is a class that looks like this.
	public CrystalConfig(ForgeConfigSpec.Builder builder) {
		// DO config stuff.
	}

 

Expand  

call it anything you want, but i'm pretty new (again) to all this.

how should I implement this into my code?

Posted
  On 9/18/2019 at 1:21 AM, DrMDGG said:

public CrystalMod() {

Expand  

This is the constructor to my @Mod class.

 

  On 9/18/2019 at 1:21 AM, DrMDGG said:

Pair<CrystalConfig, ForgeConfigSpec> pair = new ForgeConfigSpec.Builder().configure(CrystalConfig::new);

Expand  

I create a Pair variable and set it equal to ForgeConfigSpec.Builder#configure

CrystalConfig is a class that has this as it's constructor.

  On 9/18/2019 at 12:45 AM, Animefan8888 said:

public CrystalConfig(ForgeConfigSpec.Builder builder) { // DO config stuff. }

Expand  

It takes in a Builder and inside this constructor I create my config file using Builder#push(...) Builder#comment etc. I store the config values here as well.

 

  On 9/18/2019 at 1:21 AM, DrMDGG said:

CONFIG = pair.getLeft();

Expand  

Now I store the CrystalConfig value from the pair into my @Mod class.

  On 9/18/2019 at 12:45 AM, Animefan8888 said:

ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, pair.getRight(), "modid.toml");

Expand  

Then I register the other value as a config.

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.

Posted
  On 9/18/2019 at 1:30 AM, Animefan8888 said:

This is the constructor to my @Mod class.

 

I create a Pair variable and set it equal to ForgeConfigSpec.Builder#configure

CrystalConfig is a class that has this as it's constructor.

It takes in a Builder and inside this constructor I create my config file using Builder#push(...) Builder#comment etc. I store the config values here as well.

 

Now I store the CrystalConfig value from the pair into my @Mod class.

Then I register the other value as a config.

Expand  

I'm gonna be honest here. I'm completely confused as how to implement this into my code. do i add it to my main class or the oregeneration class. I'm sorry. but I'm more confused now.

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.