pmmp / PocketMine-MP

A server software for Minecraft: Bedrock Edition in PHP
https://pmmp.io
GNU Lesser General Public License v3.0
3.26k stars 1.54k forks source link

6349 container window not closed #6382

Open CoderJoeW opened 3 months ago

CoderJoeW commented 3 months ago

Introduction

If a player is inside of a container window and is moved over 6 blocks from the container the window will automatically be closed

In vanilla minecraft when I was testing this it closed the window after be moving 12 blocks(I could have miscounted) so that is what I implemented here

By running the following this change can be disabled

$inventory->setMaxDistanceFromContainer(0)

Relevant issues

This is a resolution for the issue

6349

Test

https://file.io/mphsWsJrFfcy

CoderJoeW commented 3 months ago

I am not super familiar with the API implementation so that might take me a min to figure out

Do you think we should have some method like setWindowCloseDistance and setting it to 0 would disable the functionality?

CoderJoeW commented 3 months ago

@ShockedPlot7560 @nicholass003 @jasonw4331

I believe I addressed all concerns and included a video of testing the server against a vanilla world

I found that in further testing vanilla seems to kick you out of an inventory window > 6 blocks distance so thats what I also updated this PR to do