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

Implemented functional anvils #521

Merged
merged 65 commits into from
Jul 11, 2022
Merged

Implemented functional anvils #521

merged 65 commits into from
Jul 11, 2022

Conversation

T14Raptor
Copy link
Member

@T14Raptor T14Raptor commented May 31, 2022

Closes #500.

JustTalDevelops and others added 5 commits May 15, 2022 17:06
# Conflicts:
#	server/session/handler_item_stack_request.go
#	server/session/player.go
#	server/session/session.go
#	server/session/world.go
@T14Raptor T14Raptor mentioned this pull request Jun 1, 2022
@JustTalDevelops JustTalDevelops marked this pull request as ready for review July 7, 2022 05:23
@JustTalDevelops
Copy link
Member

This is missing updated repair costs on result items and documentation, but aside from that, this is pretty much ready for review.

server/session/handler_item_stack_request.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
Copy link
Member

@Sandertv Sandertv left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the PR and apologies for taking so long to review.

I've got a couple of comments, particularly on the non-logic related stuff. The actual anvil logic is really quite difficult to read, so (as mentioned in one of the comments) I'd really recommend adding comments throughout the code explaining what's happening.

Also: I introduced a merge conflict with a change I made just now, shouldn't be very difficult to fix though.

server/entity/falling_block.go Outdated Show resolved Hide resolved
server/entity/falling_block.go Outdated Show resolved Hide resolved
server/entity/falling_block.go Show resolved Hide resolved
server/item/enchantment.go Outdated Show resolved Hide resolved
server/item/enchantment_rarity.go Outdated Show resolved Hide resolved
server/item/item.go Outdated Show resolved Hide resolved
server/item/stack.go Outdated Show resolved Hide resolved
server/item/tool.go Outdated Show resolved Hide resolved
server/session/handler_anvil.go Show resolved Hide resolved
server/session/handler_anvil.go Outdated Show resolved Hide resolved
# Conflicts:
#	server/item/enchantment/aqua_affinity.go
#	server/item/enchantment/efficiency.go
#	server/item/enchantment/feather_falling.go
#	server/item/enchantment/fire_aspect.go
#	server/item/enchantment/knock_back.go
#	server/item/enchantment/protection.go
#	server/item/enchantment/sharpness.go
#	server/item/enchantment/silk_touch.go
#	server/item/enchantment/unbreaking.go
server/session/handler_anvil.go Outdated Show resolved Hide resolved
Copy link
Member

@Sandertv Sandertv left a comment

Choose a reason for hiding this comment

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

With the comments and a couple of functions that were extracted from the original code, this looks a ton more readable. Still pretty long functions but acceptable, I think.

You guys have a lot better of an idea about the anvil functionality itself. I wasn't able to find any obvious logical flaws, but all I can say is make sure that the behaviour matches bedrock edition. If you think it does and is ready, please feel free to merge this on your own accord.

@DaPigGuy
Copy link
Member

DaPigGuy commented Jul 11, 2022

Definitely more testing required in survival mode. Already found an issue where client/server do not agree on cost when combining two Sharpness 4 books.

EDIT: Cost calculations for enchantment merging seem to differ to some extent between Java & Bedrock, particularly when both items share an enchantment of the same type. The operation on dragonfly/Java Edition costs 5 levels vs. Bedrock Edition's 1 level.

@JustTalDevelops JustTalDevelops merged commit 34556e5 into master Jul 11, 2022
@JustTalDevelops JustTalDevelops deleted the feature/anvils branch July 11, 2022 13:45
@DaPigGuy DaPigGuy mentioned this pull request Jul 15, 2022
89 tasks
@JustTalDevelops JustTalDevelops added the feature New feature or request label Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement anvils
4 participants