age-series / ElectricalAge

Electrical Age (ELN) is a Minecraft Mod offering the ability to perform large-scale in-game electrical simulations.
Other
65 stars 30 forks source link

Other mod are compatible with coal dust #297

Open ziyanyaolong opened 9 months ago

ziyanyaolong commented 9 months ago

(The following is translated by machine)

Tested version:1.20.x, 1.21.x

I was playing this mod recently and found an issue, I don't know if it's a bug.

When I add coal dust to the resistor's slot, only a portion of the mod's coal dust can be added to this slot(such as EnderIO), so I read the code, and make the following changes:

In ElectricalAge-1.20.x\src\main\java\mods\eln\gui\ItemStackFilter.java, line: 50:

@Override
public boolean tryItemStack(ItemStack itemStack) {
    if (Utils.getItemId(itemStack) != itemId)
        return false;
    if ((itemStack.getItemDamage() & damageMask) != damageValue)
        return false;
    return true;
}

Change to:

@Override
public boolean tryItemStack(ItemStack itemStack) {
    if (Utils.getItemId(itemStack) != itemId)
        return false;
    if (itemStack.getItemDamage() != damageValue)
        return false;
    return true;
}

After this change, it is possible to identify other mods' coal dust. Here is the test plot: GT5 (Cannot add): 111 EnderIO (Can add): 222

TheNicolasDeveloper commented 8 months ago

You should make a pull request for this.

ziyanyaolong commented 8 months ago

You should make a pull request for this.

I haven't sent a pull request to anyone's project yet, but I thought I'd give it a try.

jrddunbr commented 7 months ago

I looked at the PR and I'm not sure it's the right solution, but if someone wants to build it for themselves and use that I have no problem with that.