Create

Create

86M Downloads

Create Wrench can dupe blocks when sneak+clicked in protected areas

desht opened this issue · 6 comments

commented

Describe the Bug

See FTBTeam/FTB-Mods-Issues#1162 (comment) for a detailed description of what's happening.

In short: if the Create wrench is used to break a block by sneak + right-clicking, in an area where the Forge BlockEvent.PlaceEvent gets cancelled, a dupe will occur. This is due to an interaction between the way the Create wrench works (breaking the block immediately and putting a copy of the item into the player's inventory), and the way Forge handles item use (specifically, firing a block place event later and restoring a block snapshot if the event is cancelled).

This means that in areas protected by FTB Chunks, or any other mod which cancels a block place event, the Create wrench can be used to dupe any block it's able to sneak+right-click.

Reproduction Steps

  1. Claim an area with FTB Chunks, or any other protection mod
  2. Place down any Create block (tested with a Depot)
  3. Sneak + right-click it with a wrench
  4. Repeat until inventory is full of Depots...

Expected Result

No block duping

Screenshots and Videos

No response

Crash Report or Log

No response

Operating System

Any

Mod Version

0.5.1f

Minecraft Version

1.20.1

Forge Version

47.2.30

Other Mods

No crash

Additional Context

No response

commented

Can't reproduce with just Create, FTB Chunks, and their dependencies. Is there a reason this shouldn't be reproducable with standard version of the mods?

Nevermind, ignore me. I just can't read apparently

commented

I got a similar issue too. But I wasn't in a protected area...? I'm assuming its something similar to what you said with the block placement and removal. Are there any solutions yet?

commented

Yea, it’s in the linked pr

commented

Is the code a full fix/patch? If so how do I use it? (tried downloading it and compressing into a .class file to replace the one in the .jar from modrinth)

commented

you wait until it’s merged, then it will be fixed in the next release

commented

ok, thanks!