Inventory visual bug
Issue description
- Expected result: when canceling the inventory transaction u will get the item but its only visual
- Actual result: when canceling the inventory nothing happens other than it being canceled no visual bug
Steps to reproduce the issue
- create a new plugin
- add transaction event and cancel it
OS and versions
- BetterAltay: Newest
- PHP: 8.1
- Using JIT: no
- Server OS: win
- Game version: Win10
Plugins
the issue is not from plugins its from the software
Crashdump, backtrace or other files
There is no crashdump
$player->getCursorInventory()->setItem(0, Item::get(0), true);
did this fix it?
$player->getCursorInventory()->setItem(0, Item::get(0), true);
Send a video if so
https://github.com/Benedikt05/BetterAltay/assets/169461154/293053c2-b439-4d21-8539-028e22adfb43
` public function onInventoryTransaction(InventoryTransactionEvent $event) : void{
$transaction = $event->getTransaction();
$player = $transaction->getSource();
$network_stack_callbacks = [];
foreach($transaction->getActions() as $action){
if($action instanceof SlotChangeAction && ($inventory = $action->getInventory()) instanceof InvMenuInventory){
$result = $inventory->handleInventoryTransaction($player, $action->getSourceItem(), $action->getTargetItem(), $action, $transaction);
$network_stack_callback = $result->getPostTransactionCallback();
if($network_stack_callback !== null){
$network_stack_callbacks[] = $network_stack_callback;
}
if($result->isCancelled()){
$player->getCursorInventory()->setItem(0, Item::get(0), true);
$event->setCancelled();
break;
}
}
}
}`
i will see that later
@Benedikt05