buttilda / Another-One-Bites-the-Dust

Process ALL the ores!
http://minecraft.curseforge.com/mc-mods/221863-another-one-bites-the-dust
24 stars 21 forks source link

RotaryCraft compatability (Extractor and Grinder) #46

Closed SisterJacq closed 9 years ago

SisterJacq commented 9 years ago

I was trying out the manual config to add ores to the Extractor today, but I thought, "Hey, as Reika recently (in v5) added an API for the Extractor, this seems like a job for AOBD," and as such, am suggesting it. :P

buttilda commented 9 years ago

Hey @ReikaKalseki would you be okay with this?

In case you aren't familiar: AOBD finds ores dynamically and makes those ores processable on several mods that I add support to. So basically this would make any ore added by any mod processable by your machines.

ReikaKalseki commented 9 years ago

As long as the API is used properly (i.e. all ores are registered appropriately - e.g. "banded iron" is iron, not tin, and ore rarities are specified accurately), and nothing conflicts with my native handling here and here, this should be fine.

You can add ores as native ores too, using this: https://github.com/ReikaKalseki/RotaryCraft/blob/master/API/ExtractAPI.java#L42

buttilda commented 9 years ago

AOBD would just add ores that are not already supported by your mod, so it shouldn't override any pre-existing behaviour.

ReikaKalseki commented 9 years ago

I was just thinking of cases like AOBD trying to add ores like Certus Quartz which it did not realize I supported, or new versions of existing ores.

buttilda commented 9 years ago

It would only support ores that have an item named ingotX and a ore named oreX (ingotCopper and oreCopper for example) in the ore dictionary, so that excludes gems, quartz and etc.

ReikaKalseki commented 9 years ago

I already support many, many metals, including copper, tin, silver, nickel, iridium, chromite, uranium, cobalt, ardite, osmium, zinc, cadmium, and 30+ others.

buttilda commented 9 years ago

That's a lot XD AOBD would, though, make sure that any metal you happened to miss would be supported (Metallurgy metals, or really any metals anyone decides to make)

buttilda commented 9 years ago

Hey @ReikaKalseki, having some problems using your API. I understood it fine, but it's not working as I believe is intended. Where can we discuss this? Is here fine or should I contact you somewhere else?

ReikaKalseki commented 9 years ago

Here is fine. What exactly is not working (and is there a stacktrace being generated)?

buttilda commented 9 years ago

Well firstly, not sure if this is a dev environment issue only, but I can't run your mod unless BloodMagic is also running. Something to do with the teleposer.

The ExtractAPI is having some issues. https://github.com/ReikaKalseki/RotaryCraft/blob/master/API/ExtractAPI.java

Calling : ExtractAPI.addCustomExtractEntry(...) throws a null pointer exception at line 64. This is due to the field "product" being null

buttilda commented 9 years ago

"product" is null because an exception is thrown when the API is being initiated (in that static block you have at the bottom of the class)

The log says: [15:52:01] [Client thread/INFO] [FML/aobd]: Could not load Extracts API!

buttilda commented 9 years ago

The game still loads but no recipe is added.

Through reflection I was able to set the necessary fields (bypassing the failed static init) which worked! The items are created just like expected but the NEI recipe viewing for them doesn't work (either that or the recipe is not actually being added)

buttilda commented 9 years ago

Another problem I noticed is that the items created are not registered in the ore dictionary, I created a recipe that has an ingot as output and that ingot wasn't registered anywhere (and therefore was useless)

ReikaKalseki commented 9 years ago

The "product" field was null because it is an internal class. I will fix this.

As for the teleposer issue, my @Strippable does not run in the dev environment, so you will need to either add the Blood Magic API (including the new TeleposeEvent) or add BM itself.

Finally, as for the OreDict, that would be because this system was designed for things not in the oreDict. I might be able to fix it.

ReikaKalseki commented 9 years ago

Done.

buttilda commented 9 years ago

If you want I can add the ingot myself to the ore dictionary? I wasn't sure if this would cause issues with your mod.

Oh and there's something else... The metal colours, they are final fields, any chance you change that? AOBD defines the item colours just before the server starts, far too late for items to be created. I solved it for now by using reflection again.

What about the recipes not showing in NEI?

ReikaKalseki commented 9 years ago

I already handled the OreDict support; as for the color, go ahead and reflect if you want; I would rather not un-final the field because of the tampering possibility.

As for NEI, that would be because the Extractor handler does not normally load this registry, as far as I know. I will look into it, but I am working on CC renders at the moment.

ReikaKalseki commented 9 years ago

The NEI handler has been rewritten and now includes the custom-added ores.

buttilda commented 9 years ago

Awesome. Thank you :)

ReikaKalseki commented 9 years ago

It should also be faster, though FPS matters rather less in a GUI. :P

Hash-0 commented 9 years ago

Hi!

When I am using AOBD-2.6.0 together with RotaryCraft 1.7.10 V6f and DragonAPI 1.7.10 V6f, the extractor is not able to process any of the non-vanilla ores (certus quartz, silicon, tin etc)

Checking the logs i found this exception: [03/5/2015 06:04:42 AM] [Client thread/INFO] [FML]: Could not load Extracts API! [03/5/2015 06:04:42 AM] [06:04:42] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: java.lang.NoSuchFieldException: modOres [03/5/2015 06:04:42 AM] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at java.lang.Class.getDeclaredField(Unknown Source) [03/5/2015 06:04:42 AM] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at Reika.RotaryCraft.API.ExtractAPI.(ExtractAPI.java:98) [03/5/2015 06:04:42 AM] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at ganymedes01.aobd.recipes.modules.RotaryCraft.initOre(RotaryCraft.java:28) [03/5/2015 06:04:42 AM] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at ganymedes01.aobd.recipes.RecipesModule.init(RecipesModule.java:37) [03/5/2015 06:04:42 AM] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at ganymedes01.aobd.recipes.ModulesHandler.init(ModulesHandler.java:31) [03/5/2015 06:04:42 AM] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at ganymedes01.aobd.AOBD.init(AOBD.java:73)

buttilda commented 9 years ago

@ReikaKalseki I think that's something broken inside RotaryCraft, all I'm doing in the line the error points at is call the ExtractAPI.addCustomExtractEntry method

ReikaKalseki commented 9 years ago

Fixed for v7.