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
  • [1.12] Mod detecting
1.13 Update Notes for Mod Creators
Sign in to follow this  
Followers 2
PanSzelescik

[1.12] Mod detecting

By PanSzelescik, July 17, 2017 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

PanSzelescik    0

PanSzelescik

PanSzelescik    0

  • Tree Puncher
  • PanSzelescik
  • Members
  • 0
  • 19 posts
Posted July 17, 2017

Hello, I have a little question.

How do I get my added item loaded after a modification is detected? I've done so far mod checker, which adds information in the console, but even that does not work.

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    6667

diesieben07

diesieben07    6667

  • Reality Controller
  • diesieben07
  • Forum Team
  • 6667
  • 45570 posts
Posted July 17, 2017

Show what you have tried so far.

  • Quote

Share this post


Link to post
Share on other sites

PanSzelescik    0

PanSzelescik

PanSzelescik    0

  • Tree Puncher
  • PanSzelescik
  • Members
  • 0
  • 19 posts
Posted July 17, 2017
16 minutes ago, diesieben07 said:

Show what you have tried so far.

I created ModChecker.java in java/panszelescik/mymodid/

package panszelescik.moreplates;

import net.minecraftforge.fml.common.Loader;

public class ModChecker {

	public static boolean isBotaniaLoaded;
	public static boolean isDraconicEvolutionLoaded;
	public static boolean isEnderIOLoaded;
	public static boolean isMekanismLoaded;
	public static boolean isRefinedStorageLoaded;
	public static boolean isTinkersConstructLoaded;
	
	public ModChecker() {
		this.isBotaniaLoaded = Loader.isModLoaded("botania");
		this.isDraconicEvolutionLoaded = Loader.isModLoaded("draconicevoulution");
		this.isEnderIOLoaded = Loader.isModLoaded("enderio");
		this.isMekanismLoaded = Loader.isModLoaded("mekanism");
		this.isRefinedStorageLoaded = Loader.isModLoaded("refinedstorage");
		this.isTinkersConstructLoaded = Loader.isModLoaded("tconstruct");
	}
	
	public static void printSuccessMessage() {
		if(isBotaniaLoaded) {
			MorePlates.logger.info("Botania has been detected.");
		}
		if(isDraconicEvolutionLoaded) {
			MorePlates.logger.info("Draconic Evolution has been detected.");
		}
		if(isEnderIOLoaded) {
			MorePlates.logger.info("Ender IO has been detected.");
		}
		if(isMekanismLoaded) {
			MorePlates.logger.info("Mekanism has been detected.");
		}
		if(isRefinedStorageLoaded) {
			MorePlates.logger.info("Refined Storage has been detected.");
		}
		if(isTinkersConstructLoaded) {
			MorePlates.logger.info("Tinkers' Construct has been detected.");
		}
	}
}

And in java/panszelescik/mymodid/mymodname.java i add:

public static final Logger logger = LogManager.getFormatterLogger(Reference.MODID);
public static ModChecker modChecker;

in public void preInit i add:

		modChecker = new ModChecker();
		modChecker.printSuccessMessage();

This doesn't work, tested with Draconic Evolution. No information in console (log)

fml-client-latest.log

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    6667

diesieben07

diesieben07    6667

  • Reality Controller
  • diesieben07
  • Forum Team
  • 6667
  • 45570 posts
Posted July 17, 2017

Is your preinit called? Why do you check for all these mods?

  • Quote

Share this post


Link to post
Share on other sites

larsgerrits    510

larsgerrits

larsgerrits    510

  • Reality Controller
  • larsgerrits
  • Members
  • 510
  • 3455 posts
Posted July 17, 2017

Also, check the modid you use for Draconic Evolution. I don't think you spelled it right ;)

  • Quote

Share this post


Link to post
Share on other sites

PanSzelescik    0

PanSzelescik

PanSzelescik    0

  • Tree Puncher
  • PanSzelescik
  • Members
  • 0
  • 19 posts
Posted July 17, 2017
14 minutes ago, larsgerrits said:

Also, check the modid you use for Draconic Evolution. I don't think you spelled it right ;)

https://github.com/brandon3055/Draconic-Evolution/blob/master/src/main/java/com/brandon3055/draconicevolution/DraconicEvolution.java

MODID = "draconicevolution"

