-
-
Notifications
You must be signed in to change notification settings - Fork 404
Fixes and update Minecarts #8064
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
base: dev/patch
Are you sure you want to change the base?
Conversation
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.
good job
Co-authored-by: SirSmurfy2 <82696841+Absolutionism@users.noreply.github.com>
Co-authored-by: SirSmurfy2 <82696841+Absolutionism@users.noreply.github.com>
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.
Just about ready
return false; | ||
} | ||
protected boolean equals_i(EntityData<?> obj) { | ||
return obj instanceof MinecartData minecartData && type == minecartData.type; |
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.
return obj instanceof MinecartData minecartData && type == minecartData.type; | |
return obj instanceof MinecartData minecartData && | |
isSupertype == minecartData.isSupertype && | |
type == minecartData.type; |
Ah, perhaps this why the earlier confusion. Need to check superType here to differentiate between minecart
and regular minecart
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.
It doesn't matter, the class types of Minecarts don't have any defining fields. The getSuperType method takes priority in basically all the equals checks.
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.
Right, but this method should still be correct. regular minecart
and minecart
should not be considered equal by this method (hence the recommendation of an isSuperType check)
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.
Left new reply above on previous review comment
Problem
minecart
maps to the Minecart.class which is an interface... You can't spawn an interface.Solution
Update the MinecartData class with proper handling of the different Minecart classes.
I also moved the
WORLD_1_17_CONSUMER
outside the try catch, because it doesn't need to be doing a try catch every time an entity is spawned.All of these would fail prior to this pull request aside from the spawning of a storage minecart:
Completes: #7663