Posted May 8, 201312 yr I found the following class within OreDictionary public static class OreRegisterEvent extends Event { public final String Name; public final ItemStack Ore; public OreRegisterEvent(String name, ItemStack ore) { this.Name = name; this.Ore = ore; } } and above this method is the forge event bus invoker private static void registerOre(String name, int id, ItemStack ore) { ArrayList<ItemStack> ores = getOres(id); ore = ore.copy(); ores.add(ore); MinecraftForge.EVENT_BUS.post(new OreRegisterEvent(name, ore)); } I have my ForgeEvents class setup to receive these events and have successfully received other events but not this one public class ForgeEvents { @ForgeSubscribe public void DropEvent(LivingDropsEvent e) { //working event snipped for less spam code } @ForgeSubscribe public void oreRegistrationEvent(OreRegisterEvent e) { Log.log("Recieved oreRegistrationEvent"); if (e.Name.toLowerCase().contains("ore")) { addOre(e.Name); } } } and in my preInit method I have MinecraftForge.EVENT_BUS.register(new ForgeEvents()); is there a reason why I am not receiving this particular event?
May 8, 201312 yr because ore events use MinecraftForge.ORE_BUS (or something like that) to register the ore events..
May 8, 201312 yr MinecraftForge.EVENT_BUS.post(new OreRegisterEvent(name, ore)); No.. no it doesn't. That should work fine as long as a ore is registered. I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
May 8, 201312 yr Author Oh wait it is working but due to my listener being registered after vanilla registration it doesn't invoke my method for vanilla ores anyway to register my event before objects start getting registed?
May 9, 201312 yr MinecraftForge.EVENT_BUS.post(new OreRegisterEvent(name, ore)); No.. no it doesn't. That should work fine as long as a ore is registered. erm ok, anyways did u registred the event on the @PreInit? if not try that
May 9, 201312 yr Oh wait it is working but due to my listener being registered after vanilla registration it doesn't invoke my method for vanilla ores anyway to register my event before objects start getting registed? No But you do have access to get all currently registered ores You dont need a damn event for that. I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
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.