Jump to content

HariboTer

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by HariboTer

  1. I want do prevent some inter-mod recipes to show up when their respective mod is missing, so I created this json-file (assets/moaroresreforged/recipes/_factories.json): { "conditions": { "spartanshields_installed": "moaroresreforged.compatibility.TestConditionFactory" } } And this class: package main.java.moaroresreforged.compatibility; import java.util.function.BooleanSupplier; import com.google.gson.JsonObject; import net.minecraftforge.common.crafting.IConditionFactory; import net.minecraftforge.common.crafting.JsonContext; import net.minecraftforge.fml.common.Loader; public class TestConditionFactory implements IConditionFactory { @Override public BooleanSupplier parse(JsonContext context, JsonObject json) { return () -> Loader.isModLoaded("spartanshields"); } } ... and it crashes terribly upon loading. I've tried adding "main.java" or variations of it to the class path without avail. The corresponding crash log: There is probably some embarassingly trivial mistake hiding somewhere around there, but I'm totally not seeing it and clueless at the moment about what else to do. A hint as to what I'm doing wrong here would be very welcome ?
  2. Rummaging around the MissingMappings code I found that getMappings() filters the mappings for only those whose mod ID matches the mod for which the event is called, which were empty due to the different mod ID. getAllMappings() does not perform this filtration, thus replacing getMappings() with getAllMappings() in both cases solved the issue ?
  3. Thanks for your input. You should know though that the itemMap and the blockMap contain the registered and valid current items/blocks, keyed by their old names, which are not changed by the remapping because they are the target, not the source. So unfortunately your proposal doesn't fix the problem.
  4. For private uses I've rewritten the MoarOres mod. Because it was not conforming to the conventional naming scheme (e.g. it was "SteelSword" instead of "steel_sword") I renamed everything properly and process the appropriate MissingMappings events to not break old worlds, which after some troubleshooting worked fine. Then due to the amount of changes made, I found it adequate to change the mod id from "moarores" to "moaroresreforged". It's no trouble for new worlds, but for some odd reason it seems the MissingMappings stopped working. Or rather: The MissingMappings handling *still works*, but Forge now rejects it. The code is (the methods are called from the main class which is listening for those events) And the output that gets produced (I reduced the listings to one block and one item each in favor of readability): It's worth noting that the printing "Couldn't remap ..." is *not* made, so the remapping worked, but forge doesn't like it. How can I tell forge to accept the change?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.