File tree Expand file tree Collapse file tree 8 files changed +8
-10
lines changed
Expand file tree Collapse file tree 8 files changed +8
-10
lines changed Original file line number Diff line number Diff line change 1- .idea /
2- vendor /
1+ / vendor
2+ / composer.lock
Original file line number Diff line number Diff line change 44
55namespace muqsit \invmenu ;
66
7- use muqsit \invmenu \inventory \InvMenuInventory ;
87use muqsit \invmenu \session \network \PlayerNetwork ;
98use muqsit \invmenu \session \PlayerManager ;
109use muqsit \invmenu \session \PlayerWindowDispatcher ;
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ final class PlayerNetworkHandlerRegistry{
2020 public function __construct (){
2121 $ this ->registerDefault (new ClosurePlayerNetworkHandler (static function (Closure $ then , int $ protocolId ) : NetworkStackLatencyEntry {
2222 $ timestamp = mt_rand ();
23- return new NetworkStackLatencyEntry ($ timestamp * ($ protocolId >= ProtocolInfo::PROTOCOL_1_20_10 ? 1000000 : 1000 ), $ then , $ timestamp * ( $ protocolId >= ProtocolInfo:: PROTOCOL_1_20_10 ? 1 : 1000 ) );
23+ return new NetworkStackLatencyEntry ($ timestamp * ($ protocolId >= ProtocolInfo::PROTOCOL_1_20_10 ? 1000000 : 1000 ), $ then , $ timestamp );
2424 }));
2525 $ this ->register (DeviceOS::PLAYSTATION , new ClosurePlayerNetworkHandler (static function (Closure $ then , int $ protocolId ) : NetworkStackLatencyEntry {
2626 $ timestamp = mt_rand ();
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ public function getSize() : int{
3535
3636 public function createGraphic (InvMenu $ menu , Player $ player ) : ?InvMenuGraphic {
3737 $ position = $ player ->getPosition ();
38- $ origin = $ position ->addVector (InvMenuTypeHelper::getPositionOffset ())->floor ();
38+ $ origin = $ position ->addVector (InvMenuTypeHelper::getBehindPositionOffset ())->floor ();
3939 if (!InvMenuTypeHelper::isValidYCoordinate ($ origin ->y )){
4040 return null ;
4141 }
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ public function getSize() : int{
2727 }
2828
2929 public function createGraphic (InvMenu $ menu , Player $ player ) : ?InvMenuGraphic {
30- $ origin = $ player ->getPosition ()->addVector (InvMenuTypeHelper::getPositionOffset ())->floor ();
30+ $ origin = $ player ->getPosition ()->addVector (InvMenuTypeHelper::getBehindPositionOffset ())->floor ();
3131 if (!InvMenuTypeHelper::isValidYCoordinate ($ origin ->y )){
3232 return null ;
3333 }
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ public function getSize() : int{
3535
3636 public function createGraphic (InvMenu $ menu , Player $ player ) : ?InvMenuGraphic {
3737 $ position = $ player ->getPosition ();
38- $ origin = $ position ->addVector (InvMenuTypeHelper::getPositionOffset ())->floor ();
38+ $ origin = $ position ->addVector (InvMenuTypeHelper::getBehindPositionOffset ())->floor ();
3939 if (!InvMenuTypeHelper::isValidYCoordinate ($ origin ->y )){
4040 return null ;
4141 }
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ public function send(Player $player, ?string $name) : void{
3131
3232 $ network ->sendDataPacket (UpdateBlockPacket::create (
3333 BlockPosition::fromVector3 ($ this ->position ),
34- TypeConverter::getInstance ($ network ->getProtocolId ())->getBlockTranslator ()->internalIdToNetworkId ($ this ->block ->getStateId ()),
34+ TypeConverter::getInstance ($ network ->getProtocolId ())->getBlockTranslator ()->internalIdToNetworkId ($ this ->block ->getStateId ()),
3535 UpdateBlockPacket::FLAG_NETWORK ,
3636 UpdateBlockPacket::DATA_LAYER_NORMAL
3737 ));
@@ -43,7 +43,6 @@ public function sendInventory(Player $player, Inventory $inventory) : bool{
4343
4444 public function remove (Player $ player ) : void {
4545 $ network = $ player ->getNetworkSession ();
46-
4746 foreach ($ player ->getWorld ()->createBlockUpdatePackets ($ network ->getTypeConverter (), [$ this ->position ]) as $ packet ){
4847 $ network ->sendDataPacket ($ packet );
4948 }
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ final class InvMenuTypeHelper{
1515 public const NETWORK_WORLD_Y_MIN = -64 ;
1616 public const NETWORK_WORLD_Y_MAX = 320 ;
1717
18- public static function getPositionOffset () : Vector3 {
18+ public static function getBehindPositionOffset () : Vector3 {
1919 return new Vector3 (0 , -2 , 0 );
2020 }
2121
You can’t perform that action at this time.
0 commit comments