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

NetItem changes #2945

Open
wants to merge 10 commits into
base: general-devel
Choose a base branch
from
Open

Conversation

AgaSpace
Copy link
Contributor

@AgaSpace AgaSpace commented May 14, 2023

Added the ability to get from NetItem to TerrariaItem.
Added the ability to get NetItem from TerrariaItem.
Added optional parameters to the NetItem constructor (stack, prefix).

TShockAPI/NetItem.cs Outdated Show resolved Hide resolved
@AgaSpace AgaSpace requested review from Arthri June 7, 2023 14:28
Arthri
Arthri previously approved these changes Jun 7, 2023
Your changes could be here!
* Updated `TShockAPI.NetItem` (@AgaSpace):
* Added constructor overload with parameter `Terraria.Item`.
* Added the `Build` method to get a copy of `Terraria.Item`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Needs to be updated to ToItem

public Item ToItem()
{
if (_netId == 0)
throw new Exception("It is impossible to create an item whose ID is 0.");
Copy link
Contributor

Choose a reason for hiding this comment

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

That is not true, and this method should allow creating an empty item in my opinion, in case that is useful to some plugins.

@AgaSpace AgaSpace requested a review from punchready June 8, 2023 09:34
Arthri
Arthri previously approved these changes Jun 8, 2023
TShockAPI/NetItem.cs Outdated Show resolved Hide resolved
docs/changelog.md Outdated Show resolved Hide resolved
Arthri
Arthri previously approved these changes Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants