-
-
Notifications
You must be signed in to change notification settings - Fork 413
Update ExprLeashHolder to use Leashable instead of LivingEntity #8241
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?
Update ExprLeashHolder to use Leashable instead of LivingEntity #8241
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.
Would also benefit from some tests, if possible. Test that you can leash a living entity, a non-living entity, and ensure that a non-leashable just returns null and doesn't throw exceptions. See the README in the tests directory for guidance on adding a test file!
@Override | ||
@Nullable | ||
public Entity convert(LivingEntity entity) { | ||
public Entity convert(Leashable entity) { |
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.
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.
I see. SInce I cannot add Leashable
in the pattern, the other solution I have tried now is to update the convert
method to accept Entity
objects and then add a check within the convert
method. Please let me know if this works.
Okay will do |
Problem
Currently none of the Leash related syntax work with boats meaning you will have to use Reflect and paper syntax instead.
Solution
Updated
ExprLeashHolder
andEffLeash
to use Paper'sLeashable
instead of theLivingEntity
interface.Testing Completed
Tested with
quickTest
,skriptTest
andJunit
tasksCompletes: #8239