Customies
Customies copied to clipboard
Bedrock 1.12.30: Kicked due to "Server sent broken packet."
After upgrading to Bedrock Edition v1.12.30, the client disconnects when logging in and the client-side message "Server sent broken packet." is displayed. Other WearableComponent::SLOT_ constants function correctly, however WearableComponent::SLOT_WEAPON_MAIN_HAND appears to be causing this issue. I'm defining the wearable component only for completeness, so I've resorted to removing the wearable definition when registering weapons.
<?php
declare(strict_types=1);
namespace muqsit\testswords;
use customiesdevs\customies\item\component\WearableComponent;
use customiesdevs\customies\item\CustomiesItemFactory;
use customiesdevs\customies\item\ItemComponents;
use customiesdevs\customies\item\ItemComponentsTrait;
use pocketmine\event\Listener;
use pocketmine\item\Item;
use pocketmine\item\ItemIdentifier;
use pocketmine\plugin\PluginBase;
final class Loader extends PluginBase implements Listener{
protected function onEnable() : void{
$this->getServer()->getPluginManager()->registerEvents($this, $this);
CustomiesItemFactory::getInstance()->registerItem(CustomSword::class, "custom:sword", "Custom Sword");
}
}
final class CustomSword extends Item implements ItemComponents{
use ItemComponentsTrait;
public function __construct(ItemIdentifier $identifier, string $name){
parent::__construct($identifier, $name);
$this->initComponent("stick");
$this->addComponent(new WearableComponent(WearableComponent::SLOT_WEAPON_MAIN_HAND));
}
}
Looks like there was some changes related to the component in the 1.20.30 changelogs, I'll take a look to see if SLOT_WEAPON_MAIN_HAND was also changed