Fix onPlaceItemIntoWorld always resetting item stack when in creative mode (#10048)

This commit is contained in:
Martijn van den Brand authored and GitHub committed 2024-07-18 13:03:23 -07:00
1 parent 845f315c47
commit 0554de0251
1 file changed
+2 -3
@@ -474,7 +474,7 @@ public final class ForgeHooks {
level.captureBlockSnapshots = false;
if (ret.consumesAction()) {
var postUse = itemstack.copy();
var postUse = player.getItemInHand(context.getHand());
var blockSnapshots = new ArrayList<>(level.capturedBlockSnapshots);
level.capturedBlockSnapshots.clear();
@@ -500,8 +500,7 @@ public final class ForgeHooks {
}
} else {
// Change the stack to its new content
if (!player.isCreative())
player.setItemInHand(context.getHand(), postUse);
player.setItemInHand(context.getHand(), postUse);
for (BlockSnapshot snap : blockSnapshots) {
int updateFlag = snap.getFlag();