Jump to content
  • Home
  • Files
  • Docs
  • Merch
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Load a mod after a different mod
1.13 Update Notes for Mod Creators
Sign in to follow this  
Followers 0
gudenau

Load a mod after a different mod

By gudenau, March 31, 2013 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

gudenau    1

gudenau

gudenau    1

  • Tree Puncher
  • gudenau
  • Members
  • 1
  • 14 posts
Posted March 31, 2013

How do I do this, I get null pointers with this code.

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    6671

diesieben07

diesieben07    6671

  • Reality Controller
  • diesieben07
  • Forum Team
  • 6671
  • 45615 posts
Posted March 31, 2013

The issue is:

Once the Storage class gets instanciated, it gets the Logger from the Common. That can cause 2 problems:

1) instance of Common might not be set yet (why do you set it in preInit anyways? @Instance automatically fills the field)

2) Common.getLogger causes the Common to log something, but it's logger might not be created yet either.

 

  • Quote

Share this post


Link to post
Share on other sites

SanAndreasP    402

SanAndreasP

SanAndreasP    402

  • World Shaper
  • SanAndreasP
  • Forge Modder
  • 402
  • 1689 posts
Posted March 31, 2013

The issue is:

Once the Storage class gets instanciated, it gets the Logger from the Common. That can cause 2 problems:

1) instance of Common might not be set yet (why do you set it in preInit anyways? @Instance automatically fills the field)

2) Common.getLogger causes the Common to log something, but it's logger might not be created yet either.

 

Also you have to give the full class path in your dependencies string, NOT the modID! Mine would look like this:

dependencies="after:sanandreasp.mods.managers.SAP_ManagerRegistry"

  • Quote

Share this post


Link to post
Share on other sites

gudenau    1

gudenau

gudenau    1

  • Tree Puncher
  • gudenau
  • Members
  • 1
  • 14 posts
Posted March 31, 2013

The issue is:

Once the Storage class gets instanciated, it gets the Logger from the Common. That can cause 2 problems:

1) instance of Common might not be set yet (why do you set it in preInit anyways? @Instance automatically fills the field)

2) Common.getLogger causes the Common to log something, but it's logger might not be created yet either.

 

Also you have to give the full class path in your dependencies string, NOT the modID! Mine would look like this:

dependencies="after:sanandreasp.mods.managers.SAP_ManagerRegistry"

 

Thanks a lot!

  • Quote

Share this post


Link to post
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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

  • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • LorenzoPapi
      [1.12.2]Double-part block breaking problem

      By LorenzoPapi · Posted 12 minutes ago

      I really don't know how to do this. I've been thinking of how to do this (didn't code anything, since I didn't know what to write), but I had only an idea. Using another HOR_FACING property, but: 1) This HOR_FACING property should be null when the normal "FACING" property isn't DOWN or UP; 2) I think making another property just to check for a part of the block is completely useless. So this is what I have right now...nothing. Any kind of help would be appreciated. I'm going to bed now.
    • sondreooos
      Forge 1.12.2 wont start

      By sondreooos · Posted 19 minutes ago

      no this is it   [Info: 2019-12-07 22:06:18.9198558: mainWindows.cpp(111)] Triggering reopen event... [Info: 2019-12-07 22:06:18.9205611: mainWindows.cpp(114)] Success!
    • diesieben07
      Forge 1.12.2 wont start

      By diesieben07 · Posted 24 minutes ago

      Close the Minecraft launcher. Delete the launcher_log. Reopen the launcher and try to launch the game, once. After it failed, close the launcher and post the new launcher_log.
    • Cerandior
      [1.12.2] How do i make it so my sword renders in my mobs hand?.

      By Cerandior · Posted 24 minutes ago

      Listen man. super refers to the parent class. In your case, your entity class (EntityBarbarian) extends EntityMob, therefore your entity is a "child" of EntityMob (the parent). Every method of your parent class is accessible to you, but if you want a specific implementation of those methods, you override them (the @Override annotation). In your case, you don't really need a specific implementation of "setItemStackToSlot" so you don't have to override that method. You simply have to call it with the specified parameters. You have overriden "setItemStackToSlot" to always call the super class's method with the MAINHAND slot and your BARBARIAN_SWORD as the itemstack. Now that's bad because your entity now will always call that method with your specified parameters. That's perhaps something you don't care about. You just want it to work, and the bloody thing doesn't work. The reason why It doesn't work, is because you are never calling the "setItemStackToSlot" method anywhere. How do you expect it to do anything if it is never being called. The perfect place to call this method would be at the "onInitialSpawn" method, which currently does absolutely nothing in your class. That method is called when your entity is initially spawned on the world, as the name of the method suggests. However you just return the super class's implementation of that method and do nothing else. Which actually means you are doing nothing, because your super class's "onInitialSpawn" method would have been called anyway even if you didn't override it. Before you return the super class's implementation of "onInitialSpawn", you call the "setItemStackToSlot" with the parameters that you want (Mainhand slot and a new itemstack instance of barbarian sword). So now your class has its own implementation of "onInitialSpawn" and overriding the method makes sense.
    • sondreooos
      Forge 1.12.2 wont start

      By sondreooos · Posted 26 minutes ago

      is this it   [Info: 2019-12-07 19:48:31.2989204: mainWindows.cpp(111)] Triggering reopen event... [Info: 2019-12-07 19:48:31.2998206: mainWindows.cpp(114)] Success!
  • Topics

    • LorenzoPapi
      5
      [1.12.2]Double-part block breaking problem

      By LorenzoPapi
      Started Yesterday at 02:51 PM

    • sondreooos
      13
      Forge 1.12.2 wont start

      By sondreooos
      Started 1 hour ago

    • J0WAY
      23
      [1.12.2] How do i make it so my sword renders in my mobs hand?.

      By J0WAY
      Started Thursday at 09:10 PM

    • FireController1847
      0
      [1.14.4] How to move the position of a HUD element without copying Mojang code?

      By FireController1847
      Started 1 hour ago

    • Mylystra
      1
      my mods aren't appearing only forge does

      By Mylystra
      Started 1 hour ago

  • Who's Online (See full list)

    • Vorquel
    • Simon_kungen
    • Cerandior
    • LorenzoPapi
    • Alatyami
    • salvestrom
    • KittRiderTV
    • OoDone
    • imacatlolol
    • TehStoneMan
    • diesieben07
    • Maciej916
    • MOTRISGAMER_HD
    • Lordyammer
    • sondreooos
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Load a mod after a different mod
  • Theme
  • Contact Us
  • Discord

Copyright © 2019 ForgeDevelopment LLC · Ads by Curse Powered by Invision Community