[26.3] BundleItem patch checks the carried stack instead of the bundle, breaking bundle insert/extract
まだ誰も着手していません。
評価
調査の方向性
バグは、パッチ patches/minecraft/net/minecraft/world/item/BundleItem.java.patch の overrideOtherStackedOnMe ハンクにあります。このハンクでは、ガードが self.getCount() ではなく other.getCount() を確認しています。まずそのハンクと、対応するバニラの BundleItem メソッドを読んでください。次に、このリポジトリでパッチがどのように適用され、再生成されるかを確認してください。完了の条件は、1行の修正が適用され、スタックされたカーソルがある状態でのバンドルへの挿入と取り出しがバニラと同じように動作し、クライアントとサーバーの不整合が起きないことです。
索引モデルが issue の本文から書いたものです。
説明
Minecraft Version: 26.3
Forge Version: 66.0.12
Logs: Nothing relevant in the log, there is no error or crash. This is a logic bug in a patch.
Steps to Reproduce:
- Start a Forge 66.0.12 server (dedicated, no other mods needed) and join with a vanilla client.
- Put an empty or partly filled bundle into an inventory slot.
- Pick up a stack of more than one item (e.g. 16 wheat seeds) with the cursor and left click the bundle.
- Alternatively, with an empty cursor, right click a bundle that contains items to take one out.
Expected (vanilla behavior):
- Step 3: the items go into the bundle.
- Step 4: one item is taken out of the bundle onto the cursor.
Actual:
- Step 3: the client plays the insert sound and shows the items in the bundle, but a moment later the server corrects it: the bundle is now on the cursor and the items lie in the slot where the bundle was (plain slot swap).
- Step 4: the whole bundle is picked up instead of one item being taken out.
- Carrying exactly one item works. The other direction (carrying the bundle and clicking an item or an empty slot,
overrideStackedOnOther) works as well.
Description of issue:
patches/minecraft/net/minecraft/world/item/BundleItem.java.patch on the 26.3 branch adds this line to the start of BundleItem#overrideOtherStackedOnMe:
public boolean overrideOtherStackedOnMe(
final ItemStack self, final ItemStack other, final Slot slot, final ClickAction clickAction, final Player player, final SlotAccess carriedItem
) {
+ if (other.getCount() != 1) return false;
other is the stack on the cursor, not the bundle. So whenever the cursor holds more than one item, or is empty (count 0, which is exactly the "take one item out" case), the method returns false and AbstractContainerMenu#doClick falls through to the normal slot click logic. Vanilla clients don't have the patch and predict the bundle interaction, so the result is a visible desync followed by a swap.
The check was originally added in #9457 (f2aeeeb, "Fix forge grindstone hooks allowing stacks of non-stackable items") on the bundle itself, the first parameter. That is still the case up to 1.21.5 (d50a3b5):
public boolean overrideOtherStackedOnMe(ItemStack p_150742_, ItemStack p_150743_, Slot p_150744_, ClickAction p_150745_, Player p_150746_, SlotAccess p_150747_) {
+ if (p_150742_.getCount() != 1) return false;
In the 26.1 update (047e5fe), where the patches moved to the new parameter names, p_150742_ was turned into other instead of self. The line has stayed that way through the 26.3 update (2bc9649).
Suggested fix:
+ if (self.getCount() != 1) return false;
This keeps the original protection against stacked bundles and restores vanilla behavior for normal bundles.
- 主要言語
- Java
- スター
- 7.8k
- フォーク
- 2.8k
- 平均マージ
- 2日 10時間
- マージ済み PR(30日)
- 5
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
MinecraftForge/MinecraftForge のほかの issue
-
Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
MinecraftForge/MinecraftForge#10518 · コメント 2 件 ·
-
Shrink add onオープン
難易度 4/5 3〜5日 初心者へのやさしさ 15/100
MinecraftForge/MinecraftForge#10901 ·
-
Triage
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
MinecraftForge/MinecraftForge#10861 · コメント 9 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
MinecraftForge/MinecraftForge#10830 ·
-
Triage
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
MinecraftForge/MinecraftForge#10743 · コメント 1 件 ·
MinecraftForge/MinecraftForge の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
scylladb/scylla-cdc-source-connector#350 ·
メンテナーはふだん 1 日以内に返信
-
agent:working documentation enhancement go:build lane:needs-decision
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Sanne/incus-spawn#1435 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
area:shuffle bug priority:high requires-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
apache/datafusion-comet#7062 ·
メンテナーはふだん 1 日以内に返信
-
wait for review
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
enhancement good first issue up-for-grabs
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
AnikethTS/ChangeRadar#22 ·
メンテナーはふだん 1 日以内に返信