mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-14 01:04:24 +00:00
Fix onPlaceItemIntoWorld always resetting item stack when in creative mode (#10048)
This commit is contained in:
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();
|
||||
|
||||
Reference in new issue
Block a user