mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
hacks for NPC and floating text
I didn't think mojang could break this fucking game any worse
This commit is contained in:
@ -29,8 +29,9 @@ use pocketmine\item\Item;
|
||||
use pocketmine\item\ItemFactory;
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\network\mcpe\protocol\AddPlayerPacket;
|
||||
use pocketmine\network\mcpe\protocol\PlayerSkinPacket;
|
||||
use pocketmine\network\mcpe\protocol\PlayerListPacket;
|
||||
use pocketmine\network\mcpe\protocol\RemoveEntityPacket;
|
||||
use pocketmine\network\mcpe\protocol\types\PlayerListEntry;
|
||||
use pocketmine\utils\UUID;
|
||||
|
||||
class FloatingTextParticle extends Particle{
|
||||
@ -89,9 +90,17 @@ class FloatingTextParticle extends Particle{
|
||||
}
|
||||
|
||||
if(!$this->invisible){
|
||||
$uuid = UUID::fromRandom();
|
||||
$name = $this->title . ($this->text !== "" ? "\n" . $this->text : "");
|
||||
|
||||
$add = new PlayerListPacket();
|
||||
$add->type = PlayerListPacket::TYPE_ADD;
|
||||
$add->entries = [PlayerListEntry::createAdditionEntry($uuid, $this->entityId, $name, $name, 0, new Skin("Standard_Custom", str_repeat("\x00", 8192)))];
|
||||
$p[] = $add;
|
||||
|
||||
$pk = new AddPlayerPacket();
|
||||
$pk->uuid = $uuid = UUID::fromRandom();
|
||||
$pk->username = $this->title . ($this->text !== "" ? "\n" . $this->text : "");
|
||||
$pk->uuid = $uuid;
|
||||
$pk->username = $name;
|
||||
$pk->entityRuntimeId = $this->entityId;
|
||||
$pk->position = $this->asVector3(); //TODO: check offset
|
||||
$pk->item = ItemFactory::get(Item::AIR, 0, 0);
|
||||
@ -106,10 +115,10 @@ class FloatingTextParticle extends Particle{
|
||||
|
||||
$p[] = $pk;
|
||||
|
||||
$skinPk = new PlayerSkinPacket();
|
||||
$skinPk->uuid = $uuid;
|
||||
$skinPk->skin = new Skin("Standard_Custom", str_repeat("\x00", 8192));
|
||||
$p[] = $skinPk;
|
||||
$remove = new PlayerListPacket();
|
||||
$remove->type = PlayerListPacket::TYPE_REMOVE;
|
||||
$remove->entries = [PlayerListEntry::createRemovalEntry($uuid)];
|
||||
$p[] = $remove;
|
||||
}
|
||||
|
||||
return $p;
|
||||
|
Reference in New Issue
Block a user