Update to Minecraft 1.18.2

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2022-03-01 02:00:00 +11:00
parent bd40300a4f
commit 9ee989ea81
184 changed files with 1785 additions and 1785 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/EntityAnimal.java
+++ b/net/minecraft/world/entity/animal/EntityAnimal.java
@@ -31,12 +31,19 @@
@@ -30,12 +30,19 @@
import net.minecraft.world.level.gameevent.GameEvent;
import net.minecraft.world.level.pathfinder.PathType;
@@ -20,7 +20,7 @@
protected EntityAnimal(EntityTypes<? extends EntityAnimal> entitytypes, World world) {
super(entitytypes, world);
@@ -73,6 +80,9 @@
@@ -72,6 +79,9 @@
}
@@ -30,7 +30,7 @@
@Override
public boolean hurt(DamageSource damagesource, float f) {
if (this.isInvulnerableTo(damagesource)) {
@@ -82,6 +92,7 @@
@@ -81,6 +91,7 @@
return super.hurt(damagesource, f);
}
}
@@ -38,7 +38,7 @@
@Override
public float getWalkTargetValue(BlockPosition blockposition, IWorldReader iworldreader) {
@@ -178,10 +189,17 @@
@@ -177,10 +188,17 @@
}
public void setInLove(@Nullable EntityHuman entityhuman) {
@@ -57,7 +57,7 @@
this.level.broadcastEntityEvent(this, (byte) 18);
}
@@ -221,11 +239,26 @@
@@ -220,11 +238,26 @@
EntityAgeable entityageable = this.getBreedOffspring(worldserver, entityanimal);
if (entityageable != null) {
@@ -84,7 +84,7 @@
if (entityplayer != null) {
entityplayer.awardStat(StatisticList.ANIMALS_BRED);
@@ -236,12 +269,14 @@
@@ -235,12 +268,14 @@
entityanimal.setAge(6000);
this.resetLove();
entityanimal.resetLove();

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/EntityBee.java
+++ b/net/minecraft/world/entity/animal/EntityBee.java
@@ -244,7 +244,7 @@
@@ -242,7 +242,7 @@
}
if (b0 > 0) {
@@ -9,7 +9,7 @@
}
}
@@ -644,11 +644,15 @@
@@ -642,11 +642,15 @@
if (this.isInvulnerableTo(damagesource)) {
return false;
} else {
@@ -27,7 +27,7 @@
}
}
@@ -1224,7 +1228,7 @@
@@ -1222,7 +1226,7 @@
}
}
@@ -36,7 +36,7 @@
EntityBee.this.level.levelEvent(2005, blockposition, 0);
EntityBee.this.level.setBlockAndUpdate(blockposition, (IBlockData) iblockdata.setValue(blockstateinteger, (Integer) iblockdata.getValue(blockstateinteger) + 1));
EntityBee.this.incrementNumCropsGrownSincePollination();
@@ -1297,7 +1301,7 @@
@@ -1295,7 +1299,7 @@
@Override
protected void alertOther(EntityInsentient entityinsentient, EntityLiving entityliving) {
if (entityinsentient instanceof EntityBee && this.mob.hasLineOfSight(entityliving)) {
@@ -45,7 +45,7 @@
}
}
@@ -1306,7 +1310,7 @@
@@ -1304,7 +1308,7 @@
private static class c extends PathfinderGoalNearestAttackableTarget<EntityHuman> {
c(EntityBee entitybee) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/EntityCat.java
+++ b/net/minecraft/world/entity/animal/EntityCat.java
@@ -434,7 +434,7 @@
@@ -443,7 +443,7 @@
}
} else if (this.isFood(itemstack)) {
this.usePlayerItem(entityhuman, enumhand, itemstack);
@@ -9,7 +9,7 @@
this.tame(entityhuman);
this.setOrderedToSit(true);
this.level.broadcastEntityEvent(this, (byte) 7);
@@ -491,7 +491,7 @@
@@ -500,7 +500,7 @@
private static class PathfinderGoalTemptChance extends PathfinderGoalTempt {
@Nullable
@@ -18,7 +18,7 @@
private final EntityCat cat;
public PathfinderGoalTemptChance(EntityCat entitycat, double d0, RecipeItemStack recipeitemstack, boolean flag) {
@@ -632,7 +632,15 @@
@@ -641,7 +641,15 @@
while (iterator.hasNext()) {
ItemStack itemstack = (ItemStack) iterator.next();
@@ -35,7 +35,7 @@
}
}
@@ -664,10 +672,10 @@
@@ -673,10 +681,10 @@
private final EntityCat cat;
public a(EntityCat entitycat, Class<T> oclass, float f, double d0, double d1) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/EntityDolphin.java
+++ b/net/minecraft/world/entity/animal/EntityDolphin.java
@@ -65,6 +65,12 @@
@@ -63,6 +63,12 @@
public class EntityDolphin extends EntityWaterAnimal {
@@ -13,7 +13,7 @@
private static final DataWatcherObject<BlockPosition> TREASURE_POS = DataWatcher.defineId(EntityDolphin.class, DataWatcherRegistry.BLOCK_POS);
private static final DataWatcherObject<Boolean> GOT_FISH = DataWatcher.defineId(EntityDolphin.class, DataWatcherRegistry.BOOLEAN);
private static final DataWatcherObject<Integer> MOISTNESS_LEVEL = DataWatcher.defineId(EntityDolphin.class, DataWatcherRegistry.INT);
@@ -192,7 +198,7 @@
@@ -190,7 +196,7 @@
@Override
public int getMaxAirSupply() {
@@ -22,7 +22,7 @@
}
@Override
@@ -233,6 +239,12 @@
@@ -231,6 +237,12 @@
ItemStack itemstack = entityitem.getItem();
if (this.canHoldItem(itemstack)) {
@@ -35,7 +35,7 @@
this.onItemPickup(entityitem);
this.setItemSlot(EnumItemSlot.MAINHAND, itemstack);
this.handDropChances[EnumItemSlot.MAINHAND.getIndex()] = 2.0F;
@@ -391,7 +403,7 @@
@@ -389,7 +401,7 @@
@Override
public boolean canUse() {
@@ -44,7 +44,7 @@
}
@Override
@@ -501,7 +513,7 @@
@@ -489,7 +501,7 @@
@Override
public void start() {
@@ -53,7 +53,7 @@
}
@Override
@@ -520,7 +532,7 @@
@@ -508,7 +520,7 @@
}
if (this.player.isSwimming() && this.player.level.random.nextInt(6) == 0) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/EntityFox.java
+++ b/net/minecraft/world/entity/animal/EntityFox.java
@@ -507,7 +507,8 @@
@@ -509,7 +509,8 @@
protected void pickUpItem(EntityItem entityitem) {
ItemStack itemstack = entityitem.getItem();
@@ -10,7 +10,7 @@
int i = itemstack.getCount();
if (i > 1) {
@@ -862,6 +863,16 @@
@@ -864,6 +865,16 @@
if (entityplayer1 != null && entityplayer != entityplayer1) {
entityfox.addTrustedUUID(entityplayer1.getUUID());
}
@@ -27,7 +27,7 @@
if (entityplayer2 != null) {
entityplayer2.awardStat(StatisticList.ANIMALS_BRED);
@@ -872,12 +883,14 @@
@@ -874,12 +885,14 @@
this.partner.setAge(6000);
this.animal.resetLove();
this.partner.resetLove();
@@ -46,7 +46,7 @@
}
}
@@ -1268,13 +1281,18 @@
@@ -1270,13 +1283,18 @@
}
private void pickGlowBerry(IBlockData iblockdata) {
@@ -66,7 +66,7 @@
int j = 1 + EntityFox.this.level.random.nextInt(2) + (i == 3 ? 1 : 0);
ItemStack itemstack = EntityFox.this.getItemBySlot(EnumItemSlot.MAINHAND);
@@ -1431,7 +1449,7 @@
@@ -1433,7 +1451,7 @@
private EntityLiving trustedLastHurt;
private int timestamp;

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/EntityMushroomCow.java
+++ b/net/minecraft/world/entity/animal/EntityMushroomCow.java
@@ -44,6 +44,13 @@
@@ -43,6 +43,13 @@
import net.minecraft.world.level.gameevent.GameEvent;
import org.apache.commons.lang3.tuple.Pair;
@@ -14,7 +14,7 @@
public class EntityMushroomCow extends EntityCow implements IShearable {
private static final DataWatcherObject<String> DATA_TYPE = DataWatcher.defineId(EntityMushroomCow.class, DataWatcherRegistry.STRING);
@@ -117,6 +124,11 @@
@@ -116,6 +123,11 @@
this.playSound(soundeffect, 1.0F, 1.0F);
return EnumInteractionResult.sidedSuccess(this.level.isClientSide);
} else if (itemstack.is(Items.SHEARS) && this.readyForShearing()) {
@@ -26,7 +26,7 @@
this.shear(SoundCategory.PLAYERS);
this.gameEvent(GameEvent.SHEAR, (Entity) entityhuman);
if (!this.level.isClientSide) {
@@ -164,7 +176,7 @@
@@ -163,7 +175,7 @@
this.level.playSound((EntityHuman) null, (Entity) this, SoundEffects.MOOSHROOM_SHEAR, soundcategory, 1.0F, 1.0F);
if (!this.level.isClientSide()) {
((WorldServer) this.level).sendParticles(Particles.EXPLOSION, this.getX(), this.getY(0.5D), this.getZ(), 1, 0.0D, 0.0D, 0.0D, 0.0D);
@@ -35,7 +35,7 @@
EntityCow entitycow = (EntityCow) EntityTypes.COW.create(this.level);
entitycow.moveTo(this.getX(), this.getY(), this.getZ(), this.getYRot(), this.getXRot());
@@ -180,10 +192,25 @@
@@ -179,10 +191,25 @@
}
entitycow.setInvulnerable(this.isInvulnerable());

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/EntityOcelot.java
+++ b/net/minecraft/world/entity/animal/EntityOcelot.java
@@ -134,7 +134,7 @@
@@ -133,7 +133,7 @@
@Override
public boolean removeWhenFarAway(double d0) {
@@ -9,7 +9,7 @@
}
public static AttributeProvider.Builder createAttributes() {
@@ -183,7 +183,8 @@
@@ -182,7 +182,8 @@
if ((this.temptGoal == null || this.temptGoal.isRunning()) && !this.isTrusting() && this.isFood(itemstack) && entityhuman.distanceToSqr((Entity) this) < 9.0D) {
this.usePlayerItem(entityhuman, enumhand, itemstack);
if (!this.level.isClientSide) {
@@ -19,7 +19,7 @@
this.setTrusting(true);
this.spawnTrustingParticles(true);
this.level.broadcastEntityEvent(this, (byte) 41);
@@ -313,10 +314,10 @@
@@ -312,10 +313,10 @@
private final EntityOcelot ocelot;
public a(EntityOcelot entityocelot, Class<T> oclass, float f, double d0, double d1) {

View File

@@ -18,7 +18,7 @@
this.onItemPickup(entityitem);
ItemStack itemstack = entityitem.getItem();
@@ -882,10 +884,10 @@
@@ -872,10 +874,10 @@
private final EntityPanda panda;
public c(EntityPanda entitypanda, Class<T> oclass, float f, double d0, double d1) {
@@ -32,7 +32,7 @@
this.panda = entitypanda;
}
@@ -1132,7 +1134,7 @@
@@ -1114,7 +1116,7 @@
@Override
protected void alertOther(EntityInsentient entityinsentient, EntityLiving entityliving) {
if (entityinsentient instanceof EntityPanda && ((EntityPanda) entityinsentient).isAggressive()) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/EntityParrot.java
+++ b/net/minecraft/world/entity/animal/EntityParrot.java
@@ -258,7 +258,7 @@
@@ -256,7 +256,7 @@
}
if (!this.level.isClientSide) {
@@ -9,7 +9,7 @@
this.tame(entityhuman);
this.level.broadcastEntityEvent(this, (byte) 7);
} else {
@@ -272,7 +272,7 @@
@@ -270,7 +270,7 @@
itemstack.shrink(1);
}
@@ -18,7 +18,7 @@
if (entityhuman.isCreative() || !this.isInvulnerable()) {
this.hurt(DamageSource.playerAttack(entityhuman), Float.MAX_VALUE);
}
@@ -384,7 +384,7 @@
@@ -382,7 +382,7 @@
@Override
public boolean isPushable() {
@@ -27,12 +27,12 @@
}
@Override
@@ -399,7 +399,7 @@
if (this.isInvulnerableTo(damagesource)) {
@@ -398,7 +398,7 @@
return false;
} else {
- this.setOrderedToSit(false);
+ // this.setOrderedToSit(false); // CraftBukkit - moved into EntityLiving.damageEntity(DamageSource, float)
if (!this.level.isClientSide) {
- this.setOrderedToSit(false);
+ // this.setOrderedToSit(false); // CraftBukkit - moved into EntityLiving.damageEntity(DamageSource, float)
}
return super.hurt(damagesource, f);
}
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/EntityRabbit.java
+++ b/net/minecraft/world/entity/animal/EntityRabbit.java
@@ -88,8 +88,14 @@
@@ -89,8 +89,14 @@
super(entitytypes, world);
this.jumpControl = new EntityRabbit.ControllerJumpRabbit(this);
this.moveControl = new EntityRabbit.ControllerMoveRabbit(this);
@@ -15,7 +15,7 @@
@Override
public void registerGoals() {
@@ -556,9 +562,23 @@
@@ -558,9 +564,23 @@
int i = (Integer) iblockdata.getValue(BlockCarrots.AGE);
if (i == 0) {

View File

@@ -12,7 +12,7 @@
private static final DataWatcherObject<Byte> DATA_PUMPKIN_ID = DataWatcher.defineId(EntitySnowman.class, DataWatcherRegistry.BYTE);
@@ -103,7 +107,7 @@
BiomeBase biomebase = this.level.getBiome(blockposition);
BiomeBase biomebase = (BiomeBase) this.level.getBiome(blockposition).value();
if (biomebase.shouldSnowGolemBurn(blockposition)) {
- this.hurt(DamageSource.ON_FIRE, 1.0F);

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/EntityTurtle.java
+++ b/net/minecraft/world/entity/animal/EntityTurtle.java
@@ -311,7 +311,9 @@
@@ -309,7 +309,9 @@
protected void ageBoundaryReached() {
super.ageBoundaryReached();
if (!this.isBaby() && this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) {
@@ -10,7 +10,7 @@
}
}
@@ -338,7 +340,9 @@
@@ -336,7 +338,9 @@
@Override
public void thunderHit(WorldServer worldserver, EntityLightning entitylightning) {
@@ -20,7 +20,7 @@
}
private static class e extends ControllerMove {
@@ -484,8 +488,12 @@
@@ -482,8 +486,12 @@
} else if (this.turtle.layEggCounter > this.adjustedTickDelay(200)) {
World world = this.turtle.level;

View File

@@ -1,7 +1,7 @@
--- a/net/minecraft/world/entity/animal/EntityWolf.java
+++ b/net/minecraft/world/entity/animal/EntityWolf.java
@@ -68,6 +68,11 @@
import net.minecraft.world.level.gameevent.GameEvent;
@@ -69,6 +69,11 @@
import net.minecraft.world.level.pathfinder.PathType;
import net.minecraft.world.phys.Vec3D;
+// CraftBukkit start
@@ -12,7 +12,7 @@
public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable {
private static final DataWatcherObject<Boolean> DATA_INTERESTED_ID = DataWatcher.defineId(EntityWolf.class, DataWatcherRegistry.BOOLEAN);
@@ -122,6 +127,24 @@
@@ -126,6 +131,24 @@
return EntityInsentient.createMobAttributes().add(GenericAttributes.MOVEMENT_SPEED, 0.30000001192092896D).add(GenericAttributes.MAX_HEALTH, 8.0D).add(GenericAttributes.ATTACK_DAMAGE, 2.0D);
}
@@ -37,16 +37,16 @@
@Override
protected void defineSynchedData() {
super.defineSynchedData();
@@ -293,7 +316,7 @@
} else {
@@ -298,7 +321,7 @@
Entity entity = damagesource.getEntity();
- this.setOrderedToSit(false);
+ // this.setWillSit(false); // CraftBukkit - moved into EntityLiving.damageEntity(DamageSource, float)
if (entity != null && !(entity instanceof EntityHuman) && !(entity instanceof EntityArrow)) {
f = (f + 1.0F) / 2.0F;
if (!this.level.isClientSide) {
- this.setOrderedToSit(false);
+ // this.setOrderedToSit(false); // CraftBukkit - moved into EntityLiving.damageEntity(DamageSource, float)
}
@@ -318,7 +341,7 @@
if (entity != null && !(entity instanceof EntityHuman) && !(entity instanceof EntityArrow)) {
@@ -325,7 +348,7 @@
super.setTame(flag);
if (flag) {
this.getAttribute(GenericAttributes.MAX_HEALTH).setBaseValue(20.0D);
@@ -55,7 +55,7 @@
} else {
this.getAttribute(GenericAttributes.MAX_HEALTH).setBaseValue(8.0D);
}
@@ -342,7 +365,7 @@
@@ -349,7 +372,7 @@
itemstack.shrink(1);
}
@@ -64,7 +64,7 @@
this.gameEvent(GameEvent.MOB_INTERACT, this.eyeBlockPosition());
return EnumInteractionResult.SUCCESS;
}
@@ -354,7 +377,7 @@
@@ -361,7 +384,7 @@
this.setOrderedToSit(!this.isOrderedToSit());
this.jumping = false;
this.navigation.stop();
@@ -73,7 +73,7 @@
return EnumInteractionResult.SUCCESS;
}
@@ -376,7 +399,8 @@
@@ -383,7 +406,8 @@
itemstack.shrink(1);
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/axolotl/Axolotl.java
+++ b/net/minecraft/world/entity/animal/axolotl/Axolotl.java
@@ -67,9 +67,16 @@
@@ -68,10 +68,17 @@
public class Axolotl extends EntityAnimal implements LerpingModel, Bucketable {
@@ -10,6 +10,7 @@
+ return AXOLOTL_TOTAL_AIR_SUPPLY;
+ }
+ // CraftBukkit end
private static final Logger LOGGER = LogUtils.getLogger();
public static final int TOTAL_PLAYDEAD_TIME = 200;
protected static final ImmutableList<? extends SensorType<? extends Sensor<? super Axolotl>>> SENSOR_TYPES = ImmutableList.of(SensorType.NEAREST_LIVING_ENTITIES, SensorType.NEAREST_ADULT, SensorType.HURT_BY, SensorType.AXOLOTL_ATTACKABLES, SensorType.AXOLOTL_TEMPTATIONS);
- protected static final ImmutableList<? extends MemoryModuleType<?>> MEMORY_TYPES = ImmutableList.of(MemoryModuleType.BREED_TARGET, MemoryModuleType.NEAREST_LIVING_ENTITIES, MemoryModuleType.NEAREST_VISIBLE_LIVING_ENTITIES, MemoryModuleType.NEAREST_VISIBLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_ATTACKABLE_PLAYER, MemoryModuleType.LOOK_TARGET, MemoryModuleType.WALK_TARGET, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.PATH, MemoryModuleType.ATTACK_TARGET, MemoryModuleType.ATTACK_COOLING_DOWN, MemoryModuleType.NEAREST_VISIBLE_ADULT, new MemoryModuleType[]{MemoryModuleType.HURT_BY_ENTITY, MemoryModuleType.PLAY_DEAD_TICKS, MemoryModuleType.NEAREST_ATTACKABLE, MemoryModuleType.TEMPTING_PLAYER, MemoryModuleType.TEMPTATION_COOLDOWN_TICKS, MemoryModuleType.IS_TEMPTED, MemoryModuleType.HAS_HUNTING_COOLDOWN});
@@ -18,7 +19,7 @@
private static final DataWatcherObject<Integer> DATA_VARIANT = DataWatcher.defineId(Axolotl.class, DataWatcherRegistry.INT);
private static final DataWatcherObject<Boolean> DATA_PLAYING_DEAD = DataWatcher.defineId(Axolotl.class, DataWatcherRegistry.BOOLEAN);
private static final DataWatcherObject<Boolean> FROM_BUCKET = DataWatcher.defineId(Axolotl.class, DataWatcherRegistry.BOOLEAN);
@@ -185,7 +192,7 @@
@@ -187,7 +194,7 @@
@Override
public int getMaxAirSupply() {
@@ -27,7 +28,7 @@
}
public Axolotl.Variant getVariant() {
@@ -236,6 +243,7 @@
@@ -238,6 +245,7 @@
@Override
public void setFromBucket(boolean flag) {
this.entityData.set(Axolotl.FROM_BUCKET, flag);
@@ -35,7 +36,7 @@
}
@Nullable
@@ -419,7 +427,7 @@
@@ -428,7 +436,7 @@
if (i < 2400) {
i = Math.min(2400, 100 + i);
@@ -44,7 +45,7 @@
}
entityhuman.removeEffect(MobEffects.DIG_SLOWDOWN);
@@ -469,7 +477,7 @@
@@ -478,7 +486,7 @@
@Override
public BehaviorController<Axolotl> getBrain() {
@@ -53,7 +54,7 @@
}
@Override
@@ -502,7 +510,7 @@
@@ -511,7 +519,7 @@
@Override
public boolean removeWhenFarAway(double d0) {

View File

@@ -1,8 +1,8 @@
--- a/net/minecraft/world/entity/animal/goat/Goat.java
+++ b/net/minecraft/world/entity/animal/goat/Goat.java
@@ -52,6 +52,11 @@
import net.minecraft.world.level.pathfinder.Pathfinder;
import net.minecraft.world.level.pathfinder.PathfinderNormal;
@@ -45,6 +45,11 @@
import net.minecraft.world.level.block.state.IBlockData;
import net.minecraft.world.level.pathfinder.PathType;
+// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory;
@@ -12,7 +12,7 @@
public class Goat extends EntityAnimal {
public static final EntitySize LONG_JUMPING_DIMENSIONS = EntitySize.scalable(0.9F, 1.3F).scale(0.7F);
@@ -139,7 +144,7 @@
@@ -134,7 +139,7 @@
@Override
public BehaviorController<Goat> getBrain() {
@@ -21,7 +21,7 @@
}
@Override
@@ -177,8 +182,15 @@
@@ -172,8 +177,15 @@
ItemStack itemstack = entityhuman.getItemInHand(enumhand);
if (itemstack.is(Items.BUCKET) && !this.isBaby()) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/horse/EntityLlama.java
+++ b/net/minecraft/world/entity/animal/horse/EntityLlama.java
@@ -78,6 +78,12 @@
@@ -77,6 +77,12 @@
return false;
}