1.21.6 dev

Co-authored-by: Bjarne Koll <git@lynxplay.dev>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
Co-authored-by: Noah van der Aa <ndvdaa@gmail.com>
Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
This commit is contained in:
Bjarne Koll
2025-05-28 13:23:32 +02:00
committed by Nassim Jahnke
parent 39203a65e0
commit a24f9b204c
788 changed files with 41006 additions and 6324 deletions

View File

@@ -1,34 +1,15 @@
--- a/net/minecraft/world/entity/TamableAnimal.java
+++ b/net/minecraft/world/entity/TamableAnimal.java
@@ -77,7 +_,7 @@
@@ -75,7 +_,7 @@
}
this.orderedToSit = compound.getBooleanOr("Sitting", false);
this.orderedToSit = input.getBooleanOr("Sitting", false);
- this.setInSittingPose(this.orderedToSit);
+ this.setInSittingPose(this.orderedToSit, false); // Paper - Add EntityToggleSitEvent
}
@Override
@@ -88,8 +_,16 @@
@Override
public boolean handleLeashAtDistance(Entity leashHolder, float distance) {
if (this.isInSittingPose()) {
- if (distance > 10.0F) {
- this.dropLeash();
+ if (distance > (float) this.level().paperConfig().misc.maxLeashDistance.or(Leashable.LEASH_TOO_FAR_DIST)) { // Paper - Configurable max leash distance
+ // Paper start - Expand EntityUnleashEvent
+ org.bukkit.event.entity.EntityUnleashEvent event = new org.bukkit.event.entity.EntityUnleashEvent(this.getBukkitEntity(), org.bukkit.event.entity.EntityUnleashEvent.UnleashReason.DISTANCE, true);
+ if (!event.callEvent()) return false;
+ if (event.isDropLeash()) {
+ this.dropLeash();
+ } else {
+ this.removeLeash();
+ }
+ // Paper end - Expand EntityUnleashEvent
}
return false;
@@ -148,6 +_,13 @@
@@ -133,6 +_,13 @@
}
public void setInSittingPose(boolean sitting) {
@@ -42,7 +23,7 @@
byte b = this.entityData.get(DATA_FLAGS_ID);
if (sitting) {
this.entityData.set(DATA_FLAGS_ID, (byte)(b | 1));
@@ -230,7 +_,12 @@
@@ -215,7 +_,12 @@
if (this.level() instanceof ServerLevel serverLevel
&& serverLevel.getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES)
&& this.getOwner() instanceof ServerPlayer serverPlayer) {
@@ -56,7 +37,7 @@
}
super.die(cause);
@@ -273,7 +_,14 @@
@@ -258,7 +_,14 @@
if (!this.canTeleportTo(new BlockPos(x, y, z))) {
return false;
} else {