@@ -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();
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
@@ -13,5 +13,5 @@
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
super.tick();
|
||||
this.fD();
|
||||
this.fE();
|
||||
this.checkBlockCollisions();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 @@
|
||||
|
||||
|
||||
@@ -17,4 +17,4 @@
|
||||
+ return (EntityLiving) this.brain.getMemory(MemoryModuleType.ATTACK_TARGET).orElse(null); // CraftBukkit - decompile error
|
||||
}
|
||||
|
||||
protected boolean fx() {
|
||||
protected boolean fy() {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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 @@
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
|
||||
@@ -49,23 +84,25 @@
|
||||
|
||||
if (flag && this.saturationLevel > 0.0F && entityhuman.ft() && this.foodLevel >= 20) {
|
||||
if (flag && this.saturationLevel > 0.0F && entityhuman.fu() && this.foodLevel >= 20) {
|
||||
++this.tickTimer;
|
||||
- if (this.tickTimer >= 10) {
|
||||
+ if (this.tickTimer >= this.saturatedRegenRate) { // CraftBukkit
|
||||
@@ -86,7 +86,7 @@
|
||||
+ entityhuman.applyExhaustion(f, org.bukkit.event.entity.EntityExhaustionEvent.ExhaustionReason.REGEN); // CraftBukkit - EntityExhaustionEvent
|
||||
this.tickTimer = 0;
|
||||
}
|
||||
} else if (flag && this.foodLevel >= 18 && entityhuman.ft()) {
|
||||
} else if (flag && this.foodLevel >= 18 && entityhuman.fu()) {
|
||||
++this.tickTimer;
|
||||
- if (this.tickTimer >= 80) {
|
||||
- entityhuman.heal(1.0F);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/inventory/Container.java
|
||||
+++ b/net/minecraft/world/inventory/Container.java
|
||||
@@ -29,6 +29,20 @@
|
||||
@@ -30,6 +30,20 @@
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.entity.TileEntity;
|
||||
|
||||
@@ -21,16 +21,7 @@
|
||||
public abstract class Container {
|
||||
|
||||
public static final int SLOT_CLICKED_OUTSIDE = -999;
|
||||
@@ -43,7 +57,7 @@
|
||||
public NonNullList<Slot> slots = NonNullList.a();
|
||||
private final List<ContainerProperty> dataSlots = Lists.newArrayList();
|
||||
private ItemStack carried;
|
||||
- private final NonNullList<ItemStack> remoteSlots;
|
||||
+ public NonNullList<ItemStack> remoteSlots;
|
||||
private final IntList remoteDataSlots;
|
||||
private ItemStack remoteCarried;
|
||||
@Nullable
|
||||
@@ -57,6 +71,27 @@
|
||||
@@ -59,6 +73,27 @@
|
||||
private ContainerSynchronizer synchronizer;
|
||||
private boolean suppressRemoteUpdates;
|
||||
|
||||
@@ -58,7 +49,7 @@
|
||||
protected Container(@Nullable Containers<?> containers, int i) {
|
||||
this.carried = ItemStack.EMPTY;
|
||||
this.remoteSlots = NonNullList.a();
|
||||
@@ -154,6 +189,15 @@
|
||||
@@ -156,6 +191,15 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -74,16 +65,16 @@
|
||||
public void b(ICrafting icrafting) {
|
||||
this.containerListeners.remove(icrafting);
|
||||
}
|
||||
@@ -338,7 +382,7 @@
|
||||
@@ -370,7 +414,7 @@
|
||||
}
|
||||
} else if (this.quickcraftStatus == 2) {
|
||||
if (!this.quickcraftSlots.isEmpty()) {
|
||||
- if (this.quickcraftSlots.size() == 1) {
|
||||
+ if (false && this.quickcraftSlots.size() == 1) { // CraftBukkit - treat everything as a drag since we are unable to easily call InventoryClickEvent instead
|
||||
k = ((Slot) this.quickcraftSlots.iterator().next()).index;
|
||||
this.e();
|
||||
this.f();
|
||||
this.b(k, this.quickcraftType, InventoryClickType.PICKUP, entityhuman);
|
||||
@@ -349,6 +393,7 @@
|
||||
@@ -381,6 +425,7 @@
|
||||
l = this.getCarried().getCount();
|
||||
Iterator iterator = this.quickcraftSlots.iterator();
|
||||
|
||||
@@ -91,16 +82,18 @@
|
||||
while (iterator.hasNext()) {
|
||||
Slot slot1 = (Slot) iterator.next();
|
||||
ItemStack itemstack2 = this.getCarried();
|
||||
@@ -365,12 +410,48 @@
|
||||
@@ -397,12 +442,48 @@
|
||||
}
|
||||
|
||||
l -= itemstack3.getCount() - j1;
|
||||
- slot1.set(itemstack3);
|
||||
+ // slot1.set(itemstack3);
|
||||
+ draggedSlots.put(slot1.index, itemstack3); // CraftBukkit - Put in map instead of setting
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
}
|
||||
}
|
||||
|
||||
- itemstack1.setCount(l);
|
||||
- this.setCarried(itemstack1);
|
||||
+ // CraftBukkit start - InventoryDragEvent
|
||||
+ InventoryView view = getBukkitView();
|
||||
+ org.bukkit.inventory.ItemStack newcursor = CraftItemStack.asCraftMirror(itemstack1);
|
||||
@@ -129,21 +122,19 @@
|
||||
+ if (this.getCarried() != null) {
|
||||
+ this.setCarried(CraftItemStack.asNMSCopy(event.getCursor()));
|
||||
+ needsUpdate = true;
|
||||
}
|
||||
+ }
|
||||
+ } else {
|
||||
+ this.setCarried(oldCursor);
|
||||
}
|
||||
|
||||
- itemstack1.setCount(l);
|
||||
- this.setCarried(itemstack1);
|
||||
+ }
|
||||
+
|
||||
+ if (needsUpdate && entityhuman instanceof EntityPlayer) {
|
||||
+ this.updateInventory();
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
this.e();
|
||||
@@ -388,8 +469,11 @@
|
||||
this.f();
|
||||
@@ -420,8 +501,11 @@
|
||||
if (i == -999) {
|
||||
if (!this.getCarried().isEmpty()) {
|
||||
if (clickaction == ClickAction.PRIMARY) {
|
||||
@@ -156,36 +147,39 @@
|
||||
} else {
|
||||
entityhuman.drop(this.getCarried().cloneAndSubtract(1), true);
|
||||
}
|
||||
@@ -452,6 +536,15 @@
|
||||
@@ -484,6 +568,15 @@
|
||||
}
|
||||
|
||||
slot.d();
|
||||
+ // CraftBukkit start - Make sure the client has the right slot contents
|
||||
+ if (entityhuman instanceof EntityPlayer && slot.getMaxStackSize() != 64) {
|
||||
+ ((EntityPlayer) entityhuman).connection.sendPacket(new PacketPlayOutSetSlot(this.containerId, slot.index, slot.getItem()));
|
||||
+ ((EntityPlayer) entityhuman).connection.sendPacket(new PacketPlayOutSetSlot(this.containerId, this.incrementStateId(), slot.index, slot.getItem()));
|
||||
+ // Updating a crafting inventory makes the client reset the result slot, have to send it again
|
||||
+ if (this.getBukkitView().getType() == InventoryType.WORKBENCH || this.getBukkitView().getType() == InventoryType.CRAFTING) {
|
||||
+ ((EntityPlayer) entityhuman).connection.sendPacket(new PacketPlayOutSetSlot(this.containerId, 0, this.getSlot(0).getItem()));
|
||||
+ ((EntityPlayer) entityhuman).connection.sendPacket(new PacketPlayOutSetSlot(this.containerId, this.incrementStateId(), 0, this.getSlot(0).getItem()));
|
||||
+ }
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
} else {
|
||||
Slot slot2;
|
||||
@@ -556,8 +649,11 @@
|
||||
@@ -591,13 +684,14 @@
|
||||
ItemStack itemstack = this.getCarried();
|
||||
|
||||
public void b(EntityHuman entityhuman) {
|
||||
if (!this.getCarried().isEmpty()) {
|
||||
- entityhuman.drop(this.getCarried(), false);
|
||||
+ // CraftBukkit start - SPIGOT-4556
|
||||
+ ItemStack carried = this.getCarried();
|
||||
this.setCarried(ItemStack.EMPTY);
|
||||
+ entityhuman.drop(carried, false);
|
||||
+ // CraftBukkit end
|
||||
if (!itemstack.isEmpty()) {
|
||||
+ this.setCarried(ItemStack.EMPTY); // CraftBukkit - SPIGOT-4556 - from below
|
||||
if (entityhuman.isAlive() && !((EntityPlayer) entityhuman).q()) {
|
||||
entityhuman.getInventory().f(itemstack);
|
||||
} else {
|
||||
entityhuman.drop(itemstack, false);
|
||||
}
|
||||
|
||||
- this.setCarried(ItemStack.EMPTY);
|
||||
+ // this.setCarried(ItemStack.EMPTY); // CraftBukkit - moved up
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -767,6 +863,11 @@
|
||||
@@ -811,6 +905,11 @@
|
||||
}
|
||||
|
||||
public ItemStack getCarried() {
|
||||
|
||||
@@ -22,15 +22,7 @@
|
||||
|
||||
public ContainerAnvil(int i, PlayerInventory playerinventory) {
|
||||
this(i, playerinventory, ContainerAccess.NULL);
|
||||
@@ -85,7 +93,6 @@
|
||||
if (iblockdata1 == null) {
|
||||
world.a(blockposition, false);
|
||||
world.triggerEffect(1029, blockposition, 0);
|
||||
- entityhuman.getInventory().f(itemstack);
|
||||
} else {
|
||||
world.setTypeAndData(blockposition, iblockdata1, 2);
|
||||
world.triggerEffect(1030, blockposition, 0);
|
||||
@@ -107,7 +114,7 @@
|
||||
@@ -106,7 +114,7 @@
|
||||
byte b1 = 0;
|
||||
|
||||
if (itemstack.isEmpty()) {
|
||||
@@ -39,7 +31,7 @@
|
||||
this.cost.set(0);
|
||||
} else {
|
||||
ItemStack itemstack1 = itemstack.cloneItemStack();
|
||||
@@ -125,7 +132,7 @@
|
||||
@@ -124,7 +132,7 @@
|
||||
if (itemstack1.f() && itemstack1.getItem().a(itemstack, itemstack2)) {
|
||||
k = Math.min(itemstack1.getDamage(), itemstack1.i() / 4);
|
||||
if (k <= 0) {
|
||||
@@ -48,7 +40,7 @@
|
||||
this.cost.set(0);
|
||||
return;
|
||||
}
|
||||
@@ -140,7 +147,7 @@
|
||||
@@ -139,7 +147,7 @@
|
||||
this.repairItemCountCost = i1;
|
||||
} else {
|
||||
if (!flag && (!itemstack1.a(itemstack2.getItem()) || !itemstack1.f())) {
|
||||
@@ -57,7 +49,7 @@
|
||||
this.cost.set(0);
|
||||
return;
|
||||
}
|
||||
@@ -230,7 +237,7 @@
|
||||
@@ -229,7 +237,7 @@
|
||||
}
|
||||
|
||||
if (flag2 && !flag1) {
|
||||
@@ -66,7 +58,7 @@
|
||||
this.cost.set(0);
|
||||
return;
|
||||
}
|
||||
@@ -254,11 +261,11 @@
|
||||
@@ -253,11 +261,11 @@
|
||||
itemstack1 = ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
@@ -81,7 +73,7 @@
|
||||
itemstack1 = ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
@@ -277,7 +284,7 @@
|
||||
@@ -276,7 +284,7 @@
|
||||
EnchantmentManager.a(map, itemstack1);
|
||||
}
|
||||
|
||||
@@ -90,8 +82,8 @@
|
||||
this.d();
|
||||
}
|
||||
}
|
||||
@@ -304,4 +311,18 @@
|
||||
public int j() {
|
||||
@@ -303,4 +311,18 @@
|
||||
public int m() {
|
||||
return this.cost.get();
|
||||
}
|
||||
+
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
+ player = (Player) playerinventory.player.getBukkitEntity(); // CraftBukkit
|
||||
}
|
||||
|
||||
public int i() {
|
||||
public int l() {
|
||||
@@ -124,6 +161,7 @@
|
||||
|
||||
@Override
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
@@ -154,7 +170,7 @@
|
||||
}
|
||||
|
||||
private void o() {
|
||||
private void r() {
|
||||
- if (!this.trader.getWorld().isClientSide) {
|
||||
+ if (!this.trader.getWorld().isClientSide && this.trader instanceof Entity) { // CraftBukkit - SPIGOT-5035
|
||||
Entity entity = (Entity) this.trader;
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
int i;
|
||||
@@ -242,4 +261,17 @@
|
||||
public boolean d(int i) {
|
||||
return i != this.j();
|
||||
return i != this.m();
|
||||
}
|
||||
+
|
||||
+ // CraftBukkit start
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
+ player = (Player) playerinventory.player.getBukkitEntity(); // CraftBukkit
|
||||
}
|
||||
|
||||
public int i() {
|
||||
public int l() {
|
||||
@@ -120,6 +150,7 @@
|
||||
|
||||
@Override
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
|
||||
@@ -202,4 +216,17 @@
|
||||
public boolean d(int i) {
|
||||
return i != this.j();
|
||||
return i != this.m();
|
||||
}
|
||||
+
|
||||
+ // CraftBukkit start
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
decimalformat.setDecimalFormatSymbols(DecimalFormatSymbols.getInstance(Locale.ROOT));
|
||||
});
|
||||
public static final String TAG_ENCH = "Enchantments";
|
||||
@@ -142,16 +175,30 @@
|
||||
@@ -140,16 +173,30 @@
|
||||
this.checkEmpty();
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
this.getItem().b(this.tag);
|
||||
}
|
||||
|
||||
@@ -159,6 +206,11 @@
|
||||
@@ -157,6 +204,11 @@
|
||||
this.setDamage(this.getDamage());
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
this.checkEmpty();
|
||||
}
|
||||
|
||||
@@ -196,7 +248,7 @@
|
||||
@@ -194,7 +246,7 @@
|
||||
return this.getItem() == item;
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
EntityHuman entityhuman = itemactioncontext.getEntity();
|
||||
BlockPosition blockposition = itemactioncontext.getClickPosition();
|
||||
ShapeDetectorBlock shapedetectorblock = new ShapeDetectorBlock(itemactioncontext.getWorld(), blockposition, false);
|
||||
@@ -204,12 +256,155 @@
|
||||
@@ -202,12 +254,155 @@
|
||||
if (entityhuman != null && !entityhuman.getAbilities().mayBuild && !this.b(itemactioncontext.getWorld().r(), shapedetectorblock)) {
|
||||
return EnumInteractionResult.PASS;
|
||||
} else {
|
||||
@@ -260,7 +260,7 @@
|
||||
|
||||
return enuminteractionresult;
|
||||
}
|
||||
@@ -290,6 +485,21 @@
|
||||
@@ -288,6 +483,21 @@
|
||||
}
|
||||
|
||||
i -= k;
|
||||
@@ -282,7 +282,7 @@
|
||||
if (i <= 0) {
|
||||
return false;
|
||||
}
|
||||
@@ -311,6 +521,11 @@
|
||||
@@ -309,6 +519,11 @@
|
||||
if (this.isDamaged(i, t0.getRandom(), t0 instanceof EntityPlayer ? (EntityPlayer) t0 : null)) {
|
||||
consumer.accept(t0);
|
||||
Item item = this.getItem();
|
||||
@@ -294,7 +294,7 @@
|
||||
|
||||
this.subtract(1);
|
||||
if (t0 instanceof EntityHuman) {
|
||||
@@ -466,6 +681,17 @@
|
||||
@@ -464,6 +679,17 @@
|
||||
return this.tag;
|
||||
}
|
||||
|
||||
@@ -312,7 +312,7 @@
|
||||
public NBTTagCompound getOrCreateTag() {
|
||||
if (this.tag == null) {
|
||||
this.setTag(new NBTTagCompound());
|
||||
@@ -849,6 +1075,12 @@
|
||||
@@ -844,6 +1070,12 @@
|
||||
}
|
||||
|
||||
public void setRepairCost(int i) {
|
||||
@@ -325,7 +325,7 @@
|
||||
this.getOrCreateTag().setInt("RepairCost", i);
|
||||
}
|
||||
|
||||
@@ -898,6 +1130,13 @@
|
||||
@@ -893,6 +1125,13 @@
|
||||
nbttaglist.add(nbttagcompound);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
public class ItemWorldMap extends ItemWorldMapBase {
|
||||
|
||||
public static final int IMAGE_WIDTH = 128;
|
||||
@@ -68,14 +73,18 @@
|
||||
@@ -68,7 +73,7 @@
|
||||
public static Integer d(ItemStack itemstack) {
|
||||
NBTTagCompound nbttagcompound = itemstack.getTag();
|
||||
|
||||
@@ -20,9 +20,8 @@
|
||||
+ return nbttagcompound != null && nbttagcompound.hasKeyOfType("map", 99) ? nbttagcompound.getInt("map") : -1; // CraftBukkit - make new maps for no tag
|
||||
}
|
||||
|
||||
- private static int a(World world, int i, int j, int k, boolean flag, boolean flag1, ResourceKey<World> resourcekey) {
|
||||
+ public static int a(World world, int i, int j, int k, boolean flag, boolean flag1, ResourceKey<World> resourcekey) { // PAIL private -> public
|
||||
WorldMap worldmap = WorldMap.a((double) i, (double) j, (byte) k, flag, flag1, resourcekey);
|
||||
public static int createNewSavedData(World world, int i, int j, int k, boolean flag, boolean flag1, ResourceKey<World> resourcekey) {
|
||||
@@ -76,6 +81,10 @@
|
||||
int l = world.getWorldMapCount();
|
||||
|
||||
world.a(a(l), worldmap);
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
return iblockdata;
|
||||
} else {
|
||||
int j = i + 1;
|
||||
@@ -322,10 +349,11 @@
|
||||
@@ -322,7 +349,8 @@
|
||||
public IWorldInventory a(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) {
|
||||
int i = (Integer) iblockdata.get(BlockComposter.LEVEL);
|
||||
|
||||
@@ -95,11 +95,7 @@
|
||||
+ return (IWorldInventory) (i == 8 ? new BlockComposter.ContainerOutput(iblockdata, generatoraccess, blockposition, new ItemStack(Items.BONE_MEAL)) : (i < 7 ? new BlockComposter.ContainerInput(iblockdata, generatoraccess, blockposition) : new BlockComposter.ContainerEmpty(generatoraccess, blockposition)));
|
||||
}
|
||||
|
||||
- private static class ContainerOutput extends InventorySubcontainer implements IWorldInventory {
|
||||
+ public static class ContainerOutput extends InventorySubcontainer implements IWorldInventory {
|
||||
|
||||
private final IBlockData state;
|
||||
private final GeneratorAccess level;
|
||||
public static class ContainerOutput extends InventorySubcontainer implements IWorldInventory {
|
||||
@@ -337,6 +365,7 @@
|
||||
this.state = iblockdata;
|
||||
this.level = generatoraccess;
|
||||
@@ -108,7 +104,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -361,12 +390,19 @@
|
||||
@@ -361,8 +390,15 @@
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
@@ -126,11 +122,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
- private static class ContainerInput extends InventorySubcontainer implements IWorldInventory {
|
||||
+ public static class ContainerInput extends InventorySubcontainer implements IWorldInventory {
|
||||
|
||||
private final IBlockData state;
|
||||
private final GeneratorAccess level;
|
||||
@@ -375,6 +411,7 @@
|
||||
|
||||
public ContainerInput(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) {
|
||||
@@ -139,12 +130,9 @@
|
||||
this.state = iblockdata;
|
||||
this.level = generatoraccess;
|
||||
this.pos = blockposition;
|
||||
@@ -415,10 +452,11 @@
|
||||
}
|
||||
}
|
||||
@@ -417,8 +454,9 @@
|
||||
|
||||
- private static class ContainerEmpty extends InventorySubcontainer implements IWorldInventory {
|
||||
+ public static class ContainerEmpty extends InventorySubcontainer implements IWorldInventory {
|
||||
public static class ContainerEmpty extends InventorySubcontainer implements IWorldInventory {
|
||||
|
||||
- public ContainerEmpty() {
|
||||
+ public ContainerEmpty(GeneratorAccess generatoraccess, BlockPosition blockposition) { // CraftBukkit
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockTallPlant.java
|
||||
+++ b/net/minecraft/world/level/block/BlockTallPlant.java
|
||||
@@ -84,6 +84,11 @@
|
||||
@@ -92,6 +92,11 @@
|
||||
}
|
||||
|
||||
protected static void b(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman) {
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
+
|
||||
@Override
|
||||
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, BiomeBase.Precipitation biomebase_precipitation) {
|
||||
if (BlockCauldron.a(world) && (Integer) iblockdata.get(LayeredCauldronBlock.LEVEL) != 3 && this.fillPredicate.test(biomebase_precipitation)) {
|
||||
if (BlockCauldron.a(world, biomebase_precipitation) && (Integer) iblockdata.get(LayeredCauldronBlock.LEVEL) != 3 && this.fillPredicate.test(biomebase_precipitation)) {
|
||||
- world.setTypeUpdate(blockposition, (IBlockData) iblockdata.a((IBlockState) LayeredCauldronBlock.LEVEL));
|
||||
+ changeLevel(iblockdata, world, blockposition, (IBlockData) iblockdata.a((IBlockState) LayeredCauldronBlock.LEVEL), null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL); // CraftBukkit
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntitySkull.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntitySkull.java
|
||||
@@ -1,3 +1,4 @@
|
||||
+// mc-dev import
|
||||
package net.minecraft.world.level.block.entity;
|
||||
|
||||
import com.google.common.collect.Iterables;
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/storage/Convertable.java
|
||||
+++ b/net/minecraft/world/level/storage/Convertable.java
|
||||
@@ -60,6 +60,10 @@
|
||||
@@ -61,6 +61,10 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
public class Convertable {
|
||||
|
||||
static final Logger LOGGER = LogManager.getLogger();
|
||||
@@ -105,26 +109,26 @@
|
||||
@@ -106,26 +110,26 @@
|
||||
Logger logger = Convertable.LOGGER;
|
||||
|
||||
Objects.requireNonNull(logger);
|
||||
@@ -42,7 +42,7 @@
|
||||
return new IllegalStateException("Failed to get noise settings registry");
|
||||
});
|
||||
|
||||
@@ -294,9 +298,23 @@
|
||||
@@ -302,9 +306,23 @@
|
||||
return this.backupDir;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
|
||||
public class ConversionSession implements AutoCloseable {
|
||||
|
||||
@@ -304,8 +322,12 @@
|
||||
@@ -312,8 +330,12 @@
|
||||
public final Path levelPath;
|
||||
private final String levelId;
|
||||
private final Map<SavedFile, Path> resources = Maps.newHashMap();
|
||||
@@ -82,7 +82,7 @@
|
||||
this.levelId = s;
|
||||
this.levelPath = Convertable.this.baseDir.resolve(s);
|
||||
this.lock = SessionLock.a(this.levelPath);
|
||||
@@ -322,7 +344,7 @@
|
||||
@@ -330,7 +352,7 @@
|
||||
}
|
||||
|
||||
public File a(ResourceKey<World> resourcekey) {
|
||||
|
||||
Reference in New Issue
Block a user