Update to Minecraft 1.17.1

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-07-07 00:00:00 +10:00
parent 0392f45e9c
commit e8c9836ec9
59 changed files with 428 additions and 492 deletions

View File

@@ -20,7 +20,7 @@
public abstract class EntityInsentient extends EntityLiving {
private static final DataWatcherObject<Byte> DATA_MOB_FLAGS_ID = DataWatcher.a(EntityInsentient.class, DataWatcherRegistry.BYTE);
@@ -112,6 +125,8 @@
@@ -113,6 +126,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.a(2, ItemStack.EMPTY);
@@ -135,6 +150,9 @@
@@ -136,6 +151,9 @@
this.initPathfinder();
}
@@ -39,7 +39,7 @@
}
protected void initPathfinder() {}
@@ -215,7 +233,38 @@
@@ -216,7 +234,38 @@
}
public void setGoalTarget(@Nullable EntityLiving entityliving) {
@@ -78,7 +78,7 @@
}
@Override
@@ -442,16 +491,26 @@
@@ -443,16 +492,26 @@
nbttagcompound.setBoolean("NoAI", this.isNoAI());
}
@@ -107,7 +107,7 @@
NBTTagList nbttaglist;
int i;
@@ -498,6 +557,11 @@
@@ -499,6 +558,11 @@
}
this.setNoAI(nbttagcompound.getBoolean("NoAI"));
@@ -119,7 +119,7 @@
}
@Override
@@ -561,7 +625,7 @@
@@ -562,7 +626,7 @@
protected void b(EntityItem entityitem) {
ItemStack itemstack = entityitem.getItemStack();
@@ -128,7 +128,7 @@
this.a(entityitem);
this.receive(entityitem, itemstack.getCount());
entityitem.die();
@@ -570,15 +634,29 @@
@@ -571,15 +635,29 @@
}
public boolean j(ItemStack itemstack) {
@@ -159,7 +159,7 @@
}
this.b(enumitemslot, itemstack);
@@ -691,18 +769,18 @@
@@ -692,18 +770,18 @@
EntityHuman entityhuman = this.level.findNearbyPlayer(this, -1.0D);
if (entityhuman != null) {
@@ -181,7 +181,7 @@
this.die();
} else if (d0 < (double) l) {
this.noActionTime = 0;
@@ -717,6 +795,7 @@
@@ -718,6 +796,7 @@
@Override
protected final void doTick() {
++this.noActionTime;
@@ -189,7 +189,7 @@
this.level.getMethodProfiler().enter("sensing");
this.sensing.a();
this.level.getMethodProfiler().exit();
@@ -1100,6 +1179,12 @@
@@ -1101,6 +1180,12 @@
if (!this.isAlive()) {
return EnumInteractionResult.PASS;
} else if (this.getLeashHolder() == entityhuman) {
@@ -202,7 +202,7 @@
this.unleash(true, !entityhuman.getAbilities().instabuild);
return EnumInteractionResult.a(this.level.isClientSide);
} else {
@@ -1118,6 +1203,12 @@
@@ -1119,6 +1204,12 @@
ItemStack itemstack = entityhuman.b(enumhand);
if (itemstack.a(Items.LEAD) && this.a(entityhuman)) {
@@ -215,7 +215,7 @@
this.setLeashHolder(entityhuman, true);
itemstack.subtract(1);
return EnumInteractionResult.a(this.level.isClientSide);
@@ -1133,7 +1224,7 @@
@@ -1134,7 +1225,7 @@
if (itemstack.getItem() instanceof ItemMonsterEgg) {
if (this.level instanceof WorldServer) {
ItemMonsterEgg itemmonsteregg = (ItemMonsterEgg) itemstack.getItem();
@@ -224,7 +224,7 @@
optional.ifPresent((entityinsentient) -> {
this.a(entityhuman, entityinsentient);
@@ -1183,12 +1274,19 @@
@@ -1184,12 +1275,19 @@
return this.restrictRadius != -1.0F;
}
@@ -245,7 +245,7 @@
t0.s(this);
t0.setBaby(this.isBaby());
@@ -1220,7 +1318,12 @@
@@ -1221,7 +1319,12 @@
}
}
@@ -259,7 +259,7 @@
if (this.isPassenger()) {
Entity entity = this.getVehicle();
@@ -1240,6 +1343,7 @@
@@ -1241,6 +1344,7 @@
if (this.leashHolder != null) {
if (!this.isAlive() || !this.leashHolder.isAlive()) {
@@ -267,7 +267,7 @@
this.unleash(true, true);
}
@@ -1251,7 +1355,9 @@
@@ -1252,7 +1356,9 @@
this.leashHolder = null;
this.leashInfoTag = null;
if (!this.level.isClientSide && flag1) {
@@ -277,7 +277,7 @@
}
if (!this.level.isClientSide && flag && this.level instanceof WorldServer) {
@@ -1301,6 +1407,7 @@
@@ -1302,6 +1408,7 @@
boolean flag1 = super.a(entity, flag);
if (flag1 && this.isLeashed()) {
@@ -285,7 +285,7 @@
this.unleash(true, true);
}
@@ -1396,7 +1503,14 @@
@@ -1397,7 +1504,14 @@
int i = EnchantmentManager.getFireAspectEnchantmentLevel(this);
if (i > 0) {
@@ -301,7 +301,7 @@
}
boolean flag = entity.damageEntity(DamageSource.mobAttack(this), f);
@@ -1464,9 +1578,10 @@
@@ -1465,9 +1579,10 @@
@Override
protected void cc() {
super.cc();

View File

@@ -497,7 +497,7 @@
}
}
@@ -1374,6 +1615,13 @@
@@ -1378,6 +1619,13 @@
if (!flag) {
EntityItem entityitem = new EntityItem(this.level, this.locX(), this.locY(), this.locZ(), new ItemStack(Items.WITHER_ROSE));
@@ -511,7 +511,7 @@
this.level.addEntity(entityitem);
}
}
@@ -1393,21 +1641,40 @@
@@ -1397,21 +1645,40 @@
boolean flag = this.lastHurtByPlayerTime > 0;
@@ -555,7 +555,7 @@
}
@@ -1523,9 +1790,14 @@
@@ -1527,9 +1794,14 @@
int i = this.d(f, f1);
if (i > 0) {
@@ -571,7 +571,7 @@
return true;
} else {
return flag;
@@ -1574,7 +1846,7 @@
@@ -1578,7 +1850,7 @@
protected float applyArmorModifier(DamageSource damagesource, float f) {
if (!damagesource.ignoresArmor()) {
@@ -580,7 +580,7 @@
f = CombatMath.a(f, (float) this.getArmorStrength(), (float) this.b(GenericAttributes.ARMOR_TOUGHNESS));
}
@@ -1587,7 +1859,8 @@
@@ -1591,7 +1863,8 @@
} else {
int i;
@@ -590,7 +590,7 @@
i = (this.getEffect(MobEffects.DAMAGE_RESISTANCE).getAmplifier() + 1) * 5;
int j = 25 - i;
float f1 = f * (float) j;
@@ -1618,29 +1891,172 @@
@@ -1622,29 +1895,172 @@
}
}
@@ -773,7 +773,7 @@
}
public CombatTracker getCombatTracker() {
@@ -1661,8 +2077,18 @@
@@ -1665,8 +2081,18 @@
}
public final void setArrowCount(int i) {
@@ -793,7 +793,7 @@
public final int eh() {
return (Integer) this.entityData.get(EntityLiving.DATA_STINGER_COUNT_ID);
@@ -1958,6 +2384,12 @@
@@ -1962,6 +2388,12 @@
public abstract ItemStack getEquipment(EnumItemSlot enumitemslot);
@@ -806,7 +806,7 @@
@Override
public abstract void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack);
@@ -2202,6 +2634,7 @@
@@ -2205,6 +2637,7 @@
}
if (this.onGround && !this.level.isClientSide) {
@@ -814,7 +814,7 @@
this.setFlag(7, false);
}
} else {
@@ -2732,6 +3165,7 @@
@@ -2735,6 +3168,7 @@
}
if (!this.level.isClientSide) {
@@ -822,7 +822,7 @@
this.setFlag(7, flag);
}
@@ -2899,14 +3333,21 @@
@@ -2902,14 +3336,21 @@
@Override
public boolean isInteractable() {
@@ -846,7 +846,7 @@
@Override
protected void velocityChanged() {
this.hurtMarked = this.random.nextDouble() >= this.b(GenericAttributes.KNOCKBACK_RESISTANCE);
@@ -3104,7 +3545,25 @@
@@ -3107,7 +3548,25 @@
} else {
if (!this.useItem.isEmpty() && this.isHandRaised()) {
this.b(this.useItem, 16);
@@ -873,7 +873,7 @@
if (itemstack != this.useItem) {
this.a(enumhand, itemstack);
@@ -3176,6 +3635,12 @@
@@ -3179,6 +3638,12 @@
}
public boolean a(double d0, double d1, double d2, boolean flag) {
@@ -886,7 +886,7 @@
double d3 = this.locX();
double d4 = this.locY();
double d5 = this.locZ();
@@ -3200,16 +3665,41 @@
@@ -3203,16 +3668,41 @@
}
if (flag2) {
@@ -931,7 +931,7 @@
} else {
if (flag) {
world.broadcastEntityEffect(this, (byte) 46);
@@ -3219,7 +3709,7 @@
@@ -3222,7 +3712,7 @@
((EntityCreature) this).getNavigation().o();
}
@@ -940,7 +940,7 @@
}
}
@@ -3302,7 +3792,7 @@
@@ -3305,7 +3795,7 @@
}
public void entityWakeup() {
@@ -949,16 +949,16 @@
World world = this.level;
java.util.Objects.requireNonNull(this.level);
@@ -3334,7 +3824,7 @@
@@ -3337,7 +3827,7 @@
@Nullable
public EnumDirection eW() {
public EnumDirection eX() {
- BlockPosition blockposition = (BlockPosition) this.getBedPosition().orElse((Object) null);
+ BlockPosition blockposition = (BlockPosition) this.getBedPosition().orElse(null); // CraftBukkit - decompile error
return blockposition != null ? BlockBed.a((IBlockAccess) this.level, blockposition) : null;
}
@@ -3383,7 +3873,7 @@
@@ -3386,7 +3876,7 @@
Pair<MobEffect, Float> pair = (Pair) iterator.next();
if (!world.isClientSide && pair.getFirst() != null && world.random.nextFloat() < (Float) pair.getSecond()) {

View File

@@ -7,5 +7,5 @@
- if (!entity1.isCollidable()) {
+ if (!entity1.canCollideWithBukkit(entity) || !entity.canCollideWithBukkit(entity1)) { // CraftBukkit - collidable API
return false;
} else if (entity.level.isClientSide && (!(entity1 instanceof EntityHuman) || !((EntityHuman) entity1).fh())) {
} else if (entity.level.isClientSide && (!(entity1 instanceof EntityHuman) || !((EntityHuman) entity1).fi())) {
return false;

View File

@@ -15,7 +15,7 @@
public interface Bucketable {
boolean isFromBucket();
@@ -90,10 +98,22 @@
@@ -92,10 +100,22 @@
ItemStack itemstack = entityhuman.b(enumhand);
if (itemstack.getItem() == Items.WATER_BUCKET && t0.isAlive()) {

View File

@@ -35,7 +35,7 @@
+ if (flag && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(EntityBee.this, blockposition, iblockdata.set(blockstateinteger, (Integer) iblockdata.get(blockstateinteger) + 1)).isCancelled()) { // Spigot
EntityBee.this.level.triggerEffect(2005, blockposition, 0);
EntityBee.this.level.setTypeUpdate(blockposition, (IBlockData) iblockdata.set(blockstateinteger, (Integer) iblockdata.get(blockstateinteger) + 1));
EntityBee.this.fR();
EntityBee.this.fS();
@@ -1289,7 +1293,7 @@
@Override
protected void a(EntityInsentient entityinsentient, EntityLiving entityliving) {

View File

@@ -11,7 +11,7 @@
hashmap.put(2, new MinecraftKey("textures/entity/cat/red.png"));
@@ -433,7 +433,7 @@
}
} else if (this.n(itemstack)) {
} else if (this.isBreedItem(itemstack)) {
this.a(entityhuman, enumhand, itemstack);
- if (this.random.nextInt(3) == 0) {
+ if (this.random.nextInt(3) == 0 && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this, entityhuman).isCancelled()) { // CraftBukkit

View File

@@ -8,7 +8,7 @@
+ this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityGuardian.class})).a(new Class[0])); // CraftBukkit - decompile error
}
public static AttributeProvider.Builder fv() {
public static AttributeProvider.Builder fw() {
@@ -243,6 +243,12 @@
ItemStack itemstack = entityitem.getItemStack();

View File

@@ -1,19 +1,5 @@
--- a/net/minecraft/world/entity/animal/EntityOcelot.java
+++ b/net/minecraft/world/entity/animal/EntityOcelot.java
@@ -68,11 +68,11 @@
this.t();
}
- boolean isTrusting() {
+ public boolean isTrusting() {
return (Boolean) this.entityData.get(EntityOcelot.DATA_TRUSTING);
}
- private void setTrusting(boolean flag) {
+ public void setTrusting(boolean flag) {
this.entityData.set(EntityOcelot.DATA_TRUSTING, flag);
this.t();
}
@@ -133,7 +133,7 @@
@Override
@@ -24,7 +10,7 @@
public static AttributeProvider.Builder p() {
@@ -182,7 +182,8 @@
if ((this.temptGoal == null || this.temptGoal.h()) && !this.isTrusting() && this.n(itemstack) && entityhuman.f((Entity) this) < 9.0D) {
if ((this.temptGoal == null || this.temptGoal.h()) && !this.isTrusting() && this.isBreedItem(itemstack) && entityhuman.f((Entity) this) < 9.0D) {
this.a(entityhuman, enumhand, itemstack);
if (!this.level.isClientSide) {
- if (this.random.nextInt(3) == 0) {

View File

@@ -10,7 +10,7 @@
private static final DataWatcherObject<Integer> DATA_VARIANT = DataWatcher.a(Axolotl.class, DataWatcherRegistry.INT);
private static final DataWatcherObject<Boolean> DATA_PLAYING_DEAD = DataWatcher.a(Axolotl.class, DataWatcherRegistry.BOOLEAN);
private static final DataWatcherObject<Boolean> FROM_BUCKET = DataWatcher.a(Axolotl.class, DataWatcherRegistry.BOOLEAN);
@@ -239,6 +240,7 @@
@@ -235,6 +236,7 @@
@Override
public void setFromBucket(boolean flag) {
this.entityData.set(Axolotl.FROM_BUCKET, flag);
@@ -18,7 +18,7 @@
}
@Nullable
@@ -280,7 +282,7 @@
@@ -276,7 +278,7 @@
@Override
protected void mobTick() {
this.level.getMethodProfiler().enter("axolotlBrain");
@@ -27,7 +27,7 @@
this.level.getMethodProfiler().exit();
this.level.getMethodProfiler().enter("axolotlActivityUpdate");
AxolotlAi.a(this);
@@ -422,7 +424,7 @@
@@ -418,7 +420,7 @@
if (i < 2400) {
i = Math.min(2400, 100 + i);
@@ -36,7 +36,7 @@
}
entityhuman.removeEffect(MobEffects.DIG_SLOWDOWN);
@@ -472,7 +474,7 @@
@@ -468,7 +470,7 @@
@Override
public BehaviorController<Axolotl> getBehaviorController() {
@@ -45,7 +45,7 @@
}
@Override
@@ -505,7 +507,7 @@
@@ -501,7 +503,7 @@
@Override
public boolean isTypeNotPersistent(double d0) {

View File

@@ -12,7 +12,7 @@
public class Goat extends EntityAnimal {
public static final EntitySize LONG_JUMPING_DIMENSIONS = EntitySize.b(0.9F, 1.3F).a(0.7F);
@@ -123,13 +128,13 @@
@@ -137,13 +142,13 @@
@Override
public BehaviorController<Goat> getBehaviorController() {
@@ -28,7 +28,7 @@
this.level.getMethodProfiler().exit();
this.level.getMethodProfiler().enter("goatActivityUpdate");
GoatAi.b(this);
@@ -161,8 +166,15 @@
@@ -175,8 +180,15 @@
ItemStack itemstack = entityhuman.b(enumhand);
if (itemstack.a(Items.BUCKET) && !this.isBaby()) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/horse/EntityHorseAbstract.java
+++ b/net/minecraft/world/entity/animal/horse/EntityHorseAbstract.java
@@ -70,6 +70,8 @@
@@ -69,6 +69,8 @@
import net.minecraft.world.phys.AxisAlignedBB;
import net.minecraft.world.phys.Vec3D;
@@ -9,7 +9,7 @@
public abstract class EntityHorseAbstract extends EntityAnimal implements IInventoryListener, IJumpable, ISaddleable {
public static final int EQUIPMENT_SLOT_OFFSET = 400;
@@ -109,6 +111,7 @@
@@ -108,6 +110,7 @@
private float mouthAnimO;
protected boolean canGallop = true;
protected int gallopSoundCounter;
@@ -17,7 +17,7 @@
protected EntityHorseAbstract(EntityTypes<? extends EntityHorseAbstract> entitytypes, World world) {
super(entitytypes, world);
@@ -293,7 +296,7 @@
@@ -292,7 +295,7 @@
public void loadChest() {
InventorySubcontainer inventorysubcontainer = this.inventory;
@@ -26,7 +26,7 @@
if (inventorysubcontainer != null) {
inventorysubcontainer.b((IInventoryListener) this);
int i = Math.min(inventorysubcontainer.getSize(), this.inventory.getSize());
@@ -409,7 +412,7 @@
@@ -408,7 +411,7 @@
}
public int getMaxDomestication() {
@@ -35,7 +35,7 @@
}
@Override
@@ -479,7 +482,7 @@
@@ -478,7 +481,7 @@
}
if (this.getHealth() < this.getMaxHealth() && f > 0.0F) {
@@ -44,7 +44,7 @@
flag = true;
}
@@ -556,7 +559,7 @@
@@ -555,7 +558,7 @@
super.movementTick();
if (!this.level.isClientSide && this.isAlive()) {
if (this.random.nextInt(900) == 0 && this.deathTime == 0) {
@@ -52,8 +52,8 @@
+ this.heal(1.0F, RegainReason.REGEN); // CraftBukkit
}
if (this.fU()) {
@@ -794,6 +797,7 @@
if (this.fV()) {
@@ -786,6 +789,7 @@
if (this.getOwnerUUID() != null) {
nbttagcompound.a("Owner", this.getOwnerUUID());
}
@@ -61,7 +61,7 @@
if (!this.inventory.getItem(0).isEmpty()) {
nbttagcompound.set("SaddleItem", this.inventory.getItem(0).save(new NBTTagCompound()));
@@ -821,6 +825,11 @@
@@ -813,6 +817,11 @@
if (uuid != null) {
this.setOwnerUUID(uuid);
}
@@ -73,7 +73,7 @@
if (nbttagcompound.hasKeyOfType("SaddleItem", 10)) {
ItemStack itemstack = ItemStack.a(nbttagcompound.getCompound("SaddleItem"));
@@ -903,6 +912,18 @@
@@ -895,6 +904,18 @@
@Override
public void b(int i) {
@@ -90,5 +90,5 @@
+ }
+ // CraftBukkit end
this.allowStandSliding = true;
this.fD();
this.fW();
this.fE();
this.fX();

View File

@@ -1,24 +0,0 @@
--- a/net/minecraft/world/entity/monster/EntitySkeleton.java
+++ b/net/minecraft/world/entity/monster/EntitySkeleton.java
@@ -16,10 +16,10 @@
public class EntitySkeleton extends EntitySkeletonAbstract {
- private static final DataWatcherObject<Boolean> DATA_STRAY_CONVERSION_ID = DataWatcher.a(EntitySkeleton.class, DataWatcherRegistry.BOOLEAN);
+ public static final DataWatcherObject<Boolean> DATA_STRAY_CONVERSION_ID = DataWatcher.a(EntitySkeleton.class, DataWatcherRegistry.BOOLEAN); // PAIL private -> public
public static final String CONVERSION_TAG = "StrayConversionTime";
private int inPowderSnowTime;
- private int conversionTime;
+ public int conversionTime; // PAIL private -> public
public EntitySkeleton(EntityTypes<? extends EntitySkeleton> entitytypes, World world) {
super(entitytypes, world);
@@ -80,7 +80,7 @@
}
- private void a(int i) {
+ public void a(int i) { // PAIL private -> public // PAIL rename startStrayConversion
this.conversionTime = i;
this.entityData.set(EntitySkeleton.DATA_STRAY_CONVERSION_ID, true);
}

View File

@@ -13,5 +13,5 @@
+ }
+ // CraftBukkit end
super.tick();
this.fD();
this.fE();
this.checkBlockCollisions();

View File

@@ -34,7 +34,7 @@
+ this.conversionTime -= elapsedTicks;
+ // CraftBukkit end
if (this.conversionTime < 0) {
this.fy();
this.fz();
}
@@ -222,6 +235,7 @@
}
@@ -61,7 +61,7 @@
if (entityzombie != null) {
entityzombie.z(entityzombie.level.getDamageScaler(entityzombie.getChunkCoordinates()).d());
entityzombie.w(entityzombie.p() && this.fD());
entityzombie.w(entityzombie.p() && this.fE());
+ // CraftBukkit start - SPIGOT-5208: End conversion to stop event spam
+ } else {
+ ((Zombie) getBukkitEntity()).setConversionTime(-1);
@@ -111,7 +111,7 @@
entityzombievillager.prepare(worldserver, worldserver.getDamageScaler(entityzombievillager.getChunkCoordinates()), EnumMobSpawn.CONVERSION, new EntityZombie.GroupDataZombie(false, true), (NBTTagCompound) null);
entityzombievillager.setVillagerData(entityvillager.getVillagerData());
@@ -472,7 +503,7 @@
@@ -477,7 +508,7 @@
entitychicken1.prepare(worldaccess, difficultydamagescaler, EnumMobSpawn.JOCKEY, (GroupDataEntity) null, (NBTTagCompound) null);
entitychicken1.setChickenJockey(true);
this.startRiding(entitychicken1);

View File

@@ -92,7 +92,7 @@
+ boolean flag = PiglinAI.isLovedByPiglin(itemstack, this) || itemstack.a(Items.CROSSBOW); // CraftBukkit
+ boolean flag1 = PiglinAI.isLovedByPiglin(itemstack1, this) || itemstack1.a(Items.CROSSBOW); // CraftBukkit
return flag && !flag1 ? true : (!flag && flag1 ? false : (this.fv() && !itemstack.a(Items.CROSSBOW) && itemstack1.a(Items.CROSSBOW) ? false : super.a(itemstack, itemstack1)));
return flag && !flag1 ? true : (!flag && flag1 ? false : (this.fw() && !itemstack.a(Items.CROSSBOW) && itemstack1.a(Items.CROSSBOW) ? false : super.a(itemstack, itemstack1)));
}
@@ -405,7 +433,7 @@

View File

@@ -17,4 +17,4 @@
+ return (EntityLiving) this.brain.getMemory(MemoryModuleType.ATTACK_TARGET).orElse(null); // CraftBukkit - decompile error
}
protected boolean fx() {
protected boolean fy() {

View File

@@ -96,7 +96,7 @@
@@ -278,9 +292,14 @@
boolean flag1;
if (entitypiglin.fv()) {
if (entitypiglin.fw()) {
- flag1 = b(itemstack);
+ flag1 = isBarterItem(itemstack, entitypiglin); // CraftBukkit - Changes to allow custom payment for bartering
if (flag && flag1) {
@@ -154,8 +154,8 @@
}
protected static boolean b(EntityPiglin entitypiglin, ItemStack itemstack) {
- return !x(entitypiglin) && !v(entitypiglin) && entitypiglin.fv() && b(itemstack);
+ return !x(entitypiglin) && !v(entitypiglin) && entitypiglin.fv() && isBarterItem(itemstack, entitypiglin); // CraftBukkit
- return !x(entitypiglin) && !v(entitypiglin) && entitypiglin.fw() && b(itemstack);
+ return !x(entitypiglin) && !v(entitypiglin) && entitypiglin.fw() && isBarterItem(itemstack, entitypiglin); // CraftBukkit
}
protected static void a(EntityPiglin entitypiglin, EntityLiving entityliving) {

View File

@@ -51,15 +51,6 @@
}
}
@@ -302,7 +310,7 @@
}
}
- private void fT() {
+ public void fT() {
this.t(40);
if (!this.level.isClientSide()) {
this.playSound(SoundEffects.VILLAGER_NO, this.getSoundVolume(), this.ep());
@@ -444,7 +452,14 @@
while (iterator.hasNext()) {
MerchantRecipe merchantrecipe = (MerchantRecipe) iterator.next();
@@ -96,7 +87,7 @@
+ }
+ worldserver.addAllEntities(entitywitch, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING);
+ // CraftBukkit end
this.fZ();
this.ga();
this.die();
} else {
@@ -834,6 +854,13 @@

View File

@@ -88,7 +88,7 @@
}
}
@@ -688,6 +713,30 @@
@@ -684,6 +709,30 @@
entityitem.setMot((double) (-f3 * f2 * 0.3F) + Math.cos((double) f5) * (double) f6, (double) (-f1 * 0.3F + 0.1F + (this.random.nextFloat() - this.random.nextFloat()) * 0.1F), (double) (f4 * f2 * 0.3F) + Math.sin((double) f5) * (double) f6);
}
@@ -119,7 +119,7 @@
return entityitem;
}
}
@@ -814,16 +863,17 @@
@@ -810,16 +859,17 @@
if (this.isInvulnerable(damagesource)) {
return false;
} else if (this.abilities.invulnerable && !damagesource.ignoresInvulnerability()) {
@@ -139,7 +139,7 @@
}
if (this.level.getDifficulty() == EnumDifficulty.EASY) {
@@ -835,7 +885,13 @@
@@ -831,7 +881,13 @@
}
}
@@ -154,7 +154,7 @@
}
}
}
@@ -855,10 +911,29 @@
@@ -851,10 +907,29 @@
}
public boolean a(EntityHuman entityhuman) {
@@ -187,7 +187,7 @@
}
@Override
@@ -900,8 +975,13 @@
@@ -896,8 +971,13 @@
}
}
@@ -202,7 +202,7 @@
if (!this.isInvulnerable(damagesource)) {
f = this.applyArmorModifier(damagesource, f);
f = this.applyMagicModifier(damagesource, f);
@@ -916,7 +996,7 @@
@@ -912,7 +992,7 @@
}
if (f != 0.0F) {
@@ -211,7 +211,7 @@
float f3 = this.getHealth();
this.setHealth(this.getHealth() - f);
@@ -927,6 +1007,7 @@
@@ -923,6 +1003,7 @@
}
}
@@ -219,7 +219,7 @@
}
@Override
@@ -1086,7 +1167,7 @@
@@ -1082,7 +1163,7 @@
f *= 0.2F + f2 * f2 * 0.8F;
f1 *= f2;
@@ -228,7 +228,7 @@
if (f > 0.0F || f1 > 0.0F) {
boolean flag = f2 > 0.9F;
boolean flag1 = false;
@@ -1125,8 +1206,15 @@
@@ -1121,8 +1202,15 @@
if (entity instanceof EntityLiving) {
f3 = ((EntityLiving) entity).getHealth();
if (j > 0 && !entity.isBurning()) {
@@ -246,7 +246,7 @@
}
}
@@ -1154,8 +1242,11 @@
@@ -1150,8 +1238,11 @@
EntityLiving entityliving = (EntityLiving) iterator.next();
if (entityliving != this && entityliving != entity && !this.p(entityliving) && (!(entityliving instanceof EntityArmorStand) || !((EntityArmorStand) entityliving).isMarker()) && this.f((Entity) entityliving) < 9.0D) {
@@ -259,7 +259,7 @@
}
}
@@ -1164,9 +1255,26 @@
@@ -1160,9 +1251,26 @@
}
if (entity instanceof EntityPlayer && entity.hurtMarked) {
@@ -286,7 +286,7 @@
}
if (flag2) {
@@ -1211,7 +1319,14 @@
@@ -1207,7 +1315,14 @@
this.a(StatisticList.DAMAGE_DEALT, Math.round(f5 * 10.0F));
if (j > 0) {
@@ -302,7 +302,7 @@
}
if (this.level instanceof WorldServer && f5 > 2.0F) {
@@ -1221,12 +1336,17 @@
@@ -1217,12 +1332,17 @@
}
}
@@ -321,7 +321,7 @@
}
}
@@ -1299,6 +1419,12 @@
@@ -1295,6 +1415,12 @@
public void a(ItemStack itemstack, ItemStack itemstack1, ClickAction clickaction) {}
public Either<EntityHuman.EnumBedResult, Unit> sleep(BlockPosition blockposition) {
@@ -334,7 +334,7 @@
this.entitySleep(blockposition);
this.sleepCounter = 0;
return Either.right(Unit.INSTANCE);
@@ -1383,9 +1509,9 @@
@@ -1379,9 +1505,9 @@
super.jump();
this.a(StatisticList.JUMP);
if (this.isSprinting()) {
@@ -346,7 +346,7 @@
}
}
@@ -1419,7 +1545,11 @@
@@ -1415,7 +1541,11 @@
this.setMot(vec3d2.x, d3 * 0.6D, vec3d2.z);
this.flyingSpeed = f;
this.fallDistance = 0.0F;
@@ -359,7 +359,7 @@
} else {
super.g(vec3d);
}
@@ -1454,19 +1584,19 @@
@@ -1450,19 +1580,19 @@
i = Math.round((float) Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2) * 100.0F);
if (i > 0) {
this.a(StatisticList.SWIM_ONE_CM, i);
@@ -382,7 +382,7 @@
}
} else if (this.isClimbing()) {
if (d1 > 0.0D) {
@@ -1477,13 +1607,13 @@
@@ -1473,13 +1603,13 @@
if (i > 0) {
if (this.isSprinting()) {
this.a(StatisticList.SPRINT_ONE_CM, i);
@@ -399,7 +399,7 @@
}
}
} else if (this.isGliding()) {
@@ -1549,12 +1679,24 @@
@@ -1545,12 +1675,24 @@
}
public void startGliding() {
@@ -425,7 +425,7 @@
}
@Override
@@ -1644,10 +1786,21 @@
@@ -1640,10 +1782,21 @@
return this.experienceLevel >= 30 ? 112 + (this.experienceLevel - 30) * 9 : (this.experienceLevel >= 15 ? 37 + (this.experienceLevel - 15) * 5 : 7 + this.experienceLevel * 2);
}
@@ -448,7 +448,7 @@
}
}
@@ -1724,15 +1877,22 @@
@@ -1720,15 +1873,22 @@
@Override
public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) {
@@ -474,7 +474,7 @@
this.inventory.armor.set(enumitemslot.b(), itemstack);
}
@@ -1773,26 +1933,31 @@
@@ -1769,26 +1929,31 @@
protected void releaseShoulderEntities() {
if (this.timeEntitySatOnShoulder + 20L < this.level.getTime()) {