I'm a beginner and I'm not sure if this is

  • Quote

Share this post


Link to post
Share on other sites

PanSzelescik    0

PanSzelescik

PanSzelescik    0

  • Tree Puncher
  • PanSzelescik
  • Members
  • 0
  • 19 posts
Posted July 17, 2017
19 minutes ago, diesieben07 said:

Is your preinit called? Why do you check for all these mods?

I want to do a few things to load when it's loaded that Draconic Evolution was found.

You mean this?

	@EventHandler
	public void preInit(FMLPreInitializationEvent event){
		ModItems.init();
		ModItems.register();
		Utils.getLogger().info("Pre Initialize");
		
		modChecker = new ModChecker();
		modChecker.printSuccessMessage();
		
		proxy.registerRenders();
	}

 

  • Quote

Share this post


Link to post
Share on other sites

Animefan8888    677

Animefan8888

Animefan8888    677

  • Reality Controller
  • Animefan8888
  • Forge Modder
  • 677
  • 5746 posts
Posted July 17, 2017
18 minutes ago, PanSzelescik said:

I want to do a few things to load when it's loaded that Draconic Evolution was found.

You mean this?


	@EventHandler
	public void preInit(FMLPreInitializationEvent event){
		ModItems.init();
		ModItems.register();
		Utils.getLogger().info("Pre Initialize");
		
		modChecker = new ModChecker();
		modChecker.printSuccessMessage();
		
		proxy.registerRenders();
	}

 

Larsgerrits is right you didn't spell it right when calling Loader.isModLoaded
draconicevoulution =/= draconicevolution

  • Quote

Share this post


Link to post
Share on other sites

PanSzelescik    0

PanSzelescik

PanSzelescik    0

  • Tree Puncher
  • PanSzelescik
  • Members
  • 0
  • 19 posts
Posted July 17, 2017
8 minutes ago, Animefan8888 said:

Larsgerrits is right you didn't spell it right when calling Loader.isModLoaded
draconicevoulution =/= draconicevolution

Srsly? Omg, thanks :D

  • Quote

Share this post


Link to post
Share on other sites

Draco18s    2089

Draco18s

Draco18s    2089

  • Reality Controller
  • Draco18s
  • Members
  • 2089
  • 13986 posts
Posted July 17, 2017

Also, you should always register all items and blocks, regardless. 

  • 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 2
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Kangoro
      Mc Forge 1.14.4

      By Kangoro · Posted 13 minutes ago

      Where do I find it? and i copy paste here or in other web and link here?
    • thedarkcolour
      [1.14] Patching method with coremod in TreeFeature causes IncompatibleClassChangeError

      By thedarkcolour · Posted 24 minutes ago

      Now it just freezes with no error at all.
    • thedarkcolour
      [1.14] Patching method with coremod in TreeFeature causes IncompatibleClassChangeError

      By thedarkcolour · Posted 25 minutes ago

      I just realized what I've done. I forgot to make the BeeNestGenerator method static. I'll check if that fixes it.
    • thedarkcolour
      [1.14] Patching method with coremod in TreeFeature causes IncompatibleClassChangeError

      By thedarkcolour · Posted 29 minutes ago

      BeeNestGenerator class
    • diesieben07
      1.89 crash forge

      By diesieben07 · Posted 1 hour ago

      1.8.9 is no longer supported on this forum due to it's age. Update to a modern version of Minecraft to receive support.
  • Topics

    • Kangoro
      4
      Mc Forge 1.14.4

      By Kangoro
      Started 23 hours ago

    • thedarkcolour
      13
      [1.14] Patching method with coremod in TreeFeature causes IncompatibleClassChangeError

      By thedarkcolour
      Started 11 hours ago

    • Pixelboss4d
      2
      1.89 crash forge

      By Pixelboss4d
      Started 1 hour ago

    • Junior240
      4
      I'm having trouble with Java on !MAC!

      By Junior240
      Started November 9

    • Cerandior
      10
      [1.14.4] [Solved] Trouble With Packets

      By Cerandior
      Started Yesterday at 03:20 PM

  • Who's Online (See full list)

    • Ryagal
    • Kangoro
    • loordgek
    • thedarkcolour
    • imacatlolol
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.12] Mod detecting
  • Theme
  • Contact Us
  • Discord

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