Equivalent Exchange 3

Equivalent Exchange 3

2M Downloads

EMC values for enchantments

BigXplosion opened this issue ยท 11 comments

commented

I'm wondering if it is possible to take the enchantments into account for the tools? Best way to do this is probably calculating an extra EMC value on top of the original one with the use of the enchantment weight and level. Maybe something like this:

public int getAdditionEnchantmentEMC(ItemStack stack) {
        int result = 0;

        Map<Integer, Integer> enchantments = EnchantmentHelper.getEnchantments(stack);

        if (!enchantments.isEmpty())
        {
            for (Map.Entry<Integer, Integer> entry : enchantments.entrySet())
            {
                Enchantment enchantment = Enchantment.enchantmentsList[entry.getKey()];

                if (enchantment.getWeight() == 0)
                {
                    continue;
                }

                result += 5000 / enchantment.getWeight() * entry.getValue();
            }
        }

        return result;
}

If this would be added I would say to not make the enchanted item learnable (if this isn't already the case)

commented

I don't know if fits the theme of the mod all that well. Enchantments are not exactly matter. Regardless it seems that you have some working knowledge in java, you're more than welcome to make a pull request. It's up to Pahimar to accept it though.

commented

i wanted to ask first before PRing it in

commented

This would definitely be possible, but not sure about how I feel about it. Currently (because you can set EMC values for items that have NBT data) you could set a value on an enchanted item. However, that is per item. This idea would support EMC values per enchantment.

Open to discussion on this.

commented

Great idea! There is defenitly time and effort put into enchants so you should get more out of it AND pay more for creating them

commented

I would be in support of this. Reasons being that, as Bitterholz said, to get enchants (in a vanilla environment anyways) you need to invest the time and effort, and lore-wise, enchants can be considered as additional energy imbued into the item.

commented

ProjectE does this in a way, so I guess it was also part of EE2?

It's a fixed amount of emc for the level of the enchantment, I think.

It caused some problems in the past, though.

commented

As far as I know, no, this was not a part of EE2.

commented

I don't know for sure. It was part of ProjectE since forever and was included in the code MozeIntel wrote.

I have to correct myself: The part that caused the real problems was the "Reduce amount of emc for damaged tools" and not the enchantment bonus.

commented

@Bitterholz, that was the exact idea I had when I made this issue! I needed it for a mod I was making back then although it's put on hold now :D

commented

Late to the party, but I think it goes against the spirit of the mod. EMC Values for entities, I can get behind. Items, duh. Blocks yes. Enchantments, bit nebulous. I could use some convincing.

I've been doing some thinking and I've really come around on this. I'm not sure what it is about it, but I realize now that we could do something pretty fun with this.

Edit: To be honest, I like the idea of EE3 breaking the conventions of tools/enchantments altogether. I'd like to see people doing more with alchemy. But that's just my two cents.

commented

One of my thoughts on this over the past day or so is a little incoherent, but I'm going to suss it out and share it with Pahimar and hope he likes it.