-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
API to control Vibrant Visuals #6739
Copy link
Copy link
Labels
Category: APIRelated to the plugin APIRelated to the plugin APIEasy taskProbably really easy to do, good task for first-time contributorsProbably really easy to do, good task for first-time contributors
Metadata
Metadata
Assignees
Labels
Category: APIRelated to the plugin APIRelated to the plugin APIEasy taskProbably really easy to do, good task for first-time contributorsProbably really easy to do, good task for first-time contributors
Problem description
Currently, within the
ResourcePacksPacketHandlercode, theResourcePacksInfoPacketis sent withforceDisableVibrantVisualsset to true.PocketMine-MP/src/network/mcpe/handler/ResourcePacksPacketHandler.php
Line 124 in 9c71f4f
This hardcoded value means that we have no direct way to enable or disable the Vibrant Visuals feature for players.
Proposed solution
We propose adding a mechanism for plugin developers to modify the value of
forceDisableVibrantVisualsbefore theResourcePacksInfoPacketis sent to the client. Here are a few potential approaches:PlayerResourcePackOfferEvent,setForceDisableVibrantVisuals(bool $forceDisable)orsetVibrantVisualsEnabled(bool $enabled), then pass it to theResourcePacksPacketHandler.forceDisableVibrantVisualspublic inResourcePacksInfoPacketAlternative solutions or workarounds
Currently, the only known workaround involves using the
DataPacketSendEventin conjunction with Reflection or a closure hack to modify theforceDisableVibrantVisualsvalue within the packet. Plugin developers can't rely on this method as it's fragile and has no official backing.