Skip to content

Implemented smithing table functionality #6202

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

Open
wants to merge 35 commits into
base: minor-next
Choose a base branch
from

Conversation

HimmelKreis4865
Copy link
Contributor

Introduction

This PR adds working smithing tables to pocketmine.
There are no known issues or problems

Changes

API changes

Amor->setTrim(ArmorTrim)
Armor->getTrim() : ?ArmorTrim
Armor->clearTrim()

SmithingTableInventory->getInput() : Item
SmithingTableInventory->getAddition() : Item
SmithingTableInventory->getTemplate() : Item

The new enums: ArmorTrimPattern & ArmorTrimMaterial (required to construct ArmorTrim)

Tests

Tested ingame with the smithing table several times:
image

Tested the code

$player->getInventory()->addItem(VanillaItems::LEATHER_CAP()->setTrim(new ArmorTrim(ArmorTrimMaterial::QUARTZ, ArmorTrimPattern::EYE)));

@ShockedPlot7560 ShockedPlot7560 added Category: API Related to the plugin API Category: Core Related to internal functionality Type: Enhancement Contributes features or other improvements to PocketMine-MP labels Dec 20, 2023
@HimmelKreis4865
Copy link
Contributor Author

There's not much more I can do at this point, everthing is fixed except for save ids.

Copy link
Contributor

@jasonw4331 jasonw4331 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good to me, one comment.

@fractalllll

This comment was marked as off-topic.

@pandaaaBE
Copy link
Contributor

pandaaaBE commented Mar 22, 2024

image
Looks finished now :)

@HimmelKreis4865
Copy link
Contributor Author

yeah, ready to be reviewed again.

@ipad54 ipad54 requested a review from a team as a code owner November 30, 2024 20:22
Copy link
Member

@dktapps dktapps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks mostly OK.

I'm a bit uneasy about allowing custom armor trim patterns because they'll generate confusing errors if the objects are duplicated. The ArmorTrimPattern and ArmorTrimMaterial classes should use the NotCloneable and NotSerializable traits.

@kostamax27
Copy link
Contributor

image

[12:57:00.529] [Server thread/DEBUG]: [NetworkSession: kostamax27] Invalid inventory transaction -35: Expected an exact multiple of required Item Netherite Upgrade Smithing Template (20269:0)x2 (given: 1, needed: 2)
[12:57:00.529] [Server thread/DEBUG]: [NetworkSession: kostamax27] Detected prediction mismatch in inventory pocketmine\inventory\PlayerCursorInventory#214179 slot 0
[12:57:00.529] [Server thread/DEBUG]: [NetworkSession: kostamax27] Detected prediction mismatch in inventory pocketmine\block\inventory\CraftingTableInventory#88462 slot 0
[12:57:00.529] [Server thread/DEBUG]: [NetworkSession: kostamax27] Detected prediction mismatch in inventory pocketmine\block\inventory\CraftingTableInventory#88462 slot 1
[12:57:00.529] [Server thread/DEBUG]: [NetworkSession: kostamax27] Detected prediction mismatch in inventory pocketmine\block\inventory\CraftingTableInventory#88462 slot 2
[12:57:00.529] [Server thread/DEBUG]: [NetworkSession: kostamax27] Detected prediction mismatch in inventory pocketmine\block\inventory\CraftingTableInventory#88462 slot 3
[12:57:00.529] [Server thread/DEBUG]: [NetworkSession: kostamax27] Detected prediction mismatch in inventory pocketmine\block\inventory\CraftingTableInventory#88462 slot 4
[12:57:00.529] [Server thread/DEBUG]: [NetworkSession: kostamax27] Detected prediction mismatch in inventory pocketmine\block\inventory\CraftingTableInventory#88462 slot 5
[12:57:00.529] [Server thread/DEBUG]: [NetworkSession: kostamax27] Detected prediction mismatch in inventory pocketmine\block\inventory\CraftingTableInventory#88462 slot 6
[12:57:00.529] [Server thread/DEBUG]: [NetworkSession: kostamax27] Detected prediction mismatch in inventory pocketmine\block\inventory\CraftingTableInventory#88462 slot 7
[12:57:00.529] [Server thread/DEBUG]: [NetworkSession: kostamax27] Detected prediction mismatch in inventory pocketmine\block\inventory\CraftingTableInventory#88462 slot 8
[12:57:00.560] [Server thread/DEBUG]: [NetworkSession: kostamax27] Full inventory sync requested, sending contents of 6 inventories

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: API Related to the plugin API Category: Core Related to internal functionality Type: Enhancement Contributes features or other improvements to PocketMine-MP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants