Fix entity death sounds

This commit is contained in:
KennyTV 2021-06-16 22:17:53 +02:00
parent 8e187cb187
commit 3d81d4e5b2
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
13 changed files with 36 additions and 37 deletions

View File

@ -70,7 +70,7 @@ index b9fdccfc9815b0aec7bb5f5ad633c69b8eba6af2..df02d712e7daf1603885547995d69cb7
}
}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index dd61eacfa417ed77bf09f482249bdd3a5a566ace..252a935db848a1001c6109b582886a98d21941cb 100644
index dd61eacfa417ed77bf09f482249bdd3a5a566ace..1ee5575d098b1727e33a00eb02e420245e4b6a15 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -261,6 +261,7 @@ public abstract class LivingEntity extends Entity {
@ -193,15 +193,14 @@ index dd61eacfa417ed77bf09f482249bdd3a5a566ace..252a935db848a1001c6109b582886a98
// CraftBukkit start
public int getExpReward() {
@@ -1763,7 +1789,7 @@ public abstract class LivingEntity extends Entity {
@@ -1762,6 +1788,7 @@ public abstract class LivingEntity extends Entity {
return SoundEvents.GENERIC_HURT;
}
+ public SoundEvent getDeathSoundPublic() { return getDeathSound(); } // Paper - public OBFHELPER
@Nullable
- protected SoundEvent getDeathSound() {
+ protected SoundEvent getDeathSound() { return getDeathSoundPublic(); } public SoundEvent getDeathSoundPublic() { // Paper - public OBFHELPER
protected SoundEvent getDeathSound() {
return SoundEvents.GENERIC_DEATH;
}
diff --git a/src/main/java/net/minecraft/world/entity/animal/Fox.java b/src/main/java/net/minecraft/world/entity/animal/Fox.java
index c1cdb1905536bda76f34ad3fc796996443839767..31f4e4a93ea5fd3ffe7e60dff2e2a9642b51daa2 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Fox.java

View File

@ -17,7 +17,7 @@ index 4c769a68c5c234b33d72d9ca17f8d1fef5d23478..7ba9193b3203ebc8c71e605bd80717bb
return 0.0F;
}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 252a935db848a1001c6109b582886a98d21941cb..8d11a803516ae711a10e9b3af7f6704f59d40874 100644
index 1ee5575d098b1727e33a00eb02e420245e4b6a15..77d816a5a98f3118abb91eb65e0bb316b8b0c549 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -116,6 +116,7 @@ import net.minecraft.world.level.storage.loot.LootTable;
@ -28,7 +28,7 @@ index 252a935db848a1001c6109b582886a98d21941cb..8d11a803516ae711a10e9b3af7f6704f
import net.minecraft.world.phys.HitResult;
import net.minecraft.world.phys.Vec3;
import net.minecraft.world.scores.PlayerTeam;
@@ -3729,6 +3730,38 @@ public abstract class LivingEntity extends Entity {
@@ -3730,6 +3731,38 @@ public abstract class LivingEntity extends Entity {
return level.clip(raytrace);
}

View File

@ -93,10 +93,10 @@ index 1f00d9dfb6949010a146a4536e80ae4feaa07b25..e34deb4c6773171280e0819914725f26
if (this.valid) {
Bukkit.getPluginManager().callEvent(event);
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 8d11a803516ae711a10e9b3af7f6704f59d40874..ddb0a2f4d2894bd416d4b4b8d9cf1538705d104c 100644
index 77d816a5a98f3118abb91eb65e0bb316b8b0c549..32507c52d90393101ef5140de0d82518e5cbfbcc 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3328,11 +3328,13 @@ public abstract class LivingEntity extends Entity {
@@ -3329,11 +3329,13 @@ public abstract class LivingEntity extends Entity {
return ((Byte) this.entityData.get(LivingEntity.DATA_LIVING_ENTITY_FLAGS) & 4) != 0;
}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Prevent consuming the wrong itemstack
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index ddb0a2f4d2894bd416d4b4b8d9cf1538705d104c..01546bc3e79e1f69385d070ce97f047c670ab926 100644
index 32507c52d90393101ef5140de0d82518e5cbfbcc..53951f2c4dc77e9723d0a6314781d9ee0aa8ce54 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3547,15 +3547,18 @@ public abstract class LivingEntity extends Entity {
@@ -3548,15 +3548,18 @@ public abstract class LivingEntity extends Entity {
this.entityData.set(LivingEntity.DATA_LIVING_ENTITY_FLAGS, (byte) j);
}
@ -31,7 +31,7 @@ index ddb0a2f4d2894bd416d4b4b8d9cf1538705d104c..01546bc3e79e1f69385d070ce97f047c
}
}
@@ -3628,6 +3631,7 @@ public abstract class LivingEntity extends Entity {
@@ -3629,6 +3632,7 @@ public abstract class LivingEntity extends Entity {
this.releaseUsingItem();
} else {
if (!this.useItem.isEmpty() && this.isUsingItem()) {
@ -39,7 +39,7 @@ index ddb0a2f4d2894bd416d4b4b8d9cf1538705d104c..01546bc3e79e1f69385d070ce97f047c
this.triggerItemUseEffects(this.useItem, 16);
// CraftBukkit start - fire PlayerItemConsumeEvent
ItemStack itemstack;
@@ -3662,8 +3666,8 @@ public abstract class LivingEntity extends Entity {
@@ -3663,8 +3667,8 @@ public abstract class LivingEntity extends Entity {
}
this.stopUsingItem();

View File

@ -7,10 +7,10 @@ When the server is lagging, players will wait longer when eating.
Change to also use a time check instead if it passes.
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 01546bc3e79e1f69385d070ce97f047c670ab926..13bb9c49847df699263977864dec52752ee4cf28 100644
index 53951f2c4dc77e9723d0a6314781d9ee0aa8ce54..d03d0c896ef7758dbfbf5b9aa3119e07e6ef389c 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3491,6 +3491,11 @@ public abstract class LivingEntity extends Entity {
@@ -3492,6 +3492,11 @@ public abstract class LivingEntity extends Entity {
return ((Byte) this.entityData.get(LivingEntity.DATA_LIVING_ENTITY_FLAGS) & 2) > 0 ? InteractionHand.OFF_HAND : InteractionHand.MAIN_HAND;
}
@ -22,7 +22,7 @@ index 01546bc3e79e1f69385d070ce97f047c670ab926..13bb9c49847df699263977864dec5275
private void updatingUsingItem() {
if (this.isUsingItem()) {
if (ItemStack.isSameIgnoreDurability(this.getItemInHand(this.getUsedItemHand()), this.useItem)) {
@@ -3508,8 +3513,12 @@ public abstract class LivingEntity extends Entity {
@@ -3509,8 +3514,12 @@ public abstract class LivingEntity extends Entity {
if (this.shouldTriggerItemUseEffects()) {
this.triggerItemUseEffects(stack, 5);
}
@ -37,7 +37,7 @@ index 01546bc3e79e1f69385d070ce97f047c670ab926..13bb9c49847df699263977864dec5275
this.completeUsingItem();
}
@@ -3555,7 +3564,10 @@ public abstract class LivingEntity extends Entity {
@@ -3556,7 +3565,10 @@ public abstract class LivingEntity extends Entity {
if (!itemstack.isEmpty() && !this.isUsingItem() || forceUpdate) { // Paper use override flag
this.useItem = itemstack;
@ -49,7 +49,7 @@ index 01546bc3e79e1f69385d070ce97f047c670ab926..13bb9c49847df699263977864dec5275
if (!this.level.isClientSide) {
this.setLivingEntityFlag(1, true);
this.setLivingEntityFlag(2, enumhand == InteractionHand.OFF_HAND);
@@ -3579,7 +3591,10 @@ public abstract class LivingEntity extends Entity {
@@ -3580,7 +3592,10 @@ public abstract class LivingEntity extends Entity {
}
} else if (!this.isUsingItem() && !this.useItem.isEmpty()) {
this.useItem = ItemStack.EMPTY;
@ -61,7 +61,7 @@ index 01546bc3e79e1f69385d070ce97f047c670ab926..13bb9c49847df699263977864dec5275
}
}
@@ -3705,7 +3720,10 @@ public abstract class LivingEntity extends Entity {
@@ -3706,7 +3721,10 @@ public abstract class LivingEntity extends Entity {
}
this.useItem = ItemStack.EMPTY;

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Entity Jump API
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 13bb9c49847df699263977864dec52752ee4cf28..6f036c7e2fa26359cc850e30c6107180512f7e7b 100644
index d03d0c896ef7758dbfbf5b9aa3119e07e6ef389c..6388c03176449cb7b22ed9cfb26ab0bfbcf75ccc 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3158,8 +3158,10 @@ public abstract class LivingEntity extends Entity {
@@ -3159,8 +3159,10 @@ public abstract class LivingEntity extends Entity {
} else if (this.isInLava() && (!this.onGround || d7 > d8)) {
this.jumpInLiquid((Tag) FluidTags.LAVA);
} else if ((this.onGround || flag && d7 <= d8) && this.noJumpDelay == 0) {

View File

@ -7,10 +7,10 @@ Will not run if max entity craming is disabled and
the max collisions per entity is less than or equal to 0
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 6f036c7e2fa26359cc850e30c6107180512f7e7b..919f230c7ebe3707e9517e2b733db0b57b7853de 100644
index 6388c03176449cb7b22ed9cfb26ab0bfbcf75ccc..f91c7cdd918ec1d329903beae9f3c0fd1da710c8 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3255,10 +3255,16 @@ public abstract class LivingEntity extends Entity {
@@ -3256,10 +3256,16 @@ public abstract class LivingEntity extends Entity {
protected void serverAiStep() {}
protected void pushEntities() {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerAttackEntityCooldownResetEvent
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 919f230c7ebe3707e9517e2b733db0b57b7853de..88e289cbd8bbf06bd7d7a911b990c4c780232ac4 100644
index f91c7cdd918ec1d329903beae9f3c0fd1da710c8..de5ea38fd6103cd70b646199b4e0327f981cec9f 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -2032,7 +2032,16 @@ public abstract class LivingEntity extends Entity {
@@ -2033,7 +2033,16 @@ public abstract class LivingEntity extends Entity {
EntityDamageEvent event = CraftEventFactory.handleLivingEntityDamageEvent(this, damagesource, originalDamage, hardHatModifier, blockingModifier, armorModifier, resistanceModifier, magicModifier, absorptionModifier, hardHat, blocking, armor, resistance, magic, absorption);
if (damagesource.getEntity() instanceof net.minecraft.world.entity.player.Player) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Don't check chunk for portal on world gen entity add
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 88e289cbd8bbf06bd7d7a911b990c4c780232ac4..d9f867b2d3688c3b5e5ed1d754e3d1d1567af383 100644
index de5ea38fd6103cd70b646199b4e0327f981cec9f..5bba20d869463ec859ae7ac1904da7b42b98309a 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3352,7 +3352,7 @@ public abstract class LivingEntity extends Entity {
@@ -3353,7 +3353,7 @@ public abstract class LivingEntity extends Entity {
Entity entity = this.getVehicle();
super.stopRiding(suppressCancellation); // Paper - suppress

View File

@ -61,10 +61,10 @@ index 8fb89326395a7e70982c0d757b506565e98b12a4..a060cca08631fb42041e3a79a9abc422
} else if (entity.level.isClientSide && (!(entity1 instanceof Player) || !((Player) entity1).isLocalPlayer())) {
return false;
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index d9f867b2d3688c3b5e5ed1d754e3d1d1567af383..df18c754e316335d246091169584419c3b3e2a5d 100644
index 5bba20d869463ec859ae7ac1904da7b42b98309a..6af985b2eba28d3a694afe663e1d76628add940c 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3270,7 +3270,7 @@ public abstract class LivingEntity extends Entity {
@@ -3271,7 +3271,7 @@ public abstract class LivingEntity extends Entity {
return;
}
// Paper end - don't run getEntities if we're not going to use its result
@ -73,7 +73,7 @@ index d9f867b2d3688c3b5e5ed1d754e3d1d1567af383..df18c754e316335d246091169584419c
if (!list.isEmpty()) {
// Paper - move up
@@ -3437,9 +3437,16 @@ public abstract class LivingEntity extends Entity {
@@ -3438,9 +3438,16 @@ public abstract class LivingEntity extends Entity {
return !this.isRemoved() && this.collides; // CraftBukkit
}

View File

@ -29,10 +29,10 @@ index 0f6c872288b1ea7cf1dc552827d116360d3c54bb..150b3b2411a803d6fb4d2f105752d6dd
return new Throwable(entity + " Added to world at " + new java.util.Date());
}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index df18c754e316335d246091169584419c3b3e2a5d..738d0b2e9169d6ce24c6394eb7e4fb1e396826e8 100644
index 6af985b2eba28d3a694afe663e1d76628add940c..9e89e7fc7061bbd9f09744f8fcf706c43bda693f 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3216,6 +3216,20 @@ public abstract class LivingEntity extends Entity {
@@ -3217,6 +3217,20 @@ public abstract class LivingEntity extends Entity {
this.pushEntities();
this.level.getProfiler().pop();

View File

@ -9,10 +9,10 @@ till their item is switched.
This patch clears the active item when the event is cancelled
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 738d0b2e9169d6ce24c6394eb7e4fb1e396826e8..cceba2e3dd2570962efd20d0cbbf238ccc726702 100644
index 9e89e7fc7061bbd9f09744f8fcf706c43bda693f..76400ad859d478139b9fd0433dca2a98ae49d2db 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3695,6 +3695,7 @@ public abstract class LivingEntity extends Entity {
@@ -3696,6 +3696,7 @@ public abstract class LivingEntity extends Entity {
level.getCraftServer().getPluginManager().callEvent(event);
if (event.isCancelled()) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add more line of sight methods
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index cceba2e3dd2570962efd20d0cbbf238ccc726702..46bf9aaa8406228e74f007e153afc9bcc0efd6b5 100644
index 76400ad859d478139b9fd0433dca2a98ae49d2db..58b36ed797476f3cec78529e09e913ebb791c5e3 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3423,6 +3423,7 @@ public abstract class LivingEntity extends Entity {
@@ -3424,6 +3424,7 @@ public abstract class LivingEntity extends Entity {
Vec3 vec3d = new Vec3(this.getX(), this.getEyeY(), this.getZ());
Vec3 vec3d1 = new Vec3(entity.getX(), entity.getEyeY(), entity.getZ());