BetterAltay icon indicating copy to clipboard operation
BetterAltay copied to clipboard

Inventory visual bug

Open vp817 opened this issue 2 years ago • 7 comments

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

  1. create a new plugin
  2. 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

vp817 avatar Jun 04 '23 00:06 vp817

$player->getCursorInventory()->setItem(0, Item::get(0), true);

KingDbrm avatar May 20 '24 14:05 KingDbrm

did this fix it?

$player->getCursorInventory()->setItem(0, Item::get(0), true);

vp817 avatar May 23 '24 07:05 vp817

Send a video if so

vp817 avatar May 23 '24 07:05 vp817

https://github.com/Benedikt05/BetterAltay/assets/169461154/293053c2-b439-4d21-8539-028e22adfb43

KingDbrm avatar May 29 '24 02:05 KingDbrm

` 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;
			}
		}
	}
}`

KingDbrm avatar May 29 '24 02:05 KingDbrm

i will see that later

vp817 avatar Jun 08 '24 20:06 vp817

@Benedikt05

vp817 avatar Jun 12 '24 19:06 vp817