AEInfinityBooster

AEInfinityBooster

6M Downloads

[1.20.1] Stacks quantity is become 32 instead of 64 when Dimension Card is inserted.

MPThLee opened this issue · 6 comments

commented

On All The Mods 9, 0.0.49. AE is 15.0.9-beta, AEIB is 1.20.1-1.0.0+20

When shift-click the stack of item, it became 32 per each click. See the video. See also AllTheMods/ATM-9#217

javaw_2023-08-10_22-55-35.mp4
commented

I have this same issue but when I shift+click it only pulls out 16 per item.

commented

the issue is weird but I found it to be about which card you put in

Infinity range = 16 per click
Dimension = 32 per click

commented

I´m not an expert and i could be wrong but looking through the mod it looks like that its intentional by the author
` if (wirelessBlockEntity.getInternalInventory().getStackInSlot(0).is(ModItems.DIMENSION_CARD.get())) {
currentDistanceFromGrid = 32;
cir.setReturnValue(Double.MAX_VALUE / 2);
}

        if (!this.getPlayer().level().dimension().location().toString().equals(wirelessAccessPoint.getLocation().getLevel().dimension().location().toString())) {
            return;
        }

        if (wirelessBlockEntity.getInternalInventory().getStackInSlot(0).is(ModItems.INFINITY_CARD.get())) {
            currentDistanceFromGrid = 16;
            cir.setReturnValue(Double.MAX_VALUE / 2);
        }
    });
}

// Make sure we don't use more power than we should
@Redirect(method = "extractAEPower", at = @At(value = "INVOKE", target = "Ljava/lang/Math;min(DD)D"))
private double testPowerMultiplier(double a, double b) {
    for (var wap : this.targetGrid.getMachines(WirelessAccessPointBlockEntity.class)) {
        if (wap.getInternalInventory().getStackInSlot(0).is(ModItems.INFINITY_CARD.get())) {
            return 16;
        }
        if (wap.getInternalInventory().getStackInSlot(0).is(ModItems.DIMENSION_CARD.get())) {
            return 32;`

it is annoying and it would be nice to have a config for it

commented

The 16 and 32 things are for power consumption and override distance to trick the wireless grid as it is working as intended.
But seems like something went wrong and it broken.

commented

Same problem...
Wonder why this bug has not been fixed after almost 1 month?

commented

This is caused by the following code limiting the energy consumption on every action (like inserting into or extracting from the ME system) instead of just limiting the passive power consumption when the wireless terminal is opened. This causes the ME to think that there is only enough energy stored in the terminal to insert/extract 16/32 items.

// Make sure we don't use more power than we should
@Redirect(method = "extractAEPower", at = @At(value = "INVOKE", target = "Ljava/lang/Math;min(DD)D"))
private double testPowerMultiplier(double a, double b) {
    for (var wap : this.targetGrid.getMachines(WirelessAccessPointBlockEntity.class)) {
        if (wap.getInternalInventory().getStackInSlot(0).is(ModItems.INFINITY_CARD.get())) {
            return 16;
        }
        if (wap.getInternalInventory().getStackInSlot(0).is(ModItems.DIMENSION_CARD.get())) {
            return 32;
        }
    }
    return Math.min(a, b);
}