Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[26.3] BundleItem patch checks the carried stack instead of the bundle, breaking bundle insert/extract

オープン 初心者向け
#10,902 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
75/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
java
領域
game-dev

調査の方向性

バグは、パッチ patches/minecraft/net/minecraft/world/item/BundleItem.java.patch の overrideOtherStackedOnMe ハンクにあります。このハンクでは、ガードが self.getCount() ではなく other.getCount() を確認しています。まずそのハンクと、対応するバニラの BundleItem メソッドを読んでください。次に、このリポジトリでパッチがどのように適用され、再生成されるかを確認してください。完了の条件は、1行の修正が適用され、スタックされたカーソルがある状態でのバンドルへの挿入と取り出しがバニラと同じように動作し、クライアントとサーバーの不整合が起きないことです。

索引モデルが issue の本文から書いたものです。

説明

Triage

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:

  1. Start a Forge 66.0.12 server (dedicated, no other mods needed) and join with a vanilla client.
  2. Put an empty or partly filled bundle into an inventory slot.
  3. Pick up a stack of more than one item (e.g. 16 wheat seeds) with the cursor and left click the bundle.
  4. 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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

MinecraftForge/MinecraftForge のほかの issue

MinecraftForge/MinecraftForge の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。