PocketMine-MP 5.23.3 git-f7687af337d001ddbcc47b8e773f014a33faa662
Loading...
Searching...
No Matches
SkinData.php
1<?php
2
3/*
4 * This file is part of BedrockProtocol.
5 * Copyright (C) 2014-2022 PocketMine Team <https://github.com/pmmp/BedrockProtocol>
6 *
7 * BedrockProtocol is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 */
12
13declare(strict_types=1);
14
15namespace pocketmine\network\mcpe\protocol\types\skin;
16
18use Ramsey\Uuid\Uuid;
19
21
22 public const ARM_SIZE_SLIM = "slim";
23 public const ARM_SIZE_WIDE = "wide";
24
25 private SkinImage $capeImage;
26 private string $fullSkinId;
27
33 public function __construct(
34 private string $skinId,
35 private string $playFabId,
36 private string $resourcePatch,
37 private SkinImage $skinImage,
38 private array $animations = [],
39 ?SkinImage $capeImage = null,
40 private string $geometryData = "",
41 private string $geometryDataEngineVersion = ProtocolInfo::MINECRAFT_VERSION_NETWORK,
42 private string $animationData = "",
43 private string $capeId = "",
44 ?string $fullSkinId = null,
45 private string $armSize = self::ARM_SIZE_WIDE,
46 private string $skinColor = "",
47 private array $personaPieces = [],
48 private array $pieceTintColors = [],
49 private bool $isVerified = true,
50 private bool $premium = false,
51 private bool $persona = false,
52 private bool $personaCapeOnClassic = false,
53 private bool $isPrimaryUser = true,
54 private bool $override = true
55 ){
56 $this->capeImage = $capeImage ?? new SkinImage(0, 0, "");
57 //this has to be unique or the client will do stupid things
58 $this->fullSkinId = $fullSkinId ?? Uuid::uuid4()->toString();
59 }
60
61 public function getSkinId() : string{
62 return $this->skinId;
63 }
64
65 public function getPlayFabId() : string{ return $this->playFabId; }
66
67 public function getResourcePatch() : string{
68 return $this->resourcePatch;
69 }
70
71 public function getSkinImage() : SkinImage{
72 return $this->skinImage;
73 }
74
78 public function getAnimations() : array{
79 return $this->animations;
80 }
81
82 public function getCapeImage() : SkinImage{
83 return $this->capeImage;
84 }
85
86 public function getGeometryData() : string{
87 return $this->geometryData;
88 }
89
90 public function getGeometryDataEngineVersion() : string{ return $this->geometryDataEngineVersion; }
91
92 public function getAnimationData() : string{
93 return $this->animationData;
94 }
95
96 public function getCapeId() : string{
97 return $this->capeId;
98 }
99
100 public function getFullSkinId() : string{
101 return $this->fullSkinId;
102 }
103
104 public function getArmSize() : string{
105 return $this->armSize;
106 }
107
108 public function getSkinColor() : string{
109 return $this->skinColor;
110 }
111
115 public function getPersonaPieces() : array{
116 return $this->personaPieces;
117 }
118
122 public function getPieceTintColors() : array{
123 return $this->pieceTintColors;
124 }
125
126 public function isPersona() : bool{
127 return $this->persona;
128 }
129
130 public function isPremium() : bool{
131 return $this->premium;
132 }
133
134 public function isPersonaCapeOnClassic() : bool{
135 return $this->personaCapeOnClassic;
136 }
137
138 public function isPrimaryUser() : bool{ return $this->isPrimaryUser; }
139
140 public function isOverride() : bool{ return $this->override; }
141
142 public function isVerified() : bool{
143 return $this->isVerified;
144 }
145
149 public function setVerified(bool $verified) : void{
150 $this->isVerified = $verified;
151 }
152}
__construct(private string $skinId, private string $playFabId, private string $resourcePatch, private SkinImage $skinImage, private array $animations=[], ?SkinImage $capeImage=null, private string $geometryData="", private string $geometryDataEngineVersion=ProtocolInfo::MINECRAFT_VERSION_NETWORK, private string $animationData="", private string $capeId="", ?string $fullSkinId=null, private string $armSize=self::ARM_SIZE_WIDE, private string $skinColor="", private array $personaPieces=[], private array $pieceTintColors=[], private bool $isVerified=true, private bool $premium=false, private bool $persona=false, private bool $personaCapeOnClassic=false, private bool $isPrimaryUser=true, private bool $override=true)
Definition SkinData.php:33