Attachments are not synced on player creation
まだ誰も着手していません。
評価
この issue はまだ評価されていません。
説明
Minecraft version
1.21.1
Describe the bug
When a new player is created, e.g. upon join, dimension change, or respawn, attachments are not synced. Attachments do sync properly when setAttached/removeAttached is called.
Steps to reproduce
- Create a fabric mod with the following mod initializer
@SuppressWarnings("UnstableApiUsage")
public class BugDemo implements ModInitializer {
public static final String MOD_ID = "bugdemo";
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
public static final AttachmentType<Unit> TEST = AttachmentRegistry.create(ResourceLocation.fromNamespaceAndPath(MOD_ID, "test"), builder -> builder
.persistent(Unit.CODEC)
.syncWith(StreamCodec.unit(Unit.INSTANCE), AttachmentSyncPredicate.targetOnly())
.copyOnDeath()
);
@Override
public void onInitialize() {
UseItemCallback.EVENT.register((player, world, hand) -> {
var stack = player.getItemInHand(hand);
if (stack.is(Items.BLAZE_ROD)) {
if (world.isClientSide()) return InteractionResultHolder.success(stack);
player.setAttached(TEST, Unit.INSTANCE);
return InteractionResultHolder.success(stack);
}
if (stack.is(Items.STICK)) {
LOGGER.info(
"{} {} attachment",
world.isClientSide() ? "client" : "server",
player.hasAttached(TEST) ? "has" : "does not have"
);
return InteractionResultHolder.success(stack);
}
return InteractionResultHolder.pass(stack);
});
}
}
- Run the mod on fabric.
- Use the blaze rod to set the attachment.
- Recreate the player by relogging, respawning, or changing dimensions.
- Use the stick. The log will show
[17:06:29] [Render thread/INFO] (bugdemo) client has attachment
[17:06:29] [Server thread/INFO] (bugdemo) server has attachment
- Run the mod on neoforge with connector & ffapi.
- Repeat steps 3-5. The log will show
[17:13:56] [Render thread/INFO] [bugdemo/]: client does not have attachment
[17:13:56] [Server thread/INFO] [bugdemo/]: server has attachment
- Use the blaze rod to re-set the attachment, then use the stick. The log will show
[17:18:53] [Render thread/INFO] [bugdemo/]: client has attachment
[17:18:53] [Server thread/INFO] [bugdemo/]: server has attachment
The expected behavior is that when the player is recreated, the server and client will both see the attachment.
Logs
No response
Additional context
Possibly related to FFAPI 2.2.0 using neoforge api for attachment sync.
- 主要言語
- Java
- スター
- 181
- フォーク
- 41
- 平均マージ
- 19日 17時間
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Sinytra/ForgifiedFabricAPI のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
Sinytra/ForgifiedFabricAPI#298 ·
-
Missing mixin in fabric-registry-sync-v0 suspected to break modded registry loading再び着手できるかも @Su5eD が 86 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン26.1.x bug
Sinytra/ForgifiedFabricAPI#280 · コメント 6 件 · 担当者 1 名 ·
-
1.21.x bug
Sinytra/ForgifiedFabricAPI#276 ·
-
1.21.x bug
Sinytra/ForgifiedFabricAPI#269 ·
-
1.21.x bug
Sinytra/ForgifiedFabricAPI#267 ·
Sinytra/ForgifiedFabricAPI の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Netcracker/qubership-integration-platform#1046 ·
メンテナーはふだん 2 日以内に返信
-
`check_java_version()` fails when Java path contains spaces (Windows / Git Bash, `C:\Program Files`)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
Fix Math.ceilDiv wrong result for exact positive divisions対応中かも @pamod-madubashana が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
scala-native/scala-native#5094 ·
メンテナーはふだん 1 日以内に返信
-
[Bug] AI unread message badge counts a batch of new bubbles as one message対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
apache/rocketmq-dashboard#5784 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
PCL-Community/PCL-CE#3658 ·
メンテナーはふだん 1 日以内に返信