Update to Minecraft 1.20.5

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2024-04-24 01:15:00 +10:00
parent 4deda9501f
commit 65bc2541a3
524 changed files with 7788 additions and 6181 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/projectile/EntityArrow.java
+++ b/net/minecraft/world/entity/projectile/EntityArrow.java
@@ -47,6 +47,13 @@
@@ -49,6 +49,13 @@
import net.minecraft.world.phys.Vec3D;
import net.minecraft.world.phys.shapes.VoxelShape;
@@ -14,16 +14,16 @@
public abstract class EntityArrow extends IProjectile {
private static final double ARROW_BASE_DAMAGE = 2.0D;
@@ -219,7 +226,7 @@
@@ -225,7 +232,7 @@
}
if (object != null && !flag) {
- this.onHit((MovingObjectPosition) object);
+ this.preOnHit((MovingObjectPosition) object); // CraftBukkit - projectile hit event
this.hasImpulse = true;
}
- ProjectileDeflection projectiledeflection = this.hitTargetOrDeflectSelf((MovingObjectPosition) object);
+ ProjectileDeflection projectiledeflection = this.preHitTargetOrDeflectSelf((MovingObjectPosition) object); // CraftBukkit - projectile hit event
@@ -304,7 +311,7 @@
this.hasImpulse = true;
if (projectiledeflection != ProjectileDeflection.NONE) {
@@ -316,7 +323,7 @@
protected void tickDespawn() {
++this.life;
if (this.life >= 1200) {
@@ -32,7 +32,7 @@
}
}
@@ -337,7 +344,7 @@
@@ -349,7 +356,7 @@
}
if (this.piercingIgnoreEntityIds.size() >= this.getPierceLevel() + 1) {
@@ -41,31 +41,31 @@
return;
}
@@ -367,7 +374,13 @@
boolean flag1 = entity.getType().is(TagsEntity.DEFLECTS_ARROWS);
@@ -378,7 +385,13 @@
int k = entity.getRemainingFireTicks();
if (this.isOnFire() && !flag && !flag1) {
- entity.setSecondsOnFire(5);
if (this.isOnFire() && !flag) {
- entity.igniteForSeconds(5);
+ // CraftBukkit start
+ EntityCombustByEntityEvent combustEvent = new EntityCombustByEntityEvent(this.getBukkitEntity(), entity.getBukkitEntity(), 5);
+ org.bukkit.Bukkit.getPluginManager().callEvent(combustEvent);
+ if (!combustEvent.isCancelled()) {
+ entity.setSecondsOnFire(combustEvent.getDuration(), false);
+ entity.igniteForSeconds(combustEvent.getDuration(), false);
+ }
+ // CraftBukkit end
}
if (entity.hurt(damagesource, (float) i)) {
@@ -418,7 +431,7 @@
@@ -429,7 +442,7 @@
this.playSound(this.soundEvent, 1.0F, 1.2F / (this.random.nextFloat() * 0.2F + 0.9F));
if (this.getPierceLevel() <= 0) {
- this.discard();
+ this.discard(EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause
}
} else if (flag1) {
this.deflect();
@@ -432,7 +445,7 @@
} else {
entity.setRemainingFireTicks(k);
@@ -440,7 +453,7 @@
this.spawnAtLocation(this.getPickupItem(), 0.1F);
}
@@ -74,7 +74,7 @@
}
}
@@ -545,9 +558,24 @@
@@ -547,9 +560,24 @@
@Override
public void playerTouch(EntityHuman entityhuman) {
if (!this.level().isClientSide && (this.inGround || this.isNoPhysics()) && this.shakeTime <= 0) {