Hexeption / AEInfinityBooster

https://www.curseforge.com/minecraft/mc-mods/aeinfinitybooster
GNU Lesser General Public License v3.0
3 stars 12 forks source link

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

Closed MPThLee closed 8 months ago

MPThLee commented 11 months ago

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

https://github.com/Hexeption/AEInfinityBooster/assets/26970092/e9afc590-b9bd-4a0a-abeb-ee936be569dd

unejamzezak commented 11 months ago

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

7Kav commented 10 months ago

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

DrPinguin98 commented 10 months ago

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

AzuluTheShnepsky commented 10 months ago

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

MPThLee commented 10 months ago

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.

Ambossmann commented 10 months ago

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);
}