-
-
Notifications
You must be signed in to change notification settings - Fork 368
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
Added breeding support #5116
Added breeding support #5116
Conversation
I'll see about adding the stuff under |
There is already a pull request standardizing all the the event values to be enum. |
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.
Nice feature :D
I think ExprBredChild, ExprBreedingFather, and ExprBreedingMother should be combined into one expression (ex: ExprBreedingFamily) (idk a good name lol)
Once that expression is made, I'll do further review - please feel free to re-request my review
@@ -727,13 +728,13 @@ public Entity get(final PlayerInteractEntityEvent e) { | |||
@Override | |||
@Nullable | |||
public ItemStack get(final PlayerInteractEntityEvent e) { | |||
EquipmentSlot hand = e.getHand(); |
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.
If possible, can you revert these unrelated changes?
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.
Order of methods is init -> get/getAll -> acceptChange -> change -> setTime -> getTime -> isSingle -> getReturnType -> toString
for SimpleExpression
The usage of event-father and event-mother can be used after Pickle's pull request at #4963 to distinguish between the many entities that can be involved in this event as there are many conflicts.
@Nullable | ||
@Override |
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.
@Nullable | |
@Override | |
@Override | |
@Nullable |
While here
@Override | ||
protected @Nullable LivingEntity[] get(Event event) { |
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.
@Override | |
protected @Nullable LivingEntity[] get(Event event) { | |
@Override | |
@Nullable | |
protected LivingEntity[] get(Event event) { |
Same in other classes
public class ExprBredChild extends SimpleExpression<LivingEntity> { | ||
|
||
static { | ||
Skript.registerExpression(ExprBredChild.class, LivingEntity.class, ExpressionType.SIMPLE, "bred child"); |
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 like [bred] child
as a syntax
|
||
@Override | ||
protected @Nullable LivingEntity[] get(Event event) { | ||
return new LivingEntity[]{((EntityBreedEvent) event).getEntity()}; |
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.
When it's an event specific syntax, you should add an instanceof check to ensure it's the correct event.
Same in other classes
((ExperienceSpawnEvent) e).setSpawnedXP((int) d); | ||
experience = 0; | ||
|
||
experience = Math.max(0, Math.round(experience)); |
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.
You can't continue to have this round method. The round method originally existed for the double, which is now an integer from the looks of it. Math.round(integer) doesn't exist, it only does double and floats, so no clue how this is valid code unless it's somehow converting it to a double/float.
ce966e3
to
0d44f00
Compare
Whoops , oh well, I'll quickly fix some stuff up and reopen |
Description
This PR adds the basis of breeding into skript
ignore the <none> was making sure
event-entity
= childevent-entity
acts the same asbred child
event-livingentity
returns the entity who started the breedingevent-item
returns the itemstack used for breedingNote
as for the experience changes I've copied the ones from the PR #4284
Target Minecraft Versions: 1.12.2+ (Skript 2.7 will remove this requirement)
Requirements: MC 1.12.2
Related Issues: #5111