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

implement transfer functionality for hoppers #5906

Draft
wants to merge 93 commits into
base: minor-next
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
2b5cf91
implement transfer functionality for hoppers
CoderJoeW Jul 16, 2023
e88a8df
fix return type not specified
CoderJoeW Jul 16, 2023
0773f56
fix styling issue
CoderJoeW Jul 16, 2023
9222deb
Cleaning up the mess. Should save a few cpu cycles
CoderJoeW Jul 16, 2023
726e53e
Helper functions to check ability to add fuel/smelting
CoderJoeW Jul 17, 2023
c818396
Mostly complete implementation for hopper interaction with furnance
CoderJoeW Jul 17, 2023
21dc611
move furnance accepted values to furnance inventory
CoderJoeW Jul 17, 2023
f35384f
fixes code style issues
CoderJoeW Jul 17, 2023
42d9e88
fix code style issues
CoderJoeW Jul 17, 2023
41c9764
fix code style issues
CoderJoeW Jul 17, 2023
0dca10b
code style fixes
CoderJoeW Jul 17, 2023
3ef603b
styling and bug fixes
CoderJoeW Jul 17, 2023
d62e46e
add interface for interacting with hopper
CoderJoeW Jul 17, 2023
758d300
individual hopper and furnance implementations
CoderJoeW Jul 17, 2023
e7a75b8
code style fixes
CoderJoeW Jul 17, 2023
d65112b
code style fix
CoderJoeW Jul 17, 2023
dc778fb
remove explicit item check
CoderJoeW Jul 17, 2023
8a046d8
remove unused namespaces
CoderJoeW Jul 17, 2023
3a34c3b
remove unused function
CoderJoeW Jul 17, 2023
78f8ceb
code style fixes
CoderJoeW Jul 17, 2023
b746c06
fix code style
CoderJoeW Jul 17, 2023
eaaf741
type check to fix facing issue
CoderJoeW Jul 17, 2023
26009e5
code style fix
CoderJoeW Jul 17, 2023
94f6c6d
slot should not be optional and remove old code
CoderJoeW Jul 19, 2023
07f0223
reduce hardcodings
CoderJoeW Jul 19, 2023
15af315
pull should return a bool for successful transfer
CoderJoeW Jul 19, 2023
4164c6d
scheduling corrections and return bool
CoderJoeW Jul 19, 2023
beaa1bb
fix comparison
CoderJoeW Jul 19, 2023
a5a18a5
correctly handles maxstacksize
CoderJoeW Jul 19, 2023
9c5cee6
Merge branch 'stable' into implement-hopper-push
CoderJoeW Jul 19, 2023
b4994cb
code style fix
CoderJoeW Jul 19, 2023
2b5f10e
implement chest pulling logic
CoderJoeW Jul 20, 2023
0e87884
Change pull to push
CoderJoeW Jul 20, 2023
6425daf
implements pulling from a chest
CoderJoeW Jul 20, 2023
eb73849
code style fix
CoderJoeW Jul 20, 2023
7bf4fc0
hopper to hopper action now working
CoderJoeW Jul 21, 2023
57f7cd2
cleanup
CoderJoeW Jul 21, 2023
ffc5a92
minor refactoring to reduce duplicate code
CoderJoeW Jul 21, 2023
cab3653
Merge branch 'pmmp:stable' into implement-hopper-push
CoderJoeW Jul 22, 2023
7e9173b
Complete rewrite to make proper use of interface
CoderJoeW Jul 24, 2023
9ce19a3
fix bugs
CoderJoeW Jul 24, 2023
adadddb
bug fixes
CoderJoeW Jul 24, 2023
917a6c4
change interface and all methods to pullFrom/pushTo
CoderJoeW Jul 24, 2023
499685b
use foreach instead of for
CoderJoeW Jul 24, 2023
3bf8bdf
Merge branch 'minor-next' into implement-hopper-push
CoderJoeW Jul 24, 2023
4d3a4c7
Changing interface definition to pass in inventory and hopper
CoderJoeW Jul 25, 2023
9f1b265
Changing interface definition
CoderJoeW Jul 25, 2023
88b4800
Add missing braces where applicable
CoderJoeW Jul 25, 2023
f394a2c
better grouping of variables
CoderJoeW Jul 25, 2023
4ba5f5a
move transferitem to a trait
CoderJoeW Jul 25, 2023
6963b2c
reduce duplicate code with a trait
CoderJoeW Jul 25, 2023
b1ddd43
code style fix
CoderJoeW Jul 25, 2023
9ab8df5
code style fix
CoderJoeW Jul 25, 2023
e87df4d
bug fix
CoderJoeW Jul 25, 2023
f3f534d
code style fix
CoderJoeW Jul 25, 2023
9a3a5c9
code style fixes
CoderJoeW Jul 25, 2023
01b57a1
Pass hopper block instead of base inventory
CoderJoeW Jul 25, 2023
ac8a21b
use inventory instead of baseinventory
CoderJoeW Jul 25, 2023
1fabd94
code style corrections
CoderJoeW Jul 25, 2023
95d426d
code style fixes
CoderJoeW Jul 25, 2023
8b229f5
Merge branch 'minor-next' into implement-hopper-push
CoderJoeW Jul 25, 2023
3be1750
improve readability
CoderJoeW Jul 25, 2023
efb49ad
use getResult when pushing
CoderJoeW Jul 25, 2023
491d1f3
Performance corrections
CoderJoeW Jul 25, 2023
e4e31b0
remove unneccesary
CoderJoeW Jul 25, 2023
b3c8365
pass through hopper block instead of inventory
CoderJoeW Jul 26, 2023
9ab0ac1
correct push/pull
CoderJoeW Jul 26, 2023
0037b08
add comments for interface
CoderJoeW Jul 26, 2023
0fab569
Merge branch 'minor-next' into implement-hopper-push
CoderJoeW Jul 27, 2023
93cfda5
style fix
CoderJoeW Jul 31, 2023
fe66be1
logic fix
CoderJoeW Jul 31, 2023
7ac0cba
remove useless check hopper can't face up
CoderJoeW Jul 31, 2023
8c8f930
introduce cooldown
CoderJoeW Aug 1, 2023
e312ee1
use constant instead of hardcoded value
CoderJoeW Aug 2, 2023
136167f
better naming
CoderJoeW Aug 2, 2023
716b9b0
style fixes
CoderJoeW Aug 2, 2023
8ea906f
style fix
CoderJoeW Aug 2, 2023
cb06633
minor equality fix
CoderJoeW Aug 3, 2023
4f1934f
make push/pull order match interface
CoderJoeW Aug 4, 2023
8e98081
bug fix
CoderJoeW Aug 4, 2023
917fae9
refactoring and apply lock system
ShockedPlot7560 Oct 6, 2023
3941a4e
Merge remote-tracking branch 'upstream/minor-next' into PocketSoftMin…
ShockedPlot7560 Oct 6, 2023
a785ed1
add BrewingStand
ShockedPlot7560 Oct 6, 2023
8414455
add redstone lock system
ShockedPlot7560 Oct 6, 2023
b726f55
improve docs + fix hopper transfer cooldown
ShockedPlot7560 Oct 6, 2023
e9d8dde
implement container block
ShockedPlot7560 Oct 6, 2023
f2940a4
implement entity picking system + rename cooldown to transfer cooldown
ShockedPlot7560 Oct 6, 2023
def0bc9
Merge branch 'pmmp:stable' into implement-hopper-push
CoderJoeW Oct 10, 2023
d520933
Merge branch 'implement-hopper-push' of github.com:PocketSoftMine/Poc…
ShockedPlot7560 Oct 10, 2023
1b651d6
Hopper: fix schedule block update cancel when locked
ShockedPlot7560 Oct 10, 2023
14a53e1
hopper: dont recalculate picking box each time
ShockedPlot7560 Oct 10, 2023
54f356f
add events
ShockedPlot7560 Oct 11, 2023
23fcb55
optimize hopper Scheduling updates
ShockedPlot7560 Oct 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ jobs:

steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
run: echo NAME=$(echo "${GITHUB_REPOSITORY,,}") >> $GITHUB_OUTPUT

- name: Build image for tag
uses: docker/build-push-action@v4.1.1
uses: docker/build-push-action@v5.0.0
with:
push: true
context: ./pocketmine-mp
Expand All @@ -66,7 +66,7 @@ jobs:

- name: Build image for major tag
if: steps.channel.outputs.CHANNEL == 'stable'
uses: docker/build-push-action@v4.1.1
uses: docker/build-push-action@v5.0.0
with:
push: true
context: ./pocketmine-mp
Expand All @@ -79,7 +79,7 @@ jobs:

- name: Build image for minor tag
if: steps.channel.outputs.CHANNEL == 'stable'
uses: docker/build-push-action@v4.1.1
uses: docker/build-push-action@v5.0.0
with:
push: true
context: ./pocketmine-mp
Expand All @@ -92,7 +92,7 @@ jobs:

- name: Build image for latest tag
if: steps.channel.outputs.CHANNEL == 'stable'
uses: docker/build-push-action@v4.1.1
uses: docker/build-push-action@v5.0.0
with:
push: true
context: ./pocketmine-mp
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/discord-release-notify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v4

- name: Setup PHP and tools
uses: shivammathur/setup-php@2.25.5
uses: shivammathur/setup-php@2.26.0
with:
php-version: 8.1

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
submodules: true

- name: Setup PHP
uses: shivammathur/setup-php@2.25.5
uses: shivammathur/setup-php@2.26.0
with:
php-version: ${{ matrix.php-version }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ jobs:
- uses: actions/checkout@v4

- name: Setup PHP and tools
uses: shivammathur/setup-php@2.25.5
uses: shivammathur/setup-php@2.26.0
with:
php-version: 8.1
tools: php-cs-fixer:3.17
Expand Down
2 changes: 1 addition & 1 deletion build/php
Submodule php updated from 3331f8 to a34e48
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"symfony/filesystem": "~6.3.0"
},
"require-dev": {
"phpstan/phpstan": "1.10.35",
"phpstan/phpstan": "1.10.38",
"phpstan/phpstan-phpunit": "^1.1.0",
"phpstan/phpstan-strict-rules": "^1.2.0",
"phpunit/phpunit": "^10.1"
Expand Down
78 changes: 39 additions & 39 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/block/Barrel.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

use pocketmine\block\tile\Barrel as TileBarrel;
use pocketmine\block\utils\AnyFacingTrait;
use pocketmine\block\utils\HopperInteractableContainerTrait;
use pocketmine\data\runtime\RuntimeDataDescriber;
use pocketmine\item\Item;
use pocketmine\math\Facing;
Expand All @@ -33,7 +34,8 @@
use pocketmine\world\BlockTransaction;
use function abs;

class Barrel extends Opaque{
class Barrel extends Opaque implements HopperInteractable{
use HopperInteractableContainerTrait;
use AnyFacingTrait;

protected bool $open = false;
Expand Down
Loading