Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Posts

  • Joined

  • Last visited

Chaos_02's Achievements

Tree Puncher

Tree Puncher (2/8)



  1. okay thank you for clarifying! I'll try to implement the setup method and event listeners as an extra class, maybe this works!
  2. do you mean this? @Mod("examplemod") public class ExampleMod { // Directly reference a log4j logger. private static final Logger LOGGER = LogManager.getLogger(); public ExampleMod() { // Register the setup method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); // Register the enqueueIMC method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::enqueueIMC); // Register the processIMC method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::processIMC); // Register ourselves for server and other game events we are interested in MinecraftForge.EVENT_BUS.register(this); } private void setup(final FMLCommonSetupEvent event) { // some preinit code LOGGER.info("HELLO FROM PREINIT"); LOGGER.info("DIRT BLOCK >> {}", Blocks.DIRT.getRegistryName()); } from literally mdk.zip/src/main/java/com/example/examplemod/examplemod.java ? Because, as you can see I literally copied it and then needed to comment it out because it crashes when the mod is constructed at that time
  3. @diesieben07 Hey, so with some extensieve help from literally a random guy on Discord I got the project finished! I have noticed a "bug"? in FML tho: Although my mod works now, I cannot add the event listeners and stuff (literally taken from the docs) in the constructor, then the Mod crashes and fails to override the scanCandidates() method of AbstractJarFileLocator. Full Stacktrace (afterwards it just loaded default mods folder), should I create an issue on gitHub? Sadly, because of this, I was unable to use the forge config system and implemented my own with the nightconfig library. Also the Mod is currently not displayed in Minecraft in the Mods tab (looking forward!!) My most up-to-date code is on GitHub, where you can btw also find a link to its curseforge page! (for future reference: GitHub name will at some point be changed to StructuredModLoader instead of SubFolderLoader!!)
  4. Another question has come up: How can I cast from a regular java File type to the IModFile type? I can't find any examples in the source code where it is done except the private method createMod.
  5. if I implement IModLocator I need to implement all methods of it - even implementing the scanMods() method is hard enough because I keep having to recursively add code from other classes, which then doesnt work outside of said class. easiest example is the ModJarMetadata.buildFile method which is deprecated. Eclipse shows that buildFile is invisible. When I then copy the code of buildFile it needs the class object of ModJarMetadata which I cannot provide. Then there's also NightConfigWrapper.setFile() How do I get around this??? EDIT: I think I have it figured out now. because I just want to add to the artifacts object I can override the scanMods() method while calling itself:
  6. To add my modfinding (or override FML) would I need to override the net.minecraftforge.fml.loading.moddiscovery.MinecraftLocator.scanMods method? And if yes, how do I because when I extend my main class with MinecraftLocator and @Override scanMods with an exact copy of it it gives these errors: ModJarMetadata.buildFile(...): The method buildFile(Function<SecureJar,IModFile>, Predicate<SecureJar>, BiPredicate<String,String>, Path...) from the type ModJarMetadata is not visible this::buildMinecraftTOML: The type StructuredModLoader does not define buildMinecraftTOML(IModFile) that is applicable here I just want to add to this method, not entirely rewrite it.
  7. well because it makes it easier for modpack creators to find mods that achieve a specific thing or two or to just be able to see which mod adds content and which one does not and by that definition filter out mods to reduce system load or size You'll probably see the demand for such thing once I upload it to curseforge ¯\_(ツ)_/¯
  8. thank you about the concern with multiple directories but I am talking about modpacks and that I can at least sort out library mods or coremods into their own folder (which I happily did in the minecraft verion folder) Thank you for providing me with the details I need anyway though! I'll consider this thread closed tho I still may have questions so will keep it open!
  9. Simply enough - I want to have a structure in my modfolders and since forge itself commited to not load subfolders anymore and will keep it that way according to previous questions about it I will try to do it myself! EDIT: I already implemented an algorithm that filters out folders containing configurable strings but the config file itself is also not yet documented in forge docs (I found a tutorial here tho: https://forge.gemwire.uk/wiki/Configs)
  10. Hi and first of all thanks in advance! I am currently trying to write a mod for Forge 1.18.1 (and upwards, maybe even backport) that needs to load a mod jarfile from a subfolder and I found the net.minecraftforge.fml.ModLoader package/class which I imported in hopes of being able to just queue the jarfile with this I have found this text when hovering over the ModLoader class: but I can't find any information online on what the # in #loadMods could stand for and or how I would use the class. I am pretty new to java and using eclipse tho I think I found my way around things by now! I have previously programmed in several C derivatives but Java is my first object oriented language. If you could help me find the right ressources and / or tell me how to use ModLoader to load a .jar file (I have the surrounding structure for finding the folder etc. already written) I would really appreciate that! Again, thanks in advance - looking forward to getting help :) ~Chaos_02
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.