mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Merge branch 'api3/network' into api3/network_mcpe-1.0.5
This commit is contained in:
@ -94,8 +94,10 @@ class PlayerInventory extends BaseInventory{
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal This method is intended for use in network interaction with clients only.
|
||||
* @deprecated Do not change hotbar slot mapping with plugins, this will cause myriad client-sided bugs, especially with desktop GUI clients.
|
||||
* Links a hotbar slot to the specified slot in the main inventory. -1 links to no slot and will clear the hotbar slot.
|
||||
* This method is intended for use in network interaction with clients only.
|
||||
*
|
||||
* NOTE: Do not change hotbar slot mapping with plugins, this will cause myriad client-sided bugs, especially with desktop GUI clients.
|
||||
*
|
||||
* @param int $hotbarSlot
|
||||
* @param int $inventorySlot
|
||||
|
@ -98,7 +98,7 @@ class SimpleTransactionGroup implements TransactionGroup{
|
||||
}
|
||||
$checkSourceItem = $ts->getInventory()->getItem($ts->getSlot());
|
||||
$sourceItem = $ts->getSourceItem();
|
||||
if(!$checkSourceItem->deepEquals($sourceItem) or $sourceItem->getCount() !== $checkSourceItem->getCount()){
|
||||
if(!$checkSourceItem->equals($sourceItem) or $sourceItem->getCount() !== $checkSourceItem->getCount()){
|
||||
return false;
|
||||
}
|
||||
if($sourceItem->getId() !== Item::AIR){
|
||||
@ -108,7 +108,7 @@ class SimpleTransactionGroup implements TransactionGroup{
|
||||
|
||||
foreach($needItems as $i => $needItem){
|
||||
foreach($haveItems as $j => $haveItem){
|
||||
if($needItem->deepEquals($haveItem)){
|
||||
if($needItem->equals($haveItem)){
|
||||
$amount = min($needItem->getCount(), $haveItem->getCount());
|
||||
$needItem->setCount($needItem->getCount() - $amount);
|
||||
$haveItem->setCount($haveItem->getCount() - $amount);
|
||||
|
Reference in New Issue
Block a user