Update to Minecraft 1.19.3

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2022-12-08 03:00:00 +11:00
parent a13136ada2
commit 8b26bb8f3e
305 changed files with 3331 additions and 2864 deletions

View File

@@ -14,7 +14,7 @@
public class ChestBoat extends EntityBoat implements HasCustomInventoryScreen, ContainerEntity {
@@ -215,4 +222,51 @@
@@ -218,4 +225,51 @@
public void clearItemStacks() {
this.itemStacks = NonNullList.withSize(this.getContainerSize(), ItemStack.EMPTY);
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/vehicle/EntityBoat.java
+++ b/net/minecraft/world/entity/vehicle/EntityBoat.java
@@ -51,6 +51,15 @@
@@ -53,6 +53,15 @@
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.phys.shapes.VoxelShapes;
@@ -13,10 +13,10 @@
+import org.bukkit.event.vehicle.VehicleMoveEvent;
+// CraftBukkit end
+
public class EntityBoat extends Entity {
public class EntityBoat extends Entity implements VariantHolder<EntityBoat.EnumBoatType> {
private static final DataWatcherObject<Integer> DATA_ID_HURT = DataWatcher.defineId(EntityBoat.class, DataWatcherRegistry.INT);
@@ -91,6 +100,14 @@
@@ -93,6 +102,14 @@
private float bubbleAngle;
private float bubbleAngleO;
@@ -31,7 +31,7 @@
public EntityBoat(EntityTypes<? extends EntityBoat> entitytypes, World world) {
super(entitytypes, world);
this.paddlePositions = new float[2];
@@ -160,6 +177,19 @@
@@ -162,6 +179,19 @@
if (this.isInvulnerableTo(damagesource)) {
return false;
} else if (!this.level.isClientSide && !this.isRemoved()) {
@@ -51,7 +51,7 @@
this.setHurtDir(-this.getHurtDir());
this.setHurtTime(10);
this.setDamage(this.getDamage() + f * 10.0F);
@@ -168,6 +198,15 @@
@@ -170,6 +200,15 @@
boolean flag = damagesource.getEntity() instanceof EntityHuman && ((EntityHuman) damagesource.getEntity()).getAbilities().instabuild;
if (flag || this.getDamage() > 40.0F) {
@@ -67,7 +67,7 @@
if (!flag && this.level.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
this.destroy(damagesource);
}
@@ -207,9 +246,29 @@
@@ -209,9 +248,29 @@
public void push(Entity entity) {
if (entity instanceof EntityBoat) {
if (entity.getBoundingBox().minY < this.getBoundingBox().maxY) {
@@ -97,7 +97,7 @@
super.push(entity);
}
@@ -262,6 +321,7 @@
@@ -276,6 +335,7 @@
return this.getDirection().getClockWise();
}
@@ -105,7 +105,7 @@
@Override
public void tick() {
this.oldStatus = this.status;
@@ -302,6 +362,22 @@
@@ -316,6 +376,22 @@
this.setDeltaMovement(Vec3D.ZERO);
}
@@ -128,7 +128,7 @@
this.tickBubbleColumn();
for (int i = 0; i <= 1; ++i) {
@@ -809,6 +885,11 @@
@@ -823,6 +899,11 @@
this.causeFallDamage(this.fallDistance, 1.0F, DamageSource.FALL);
if (!this.level.isClientSide && !this.isRemoved()) {
@@ -140,7 +140,7 @@
this.kill();
if (this.level.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
int i;
@@ -822,6 +903,7 @@
@@ -836,6 +917,7 @@
}
}
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java
+++ b/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java
@@ -48,6 +48,15 @@
@@ -47,6 +47,15 @@
import net.minecraft.world.phys.AxisAlignedBB;
import net.minecraft.world.phys.Vec3D;
@@ -16,7 +16,7 @@
public abstract class EntityMinecartAbstract extends Entity {
private static final DataWatcherObject<Integer> DATA_ID_HURT = DataWatcher.defineId(EntityMinecartAbstract.class, DataWatcherRegistry.INT);
@@ -90,6 +99,17 @@
@@ -89,6 +98,17 @@
private double lyd;
private double lzd;
@@ -34,7 +34,7 @@
protected EntityMinecartAbstract(EntityTypes<?> entitytypes, World world) {
super(entitytypes, world);
this.blocksBuilding = true;
@@ -216,6 +236,19 @@
@@ -215,6 +235,19 @@
if (this.isInvulnerableTo(damagesource)) {
return false;
} else {
@@ -54,7 +54,7 @@
this.setHurtDir(-this.getHurtDir());
this.setHurtTime(10);
this.markHurt();
@@ -224,6 +257,15 @@
@@ -223,6 +256,15 @@
boolean flag = damagesource.getEntity() instanceof EntityHuman && ((EntityHuman) damagesource.getEntity()).getAbilities().instabuild;
if (flag || this.getDamage() > 40.0F) {
@@ -70,7 +70,7 @@
this.ejectPassengers();
if (flag && !this.hasCustomName()) {
this.discard();
@@ -285,6 +327,14 @@
@@ -284,6 +326,14 @@
@Override
public void tick() {
@@ -85,7 +85,7 @@
if (this.getHurtTime() > 0) {
this.setHurtTime(this.getHurtTime() - 1);
}
@@ -294,7 +344,7 @@
@@ -293,7 +343,7 @@
}
this.checkOutOfWorld();
@@ -94,7 +94,7 @@
double d0;
if (this.level.isClientSide) {
@@ -360,6 +410,18 @@
@@ -359,6 +409,18 @@
}
this.setRot(this.getYRot(), this.getXRot());
@@ -113,7 +113,7 @@
if (this.getMinecartType() == EntityMinecartAbstract.EnumMinecartType.RIDEABLE && this.getDeltaMovement().horizontalDistanceSqr() > 0.01D) {
List<Entity> list = this.level.getEntities((Entity) this, this.getBoundingBox().inflate(0.20000000298023224D, 0.0D, 0.20000000298023224D), IEntitySelector.pushableBy(this));
@@ -368,8 +430,26 @@
@@ -367,8 +429,26 @@
Entity entity = (Entity) list.get(l);
if (!(entity instanceof EntityHuman) && !(entity instanceof EntityIronGolem) && !(entity instanceof EntityMinecartAbstract) && !this.isVehicle() && !entity.isPassenger()) {
@@ -140,7 +140,7 @@
entity.push(this);
}
}
@@ -381,6 +461,14 @@
@@ -380,6 +460,14 @@
Entity entity1 = (Entity) iterator.next();
if (!this.hasPassenger(entity1) && entity1.isPushable() && entity1 instanceof EntityMinecartAbstract) {
@@ -155,7 +155,7 @@
entity1.push(this);
}
}
@@ -397,7 +485,7 @@
@@ -396,7 +484,7 @@
}
protected double getMaxSpeed() {
@@ -164,7 +164,7 @@
}
public void activateMinecart(int i, int j, int k, boolean flag) {}
@@ -408,12 +496,16 @@
@@ -407,12 +495,16 @@
this.setDeltaMovement(MathHelper.clamp(vec3d.x, -d0, d0), vec3d.y, MathHelper.clamp(vec3d.z, -d0, d0));
if (this.onGround) {
@@ -183,7 +183,7 @@
}
}
@@ -604,7 +696,7 @@
@@ -603,7 +695,7 @@
}
protected void applyNaturalSlowdown() {
@@ -192,7 +192,7 @@
Vec3D vec3d = this.getDeltaMovement();
vec3d = vec3d.multiply(d0, 0.0D, d0);
@@ -743,6 +835,14 @@
@@ -742,6 +834,14 @@
if (!this.level.isClientSide) {
if (!entity.noPhysics && !this.noPhysics) {
if (!this.hasPassenger(entity)) {
@@ -207,7 +207,7 @@
double d0 = entity.getX() - this.getX();
double d1 = entity.getZ() - this.getZ();
double d2 = d0 * d0 + d1 * d1;
@@ -922,4 +1022,26 @@
@@ -916,4 +1016,26 @@
private EnumMinecartType() {}
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/vehicle/EntityMinecartTNT.java
+++ b/net/minecraft/world/entity/vehicle/EntityMinecartTNT.java
@@ -20,6 +20,10 @@
@@ -22,6 +22,10 @@
import net.minecraft.world.level.block.state.IBlockData;
import net.minecraft.world.level.material.Fluid;
@@ -11,11 +11,11 @@
public class EntityMinecartTNT extends EntityMinecartAbstract {
private static final byte EVENT_PRIME = 10;
@@ -106,7 +110,15 @@
@@ -114,7 +118,15 @@
d1 = 5.0D;
}
- this.level.explode(this, this.getX(), this.getY(), this.getZ(), (float) (4.0D + this.random.nextDouble() * 1.5D * d1), Explosion.Effect.BREAK);
- this.level.explode(this, damagesource, (ExplosionDamageCalculator) null, this.getX(), this.getY(), this.getZ(), (float) (4.0D + this.random.nextDouble() * 1.5D * d1), false, World.a.TNT);
+ // CraftBukkit start
+ ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), (float) (4.0D + this.random.nextDouble() * 1.5D * d1), false);
+ this.level.getCraftServer().getPluginManager().callEvent(event);
@@ -23,7 +23,7 @@
+ fuse = -1;
+ return;
+ }
+ this.level.explode(this, this.getX(), this.getY(), this.getZ(), event.getRadius(), event.getFire(), Explosion.Effect.BREAK);
+ this.level.explode(this, damagesource, (ExplosionDamageCalculator) null, this.getX(), this.getY(), this.getZ(), event.getRadius(), event.getFire(), World.a.TNT);
+ // CraftBukkit end
this.discard();
}