Ex Compressum

Ex Compressum

22M Downloads

How do I add compressed hammer/sieve recipes? (not with the config) 1.7.10

RCXcrafter opened this issue ยท 3 comments

commented

I'm working on a mod that adds compressed blocks and I would like to add compatibility for ex compressum. So I was looking around your source code and I can't seem to find a way to add recipes to the compressed hammer/sieve from an external mod.
If there isn't currently a way to add recipes, could you add that? (unless you're no longer updating the 1.7.10 branch)

commented

The 1.7.10 branch is indeed no longer receiving new features, and it didn't have a public API (and the code wasn't the nicest as I followed Ex Nihilo's lead). A quick look suggests adding support will be a pain as you'd have to use Reflection to access the private methods. I'll add an API on the 1.11 version for the future.

commented
commented

So it turns out I didn't have to use reflection, here's what I did for anyone who wants to know.

CompressedHammerRegistry.getSmashables().put(new ItemAndMetadata(Blocks.grass, 0), new Smashable(Blocks.grass, 0, Items.apple, 0, 1.5F, 4.2F));

HeavySieveRegistry.getSiftables().put(new ItemAndMetadata(Blocks.grass, 0), new SiftingResult(Items.apple, 0, 0.4F));

These are of course just example recipes.