Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.20.10 broke something #216

Closed
dadodasyra opened this issue Jul 12, 2023 · 9 comments
Closed

1.20.10 broke something #216

dadodasyra opened this issue Jul 12, 2023 · 9 comments
Labels
client-sided bug A bug in the Bedrock Edition client

Comments

@dadodasyra
Copy link
Contributor

Seems like nothing is happening, the chest pops out put not the UI..

@alvin0319
Copy link

if(!$sender instanceof Player) return;
			$pk = UpdateBlockPacket::create(
				BlockPosition::fromVector3($pos = $sender->getPosition()->add(0, 5, 0)),
				TypeConverter::getInstance()->getBlockTranslator()->internalIdToNetworkId(VanillaBlocks::CHEST()->getStateId()),
				UpdateBlockPacket::FLAG_NETWORK,
				UpdateBlockPacket::DATA_LAYER_NORMAL
			);
			$sender->getNetworkSession()->sendDataPacket($pk);
			$sender->getNetworkSession()->sendDataPacket(
				UpdateBlockPacket::create(
					BlockPosition::fromVector3($pos->add(1, 0, 0)),
					TypeConverter::getInstance()->getBlockTranslator()->internalIdToNetworkId(VanillaBlocks::CHEST()->getStateId()),
					UpdateBlockPacket::FLAG_NETWORK,
					UpdateBlockPacket::DATA_LAYER_NORMAL
				)
			);
			$sender->getNetworkSession()->sendDataPacket(
				BlockActorDataPacket::create(
					BlockPosition::fromVector3($pos),
					new CacheableNbt(CompoundTag::create()
						->setString(Tile::TAG_ID, "Chest")
						->setInt(Tile::TAG_X, $pos->getFloorX())
						->setInt(Tile::TAG_Y, $pos->getFloorY())
						->setInt(Tile::TAG_Z, $pos->getFloorZ())
						->setString(Chest::TAG_CUSTOM_NAME, "TEST")
						->setInt(Chest::TAG_PAIRX, $pos->getFloorX() + 1)
						->setInt(Chest::TAG_PAIRZ, $pos->getFloorZ())
					)
				)
			);
			$sender->getNetworkSession()->sendDataPacket(
				BlockActorDataPacket::create(
					BlockPosition::fromVector3($pos->add(1, 0, 0)),
					new CacheableNbt(CompoundTag::create()
						->setString(Tile::TAG_ID, "Chest")
						->setInt(Tile::TAG_X, $pos->getFloorX() + 1)
						->setInt(Tile::TAG_Y, $pos->getFloorY())
						->setInt(Tile::TAG_Z, $pos->getFloorZ())
						->setString(Chest::TAG_CUSTOM_NAME, "TEST")
						->setInt(Chest::TAG_PAIRX, $pos->getFloorX())
						->setInt(Chest::TAG_PAIRZ, $pos->getFloorZ())
					)
				)
			);
			$this->getScheduler()->scheduleDelayedTask(new ClosureTask(function() use ($sender, $pos) : void{
				$sender->getNetworkSession()->sendDataPacket(
					ContainerOpenPacket::blockInv(
						1,
						WindowTypes::CONTAINER,
						BlockPosition::fromVector3($pos),
					)
				);
			}), 10);
			$sender->sendMessage("Complete");

From what I can tell is that this code works. Looks like we need to add a delay for container opening?

@dadodasyra
Copy link
Contributor Author

@alvin0319 Can you confirm this is not related to my code and your InvMenu is broken too ?

@dadodasyra
Copy link
Contributor Author

I don't really understand what could have break since I found no server software changing anything about UIs..

@dries-c
Copy link
Contributor

dries-c commented Jul 12, 2023

We're experiencing the same issue. However I've no clue what causes it yet

@supercrafter333
Copy link

supercrafter333 commented Jul 12, 2023

If I try to open a InvMenu, I can open it one time. If I try to open it a second time (no matter what contents or name the invmenu-inventory have), it doesn't work - no inventory is opening. If I try to open my own player-inventory, everything works fine.

I think the InvMenu-inventory wasn't closed the right way. Maybe we have to show what the code for closing the inventory do.

I also tried to use debug-messages but that wasn't helpful.

@aabstractt
Copy link

aabstractt commented Jul 13, 2023

image
The issue is the timestamp, InvMenu store the timestamp without long value and MCPE sent the packet with long (many 0)

@supercrafter333
Copy link

image
The issue is the timestamp, InvMenu store the timestamp with an long value and MCPE sent the packet without long

Any idea how to fix?

@aabstractt
Copy link

image

This is the quickfix on the PlayerNetwork method notify

@Muqsit Muqsit added the client-sided bug A bug in the Bedrock Edition client label Jul 13, 2023
@Muqsit Muqsit closed this as completed in c597754 Jul 13, 2023
Muqsit added a commit that referenced this issue Jul 13, 2023
@Muqsit
Copy link
Owner

Muqsit commented Jul 13, 2023

Seems like there was a change in behavior of NetworkStackLatencyPacket in Bedrock Edition v1.20.10. This protocol change may be impacting PlayStation users as well, however I do not have access to one at the moment to test it.

Thank you for the details and analysis @alvin0319 @supercrafter333 @aabstractt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client-sided bug A bug in the Bedrock Edition client
Projects
None yet
Development

No branches or pull requests

6 participants