Update to Minecraft 1.20.2

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2023-09-22 02:40:00 +10:00
parent 193398c0ff
commit 8a3c8cfcd4
238 changed files with 2448 additions and 2344 deletions

View File

@@ -1,8 +1,8 @@
--- a/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java
+++ b/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java
@@ -47,6 +47,16 @@
import net.minecraft.world.phys.AxisAlignedBB;
@@ -50,6 +50,16 @@
import net.minecraft.world.phys.Vec3D;
import org.joml.Vector3f;
+// CraftBukkit start
+import org.bukkit.Location;
@@ -16,10 +16,10 @@
+
public abstract class EntityMinecartAbstract extends Entity {
private static final DataWatcherObject<Integer> DATA_ID_HURT = DataWatcher.defineId(EntityMinecartAbstract.class, DataWatcherRegistry.INT);
@@ -90,6 +100,17 @@
private double lyd;
private double lzd;
private static final float LOWERED_PASSENGER_ATTACHMENT_Y = 0.0F;
@@ -93,6 +103,17 @@
enummap.put(BlockPropertyTrackPosition.NORTH_EAST, Pair.of(baseblockposition2, baseblockposition1));
});
+ // CraftBukkit start
+ public boolean slowWhenEmpty = true;
@@ -34,8 +34,8 @@
+
protected EntityMinecartAbstract(EntityTypes<?> entitytypes, World world) {
super(entitytypes, world);
this.blocksBuilding = true;
@@ -216,6 +237,19 @@
this.targetDeltaMovement = Vec3D.ZERO;
@@ -222,6 +243,19 @@
if (this.isInvulnerableTo(damagesource)) {
return false;
} else {
@@ -55,7 +55,7 @@
this.setHurtDir(-this.getHurtDir());
this.setHurtTime(10);
this.markHurt();
@@ -224,6 +258,15 @@
@@ -230,6 +264,15 @@
boolean flag = damagesource.getEntity() instanceof EntityHuman && ((EntityHuman) damagesource.getEntity()).getAbilities().instabuild;
if (flag || this.getDamage() > 40.0F) {
@@ -71,7 +71,7 @@
this.ejectPassengers();
if (flag && !this.hasCustomName()) {
this.discard();
@@ -285,6 +328,14 @@
@@ -291,6 +334,14 @@
@Override
public void tick() {
@@ -86,16 +86,16 @@
if (this.getHurtTime() > 0) {
this.setHurtTime(this.getHurtTime() - 1);
}
@@ -294,7 +345,7 @@
@@ -300,7 +351,7 @@
}
this.checkBelowWorld();
- this.handleNetherPortal();
+ // this.handleNetherPortal(); // CraftBukkit - handled in postTick
double d0;
if (this.level().isClientSide) {
@@ -361,6 +412,18 @@
if (this.lerpSteps > 0) {
this.lerpPositionAndRotationStep(this.lerpSteps, this.lerpX, this.lerpY, this.lerpZ, this.lerpYRot, this.lerpXRot);
@@ -358,6 +409,18 @@
}
this.setRot(this.getYRot(), this.getXRot());
@@ -114,8 +114,8 @@
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));
@@ -369,8 +432,26 @@
Entity entity = (Entity) list.get(l);
@@ -368,8 +431,26 @@
Entity entity = (Entity) iterator.next();
if (!(entity instanceof EntityHuman) && !(entity instanceof EntityIronGolem) && !(entity instanceof EntityMinecartAbstract) && !this.isVehicle() && !entity.isPassenger()) {
+ // CraftBukkit start
@@ -141,8 +141,8 @@
entity.push(this);
}
}
@@ -382,6 +463,14 @@
Entity entity1 = (Entity) iterator.next();
@@ -381,6 +462,14 @@
Entity entity1 = (Entity) iterator1.next();
if (!this.hasPassenger(entity1) && entity1.isPushable() && entity1 instanceof EntityMinecartAbstract) {
+ // CraftBukkit start
@@ -156,7 +156,7 @@
entity1.push(this);
}
}
@@ -398,7 +487,7 @@
@@ -397,7 +486,7 @@
}
protected double getMaxSpeed() {
@@ -165,7 +165,7 @@
}
public void activateMinecart(int i, int j, int k, boolean flag) {}
@@ -409,12 +498,16 @@
@@ -408,12 +497,16 @@
this.setDeltaMovement(MathHelper.clamp(vec3d.x, -d0, d0), vec3d.y, MathHelper.clamp(vec3d.z, -d0, d0));
if (this.onGround()) {
@@ -184,7 +184,7 @@
}
}
@@ -610,7 +703,7 @@
@@ -609,7 +702,7 @@
}
protected void applyNaturalSlowdown() {
@@ -193,7 +193,7 @@
Vec3D vec3d = this.getDeltaMovement();
vec3d = vec3d.multiply(d0, 0.0D, d0);
@@ -749,6 +842,14 @@
@@ -748,6 +841,14 @@
if (!this.level().isClientSide) {
if (!entity.noPhysics && !this.noPhysics) {
if (!this.hasPassenger(entity)) {
@@ -208,7 +208,7 @@
double d0 = entity.getX() - this.getX();
double d1 = entity.getZ() - this.getZ();
double d2 = d0 * d0 + d1 * d1;
@@ -923,4 +1024,26 @@
@@ -945,4 +1046,26 @@
private EnumMinecartType() {}
}