Mod causing crash upon launch
sicklyFoxJay opened this issue · 9 comments
latest.log
AE Infinity Booster crashes on start up with ae2 installed. It seems to be running into an error due to the injection method of MixinWirelessTerminalHost.java . This is on forge v47.1.0. Not sure if the issue has to do with ae2 itself and the mixin file error is a byproduct, or if the mixin file error is the only issue, but ae2, with it's dependencies, seems to work fine. I've included my log file for the crash.
Yes. Sorry testWap
testWap i presume would mean test wireless access point, as that is what some of the items of the mod interact with.
but from what i can tell, ae2 may have changed the way wireless access points work coding wise, as i couldn't find testwap within their code on github. i could only find mywap as an identifier.
The files
aeifinitybooster.mixins.MixinWirelessTerminalMenuHost.java and appeng.helpers.WirelessTerminalMenuHost.java cannot communicate with each other because it is not testWap but bestWap.
It's just a typo.
appeng.helpers.WirelessTerminalMenuHost.java [Applied-Energistics-2]
public boolean rangeCheck() {
this.currentDistanceFromGrid = Double.MAX_VALUE;
if (this.targetGrid != null) {
@Nullable
IWirelessAccessPoint bestWap = null;
double bestSqDistance = Double.MAX_VALUE;
// Find closest WAP
for (var wap : this.targetGrid.getMachines(WirelessAccessPointBlockEntity.class)) {
double sqDistance = getWapSqDistance(wap);
// If the WAP is not suitable then MAX_VALUE will be returned and the check will fail
if (sqDistance < bestSqDistance) {
bestSqDistance = sqDistance;
bestWap = wap;
}
}
// If no WAP is found this will work too
this.myWap = bestWap;
this.currentDistanceFromGrid = Math.sqrt(bestSqDistance);
return this.myWap != null;
}
return false;
instead of
aeifinitybooster.mixins.MixinWirelessTerminalMenuHost.java AEInfinityBooster
@Mixin(value = WirelessTerminalMenuHost.class, remap = false)
public class MixinWirelessTerminalMenuHost extends ItemMenuHost {
@Shadow
private double currentDistanceFromGrid;
public MixinWirelessTerminalMenuHost(Player player, int slot, ItemStack itemStack) {
super(player, slot, itemStack);
}
@Inject(method = "testWap", at = @At("HEAD"), cancellable = true)
private void testWap(IWirelessAccessPoint wirelessAccessPoint, CallbackInfoReturnable<Boolean> cir) {
wirelessAccessPoint.getGrid().getMachines(WirelessAccessPointBlockEntity.class).forEach(wirelessBlockEntity -> {
if (wirelessBlockEntity.getInternalInventory().getStackInSlot(0).is(ModItems.DIMENSION_CARD.get())) {
currentDistanceFromGrid = 32;
cir.setReturnValue(true);
}
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(true);
}
});
}
}
thank you very much ErythroCraft. this was alot of help