Attachments are not synced on player creation
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 38/100
Direzione di ricerca
The issue includes a Fabric mod initializer and attachment setup, but names no ForgifiedFabricAPI source files or tests. Start by tracing attachment synchronization during player creation and compare it with the working setAttached/removeAttached path. Done means the client receives the attachment after join, respawn, and dimension changes on NeoForge with Connector and FFAPI.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Java
- Stelle
- 181
- Fork
- 41
- Merge medio
- 10g 5h
- PR unite (30g)
- 2
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Sinytra/ForgifiedFabricAPI
-
Missing mixin in fabric-registry-sync-v0 suspected to break modded registry loadingForse di nuovo libera @Su5eD l’ha presa 92 giorni fa e non c’è nessuna pull request aperta. Aperta26.1.x bug
Sinytra/ForgifiedFabricAPI#280 · 6 commenti · 1 assegnatario ·
-
1.21.x bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
Sinytra/ForgifiedFabricAPI#276 ·
-
1.21.x bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
Sinytra/ForgifiedFabricAPI#269 ·
-
1.21.x bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 53/100
Sinytra/ForgifiedFabricAPI#267 ·
-
1.21.x bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
Sinytra/ForgifiedFabricAPI#265 · 6 commenti ·
Tutte le issue di Sinytra/ForgifiedFabricAPI
Issue simili
-
RRateLimiter acquire methods accept negative permits and raise available permits above the rate.Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 4 giorni
-
README 中的代码语言数量与当前目录不一致Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
krahets/hello-algo#1993 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
NationalSecurityAgency/ghidra#9884 ·
I maintainer di solito rispondono entro 2 giorni
-
Status: Pending Review Type: Feature Request
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
OpenRefine/OpenRefine#8019 ·
I maintainer di solito rispondono entro 1 giorno
-
`timer` rule rejects dates the engine acceptsForse già presa @MFA-G l’ha presa oggi. Apertabug ready
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
camunda/bpmnlint-plugin-camunda-compat#281 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno