Attachments are not synced on player creation
Ninguém assumiu esta issue ainda.
Avaliação
Esta issue ainda não foi avaliada.
Descrição
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.
- Linguagem predominante
- Java
- Estrelas
- 181
- Forks
- 41
- Merge médio
- 19d 17h
- PRs com merge (30d)
- 1
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de Sinytra/ForgifiedFabricAPI
-
Fabric mods cannot query `isEyeInFluid`Talvez já em andamento @cassiancc assumiu hoje. Abertabug
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 15/100
Sinytra/ForgifiedFabricAPI#299 ·
-
Missing mixin in fabric-registry-sync-v0 suspected to break modded registry loadingTalvez livre de novo @Su5eD assumiu há 87 dias e não há nenhum pull request aberto. Aberta26.1.x bug
Sinytra/ForgifiedFabricAPI#280 · 6 comentários · 1 responsável ·
-
1.21.x bug
Sinytra/ForgifiedFabricAPI#276 ·
-
1.21.x bug
Sinytra/ForgifiedFabricAPI#269 ·
-
1.21.x bug
Sinytra/ForgifiedFabricAPI#267 ·
Todas as issues de Sinytra/ForgifiedFabricAPI
Issues semelhantes
-
[BUG] S3 CORS responses omit Access-Control-Allow-Credentials for matched originsTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
floci-io/floci#5369 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
sqlcipher/sqlcipher-android#97 · 1 comentário ·
-
area-integrations
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Mantenedores costumam responder em até 1 dia
-
bug IIIF interoperability
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100