mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-16 18:59:00 +00:00
Bad hack, TODO REMOVE, workarounds client bug by sending inventory contents specifically for creative players <-- this commit is full of sadness
This commit is contained in:
parent
885fc07e5c
commit
24f8de2cc3
@ -1706,6 +1706,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
|
|
||||||
$pk = new StartGamePacket();
|
$pk = new StartGamePacket();
|
||||||
$pk->seed = -1;
|
$pk->seed = -1;
|
||||||
|
$pk->dimension = 0;
|
||||||
$pk->x = $this->x;
|
$pk->x = $this->x;
|
||||||
$pk->y = $this->y;
|
$pk->y = $this->y;
|
||||||
$pk->z = $this->z;
|
$pk->z = $this->z;
|
||||||
|
@ -383,10 +383,17 @@ class PlayerInventory extends BaseInventory{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$pk = new ContainerSetContentPacket();
|
$pk = new ContainerSetContentPacket();
|
||||||
$pk;
|
|
||||||
$pk->slots = [];
|
$pk->slots = [];
|
||||||
for($i = 0; $i < $this->getSize(); ++$i){ //Do not send armor by error here
|
$holder = $this->getHolder();
|
||||||
$pk->slots[$i] = $this->getItem($i);
|
if($holder instanceof Player and $holder->isCreative()){
|
||||||
|
//TODO: Remove this workaround because of broken client
|
||||||
|
foreach(Item::getCreativeItems() as $i => $item){
|
||||||
|
$pk->slots[$i] = Item::getCreativeItem($i);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
for($i = 0; $i < $this->getSize(); ++$i){ //Do not send armor by error here
|
||||||
|
$pk->slots[$i] = $this->getItem($i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($target as $player){
|
foreach($target as $player){
|
||||||
@ -416,7 +423,6 @@ class PlayerInventory extends BaseInventory{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$pk = new ContainerSetSlotPacket();
|
$pk = new ContainerSetSlotPacket();
|
||||||
$pk;
|
|
||||||
$pk->slot = $index;
|
$pk->slot = $index;
|
||||||
$pk->item = clone $this->getItem($index);
|
$pk->item = clone $this->getItem($index);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user