Update to Minecraft 1.21.2

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2024-10-23 02:15:00 +11:00
parent 2c4beb962b
commit d3a23f42c3
522 changed files with 8501 additions and 6477 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/projectile/IProjectile.java
+++ b/net/minecraft/world/entity/projectile/IProjectile.java
@@ -30,6 +30,10 @@
@@ -36,6 +36,10 @@
import net.minecraft.world.phys.MovingObjectPositionEntity;
import net.minecraft.world.phys.Vec3D;
@@ -11,7 +11,7 @@
public abstract class IProjectile extends Entity implements TraceableEntity {
@Nullable
@@ -41,6 +45,10 @@
@@ -47,6 +51,10 @@
@Nullable
private Entity lastDeflectedBy;
@@ -22,7 +22,7 @@
IProjectile(EntityTypes<? extends IProjectile> entitytypes, World world) {
super(entitytypes, world);
}
@@ -50,6 +58,7 @@
@@ -56,6 +64,7 @@
this.ownerUUID = entity.getUUID();
this.cachedOwner = entity;
}
@@ -30,8 +30,17 @@
}
@@ -177,6 +186,17 @@
this.setDeltaMovement(this.getDeltaMovement().add(vec3d.x, entity.onGround() ? 0.0D : vec3d.y, vec3d.z));
@@ -213,7 +222,7 @@
public static <T extends IProjectile> T spawnProjectile(T t0, WorldServer worldserver, ItemStack itemstack, Consumer<T> consumer) {
consumer.accept(t0);
- worldserver.addFreshEntity(t0);
+ if (worldserver.addFreshEntity(t0)) // CraftBukkit
t0.applyOnProjectileSpawned(worldserver, itemstack);
return t0;
}
@@ -232,6 +241,17 @@
}
+ // CraftBukkit start - call projectile hit event
@@ -48,7 +57,7 @@
protected ProjectileDeflection hitTargetOrDeflectSelf(MovingObjectPosition movingobjectposition) {
if (movingobjectposition.getType() == MovingObjectPosition.EnumMovingObjectType.ENTITY) {
MovingObjectPositionEntity movingobjectpositionentity = (MovingObjectPositionEntity) movingobjectposition;
@@ -237,6 +257,11 @@
@@ -309,6 +329,11 @@
protected void onHitEntity(MovingObjectPositionEntity movingobjectpositionentity) {}
protected void onHitBlock(MovingObjectPositionBlock movingobjectpositionblock) {