Nuclear Control 2

Nuclear Control 2

6M Downloads

Bad Energy sensor card given when using the Energy Sensor Kit On MFSU or MFE

bahakc opened this issue ยท 3 comments

commented

With Thermal Expansion installed, using the Energy Sensor Kit on Energy devices like the MFSU or the MFE, the RF Energy Sensor Location card is given instead of the standard Energy Sensor Location card.
Probably the same issue with other IC2 energy storage devices which i didn't try.

Placing the RF Energy Sensor Location card (linked to the MFSU or MFE) into an industrial information panel will lead to a "Target Not Found" message.

Versions used :

  • Minecraft 1.7.10
  • Forge 1.7.10-10.13.4.1614-1.7.10
  • industrialcraft-2-2.2.822-experimental
  • IC2NuclearControl-2.4.1a
  • MicdoodleCore-1.7-3.0.12.375
  • ThermalFoundation-[1.7.10]1.2.5-115
  • ThermalExpansion-[1.7.10]4.1.3-246

To reproduce the problem :

  1. Install IC2 Experimental, ThermalExpansion and NuclearControl mods.
  2. In creative mode, place a MFSU device.
  3. Place an Industrial Information Panel with redstone torch to power it.
  4. Use an Energy Sensor Kit on the MFSU.
  5. Place the obtained RF Energy Sensor Location card into the Industrial Information Panel.
  6. Target Not Found should be displayed.

Also note that using the Energy Sensor Kit on EnergyCounter devices crashes the game.

After my investigation, i found the following code has been reworked lately :
Nuclear-Control-master\src\main\java\shedar\mods\ic2\nuclearcontrol\items\ItemKitEnergySensor.java
At Line 35 :
else if (Loader.isModLoaded(ModLib.TE) || storageData.type
== EnergyStorageData.TARGET_TYPE_RF) {
return new ItemStack(CrossTE.RFSensorCard);
}

The OR logical operand seems to explain the problem.
After looking at the file history, if found that in earlier builds, the EnergyStorageData type (TARGET_TYPE_RF) was checked before the presence of ThermalExpansion (Loader.isModLoaded(ModLib.TE)) which is no longer the case in v2.4.1a

So, knowing that, I made a test on my computer by replacing the OR condition by and AND :
else if (Loader.isModLoaded(ModLib.TE) && storageData.type == EnergyStorageData.TARGET_TYPE_RF) {
return new ItemStack(CrossTE.RFSensorCard);
}

Recompile the lib, install.

Then using the EnergyKit on the MFSU gives me an Energy Sensor Location card like old time and work as expected in the Industrial Information Panel.

I dunno if that change is sufficient to fix the lib cause of Mekanism integration (which i don't have) but
the minor change above solves my problem for EnergySensorKit when ThermalExpansion is installed.

I hope my investigation help you in an incoming fix.

commented

It shouldn't be TE-only anyway, so I'll just knock off that part of the code.

commented

Excellent.
Thank you for the fast response and for the nice mod work ๐Ÿ‘

commented

I get paid big bucks for this.

(not really)