Skip to content

player.sendBlockChange( Location, BlockData ) & player.sendBlockChanges( Collection<BlockState> ) produce different client-side results. #10010

Description

@tye-exe

Expected behavior

The block states / data sent to the client to match the values passed into the method, no matter which one i use.

Initial world state:
image

Successful block changes sent with player.sendBlockChange() or player.sendBlockChanges():
image

Successful reverting the block changes sent with player.sendBlockChange() or player.sendBlockChanges():
image

Observed/Actual behavior

The block states sent to the client didn't match the states I passed into the method.

Initial world state:
image

Successful block changes were initially sent with player.sendBlockChanges():
image

Garbled block states were sent to the client with player.sendBlockChanges():
image

However, if player.sendBlockChange() is used while iterating over the collection, the correct block data is sent to the client:
image

Steps/models to reproduce

This code snippet is run & performs as intended to produce the first changes:

//List of blockStates to set to red_stained_glass.
List<BlockState> nearbyOutlines = member.getNearbyClaimOutlines(selectionRenderRadius);

//Sets all the block states to red_stained_glass.
for (int i = 0; i < nearbyOutlines.size(); i++) {
  BlockState state = nearbyOutlines.get(i);
  state.setType(Material.RED_STAINED_GLASS);
  nearbyOutlines.set(i, state);
}

player.sendBlockChanges(nearbyOutlines);

Running this code snippet after I've run the first one (I've only tested this with a long delay between the two), where I don't change the state from that of the default world, leads to garbled block states being sent.

//List of blockStates to set to revert.
List<BlockState> nearbyOutlines = member.getNearbyClaimOutlines(selectionRenderRadius);

player.sendBlockChanges(nearbyOutlines);

Plugin and Datapack List

Running slash plugins produces this result:
FastAsyncWorldEdit, Mine, spark, SpawnFix

The links are to downloads for each plugin.
Running slash datapack list produces this result:
There are 3 data pack(s) enabled: [vanilla (built-in)], [file/bukkit (world)], [file/Origins-GenesisMC[0_2_2] (world)]

The [file/Origins-GenesisMC[0_2_2] datapack is a reminant from (genesisMC)[https://modrinth.com/plugin/genesismc/version/mc1.20-v0.2.2]

Paper version

> version
[17:14:08 INFO]: Checking version, please wait...
[17:14:08 INFO]: This server is running Paper version git-Paper-318 (MC: 1.20.2) (Implementing API version 1.20.2-R0.1-SNAPSHOT) (Git: 9271ee7)
You are running the latest version
Previous version: git-Paper-299 (MC: 1.20.2)

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    resolution: awaiting responseAdditional information is required from the issue reportertype: bugSomething doesn't work as it was intended to.

    Type

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions