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/EntityInsentient.java
+++ b/net/minecraft/world/entity/EntityInsentient.java
@@ -74,6 +74,19 @@
import net.minecraft.world.level.material.FluidType;
@@ -75,6 +75,19 @@
import net.minecraft.world.level.pathfinder.PathType;
import net.minecraft.world.phys.AxisAlignedBB;
+// CraftBukkit start
+import net.minecraft.server.level.EntityPlayer;
@@ -20,7 +20,7 @@
public abstract class EntityInsentient extends EntityLiving implements Targeting {
private static final DataWatcherObject<Byte> DATA_MOB_FLAGS_ID = DataWatcher.defineId(EntityInsentient.class, DataWatcherRegistry.BYTE);
@@ -120,6 +133,8 @@
@@ -122,6 +135,8 @@
private BlockPosition restrictCenter;
private float restrictRadius;
@@ -29,7 +29,7 @@
protected EntityInsentient(EntityTypes<? extends EntityInsentient> entitytypes, World world) {
super(entitytypes, world);
this.handItems = NonNullList.withSize(2, ItemStack.EMPTY);
@@ -145,6 +160,12 @@
@@ -147,6 +162,12 @@
}
@@ -42,7 +42,7 @@
protected void registerGoals() {}
public static AttributeProvider.Builder createMobAttributes() {
@@ -257,7 +278,38 @@
@@ -258,7 +279,38 @@
}
public void setTarget(@Nullable EntityLiving entityliving) {
@@ -81,7 +81,7 @@
}
@Override
@@ -397,6 +449,12 @@
@@ -398,6 +450,12 @@
return null;
}
@@ -94,7 +94,7 @@
@Override
public void addAdditionalSaveData(NBTTagCompound nbttagcompound) {
super.addAdditionalSaveData(nbttagcompound);
@@ -486,16 +544,26 @@
@@ -487,16 +545,26 @@
nbttagcompound.putBoolean("NoAI", this.isNoAi());
}
@@ -123,7 +123,7 @@
NBTTagList nbttaglist;
int i;
@@ -542,6 +610,11 @@
@@ -543,6 +611,11 @@
}
this.setNoAi(nbttagcompound.getBoolean("NoAI"));
@@ -135,7 +135,7 @@
}
@Override
@@ -609,7 +682,7 @@
@@ -610,7 +683,7 @@
protected void pickUpItem(EntityItem entityitem) {
ItemStack itemstack = entityitem.getItem();
@@ -144,7 +144,7 @@
if (!itemstack1.isEmpty()) {
this.onItemPickup(entityitem);
@@ -623,6 +696,12 @@
@@ -624,6 +697,12 @@
}
public ItemStack equipItemIfPossible(ItemStack itemstack) {
@@ -157,7 +157,7 @@
EnumItemSlot enumitemslot = getEquipmentSlotForItem(itemstack);
ItemStack itemstack1 = this.getItemBySlot(enumitemslot);
boolean flag = this.canReplaceCurrentItem(itemstack, itemstack1);
@@ -633,11 +712,19 @@
@@ -634,11 +713,19 @@
flag = itemstack1.isEmpty();
}
@@ -178,7 +178,7 @@
}
if (enumitemslot.isArmor() && itemstack.getCount() > 1) {
@@ -782,6 +869,7 @@
@@ -790,6 +877,7 @@
@Override
protected final void serverAiStep() {
++this.noActionTime;
@@ -186,7 +186,7 @@
this.level().getProfiler().push("sensing");
this.sensing.tick();
this.level().getProfiler().pop();
@@ -1175,6 +1263,12 @@
@@ -1183,6 +1271,12 @@
if (!this.isAlive()) {
return EnumInteractionResult.PASS;
} else if (this.getLeashHolder() == entityhuman) {
@@ -199,7 +199,7 @@
this.dropLeash(true, !entityhuman.getAbilities().instabuild);
this.gameEvent(GameEvent.ENTITY_INTERACT, entityhuman);
return EnumInteractionResult.sidedSuccess(this.level().isClientSide);
@@ -1200,6 +1294,12 @@
@@ -1208,6 +1302,12 @@
ItemStack itemstack = entityhuman.getItemInHand(enumhand);
if (itemstack.is(Items.LEAD) && this.canBeLeashed(entityhuman)) {
@@ -212,7 +212,7 @@
this.setLeashedTo(entityhuman, true);
itemstack.shrink(1);
return EnumInteractionResult.sidedSuccess(this.level().isClientSide);
@@ -1215,7 +1315,7 @@
@@ -1223,7 +1323,7 @@
if (itemstack.getItem() instanceof ItemMonsterEgg) {
if (this.level() instanceof WorldServer) {
ItemMonsterEgg itemmonsteregg = (ItemMonsterEgg) itemstack.getItem();
@@ -221,7 +221,7 @@
optional.ifPresent((entityinsentient) -> {
this.onOffspringSpawnedFromEgg(entityhuman, entityinsentient);
@@ -1265,12 +1365,19 @@
@@ -1273,12 +1373,19 @@
return this.restrictRadius != -1.0F;
}
@@ -242,7 +242,7 @@
if (t0 == null) {
return null;
@@ -1304,7 +1411,12 @@
@@ -1312,7 +1419,12 @@
}
}
@@ -256,7 +256,7 @@
if (this.isPassenger()) {
Entity entity = this.getVehicle();
@@ -1325,6 +1437,7 @@
@@ -1333,6 +1445,7 @@
if (this.leashHolder != null) {
if (!this.isAlive() || !this.leashHolder.isAlive()) {
@@ -264,7 +264,7 @@
this.dropLeash(true, true);
}
@@ -1336,7 +1449,9 @@
@@ -1344,7 +1457,9 @@
this.leashHolder = null;
this.leashInfoTag = null;
if (!this.level().isClientSide && flag1) {
@@ -274,7 +274,7 @@
}
if (!this.level().isClientSide && flag && this.level() instanceof WorldServer) {
@@ -1386,6 +1501,7 @@
@@ -1394,6 +1509,7 @@
boolean flag1 = super.startRiding(entity, flag);
if (flag1 && this.isLeashed()) {
@@ -282,7 +282,7 @@
this.dropLeash(true, true);
}
@@ -1410,7 +1526,9 @@
@@ -1418,7 +1534,9 @@
}
if (this.tickCount > 100) {
@@ -292,7 +292,7 @@
this.leashInfoTag = null;
}
}
@@ -1486,7 +1604,14 @@
@@ -1500,7 +1618,14 @@
int i = EnchantmentManager.getFireAspect(this);
if (i > 0) {
@@ -308,7 +308,7 @@
}
boolean flag = entity.hurt(this.damageSources().mobAttack(this), f);
@@ -1560,6 +1685,7 @@
@@ -1574,6 +1699,7 @@
@Override
protected void removeAfterChangingDimensions() {
super.removeAfterChangingDimensions();