GregTechCEu / GregTech

GregTech CE 1.12 fork continuing progression and development
GNU Lesser General Public License v3.0
228 stars 173 forks source link

Placing an electric tool into an item frame duplicates the power unit #1634

Closed xeals closed 1 year ago

xeals commented 1 year ago

GregTech CEu Version

v2.5.4

Modpack Used

Nomifactory CEu 1.5.2

Addons Installed

No response

Environment

Singleplayer

New Worlds

Yes

Cross-Mod Interaction

No

Expected Behavior

Placing a tool into an item frame only consumes the tool.

Actual Behavior

Placing an electric tool into an item frame places the tool and gives a copy of the power unit (energy tier and charge) of the placed tool.

Steps to Reproduce

  1. give the JEI electric tool (e.g., screwdriver) to the player
  2. place the tool into an item frame
  3. item frame contains the tool and player gets LV power unit with MAX_INT charge
  4. tool can be removed from item frame and used as normal

Additional Information

No response

Caedis commented 1 year ago

Cause:

Placing an item in an item frame causes PlayerDestroyItemEvent to be fired which in turns returns the power unit of the item.