mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-18 22:03:51 -07:00
[ci skip] Add more patch identifying comments
This commit is contained in:
@@ -18,10 +18,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
int i = this.getAge();
|
||||
|
||||
if (!this.level().isClientSide && i == 0 && this.canFallInLove()) {
|
||||
+ final ItemStack breedCopy = itemstack.copy(); // Paper
|
||||
+ final ItemStack breedCopy = itemstack.copy(); // Paper - Fix EntityBreedEvent copying
|
||||
this.usePlayerItem(player, hand, itemstack);
|
||||
- this.setInLove(player);
|
||||
+ this.setInLove(player, breedCopy); // Paper
|
||||
+ this.setInLove(player, breedCopy); // Paper - Fix EntityBreedEvent copying
|
||||
return InteractionResult.SUCCESS;
|
||||
}
|
||||
|
||||
@@ -29,18 +29,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
return this.inLove <= 0;
|
||||
}
|
||||
|
||||
+ @Deprecated @io.papermc.paper.annotation.DoNotUse // Paper
|
||||
+ @Deprecated @io.papermc.paper.annotation.DoNotUse // Paper - Fix EntityBreedEvent copying
|
||||
public void setInLove(@Nullable Player player) {
|
||||
+ // Paper start - pass breed stack
|
||||
+ // Paper start - Fix EntityBreedEvent copying
|
||||
+ this.setInLove(player, null);
|
||||
+ }
|
||||
+ public void setInLove(@Nullable Player player, @Nullable ItemStack breedItemCopy) {
|
||||
+ if (breedItemCopy != null) this.breedItem = breedItemCopy;
|
||||
+ // Paper end
|
||||
+ // Paper end - Fix EntityBreedEvent copying
|
||||
// CraftBukkit start
|
||||
EntityEnterLoveModeEvent entityEnterLoveModeEvent = CraftEventFactory.callEntityEnterLoveModeEvent(player, this, 600);
|
||||
if (entityEnterLoveModeEvent.isCancelled()) {
|
||||
+ this.breedItem = null; // Paper - clear if cancelled
|
||||
+ this.breedItem = null; // Paper - Fix EntityBreedEvent copying; clear if cancelled
|
||||
return;
|
||||
}
|
||||
this.inLove = entityEnterLoveModeEvent.getTicksInLove();
|
||||
@@ -49,7 +49,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
this.loveCause = player.getUUID();
|
||||
}
|
||||
- this.breedItem = player.getInventory().getSelected(); // CraftBukkit
|
||||
+ // Paper - set breed item in better place
|
||||
+ // Paper - Fix EntityBreedEvent copying; set breed item in better place
|
||||
|
||||
this.level().broadcastEntityEvent(this, (byte) 18);
|
||||
}
|
||||
@@ -61,10 +61,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
this.usePlayerItem(player, hand, itemstack);
|
||||
this.ageUp((int) ((float) (-this.getAge() / 20) * 0.1F), true);
|
||||
} else if (!this.level().isClientSide && this.getAge() == 0 && this.canFallInLove()) {
|
||||
+ final ItemStack breedCopy = itemstack.copy(); // Paper
|
||||
+ final ItemStack breedCopy = itemstack.copy(); // Paper - Fix EntityBreedEvent copying
|
||||
this.usePlayerItem(player, hand, itemstack);
|
||||
- this.setInLove(player);
|
||||
+ this.setInLove(player, breedCopy); // Paper
|
||||
+ this.setInLove(player, breedCopy); // Paper - Fix EntityBreedEvent copying
|
||||
} else {
|
||||
if (this.level().isClientSide || this.isSitting() || this.isInWater()) {
|
||||
return InteractionResult.PASS;
|
||||
@@ -77,7 +77,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
boolean bl2 = this.isTamed() && this.getAge() == 0 && this.canFallInLove();
|
||||
if (bl2) {
|
||||
- this.setInLove(player);
|
||||
+ this.setInLove(player, item.copy()); // Paper
|
||||
+ this.setInLove(player, item.copy()); // Paper - Fix EntityBreedEvent copying
|
||||
}
|
||||
|
||||
boolean bl3 = this.isBaby();
|
||||
@@ -90,7 +90,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
if (!this.level().isClientSide && this.isTamed() && this.getAge() == 0 && !this.isInLove()) {
|
||||
flag = true;
|
||||
- this.setInLove(player);
|
||||
+ this.setInLove(player, item.copy()); // Paper
|
||||
+ this.setInLove(player, item.copy()); // Paper - Fix EntityBreedEvent copying
|
||||
}
|
||||
} else if (item.is(Items.GOLDEN_APPLE) || item.is(Items.ENCHANTED_GOLDEN_APPLE)) {
|
||||
f = 10.0F;
|
||||
@@ -99,7 +99,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
if (!this.level().isClientSide && this.isTamed() && this.getAge() == 0 && !this.isInLove()) {
|
||||
flag = true;
|
||||
- this.setInLove(player);
|
||||
+ this.setInLove(player, item.copy()); // Paper
|
||||
+ this.setInLove(player, item.copy()); // Paper - Fix EntityBreedEvent copying
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
if (this.isTamed() && this.getAge() == 0 && this.canFallInLove()) {
|
||||
flag = true;
|
||||
- this.setInLove(player);
|
||||
+ this.setInLove(player, item.copy()); // Paper
|
||||
+ this.setInLove(player, item.copy()); // Paper - Fix EntityBreedEvent copying
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user