-
-
Notifications
You must be signed in to change notification settings - Fork 382
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
base: general-devel
Are you sure you want to change the base?
NetItem changes #2945
Conversation
The method will create a Terraria.Item instance based on the data from the structure.
docs/changelog.md
Outdated
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`. |
There was a problem hiding this comment.
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
TShockAPI/NetItem.cs
Outdated
public Item ToItem() | ||
{ | ||
if (_netId == 0) | ||
throw new Exception("It is impossible to create an item whose ID is 0."); |
There was a problem hiding this comment.
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.
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).