Optional Pack Detection Code#4806
Conversation
onebeastchris
left a comment
There was a problem hiding this comment.
Hey! Thanks for the PR - might be useful to allow GeyserMC/GeyserIntegratedPack#55 to be merged :p
However, there are a few functional changes that i thought i should already mention.
|
|
||
| @Override | ||
| public PacketSignal handle(ResourcePackChunkRequestPacket packet) { | ||
| session.setRequestedPacks(true); |
There was a problem hiding this comment.
This would probably falsely (not) trigger if a pack is already loaded on a client - since it wouldnt request resource packs from the server then
| PackCodec codec = pack.codec(); | ||
| ResourcePackManifest.Header header = pack.manifest().header(); | ||
|
|
||
| if (header.uuid().toString().equals("e5f5c938-a701-11eb-b2a3-047d7bb283ba")) { |
There was a problem hiding this comment.
This check doesn't need to be here; should be fine to have it above
|
GeyserMC/GeyserIntegratedPack#55 doesn't require this optional pack code. I also couldn't figure out how to solve the issue of the pack already being loaded by the client without it breaking other things like force-resource-pack being false I'll see if i can figure something out again but I'm not really sure what to do about it |
|
Unfortunately, the client does not let us know about which packs it has installed locally - however, for e.g. the optional pack, that would not be a huge issue as they're likely to be provided by the server (soon likely by default). |
|
Thanks for the PR! However, this would currently be unused within Geyser; so there is no immediate reason to add it. API users can detect the session's packs by checking the |
This is the code to detect the Geyser Optional Pack. I was going to use this in the code to add java attack sounds, but I ended up not needing it. It was tested with the force resource pack option disabled and enabled, and works if the pack is declined or accepted, per player. However if the player has the pack loaded client side, this code wont detect it.
In the future this could be used for a better cooldown texture, and for playing sounds that are different for crops on bedrock.