mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-11 08:19:45 +00:00
inventory: fix some transactions being rejected for no good reason
since 1.13, transactions such as interacting with creative inventory cause a spoof windowID 124 slot 50 action to appear which changes air -> air. This currently gets rejected because only cursor is mapped to ID 124, and it only has a single slot. It is not clear what the purpose of 124:50 is, but this fix filters out any actions which do not change anything, since they won't affect transaction balance anyway.
This commit is contained in:
parent
b7c4379700
commit
7fdfe947b0
@ -167,6 +167,10 @@ class NetworkInventoryAction{
|
||||
* @throws \UnexpectedValueException
|
||||
*/
|
||||
public function createInventoryAction(Player $player){
|
||||
if($this->oldItem->equalsExact($this->newItem)){
|
||||
//filter out useless noise in 1.13
|
||||
return null;
|
||||
}
|
||||
switch($this->sourceType){
|
||||
case self::SOURCE_CONTAINER:
|
||||
$window = $player->getWindow($this->windowId);
|
||||
|
Loading…
x
Reference in New Issue
Block a user