Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inventory visual bug #185

Open
vp817 opened this issue Jun 4, 2023 · 7 comments
Open

Inventory visual bug #185

vp817 opened this issue Jun 4, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@vp817
Copy link
Collaborator

vp817 commented Jun 4, 2023

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 vp817 added bug Something isn't working Support request labels Jun 4, 2023
@github-actions github-actions bot closed this as completed Jun 4, 2023
@vp817 vp817 reopened this Jun 4, 2023
Repository owner deleted a comment from github-actions bot Jun 4, 2023
@AfterKing
Copy link

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

@vp817
Copy link
Collaborator Author

vp817 commented May 23, 2024

did this fix it?

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

@vp817
Copy link
Collaborator Author

vp817 commented May 23, 2024

Send a video if so

@AfterKing
Copy link

Minecraft.2024-05-28.22-59-24.mp4

@AfterKing
Copy link

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

@vp817
Copy link
Collaborator Author

vp817 commented Jun 8, 2024

i will see that later

@vp817
Copy link
Collaborator Author

vp817 commented Jun 12, 2024

@Benedikt05

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants