@@ -200,7 +200,7 @@
|
||||
this.setYRot(f % 360.0F);
|
||||
this.setXRot(f1 % 360.0F);
|
||||
}
|
||||
@@ -458,6 +597,15 @@
|
||||
@@ -462,6 +601,15 @@
|
||||
this.baseTick();
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@
|
||||
public void baseTick() {
|
||||
GameProfilerFiller gameprofilerfiller = Profiler.get();
|
||||
|
||||
@@ -471,7 +619,7 @@
|
||||
@@ -475,7 +623,7 @@
|
||||
--this.boardingCooldown;
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@
|
||||
if (this.canSpawnSprintParticle()) {
|
||||
this.spawnSprintParticle();
|
||||
}
|
||||
@@ -510,6 +658,10 @@
|
||||
@@ -514,6 +662,10 @@
|
||||
if (this.isInLava()) {
|
||||
this.lavaHurt();
|
||||
this.fallDistance *= 0.5F;
|
||||
@@ -236,7 +236,7 @@
|
||||
}
|
||||
|
||||
this.checkBelowWorld();
|
||||
@@ -521,7 +673,7 @@
|
||||
@@ -525,7 +677,7 @@
|
||||
world = this.level();
|
||||
if (world instanceof WorldServer worldserver) {
|
||||
if (this instanceof Leashable) {
|
||||
@@ -245,7 +245,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -564,15 +716,32 @@
|
||||
@@ -568,15 +720,32 @@
|
||||
|
||||
public void lavaHurt() {
|
||||
if (!this.fireImmune()) {
|
||||
@@ -280,7 +280,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -583,6 +752,22 @@
|
||||
@@ -587,6 +756,22 @@
|
||||
}
|
||||
|
||||
public final void igniteForSeconds(float f) {
|
||||
@@ -303,7 +303,7 @@
|
||||
this.igniteForTicks(MathHelper.floor(f * 20.0F));
|
||||
}
|
||||
|
||||
@@ -606,7 +791,7 @@
|
||||
@@ -610,7 +795,7 @@
|
||||
}
|
||||
|
||||
protected void onBelowWorld() {
|
||||
@@ -312,7 +312,7 @@
|
||||
}
|
||||
|
||||
public boolean isFree(double d0, double d1, double d2) {
|
||||
@@ -739,6 +924,28 @@
|
||||
@@ -750,6 +935,28 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -341,7 +341,7 @@
|
||||
if (!this.level().isClientSide() || this.isControlledByLocalInstance()) {
|
||||
Entity.MovementEmission entity_movementemission = this.getMovementEmission();
|
||||
|
||||
@@ -1120,6 +1327,20 @@
|
||||
@@ -1133,6 +1340,20 @@
|
||||
return SoundEffects.GENERIC_SPLASH;
|
||||
}
|
||||
|
||||
@@ -362,7 +362,7 @@
|
||||
public void recordMovementThroughBlocks(Vec3D vec3d, Vec3D vec3d1) {
|
||||
this.movementThisTick.add(new Entity.b(vec3d, vec3d1));
|
||||
}
|
||||
@@ -1586,6 +1807,7 @@
|
||||
@@ -1609,6 +1830,7 @@
|
||||
this.yo = d1;
|
||||
this.zo = d4;
|
||||
this.setPos(d3, d1, d4);
|
||||
@@ -370,7 +370,7 @@
|
||||
}
|
||||
|
||||
public void moveTo(Vec3D vec3d) {
|
||||
@@ -1838,6 +2060,12 @@
|
||||
@@ -1861,6 +2083,12 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -380,10 +380,10 @@
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
public void awardKillScore(Entity entity, int i, DamageSource damagesource) {
|
||||
public void awardKillScore(Entity entity, DamageSource damagesource) {
|
||||
if (entity instanceof EntityPlayer) {
|
||||
CriterionTriggers.ENTITY_KILLED_PLAYER.trigger((EntityPlayer) entity, this, damagesource);
|
||||
@@ -1866,16 +2094,22 @@
|
||||
@@ -1889,16 +2117,22 @@
|
||||
}
|
||||
|
||||
public boolean saveAsPassenger(NBTTagCompound nbttagcompound) {
|
||||
@@ -408,7 +408,7 @@
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1886,16 +2120,38 @@
|
||||
@@ -1909,16 +2143,38 @@
|
||||
}
|
||||
|
||||
public NBTTagCompound saveWithoutId(NBTTagCompound nbttagcompound) {
|
||||
@@ -451,7 +451,7 @@
|
||||
nbttagcompound.put("Rotation", this.newFloatList(this.getYRot(), this.getXRot()));
|
||||
nbttagcompound.putFloat("FallDistance", this.fallDistance);
|
||||
nbttagcompound.putShort("Fire", (short) this.remainingFireTicks);
|
||||
@@ -1903,7 +2159,28 @@
|
||||
@@ -1926,7 +2182,28 @@
|
||||
nbttagcompound.putBoolean("OnGround", this.onGround());
|
||||
nbttagcompound.putBoolean("Invulnerable", this.invulnerable);
|
||||
nbttagcompound.putInt("PortalCooldown", this.portalCooldown);
|
||||
@@ -481,7 +481,7 @@
|
||||
IChatBaseComponent ichatbasecomponent = this.getCustomName();
|
||||
|
||||
if (ichatbasecomponent != null) {
|
||||
@@ -1952,7 +2229,7 @@
|
||||
@@ -1975,7 +2252,7 @@
|
||||
nbttagcompound.put("Tags", nbttaglist);
|
||||
}
|
||||
|
||||
@@ -490,7 +490,7 @@
|
||||
if (this.isVehicle()) {
|
||||
nbttaglist = new NBTTagList();
|
||||
iterator = this.getPassengers().iterator();
|
||||
@@ -1961,7 +2238,7 @@
|
||||
@@ -1984,7 +2261,7 @@
|
||||
Entity entity = (Entity) iterator.next();
|
||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||
|
||||
@@ -499,7 +499,7 @@
|
||||
nbttaglist.add(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
@@ -1971,6 +2248,11 @@
|
||||
@@ -1994,6 +2271,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -511,7 +511,7 @@
|
||||
return nbttagcompound;
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT");
|
||||
@@ -2055,6 +2337,45 @@
|
||||
@@ -2080,6 +2362,45 @@
|
||||
} else {
|
||||
throw new IllegalStateException("Entity has invalid position");
|
||||
}
|
||||
@@ -557,7 +557,7 @@
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Loading entity NBT");
|
||||
CrashReportSystemDetails crashreportsystemdetails = crashreport.addCategory("Entity being loaded");
|
||||
@@ -2076,6 +2397,12 @@
|
||||
@@ -2101,6 +2422,12 @@
|
||||
return entitytypes.canSerialize() && minecraftkey != null ? minecraftkey.toString() : null;
|
||||
}
|
||||
|
||||
@@ -570,7 +570,7 @@
|
||||
protected abstract void readAdditionalSaveData(NBTTagCompound nbttagcompound);
|
||||
|
||||
protected abstract void addAdditionalSaveData(NBTTagCompound nbttagcompound);
|
||||
@@ -2128,9 +2455,22 @@
|
||||
@@ -2153,9 +2480,22 @@
|
||||
if (itemstack.isEmpty()) {
|
||||
return null;
|
||||
} else {
|
||||
@@ -593,7 +593,7 @@
|
||||
worldserver.addFreshEntity(entityitem);
|
||||
return entityitem;
|
||||
}
|
||||
@@ -2159,6 +2499,12 @@
|
||||
@@ -2184,6 +2524,12 @@
|
||||
if (this.isAlive() && this instanceof Leashable leashable) {
|
||||
if (leashable.getLeashHolder() == entityhuman) {
|
||||
if (!this.level().isClientSide()) {
|
||||
@@ -603,10 +603,10 @@
|
||||
+ return EnumInteractionResult.PASS;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
leashable.dropLeash(true, !entityhuman.hasInfiniteMaterials());
|
||||
this.gameEvent(GameEvent.ENTITY_INTERACT, entityhuman);
|
||||
}
|
||||
@@ -2170,6 +2516,13 @@
|
||||
if (entityhuman.hasInfiniteMaterials()) {
|
||||
leashable.removeLeash();
|
||||
} else {
|
||||
@@ -2200,6 +2546,13 @@
|
||||
|
||||
if (itemstack.is(Items.LEAD) && leashable.canHaveALeashAttachedToIt()) {
|
||||
if (!this.level().isClientSide()) {
|
||||
@@ -620,7 +620,7 @@
|
||||
leashable.setLeashedTo(entityhuman, true);
|
||||
}
|
||||
|
||||
@@ -2243,7 +2596,7 @@
|
||||
@@ -2273,7 +2626,7 @@
|
||||
return false;
|
||||
} else if (!entity.couldAcceptPassenger()) {
|
||||
return false;
|
||||
@@ -629,7 +629,7 @@
|
||||
return false;
|
||||
} else {
|
||||
for (Entity entity1 = entity; entity1.vehicle != null; entity1 = entity1.vehicle) {
|
||||
@@ -2255,6 +2608,27 @@
|
||||
@@ -2285,6 +2638,27 @@
|
||||
if (!flag && (!this.canRide(entity) || !entity.canAddPassenger(this))) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -657,7 +657,7 @@
|
||||
if (this.isPassenger()) {
|
||||
this.stopRiding();
|
||||
}
|
||||
@@ -2288,7 +2662,7 @@
|
||||
@@ -2318,7 +2692,7 @@
|
||||
Entity entity = this.vehicle;
|
||||
|
||||
this.vehicle = null;
|
||||
@@ -666,7 +666,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2319,10 +2693,38 @@
|
||||
@@ -2349,10 +2723,38 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -706,7 +706,7 @@
|
||||
if (this.passengers.size() == 1 && this.passengers.get(0) == entity) {
|
||||
this.passengers = ImmutableList.of();
|
||||
} else {
|
||||
@@ -2334,6 +2736,7 @@
|
||||
@@ -2364,6 +2766,7 @@
|
||||
entity.boardingCooldown = 60;
|
||||
this.gameEvent(GameEvent.ENTITY_DISMOUNT, entity);
|
||||
}
|
||||
@@ -714,7 +714,7 @@
|
||||
}
|
||||
|
||||
protected boolean canAddPassenger(Entity entity) {
|
||||
@@ -2434,7 +2837,7 @@
|
||||
@@ -2464,7 +2867,7 @@
|
||||
if (teleporttransition != null) {
|
||||
WorldServer worldserver1 = teleporttransition.newLevel();
|
||||
|
||||
@@ -723,7 +723,7 @@
|
||||
this.teleport(teleporttransition);
|
||||
}
|
||||
}
|
||||
@@ -2541,6 +2944,13 @@
|
||||
@@ -2571,6 +2974,13 @@
|
||||
}
|
||||
|
||||
public void setSwimming(boolean flag) {
|
||||
@@ -737,7 +737,7 @@
|
||||
this.setSharedFlag(4, flag);
|
||||
}
|
||||
|
||||
@@ -2594,8 +3004,12 @@
|
||||
@@ -2624,8 +3034,12 @@
|
||||
return this.getTeam() != null ? this.getTeam().isAlliedTo(scoreboardteambase) : false;
|
||||
}
|
||||
|
||||
@@ -751,7 +751,7 @@
|
||||
}
|
||||
|
||||
public boolean getSharedFlag(int i) {
|
||||
@@ -2614,7 +3028,7 @@
|
||||
@@ -2644,7 +3058,7 @@
|
||||
}
|
||||
|
||||
public int getMaxAirSupply() {
|
||||
@@ -760,7 +760,7 @@
|
||||
}
|
||||
|
||||
public int getAirSupply() {
|
||||
@@ -2622,7 +3036,18 @@
|
||||
@@ -2652,7 +3066,18 @@
|
||||
}
|
||||
|
||||
public void setAirSupply(int i) {
|
||||
@@ -780,7 +780,7 @@
|
||||
}
|
||||
|
||||
public int getTicksFrozen() {
|
||||
@@ -2649,11 +3074,40 @@
|
||||
@@ -2679,11 +3104,40 @@
|
||||
|
||||
public void thunderHit(WorldServer worldserver, EntityLightning entitylightning) {
|
||||
this.setRemainingFireTicks(this.remainingFireTicks + 1);
|
||||
@@ -823,7 +823,7 @@
|
||||
}
|
||||
|
||||
public void onAboveBubbleCol(boolean flag) {
|
||||
@@ -2822,6 +3276,18 @@
|
||||
@@ -2852,6 +3306,18 @@
|
||||
|
||||
if (world instanceof WorldServer worldserver) {
|
||||
if (!this.isRemoved()) {
|
||||
@@ -842,7 +842,7 @@
|
||||
WorldServer worldserver1 = teleporttransition.newLevel();
|
||||
boolean flag = worldserver1.dimension() != worldserver.dimension();
|
||||
|
||||
@@ -2890,8 +3356,12 @@
|
||||
@@ -2920,8 +3386,12 @@
|
||||
} else {
|
||||
entity.restoreFrom(this);
|
||||
this.removeAfterChangingDimensions();
|
||||
@@ -856,7 +856,7 @@
|
||||
Iterator iterator1 = list1.iterator();
|
||||
|
||||
while (iterator1.hasNext()) {
|
||||
@@ -2965,8 +3435,9 @@
|
||||
@@ -2995,8 +3465,9 @@
|
||||
}
|
||||
|
||||
protected void removeAfterChangingDimensions() {
|
||||
@@ -864,10 +864,10 @@
|
||||
+ this.setRemoved(Entity.RemovalReason.CHANGED_DIMENSION, null); // CraftBukkit - add Bukkit remove cause
|
||||
if (this instanceof Leashable leashable) {
|
||||
+ this.level().getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), UnleashReason.UNKNOWN)); // CraftBukkit
|
||||
leashable.dropLeash(true, false);
|
||||
leashable.removeLeash();
|
||||
}
|
||||
|
||||
@@ -2976,6 +3447,20 @@
|
||||
@@ -3006,6 +3477,20 @@
|
||||
return BlockPortalShape.getRelativePosition(blockutil_rectangle, enumdirection_enumaxis, this.position(), this.getDimensions(this.getPose()));
|
||||
}
|
||||
|
||||
@@ -888,7 +888,7 @@
|
||||
public boolean canUsePortal(boolean flag) {
|
||||
return (flag || !this.isPassenger()) && this.isAlive();
|
||||
}
|
||||
@@ -3104,9 +3589,15 @@
|
||||
@@ -3134,9 +3619,15 @@
|
||||
return (Boolean) this.entityData.get(Entity.DATA_CUSTOM_NAME_VISIBLE);
|
||||
}
|
||||
|
||||
@@ -906,7 +906,7 @@
|
||||
|
||||
return entity != null;
|
||||
}
|
||||
@@ -3228,7 +3719,26 @@
|
||||
@@ -3258,7 +3749,26 @@
|
||||
}
|
||||
|
||||
public final void setBoundingBox(AxisAlignedBB axisalignedbb) {
|
||||
@@ -934,7 +934,7 @@
|
||||
}
|
||||
|
||||
public final float getEyeHeight(EntityPose entitypose) {
|
||||
@@ -3463,8 +3973,37 @@
|
||||
@@ -3489,8 +3999,37 @@
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -973,7 +973,7 @@
|
||||
}
|
||||
|
||||
public void lookAt(ArgumentAnchor.Anchor argumentanchor_anchor, Vec3D vec3d) {
|
||||
@@ -3525,6 +4064,11 @@
|
||||
@@ -3551,6 +4090,11 @@
|
||||
vec3d = vec3d.add(vec3d1);
|
||||
++k1;
|
||||
}
|
||||
@@ -985,7 +985,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3792,6 +4336,14 @@
|
||||
@@ -3818,6 +4362,14 @@
|
||||
|
||||
@Override
|
||||
public final void setRemoved(Entity.RemovalReason entity_removalreason) {
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
Vec3D vec3d = new Vec3D(this.followingPlayer.getX() - this.getX(), this.followingPlayer.getY() + (double) this.followingPlayer.getEyeHeight() / 2.0D - this.getY(), this.followingPlayer.getZ() - this.getZ());
|
||||
double d0 = vec3d.lengthSqr();
|
||||
|
||||
@@ -119,7 +143,7 @@
|
||||
@@ -121,7 +145,7 @@
|
||||
|
||||
++this.age;
|
||||
if (this.age >= 6000) {
|
||||
@@ -56,7 +56,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -188,7 +212,7 @@
|
||||
@@ -190,7 +214,7 @@
|
||||
private void merge(EntityExperienceOrb entityexperienceorb) {
|
||||
this.count += entityexperienceorb.count;
|
||||
this.age = Math.min(this.age, entityexperienceorb.age);
|
||||
@@ -65,7 +65,7 @@
|
||||
}
|
||||
|
||||
private void setUnderwaterMovement() {
|
||||
@@ -213,7 +237,7 @@
|
||||
@@ -215,7 +239,7 @@
|
||||
this.markHurt();
|
||||
this.health = (int) ((float) this.health - f);
|
||||
if (this.health <= 0) {
|
||||
@@ -74,7 +74,7 @@
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -240,17 +264,17 @@
|
||||
@@ -242,17 +266,17 @@
|
||||
public void playerTouch(EntityHuman entityhuman) {
|
||||
if (entityhuman instanceof EntityPlayer entityplayer) {
|
||||
if (entityhuman.takeXpDelay == 0) {
|
||||
@@ -95,7 +95,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,12 +288,20 @@
|
||||
@@ -266,12 +290,20 @@
|
||||
ItemStack itemstack = ((EnchantedItemInUse) optional.get()).itemStack();
|
||||
int j = EnchantmentManager.modifyDurabilityToRepairFromXp(entityplayer.serverLevel(), itemstack, i);
|
||||
int k = Math.min(j, itemstack.getDamageValue());
|
||||
@@ -116,7 +116,7 @@
|
||||
return this.repairPlayerItems(entityplayer, l);
|
||||
}
|
||||
}
|
||||
@@ -289,6 +321,24 @@
|
||||
@@ -291,6 +323,24 @@
|
||||
}
|
||||
|
||||
public static int getExperienceValue(int i) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/EntityInsentient.java
|
||||
+++ b/net/minecraft/world/entity/EntityInsentient.java
|
||||
@@ -89,6 +89,18 @@
|
||||
@@ -85,6 +85,18 @@
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParameters;
|
||||
import net.minecraft.world.phys.AxisAlignedBB;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
public abstract class EntityInsentient extends EntityLiving implements EquipmentUser, Leashable, Targeting {
|
||||
|
||||
private static final DataWatcherObject<Byte> DATA_MOB_FLAGS_ID = DataWatcher.defineId(EntityInsentient.class, DataWatcherRegistry.BYTE);
|
||||
@@ -136,6 +148,8 @@
|
||||
@@ -132,6 +144,8 @@
|
||||
private BlockPosition restrictCenter;
|
||||
private float restrictRadius;
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
protected EntityInsentient(EntityTypes<? extends EntityInsentient> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
this.handItems = NonNullList.withSize(2, ItemStack.EMPTY);
|
||||
@@ -164,6 +178,12 @@
|
||||
@@ -160,6 +174,12 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
protected void registerGoals() {}
|
||||
|
||||
public static AttributeProvider.Builder createMobAttributes() {
|
||||
@@ -268,11 +288,42 @@
|
||||
@@ -264,11 +284,42 @@
|
||||
|
||||
@Nullable
|
||||
protected final EntityLiving getTargetFromBrain() {
|
||||
@@ -85,7 +85,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -403,6 +454,12 @@
|
||||
@@ -399,6 +450,12 @@
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
@Override
|
||||
public void addAdditionalSaveData(NBTTagCompound nbttagcompound) {
|
||||
super.addAdditionalSaveData(nbttagcompound);
|
||||
@@ -476,16 +533,26 @@
|
||||
@@ -473,13 +530,25 @@
|
||||
nbttagcompound.putBoolean("NoAI", this.isNoAi());
|
||||
}
|
||||
|
||||
@@ -108,17 +108,16 @@
|
||||
@Override
|
||||
public void readAdditionalSaveData(NBTTagCompound nbttagcompound) {
|
||||
super.readAdditionalSaveData(nbttagcompound);
|
||||
+
|
||||
- this.setCanPickUpLoot(nbttagcompound.getBoolean("CanPickUpLoot"));
|
||||
- this.persistenceRequired = nbttagcompound.getBoolean("PersistenceRequired");
|
||||
+ // CraftBukkit start - If looting or persistence is false only use it if it was set after we started using it
|
||||
if (nbttagcompound.contains("CanPickUpLoot", 99)) {
|
||||
- this.setCanPickUpLoot(nbttagcompound.getBoolean("CanPickUpLoot"));
|
||||
+ if (nbttagcompound.contains("CanPickUpLoot", 99)) {
|
||||
+ boolean data = nbttagcompound.getBoolean("CanPickUpLoot");
|
||||
+ if (isLevelAtLeast(nbttagcompound, 1) || data) {
|
||||
+ this.setCanPickUpLoot(data);
|
||||
+ }
|
||||
}
|
||||
|
||||
- this.persistenceRequired = nbttagcompound.getBoolean("PersistenceRequired");
|
||||
+ }
|
||||
+
|
||||
+ boolean data = nbttagcompound.getBoolean("PersistenceRequired");
|
||||
+ if (isLevelAtLeast(nbttagcompound, 1) || data) {
|
||||
+ this.persistenceRequired = data;
|
||||
@@ -127,9 +126,9 @@
|
||||
NBTTagList nbttaglist;
|
||||
NBTTagCompound nbttagcompound1;
|
||||
int i;
|
||||
@@ -539,6 +606,11 @@
|
||||
}
|
||||
@@ -547,6 +616,11 @@
|
||||
|
||||
this.lootTableSeed = nbttagcompound.getLong("DeathLootTableSeed");
|
||||
this.setNoAi(nbttagcompound.getBoolean("NoAI"));
|
||||
+ // CraftBukkit start
|
||||
+ if (nbttagcompound.contains("Bukkit.Aware")) {
|
||||
@@ -139,7 +138,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -615,20 +687,26 @@
|
||||
@@ -623,20 +697,26 @@
|
||||
|
||||
protected void pickUpItem(WorldServer worldserver, EntityItem entityitem) {
|
||||
ItemStack itemstack = entityitem.getItem();
|
||||
@@ -168,7 +167,7 @@
|
||||
EnumItemSlot enumitemslot = this.getEquipmentSlotForItem(itemstack);
|
||||
ItemStack itemstack1 = this.getItemBySlot(enumitemslot);
|
||||
boolean flag = this.canReplaceCurrentItem(itemstack, itemstack1, enumitemslot);
|
||||
@@ -639,11 +717,19 @@
|
||||
@@ -647,11 +727,19 @@
|
||||
flag = itemstack1.isEmpty();
|
||||
}
|
||||
|
||||
@@ -189,7 +188,7 @@
|
||||
}
|
||||
|
||||
ItemStack itemstack2 = enumitemslot.limit(itemstack);
|
||||
@@ -770,7 +856,7 @@
|
||||
@@ -768,7 +856,7 @@
|
||||
@Override
|
||||
public void checkDespawn() {
|
||||
if (this.level().getDifficulty() == EnumDifficulty.PEACEFUL && this.shouldDespawnInPeaceful()) {
|
||||
@@ -198,7 +197,7 @@
|
||||
} else if (!this.isPersistenceRequired() && !this.requiresCustomPersistence()) {
|
||||
EntityHuman entityhuman = this.level().getNearestPlayer(this, -1.0D);
|
||||
|
||||
@@ -780,14 +866,14 @@
|
||||
@@ -778,14 +866,14 @@
|
||||
int j = i * i;
|
||||
|
||||
if (d0 > (double) j && this.removeWhenFarAway(d0)) {
|
||||
@@ -215,7 +214,7 @@
|
||||
} else if (d0 < (double) l) {
|
||||
this.noActionTime = 0;
|
||||
}
|
||||
@@ -801,6 +887,7 @@
|
||||
@@ -799,6 +887,7 @@
|
||||
@Override
|
||||
protected final void serverAiStep() {
|
||||
++this.noActionTime;
|
||||
@@ -223,7 +222,7 @@
|
||||
GameProfilerFiller gameprofilerfiller = Profiler.get();
|
||||
|
||||
gameprofilerfiller.push("sensing");
|
||||
@@ -1340,7 +1427,7 @@
|
||||
@@ -1338,7 +1427,7 @@
|
||||
if (itemstack.getItem() instanceof ItemMonsterEgg) {
|
||||
if (this.level() instanceof WorldServer) {
|
||||
ItemMonsterEgg itemmonsteregg = (ItemMonsterEgg) itemstack.getItem();
|
||||
@@ -232,7 +231,7 @@
|
||||
|
||||
optional.ifPresent((entityinsentient) -> {
|
||||
this.onOffspringSpawnedFromEgg(entityhuman, entityinsentient);
|
||||
@@ -1391,12 +1478,19 @@
|
||||
@@ -1389,12 +1478,19 @@
|
||||
return this.restrictRadius != -1.0F;
|
||||
}
|
||||
|
||||
@@ -253,7 +252,7 @@
|
||||
|
||||
if (t0 == null) {
|
||||
return null;
|
||||
@@ -1405,14 +1499,24 @@
|
||||
@@ -1403,14 +1499,24 @@
|
||||
conversionparams_a.finalizeConversion(t0);
|
||||
World world = this.level();
|
||||
|
||||
@@ -280,7 +279,7 @@
|
||||
}
|
||||
|
||||
return t0;
|
||||
@@ -1422,7 +1526,14 @@
|
||||
@@ -1420,7 +1526,14 @@
|
||||
|
||||
@Nullable
|
||||
public <T extends EntityInsentient> T convertTo(EntityTypes<T> entitytypes, ConversionParams conversionparams, ConversionParams.a<T> conversionparams_a) {
|
||||
@@ -296,15 +295,15 @@
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -1461,6 +1572,7 @@
|
||||
@@ -1458,6 +1571,7 @@
|
||||
boolean flag1 = super.startRiding(entity, flag);
|
||||
|
||||
if (flag1 && this.isLeashed()) {
|
||||
+ this.level().getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), UnleashReason.UNKNOWN)); // CraftBukkit
|
||||
this.dropLeash(true, true);
|
||||
this.dropLeash();
|
||||
}
|
||||
|
||||
@@ -1545,7 +1657,7 @@
|
||||
@@ -1542,7 +1656,7 @@
|
||||
|
||||
if (f1 > 0.0F && entity instanceof EntityLiving) {
|
||||
entityliving = (EntityLiving) entity;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/EntityLiving.java
|
||||
+++ b/net/minecraft/world/entity/EntityLiving.java
|
||||
@@ -137,6 +137,33 @@
|
||||
@@ -136,6 +136,33 @@
|
||||
import net.minecraft.world.scores.ScoreboardTeam;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
public abstract class EntityLiving extends Entity implements Attackable {
|
||||
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
@@ -262,6 +289,19 @@
|
||||
@@ -260,6 +287,19 @@
|
||||
protected boolean skipDropExperience;
|
||||
private final EnumMap<EnumItemSlot, Reference2ObjectMap<Enchantment, Set<EnchantmentLocationBasedEffect>>> activeLocationDependentEnchantments;
|
||||
protected float appliedScale;
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
protected EntityLiving(EntityTypes<? extends EntityLiving> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@@ -278,7 +318,9 @@
|
||||
@@ -276,7 +316,9 @@
|
||||
this.activeLocationDependentEnchantments = new EnumMap(EnumItemSlot.class);
|
||||
this.appliedScale = 1.0F;
|
||||
this.attributes = new AttributeMapBase(AttributeDefaults.getSupplier(entitytypes));
|
||||
@@ -65,14 +65,14 @@
|
||||
this.blocksBuilding = true;
|
||||
this.rotA = (float) ((Math.random() + 1.0D) * 0.009999999776482582D);
|
||||
this.reapplyPosition();
|
||||
@@ -358,7 +400,13 @@
|
||||
@@ -356,7 +398,13 @@
|
||||
double d8 = Math.min((double) (0.2F + f / 15.0F), 2.5D);
|
||||
int i = (int) (150.0D * d8);
|
||||
|
||||
- worldserver.sendParticles(new ParticleParamBlock(Particles.BLOCK, iblockdata), d2, d3, d4, i, 0.0D, 0.0D, 0.0D, 0.15000000596046448D);
|
||||
+ // CraftBukkit start - visiblity api
|
||||
+ if (this instanceof EntityPlayer) {
|
||||
+ worldserver.sendParticles((EntityPlayer) this, new ParticleParamBlock(Particles.BLOCK, iblockdata), d2, d3, d4, i, 0.0D, 0.0D, 0.0D, 0.15000000596046448D, false);
|
||||
+ worldserver.sendParticlesSource((EntityPlayer) this, new ParticleParamBlock(Particles.BLOCK, iblockdata), false, false, d2, d3, d4, i, 0.0D, 0.0D, 0.0D, 0.15000000596046448D);
|
||||
+ } else {
|
||||
+ worldserver.sendParticles(new ParticleParamBlock(Particles.BLOCK, iblockdata), d2, d3, d4, i, 0.0D, 0.0D, 0.0D, 0.15000000596046448D);
|
||||
+ }
|
||||
@@ -498,7 +498,7 @@
|
||||
this.hurtDuration = 10;
|
||||
this.hurtTime = this.hurtDuration;
|
||||
}
|
||||
@@ -1275,7 +1519,7 @@
|
||||
@@ -1243,7 +1487,7 @@
|
||||
worldserver.broadcastDamageEvent(this, damagesource);
|
||||
}
|
||||
|
||||
@@ -507,7 +507,7 @@
|
||||
this.markHurt();
|
||||
}
|
||||
|
||||
@@ -1295,7 +1539,7 @@
|
||||
@@ -1263,7 +1507,7 @@
|
||||
d1 = damagesource.getSourcePosition().z() - this.getZ();
|
||||
}
|
||||
|
||||
@@ -516,7 +516,7 @@
|
||||
if (!flag) {
|
||||
this.indicateDamage(d0, d1);
|
||||
}
|
||||
@@ -1314,7 +1558,7 @@
|
||||
@@ -1282,7 +1526,7 @@
|
||||
this.playHurtSound(damagesource);
|
||||
}
|
||||
|
||||
@@ -525,7 +525,7 @@
|
||||
|
||||
if (flag2) {
|
||||
this.lastDamageSource = damagesource;
|
||||
@@ -1352,7 +1596,7 @@
|
||||
@@ -1363,7 +1607,7 @@
|
||||
}
|
||||
|
||||
protected void blockedByShield(EntityLiving entityliving) {
|
||||
@@ -534,7 +534,7 @@
|
||||
}
|
||||
|
||||
private boolean checkTotemDeathProtection(DamageSource damagesource) {
|
||||
@@ -1364,20 +1608,33 @@
|
||||
@@ -1375,20 +1619,33 @@
|
||||
EnumHand[] aenumhand = EnumHand.values();
|
||||
int i = aenumhand.length;
|
||||
|
||||
@@ -572,7 +572,7 @@
|
||||
EntityPlayer entityplayer = (EntityPlayer) this;
|
||||
|
||||
entityplayer.awardStat(StatisticList.ITEM_USED.get(itemstack.getItem()));
|
||||
@@ -1501,14 +1758,22 @@
|
||||
@@ -1512,14 +1769,22 @@
|
||||
IBlockData iblockdata = Blocks.WITHER_ROSE.defaultBlockState();
|
||||
|
||||
if (this.level().getBlockState(blockposition).isAir() && iblockdata.canSurvive(this.level(), blockposition)) {
|
||||
@@ -597,7 +597,7 @@
|
||||
this.level().addFreshEntity(entityitem);
|
||||
}
|
||||
}
|
||||
@@ -1519,22 +1784,37 @@
|
||||
@@ -1530,22 +1795,37 @@
|
||||
protected void dropAllDeathLoot(WorldServer worldserver, DamageSource damagesource) {
|
||||
boolean flag = this.lastHurtByPlayerTime > 0;
|
||||
|
||||
@@ -638,7 +638,7 @@
|
||||
}
|
||||
|
||||
protected void dropCustomDeathLoot(WorldServer worldserver, DamageSource damagesource, boolean flag) {}
|
||||
@@ -1601,9 +1881,14 @@
|
||||
@@ -1612,9 +1892,14 @@
|
||||
}
|
||||
|
||||
public void knockback(double d0, double d1, double d2) {
|
||||
@@ -655,7 +655,7 @@
|
||||
|
||||
Vec3D vec3d;
|
||||
|
||||
@@ -1613,7 +1898,14 @@
|
||||
@@ -1624,7 +1909,14 @@
|
||||
|
||||
Vec3D vec3d1 = (new Vec3D(d1, 0.0D, d2)).normalize().scale(d0);
|
||||
|
||||
@@ -671,7 +671,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1668,6 +1960,20 @@
|
||||
@@ -1683,6 +1975,20 @@
|
||||
return new EntityLiving.a(SoundEffects.GENERIC_SMALL_FALL, SoundEffects.GENERIC_BIG_FALL);
|
||||
}
|
||||
|
||||
@@ -692,7 +692,7 @@
|
||||
public Optional<BlockPosition> getLastClimbablePos() {
|
||||
return this.lastClimbablePos;
|
||||
}
|
||||
@@ -1746,9 +2052,14 @@
|
||||
@@ -1757,9 +2063,14 @@
|
||||
int i = this.calculateFallDamage(f, f1);
|
||||
|
||||
if (i > 0) {
|
||||
@@ -708,7 +708,7 @@
|
||||
return true;
|
||||
} else {
|
||||
return flag;
|
||||
@@ -1819,7 +2130,7 @@
|
||||
@@ -1830,7 +2141,7 @@
|
||||
|
||||
protected float getDamageAfterArmorAbsorb(DamageSource damagesource, float f) {
|
||||
if (!damagesource.is(DamageTypeTags.BYPASSES_ARMOR)) {
|
||||
@@ -717,7 +717,7 @@
|
||||
f = CombatMath.getDamageAfterAbsorb(this, f, damagesource, (float) this.getArmorValue(), (float) this.getAttributeValue(GenericAttributes.ARMOR_TOUGHNESS));
|
||||
}
|
||||
|
||||
@@ -1830,7 +2141,8 @@
|
||||
@@ -1841,7 +2152,8 @@
|
||||
if (damagesource.is(DamageTypeTags.BYPASSES_EFFECTS)) {
|
||||
return f;
|
||||
} else {
|
||||
@@ -727,7 +727,7 @@
|
||||
int i = (this.getEffect(MobEffects.DAMAGE_RESISTANCE).getAmplifier() + 1) * 5;
|
||||
int j = 25 - i;
|
||||
float f1 = f * (float) j;
|
||||
@@ -1873,15 +2185,141 @@
|
||||
@@ -1884,15 +2196,141 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -876,7 +876,7 @@
|
||||
|
||||
if (f2 > 0.0F && f2 < 3.4028235E37F) {
|
||||
Entity entity = damagesource.getEntity();
|
||||
@@ -1893,13 +2331,48 @@
|
||||
@@ -1904,13 +2342,48 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -927,7 +927,7 @@
|
||||
}
|
||||
|
||||
public CombatTracker getCombatTracker() {
|
||||
@@ -1924,9 +2397,19 @@
|
||||
@@ -1935,9 +2408,19 @@
|
||||
}
|
||||
|
||||
public final void setArrowCount(int i) {
|
||||
@@ -948,7 +948,7 @@
|
||||
public final int getStingerCount() {
|
||||
return (Integer) this.entityData.get(EntityLiving.DATA_STINGER_COUNT_ID);
|
||||
}
|
||||
@@ -2171,6 +2654,12 @@
|
||||
@@ -2182,6 +2665,12 @@
|
||||
|
||||
public abstract ItemStack getItemBySlot(EnumItemSlot enumitemslot);
|
||||
|
||||
@@ -961,7 +961,7 @@
|
||||
public abstract void setItemSlot(EnumItemSlot enumitemslot, ItemStack itemstack);
|
||||
|
||||
public Iterable<ItemStack> getHandSlots() {
|
||||
@@ -2623,7 +3112,7 @@
|
||||
@@ -2634,7 +3123,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -970,7 +970,7 @@
|
||||
if (this.tickCount % 20 == 0) {
|
||||
this.getCombatTracker().recheckStatus();
|
||||
}
|
||||
@@ -2730,7 +3219,7 @@
|
||||
@@ -2741,7 +3230,7 @@
|
||||
this.elytraAnimationState.tick();
|
||||
}
|
||||
|
||||
@@ -979,7 +979,7 @@
|
||||
Map<EnumItemSlot, ItemStack> map = this.collectEquipmentChanges();
|
||||
|
||||
if (map != null) {
|
||||
@@ -3052,6 +3541,7 @@
|
||||
@@ -3063,6 +3552,7 @@
|
||||
this.checkSlowFallDistance();
|
||||
if (!this.level().isClientSide) {
|
||||
if (!this.canGlide()) {
|
||||
@@ -987,7 +987,7 @@
|
||||
this.setSharedFlag(7, false);
|
||||
return;
|
||||
}
|
||||
@@ -3298,14 +3788,21 @@
|
||||
@@ -3305,14 +3795,21 @@
|
||||
|
||||
@Override
|
||||
public boolean isPickable() {
|
||||
@@ -1011,7 +1011,7 @@
|
||||
@Override
|
||||
public float getYHeadRot() {
|
||||
return this.yHeadRot;
|
||||
@@ -3476,7 +3973,30 @@
|
||||
@@ -3483,7 +3980,30 @@
|
||||
this.releaseUsingItem();
|
||||
} else {
|
||||
if (!this.useItem.isEmpty() && this.isUsingItem()) {
|
||||
@@ -1043,7 +1043,7 @@
|
||||
|
||||
if (itemstack != this.useItem) {
|
||||
this.setItemInHand(enumhand, itemstack);
|
||||
@@ -3561,6 +4081,12 @@
|
||||
@@ -3568,6 +4088,12 @@
|
||||
}
|
||||
|
||||
public boolean randomTeleport(double d0, double d1, double d2, boolean flag) {
|
||||
@@ -1056,7 +1056,7 @@
|
||||
double d3 = this.getX();
|
||||
double d4 = this.getY();
|
||||
double d5 = this.getZ();
|
||||
@@ -3585,16 +4111,41 @@
|
||||
@@ -3592,16 +4118,41 @@
|
||||
}
|
||||
|
||||
if (flag2) {
|
||||
@@ -1101,7 +1101,7 @@
|
||||
} else {
|
||||
if (flag) {
|
||||
world.broadcastEntityEvent(this, (byte) 46);
|
||||
@@ -3606,7 +4157,7 @@
|
||||
@@ -3613,7 +4164,7 @@
|
||||
entitycreature.getNavigation().stop();
|
||||
}
|
||||
|
||||
@@ -1110,7 +1110,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3699,7 +4250,7 @@
|
||||
@@ -3706,7 +4257,7 @@
|
||||
}
|
||||
|
||||
public void stopSleeping() {
|
||||
@@ -1119,7 +1119,7 @@
|
||||
World world = this.level();
|
||||
|
||||
java.util.Objects.requireNonNull(world);
|
||||
@@ -3733,7 +4284,7 @@
|
||||
@@ -3740,7 +4291,7 @@
|
||||
|
||||
@Nullable
|
||||
public EnumDirection getBedOrientation() {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
public abstract class EntityTameableAnimal extends EntityAnimal implements OwnableEntity {
|
||||
|
||||
public static final int TELEPORT_WHEN_DISTANCE_IS_SQ = 144;
|
||||
@@ -292,7 +298,14 @@
|
||||
@@ -295,7 +301,14 @@
|
||||
if (!this.canTeleportTo(new BlockPosition(i, j, k))) {
|
||||
return false;
|
||||
} else {
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
}
|
||||
|
||||
public static <T extends Entity> Consumer<T> createDefaultStackConfig(World world, ItemStack itemstack, @Nullable EntityHuman entityhuman) {
|
||||
@@ -464,21 +472,37 @@
|
||||
@@ -464,21 +472,40 @@
|
||||
CustomData customdata = (CustomData) itemstack.getOrDefault(DataComponents.ENTITY_DATA, CustomData.EMPTY);
|
||||
|
||||
return !customdata.isEmpty() ? consumer.andThen((entity) -> {
|
||||
@@ -86,13 +86,16 @@
|
||||
|
||||
if (t0 != null) {
|
||||
- worldserver.addFreshEntityWithPassengers(t0);
|
||||
+ // CraftBukkit start
|
||||
+ worldserver.addFreshEntityWithPassengers(t0, spawnReason);
|
||||
+ return !t0.isRemoved() ? t0 : null; // Don't return an entity when CreatureSpawnEvent is canceled
|
||||
+ if (t0.isRemoved()) {
|
||||
+ return null; // Don't return an entity when CreatureSpawnEvent is canceled
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
if (t0 instanceof EntityInsentient) {
|
||||
EntityInsentient entityinsentient = (EntityInsentient) t0;
|
||||
|
||||
return t0;
|
||||
@@ -649,7 +673,7 @@
|
||||
@@ -657,7 +684,7 @@
|
||||
}
|
||||
|
||||
return entity;
|
||||
@@ -101,7 +104,7 @@
|
||||
}
|
||||
|
||||
public static Stream<Entity> loadEntitiesRecursive(final List<? extends NBTBase> list, final World world, final EntitySpawnReason entityspawnreason) {
|
||||
@@ -710,7 +734,7 @@
|
||||
@@ -718,7 +745,7 @@
|
||||
|
||||
@Nullable
|
||||
public T tryCast(Entity entity) {
|
||||
@@ -110,7 +113,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -779,7 +803,7 @@
|
||||
@@ -791,7 +818,7 @@
|
||||
this.canSpawnFarFromPlayer = enumcreaturetype == EnumCreatureType.CREATURE || enumcreaturetype == EnumCreatureType.MISC;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--- a/net/minecraft/world/entity/Interaction.java
|
||||
+++ b/net/minecraft/world/entity/Interaction.java
|
||||
@@ -26,6 +26,12 @@
|
||||
import net.minecraft.world.phys.AxisAlignedBB;
|
||||
@@ -27,6 +27,12 @@
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
+// CraftBukkit start
|
||||
@@ -13,7 +13,7 @@
|
||||
public class Interaction extends Entity implements Attackable, Targeting {
|
||||
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
@@ -64,7 +70,7 @@
|
||||
@@ -65,7 +71,7 @@
|
||||
this.setHeight(nbttagcompound.getFloat("height"));
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
Logger logger;
|
||||
|
||||
if (nbttagcompound.contains("attack")) {
|
||||
@@ -144,9 +150,16 @@
|
||||
@@ -145,9 +151,16 @@
|
||||
@Override
|
||||
public boolean skipAttackInteraction(Entity entity) {
|
||||
if (entity instanceof EntityHuman entityhuman) {
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
+ dropLeash((Entity & Leashable) this, false, false); // CraftBukkit - decompile error
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -54,7 +59,7 @@
|
||||
default void readLeashData(NBTTagCompound nbttagcompound) {
|
||||
@@ -64,7 +69,7 @@
|
||||
return new Leashable.a(Either.left(nbttagcompound.getCompound("leash").getUUID("UUID")));
|
||||
} else {
|
||||
if (nbttagcompound.contains("leash", 11)) {
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
if (either != null) {
|
||||
return new Leashable.a(either);
|
||||
@@ -69,6 +74,11 @@
|
||||
@@ -79,6 +84,11 @@
|
||||
if (leashable_a != null) {
|
||||
Either<UUID, BlockPosition> either = leashable_a.delayedLeashInfo;
|
||||
Entity entity = leashable_a.leashHolder;
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
if (entity instanceof EntityLeash) {
|
||||
EntityLeash entityleash = (EntityLeash) entity;
|
||||
@@ -111,7 +121,9 @@
|
||||
@@ -121,7 +131,9 @@
|
||||
}
|
||||
|
||||
if (e0.tickCount > 100) {
|
||||
@@ -52,16 +52,21 @@
|
||||
((Leashable) e0).setLeashData((Leashable.a) null);
|
||||
}
|
||||
}
|
||||
@@ -120,7 +132,7 @@
|
||||
@@ -130,11 +142,11 @@
|
||||
}
|
||||
|
||||
default void dropLeash(boolean flag, boolean flag1) {
|
||||
- dropLeash((Entity) this, flag, flag1);
|
||||
+ dropLeash((Entity & Leashable) this, flag, flag1); // CraftBukkit - decompile error
|
||||
default void dropLeash() {
|
||||
- dropLeash((Entity) this, true, true);
|
||||
+ dropLeash((Entity & Leashable) this, true, true); // CraftBukkit - decompile error
|
||||
}
|
||||
|
||||
private static <E extends Entity & Leashable> void dropLeash(E e0, boolean flag, boolean flag1) {
|
||||
@@ -134,7 +146,9 @@
|
||||
default void removeLeash() {
|
||||
- dropLeash((Entity) this, true, false);
|
||||
+ dropLeash((Entity & Leashable) this, true, false); // CraftBukkit - decompile error
|
||||
}
|
||||
|
||||
default void onLeashRemoved() {}
|
||||
@@ -151,7 +163,9 @@
|
||||
WorldServer worldserver = (WorldServer) world;
|
||||
|
||||
if (flag1) {
|
||||
@@ -71,17 +76,17 @@
|
||||
}
|
||||
|
||||
if (flag) {
|
||||
@@ -154,7 +168,8 @@
|
||||
@@ -171,7 +185,8 @@
|
||||
|
||||
if (leashable_a != null && leashable_a.leashHolder != null) {
|
||||
if (!e0.isAlive() || !leashable_a.leashHolder.isAlive()) {
|
||||
- dropLeash(e0, true, worldserver.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS));
|
||||
- if (worldserver.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
|
||||
+ worldserver.getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(e0.getBukkitEntity(), (!e0.isAlive()) ? UnleashReason.PLAYER_UNLEASH : UnleashReason.HOLDER_GONE)); // CraftBukkit
|
||||
+ dropLeash(e0, true, worldserver.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS) && !e0.pluginRemoved); // CraftBukkit - SPIGOT-7487: Don't drop leash, when the holder was removed by a plugin
|
||||
}
|
||||
|
||||
Entity entity = ((Leashable) e0).getLeashHolder();
|
||||
@@ -184,13 +199,18 @@
|
||||
+ if (worldserver.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS) && !e0.pluginRemoved) { // CraftBukkit - SPIGOT-7487: Don't drop leash, when the holder was removed by a plugin
|
||||
((Leashable) e0).dropLeash();
|
||||
} else {
|
||||
((Leashable) e0).removeLeash();
|
||||
@@ -205,13 +220,18 @@
|
||||
}
|
||||
|
||||
default void leashTooFarBehaviour() {
|
||||
@@ -90,7 +95,7 @@
|
||||
+ entity.level().getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(entity.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE));
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
this.dropLeash(true, true);
|
||||
this.dropLeash();
|
||||
}
|
||||
|
||||
default void closeRangeLeashBehaviour(Entity entity) {}
|
||||
@@ -101,7 +106,7 @@
|
||||
}
|
||||
|
||||
private static <E extends Entity & Leashable> void legacyElasticRangeLeashBehaviour(E e0, Entity entity, float f) {
|
||||
@@ -202,7 +222,7 @@
|
||||
@@ -223,7 +243,7 @@
|
||||
}
|
||||
|
||||
default void setLeashedTo(Entity entity, boolean flag) {
|
||||
@@ -110,7 +115,7 @@
|
||||
}
|
||||
|
||||
private static <E extends Entity & Leashable> void setLeashedTo(E e0, Entity entity, boolean flag) {
|
||||
@@ -233,7 +253,7 @@
|
||||
@@ -254,7 +274,7 @@
|
||||
|
||||
@Nullable
|
||||
default Entity getLeashHolder() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/animal/EntityBee.java
|
||||
+++ b/net/minecraft/world/entity/animal/EntityBee.java
|
||||
@@ -89,6 +89,12 @@
|
||||
@@ -93,6 +93,12 @@
|
||||
import net.minecraft.world.level.pathfinder.PathType;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityBird {
|
||||
|
||||
public static final float FLAP_DEGREES_PER_TICK = 120.32113F;
|
||||
@@ -194,12 +200,19 @@
|
||||
@@ -198,12 +204,19 @@
|
||||
|
||||
@Override
|
||||
public void addAdditionalSaveData(NBTTagCompound nbttagcompound) {
|
||||
@@ -35,7 +35,7 @@
|
||||
nbttagcompound.put("flower_pos", GameProfileSerializer.writeBlockPos(this.getSavedFlowerPos()));
|
||||
}
|
||||
|
||||
@@ -219,8 +232,8 @@
|
||||
@@ -223,8 +236,8 @@
|
||||
this.ticksWithoutNectarSinceExitingHive = nbttagcompound.getInt("TicksSincePollination");
|
||||
this.stayOutOfHiveCountdown = nbttagcompound.getInt("CannotEnterHiveTicks");
|
||||
this.numCropsGrownSincePollination = nbttagcompound.getInt("CropsGrownSincePollination");
|
||||
@@ -46,7 +46,7 @@
|
||||
this.readPersistentAngerSaveData(this.level(), nbttagcompound);
|
||||
}
|
||||
|
||||
@@ -244,7 +257,7 @@
|
||||
@@ -248,7 +261,7 @@
|
||||
}
|
||||
|
||||
if (b0 > 0) {
|
||||
@@ -55,7 +55,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -502,7 +515,7 @@
|
||||
@@ -506,7 +519,7 @@
|
||||
|
||||
@Nullable
|
||||
TileEntityBeehive getBeehiveBlockEntity() {
|
||||
@@ -64,7 +64,7 @@
|
||||
}
|
||||
|
||||
boolean isHiveValid() {
|
||||
@@ -638,8 +651,14 @@
|
||||
@@ -671,8 +684,14 @@
|
||||
if (this.isInvulnerableTo(worldserver, damagesource)) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -80,7 +80,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1048,7 +1067,7 @@
|
||||
@@ -1082,7 +1101,7 @@
|
||||
|
||||
e() {
|
||||
super();
|
||||
@@ -89,7 +89,7 @@
|
||||
this.blacklistedTargets = Lists.newArrayList();
|
||||
this.setFlags(EnumSet.of(PathfinderGoal.Type.MOVE));
|
||||
}
|
||||
@@ -1162,7 +1181,7 @@
|
||||
@@ -1196,7 +1215,7 @@
|
||||
|
||||
f() {
|
||||
super();
|
||||
@@ -98,7 +98,7 @@
|
||||
this.setFlags(EnumSet.of(PathfinderGoal.Type.MOVE));
|
||||
}
|
||||
|
||||
@@ -1267,7 +1286,7 @@
|
||||
@@ -1301,7 +1320,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
EntityBee.this.level().levelEvent(2011, blockposition, 15);
|
||||
EntityBee.this.level().setBlockAndUpdate(blockposition, iblockdata1);
|
||||
EntityBee.this.incrementNumCropsGrownSincePollination();
|
||||
@@ -1344,7 +1363,7 @@
|
||||
@@ -1378,7 +1397,7 @@
|
||||
@Override
|
||||
protected void alertOther(EntityInsentient entityinsentient, EntityLiving entityliving) {
|
||||
if (entityinsentient instanceof EntityBee && this.mob.hasLineOfSight(entityliving)) {
|
||||
@@ -116,7 +116,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1353,7 +1372,7 @@
|
||||
@@ -1387,7 +1406,7 @@
|
||||
private static class c extends PathfinderGoalNearestAttackableTarget<EntityHuman> {
|
||||
|
||||
c(EntityBee entitybee) {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
Objects.requireNonNull(iregistry);
|
||||
optional.flatMap(iregistry::get).ifPresent(this::setVariant);
|
||||
@@ -463,7 +463,7 @@
|
||||
@@ -462,7 +462,7 @@
|
||||
}
|
||||
|
||||
private void tryToTame(EntityHuman entityhuman) {
|
||||
@@ -22,7 +22,7 @@
|
||||
this.tame(entityhuman);
|
||||
this.setOrderedToSit(true);
|
||||
this.level().broadcastEntityEvent(this, (byte) 7);
|
||||
@@ -481,7 +481,7 @@
|
||||
@@ -480,7 +480,7 @@
|
||||
private static class PathfinderGoalTemptChance extends PathfinderGoalTempt {
|
||||
|
||||
@Nullable
|
||||
@@ -31,7 +31,7 @@
|
||||
private final EntityCat cat;
|
||||
|
||||
public PathfinderGoalTemptChance(EntityCat entitycat, double d0, Predicate<ItemStack> predicate, boolean flag) {
|
||||
@@ -615,7 +615,15 @@
|
||||
@@ -614,7 +614,15 @@
|
||||
this.cat.randomTeleport((double) (blockposition_mutableblockposition.getX() + randomsource.nextInt(11) - 5), (double) (blockposition_mutableblockposition.getY() + randomsource.nextInt(5) - 2), (double) (blockposition_mutableblockposition.getZ() + randomsource.nextInt(11) - 5), false);
|
||||
blockposition_mutableblockposition.set(this.cat.blockPosition());
|
||||
this.cat.dropFromGiftLootTable(getServerLevel((Entity) this.cat), LootTables.CAT_MORNING_GIFT, (worldserver, itemstack) -> {
|
||||
@@ -48,7 +48,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
@@ -646,10 +654,10 @@
|
||||
@@ -645,10 +653,10 @@
|
||||
private final EntityCat cat;
|
||||
|
||||
public a(EntityCat entitycat, Class<T> oclass, float f, double d0, double d1) {
|
||||
|
||||
@@ -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 net.minecraft.world.level.storage.loot.LootTables;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
public class EntityMushroomCow extends EntityCow implements IShearable, VariantHolder<EntityMushroomCow.Type> {
|
||||
|
||||
private static final DataWatcherObject<String> DATA_TYPE = DataWatcher.defineId(EntityMushroomCow.class, DataWatcherRegistry.STRING);
|
||||
@@ -121,6 +128,11 @@
|
||||
@@ -120,6 +127,11 @@
|
||||
if (world instanceof WorldServer) {
|
||||
WorldServer worldserver = (WorldServer) world;
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
this.shear(worldserver, SoundCategory.PLAYERS, itemstack);
|
||||
this.gameEvent(GameEvent.SHEAR, entityhuman);
|
||||
itemstack.hurtAndBreak(1, entityhuman, getSlotForHand(enumhand));
|
||||
@@ -162,11 +174,19 @@
|
||||
@@ -163,11 +175,19 @@
|
||||
worldserver.sendParticles(Particles.EXPLOSION, this.getX(), this.getY(0.5D), this.getZ(), 1, 0.0D, 0.0D, 0.0D, 0.0D);
|
||||
this.dropFromShearingLootTable(worldserver, LootTables.SHEAR_MOOSHROOM, itemstack, (worldserver1, itemstack1) -> {
|
||||
for (int i = 0; i < itemstack1.getCount(); ++i) {
|
||||
@@ -48,7 +48,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -262,7 +282,7 @@
|
||||
@@ -263,7 +283,7 @@
|
||||
}
|
||||
|
||||
static EntityMushroomCow.Type byName(String s) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/animal/EntityParrot.java
|
||||
+++ b/net/minecraft/world/entity/animal/EntityParrot.java
|
||||
@@ -250,7 +250,7 @@
|
||||
@@ -248,7 +248,7 @@
|
||||
}
|
||||
|
||||
if (!this.level().isClientSide) {
|
||||
@@ -9,7 +9,7 @@
|
||||
this.tame(entityhuman);
|
||||
this.level().broadcastEntityEvent(this, (byte) 7);
|
||||
} else {
|
||||
@@ -271,7 +271,7 @@
|
||||
@@ -269,7 +269,7 @@
|
||||
}
|
||||
} else {
|
||||
this.usePlayerItem(entityhuman, enumhand, itemstack);
|
||||
@@ -18,7 +18,7 @@
|
||||
if (entityhuman.isCreative() || !this.isInvulnerable()) {
|
||||
this.hurt(this.damageSources().playerAttack(entityhuman), Float.MAX_VALUE);
|
||||
}
|
||||
@@ -365,7 +365,7 @@
|
||||
@@ -363,7 +363,7 @@
|
||||
|
||||
@Override
|
||||
public boolean isPushable() {
|
||||
@@ -27,7 +27,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -380,8 +380,14 @@
|
||||
@@ -378,8 +378,14 @@
|
||||
if (this.isInvulnerableTo(worldserver, damagesource)) {
|
||||
return false;
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/animal/EntitySheep.java
|
||||
+++ b/net/minecraft/world/entity/animal/EntitySheep.java
|
||||
@@ -57,6 +57,12 @@
|
||||
@@ -50,6 +50,12 @@
|
||||
import net.minecraft.world.level.gameevent.GameEvent;
|
||||
import net.minecraft.world.level.storage.loot.LootTables;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
public class EntitySheep extends EntityAnimal implements IShearable {
|
||||
|
||||
private static final int EAT_ANIMATION_TICKS = 40;
|
||||
@@ -167,6 +173,11 @@
|
||||
@@ -160,6 +166,11 @@
|
||||
WorldServer worldserver = (WorldServer) world;
|
||||
|
||||
if (this.readyForShearing()) {
|
||||
@@ -25,7 +25,7 @@
|
||||
this.shear(worldserver, SoundCategory.PLAYERS, itemstack);
|
||||
this.gameEvent(GameEvent.SHEAR, entityhuman);
|
||||
itemstack.hurtAndBreak(1, entityhuman, getSlotForHand(enumhand));
|
||||
@@ -185,7 +196,9 @@
|
||||
@@ -178,7 +189,9 @@
|
||||
worldserver.playSound((EntityHuman) null, (Entity) this, SoundEffects.SHEEP_SHEAR, soundcategory, 1.0F, 1.0F);
|
||||
this.dropFromShearingLootTable(worldserver, LootTables.SHEAR_SHEEP, itemstack, (worldserver1, itemstack1) -> {
|
||||
for (int i = 0; i < itemstack1.getCount(); ++i) {
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
if (entityitem != null) {
|
||||
entityitem.setDeltaMovement(entityitem.getDeltaMovement().add((double) ((this.random.nextFloat() - this.random.nextFloat()) * 0.1F), (double) (this.random.nextFloat() * 0.05F), (double) ((this.random.nextFloat() - this.random.nextFloat()) * 0.1F)));
|
||||
@@ -280,6 +293,12 @@
|
||||
@@ -276,6 +289,12 @@
|
||||
|
||||
@Override
|
||||
public void ate() {
|
||||
@@ -48,12 +48,3 @@
|
||||
super.ate();
|
||||
this.setSheared(false);
|
||||
if (this.isBaby()) {
|
||||
@@ -299,7 +318,7 @@
|
||||
EnumColor enumcolor = entitysheep.getColor();
|
||||
EnumColor enumcolor1 = entitysheep1.getColor();
|
||||
CraftingInput craftinginput = makeCraftInput(enumcolor, enumcolor1);
|
||||
- Optional optional = worldserver.recipeAccess().getRecipeFor(Recipes.CRAFTING, craftinginput, worldserver).map((recipeholder) -> {
|
||||
+ Optional<Item> optional = worldserver.recipeAccess().getRecipeFor(Recipes.CRAFTING, craftinginput, worldserver).map((recipeholder) -> { // CraftBukkit - decompile error
|
||||
return ((RecipeCrafting) recipeholder.value()).assemble(craftinginput, worldserver.registryAccess());
|
||||
}).map(ItemStack::getItem);
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
}
|
||||
|
||||
public static AttributeProvider.Builder createAttributes() {
|
||||
@@ -229,7 +236,7 @@
|
||||
@@ -233,7 +240,7 @@
|
||||
public void aiStep() {
|
||||
super.aiStep();
|
||||
if (!this.level().isClientSide && this.isAlive() && this.tickCount % 10 == 0) {
|
||||
@@ -39,7 +39,7 @@
|
||||
}
|
||||
|
||||
if (this.isDancing() && this.shouldStopDancing() && this.tickCount % 20 == 0) {
|
||||
@@ -299,7 +306,12 @@
|
||||
@@ -303,7 +310,12 @@
|
||||
ItemStack itemstack1 = this.getItemInHand(EnumHand.MAIN_HAND);
|
||||
|
||||
if (this.isDancing() && itemstack.is(TagsItem.DUPLICATES_ALLAYS) && this.canDuplicate()) {
|
||||
@@ -53,7 +53,7 @@
|
||||
this.level().broadcastEntityEvent(this, (byte) 18);
|
||||
this.level().playSound(entityhuman, (Entity) this, SoundEffects.AMETHYST_BLOCK_CHIME, SoundCategory.NEUTRAL, 2.0F, 1.0F);
|
||||
this.removeInteractionItem(entityhuman, itemstack);
|
||||
@@ -310,7 +322,7 @@
|
||||
@@ -314,7 +326,7 @@
|
||||
this.setItemInHand(EnumHand.MAIN_HAND, itemstack2);
|
||||
this.removeInteractionItem(entityhuman, itemstack);
|
||||
this.level().playSound(entityhuman, (Entity) this, SoundEffects.ALLAY_ITEM_GIVEN, SoundCategory.NEUTRAL, 2.0F, 1.0F);
|
||||
@@ -62,7 +62,7 @@
|
||||
return EnumInteractionResult.SUCCESS;
|
||||
} else if (!itemstack1.isEmpty() && enumhand == EnumHand.MAIN_HAND && itemstack.isEmpty()) {
|
||||
this.setItemSlot(EnumItemSlot.MAINHAND, ItemStack.EMPTY);
|
||||
@@ -411,6 +423,7 @@
|
||||
@@ -415,6 +427,7 @@
|
||||
}
|
||||
|
||||
private boolean shouldStopDancing() {
|
||||
@@ -70,7 +70,7 @@
|
||||
return this.jukeboxPos == null || !this.jukeboxPos.closerToCenterThan(this.position(), (double) ((GameEvent) GameEvent.JUKEBOX_PLAY.value()).notificationRadius()) || !this.level().getBlockState(this.jukeboxPos).is(Blocks.JUKEBOX);
|
||||
}
|
||||
|
||||
@@ -502,7 +515,7 @@
|
||||
@@ -506,7 +519,7 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
Allay allay = (Allay) EntityTypes.ALLAY.create(this.level(), EntitySpawnReason.BREEDING);
|
||||
|
||||
if (allay != null) {
|
||||
@@ -510,9 +523,9 @@
|
||||
@@ -514,9 +527,9 @@
|
||||
allay.setPersistenceRequired();
|
||||
allay.resetDuplicationCooldown();
|
||||
this.resetDuplicationCooldown();
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
@@ -94,7 +98,7 @@
|
||||
this.despawnDelay = this.isLeashedToWanderingTrader() ? ((EntityVillagerTrader) this.getLeashHolder()).getDespawnDelay() - 1 : this.despawnDelay - 1;
|
||||
if (this.despawnDelay <= 0) {
|
||||
this.dropLeash(true, false);
|
||||
this.removeLeash();
|
||||
- this.discard();
|
||||
+ this.discard(EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
|
||||
}
|
||||
|
||||
@@ -191,18 +191,16 @@
|
||||
EntityExperienceOrb.award(worldserver, this.position(), MathHelper.floor((float) short0 * 0.08F));
|
||||
}
|
||||
|
||||
@@ -577,8 +672,8 @@
|
||||
if (this.dragonDeathTime == 200) {
|
||||
world = this.level();
|
||||
if (world instanceof WorldServer) {
|
||||
- worldserver = (WorldServer) world;
|
||||
- if (worldserver.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) {
|
||||
+ WorldServer worldserver = (WorldServer) world; // CraftBukkit - decompile error
|
||||
@@ -592,7 +687,7 @@
|
||||
if (world1 instanceof WorldServer) {
|
||||
WorldServer worldserver1 = (WorldServer) world1;
|
||||
|
||||
- if (worldserver1.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) {
|
||||
+ if (true) { // CraftBukkit - SPIGOT-2420: Already checked for the game rule when calculating the xp
|
||||
EntityExperienceOrb.award(worldserver, this.position(), MathHelper.floor((float) short0 * 0.2F));
|
||||
EntityExperienceOrb.award(worldserver1, this.position(), MathHelper.floor((float) short0 * 0.2F));
|
||||
}
|
||||
|
||||
@@ -586,7 +681,7 @@
|
||||
@@ -600,7 +695,7 @@
|
||||
this.dragonFight.setDragonKilled(this);
|
||||
}
|
||||
|
||||
@@ -211,7 +209,7 @@
|
||||
this.gameEvent(GameEvent.ENTITY_DIE);
|
||||
}
|
||||
}
|
||||
@@ -800,6 +895,7 @@
|
||||
@@ -814,6 +909,7 @@
|
||||
super.addAdditionalSaveData(nbttagcompound);
|
||||
nbttagcompound.putInt("DragonPhase", this.phaseManager.getCurrentPhase().getPhase().getId());
|
||||
nbttagcompound.putInt("DragonDeathTime", this.dragonDeathTime);
|
||||
@@ -219,7 +217,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -813,6 +909,11 @@
|
||||
@@ -827,6 +923,11 @@
|
||||
this.dragonDeathTime = nbttagcompound.getInt("DragonDeathTime");
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
public class EntityWither extends EntityMonster implements IRangedEntity {
|
||||
|
||||
private static final DataWatcherObject<Integer> DATA_TARGET_A = DataWatcher.defineId(EntityWither.class, DataWatcherRegistry.INT);
|
||||
@@ -253,15 +265,40 @@
|
||||
@@ -252,15 +264,40 @@
|
||||
i = this.getInvulnerableTicks() - 1;
|
||||
this.bossEvent.setProgress(1.0F - (float) i / 220.0F);
|
||||
if (i <= 0) {
|
||||
@@ -63,7 +63,7 @@
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -306,6 +343,7 @@
|
||||
@@ -305,6 +342,7 @@
|
||||
if (!list.isEmpty()) {
|
||||
EntityLiving entityliving1 = (EntityLiving) list.get(this.random.nextInt(list.size()));
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
this.setAlternativeTarget(i, entityliving1.getId());
|
||||
}
|
||||
}
|
||||
@@ -332,6 +370,11 @@
|
||||
@@ -331,6 +369,11 @@
|
||||
IBlockData iblockdata = worldserver.getBlockState(blockposition);
|
||||
|
||||
if (canDestroy(iblockdata)) {
|
||||
@@ -83,7 +83,7 @@
|
||||
flag = worldserver.destroyBlock(blockposition, true, this) || flag;
|
||||
}
|
||||
}
|
||||
@@ -343,7 +386,7 @@
|
||||
@@ -342,7 +385,7 @@
|
||||
}
|
||||
|
||||
if (this.tickCount % 20 == 0) {
|
||||
@@ -92,7 +92,7 @@
|
||||
}
|
||||
|
||||
this.bossEvent.setProgress(this.getHealth() / this.getMaxHealth());
|
||||
@@ -500,7 +543,7 @@
|
||||
@@ -499,7 +542,7 @@
|
||||
@Override
|
||||
public void checkDespawn() {
|
||||
if (this.level().getDifficulty() == EnumDifficulty.PEACEFUL && this.shouldDespawnInPeaceful()) {
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
leashable.setLeashedTo(this, true);
|
||||
flag = true;
|
||||
}
|
||||
@@ -93,18 +109,34 @@
|
||||
@@ -93,18 +109,38 @@
|
||||
boolean flag1 = false;
|
||||
|
||||
if (!flag) {
|
||||
@@ -47,7 +47,7 @@
|
||||
Leashable leashable1 = (Leashable) iterator1.next();
|
||||
|
||||
if (leashable1.isLeashed() && leashable1.getLeashHolder() == this) {
|
||||
- leashable1.dropLeash(true, false);
|
||||
- leashable1.removeLeash();
|
||||
+ // CraftBukkit start
|
||||
+ if (leashable1 instanceof Entity leashed) {
|
||||
+ if (CraftEventFactory.callPlayerUnleashEntityEvent(leashed, entityhuman, enumhand).isCancelled()) {
|
||||
@@ -55,7 +55,11 @@
|
||||
+ continue;
|
||||
+ }
|
||||
+ }
|
||||
+ leashable1.dropLeash(true, !entityhuman.getAbilities().instabuild); // false -> survival mode boolean
|
||||
+ if (entityhuman.getAbilities().instabuild){
|
||||
+ leashable1.removeLeash();
|
||||
+ } else {
|
||||
+ leashable1.dropLeash();
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
flag1 = true;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/monster/EntityEnderman.java
|
||||
+++ b/net/minecraft/world/entity/monster/EntityEnderman.java
|
||||
@@ -70,6 +70,11 @@
|
||||
@@ -69,6 +69,11 @@
|
||||
import net.minecraft.world.phys.MovingObjectPositionBlock;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
public class EntityEnderman extends EntityMonster implements IEntityAngerable {
|
||||
|
||||
private static final MinecraftKey SPEED_MODIFIER_ATTACKING_ID = MinecraftKey.withDefaultNamespace("attacking");
|
||||
@@ -113,7 +118,17 @@
|
||||
@@ -112,7 +117,17 @@
|
||||
|
||||
@Override
|
||||
public void setTarget(@Nullable EntityLiving entityliving) {
|
||||
@@ -31,7 +31,7 @@
|
||||
AttributeModifiable attributemodifiable = this.getAttribute(GenericAttributes.MOVEMENT_SPEED);
|
||||
|
||||
if (entityliving == null) {
|
||||
@@ -128,6 +143,7 @@
|
||||
@@ -127,6 +142,7 @@
|
||||
attributemodifiable.addTransientModifier(EntityEnderman.SPEED_MODIFIER_ATTACKING);
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -466,9 +482,11 @@
|
||||
@@ -465,9 +481,11 @@
|
||||
if (iblockdata2 != null) {
|
||||
iblockdata2 = Block.updateFromNeighbourShapes(iblockdata2, this.enderman.level(), blockposition);
|
||||
if (this.canPlaceBlock(world, blockposition, iblockdata2, iblockdata, iblockdata1, blockposition1)) {
|
||||
@@ -51,7 +51,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -507,9 +525,11 @@
|
||||
@@ -506,9 +524,11 @@
|
||||
boolean flag = movingobjectpositionblock.getBlockPos().equals(blockposition);
|
||||
|
||||
if (iblockdata.is(TagsBlock.ENDERMAN_HOLDABLE) && flag) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/monster/EntityPillager.java
|
||||
+++ b/net/minecraft/world/entity/monster/EntityPillager.java
|
||||
@@ -50,6 +50,10 @@
|
||||
@@ -53,6 +53,10 @@
|
||||
import net.minecraft.world.level.World;
|
||||
import net.minecraft.world.level.WorldAccess;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
public class EntityPillager extends EntityIllagerAbstract implements ICrossbow, InventoryCarrier {
|
||||
|
||||
private static final DataWatcherObject<Boolean> IS_CHARGING_CROSSBOW = DataWatcher.defineId(EntityPillager.class, DataWatcherRegistry.BOOLEAN);
|
||||
@@ -198,7 +202,7 @@
|
||||
@@ -206,7 +210,7 @@
|
||||
ItemStack itemstack1 = this.inventory.addItem(itemstack);
|
||||
|
||||
if (itemstack1.isEmpty()) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/monster/EntityRavager.java
|
||||
+++ b/net/minecraft/world/entity/monster/EntityRavager.java
|
||||
@@ -45,6 +45,10 @@
|
||||
@@ -43,6 +43,10 @@
|
||||
import net.minecraft.world.phys.AxisAlignedBB;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
public class EntityRavager extends EntityRaider {
|
||||
|
||||
private static final Predicate<Entity> ROAR_TARGET_WITH_GRIEFING = (entity) -> {
|
||||
@@ -161,6 +165,11 @@
|
||||
@@ -158,6 +162,11 @@
|
||||
Block block = iblockdata.getBlock();
|
||||
|
||||
if (block instanceof BlockLeaves) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/monster/EntitySkeletonAbstract.java
|
||||
+++ b/net/minecraft/world/entity/monster/EntitySkeletonAbstract.java
|
||||
@@ -207,7 +207,17 @@
|
||||
@@ -209,7 +209,17 @@
|
||||
World world = this.level();
|
||||
|
||||
if (world instanceof WorldServer worldserver) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/monster/EntitySkeletonWither.java
|
||||
+++ b/net/minecraft/world/entity/monster/EntitySkeletonWither.java
|
||||
@@ -97,7 +97,7 @@
|
||||
@@ -110,7 +110,7 @@
|
||||
return false;
|
||||
} else {
|
||||
if (entity instanceof EntityLiving) {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -255,6 +255,7 @@
|
||||
@@ -252,6 +252,7 @@
|
||||
|
||||
@Override
|
||||
public boolean canAttackType(EntityTypes<?> entitytypes) {
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
--- a/net/minecraft/world/entity/monster/creaking/Creaking.java
|
||||
+++ b/net/minecraft/world/entity/monster/creaking/Creaking.java
|
||||
@@ -206,7 +206,7 @@
|
||||
|
||||
@Override
|
||||
public BehaviorController<Creaking> getBrain() {
|
||||
- return super.getBrain();
|
||||
+ return (BehaviorController<Creaking>) super.getBrain(); // CraftBukkit - decompile error
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -329,7 +329,7 @@
|
||||
}
|
||||
|
||||
this.makeSound(this.getDeathSound());
|
||||
- this.remove(Entity.RemovalReason.DISCARDED);
|
||||
+ this.remove(Entity.RemovalReason.DISCARDED, null); // CraftBukkit - add Bukkit remove cause
|
||||
}
|
||||
|
||||
public void creakingDeathEffects(DamageSource damagesource) {
|
||||
@@ -476,7 +476,7 @@
|
||||
|
||||
@Override
|
||||
protected SoundEffect getHurtSound(DamageSource damagesource) {
|
||||
- return this.isHeartBound() ? SoundEffects.CREAKING_SWAY : super.getHurtSound(damagesource);
|
||||
+ return SoundEffects.CREAKING_SWAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -549,7 +549,7 @@
|
||||
}
|
||||
|
||||
public void activate(EntityHuman entityhuman) {
|
||||
- this.getBrain().setMemory(MemoryModuleType.ATTACK_TARGET, (Object) entityhuman);
|
||||
+ this.getBrain().setMemory(MemoryModuleType.ATTACK_TARGET, entityhuman); // CraftBukkit - decompile error
|
||||
this.gameEvent(GameEvent.ENTITY_ACTION);
|
||||
this.makeSound(SoundEffects.CREAKING_ACTIVATE);
|
||||
this.setIsActive(true);
|
||||
@@ -1,20 +0,0 @@
|
||||
--- a/net/minecraft/world/entity/monster/creaking/CreakingTransient.java
|
||||
+++ b/net/minecraft/world/entity/monster/creaking/CreakingTransient.java
|
||||
@@ -97,7 +97,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- this.setRemoved(Entity.RemovalReason.DISCARDED);
|
||||
+ this.setRemoved(Entity.RemovalReason.DISCARDED, null); // CraftBukkit - add Bukkit remove cause
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -149,7 +149,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- this.remove(Entity.RemovalReason.DISCARDED);
|
||||
+ this.remove(Entity.RemovalReason.DISCARDED, null); // CraftBukkit - add Bukkit remove cause
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/monster/piglin/EntityPiglin.java
|
||||
+++ b/net/minecraft/world/entity/monster/piglin/EntityPiglin.java
|
||||
@@ -57,6 +57,18 @@
|
||||
@@ -60,6 +60,18 @@
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
public class EntityPiglin extends EntityPiglinAbstract implements ICrossbow, InventoryCarrier {
|
||||
|
||||
private static final DataWatcherObject<Boolean> DATA_BABY_ID = DataWatcher.defineId(EntityPiglin.class, DataWatcherRegistry.BOOLEAN);
|
||||
@@ -76,6 +88,10 @@
|
||||
@@ -79,6 +91,10 @@
|
||||
public boolean cannotHunt;
|
||||
protected static final ImmutableList<SensorType<? extends Sensor<? super EntityPiglin>>> SENSOR_TYPES = ImmutableList.of(SensorType.NEAREST_LIVING_ENTITIES, SensorType.NEAREST_PLAYERS, SensorType.NEAREST_ITEMS, SensorType.HURT_BY, SensorType.PIGLIN_SPECIFIC_SENSOR);
|
||||
protected static final ImmutableList<MemoryModuleType<?>> MEMORY_TYPES = ImmutableList.of(MemoryModuleType.LOOK_TARGET, MemoryModuleType.DOORS_TO_CLOSE, MemoryModuleType.NEAREST_LIVING_ENTITIES, MemoryModuleType.NEAREST_VISIBLE_LIVING_ENTITIES, MemoryModuleType.NEAREST_VISIBLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_ATTACKABLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_ADULT_PIGLINS, MemoryModuleType.NEARBY_ADULT_PIGLINS, MemoryModuleType.NEAREST_VISIBLE_WANTED_ITEM, MemoryModuleType.ITEM_PICKUP_COOLDOWN_TICKS, MemoryModuleType.HURT_BY, MemoryModuleType.HURT_BY_ENTITY, new MemoryModuleType[]{MemoryModuleType.WALK_TARGET, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.ATTACK_TARGET, MemoryModuleType.ATTACK_COOLING_DOWN, MemoryModuleType.INTERACTION_TARGET, MemoryModuleType.PATH, MemoryModuleType.ANGRY_AT, MemoryModuleType.UNIVERSAL_ANGER, MemoryModuleType.AVOID_TARGET, MemoryModuleType.ADMIRING_ITEM, MemoryModuleType.TIME_TRYING_TO_REACH_ADMIRE_ITEM, MemoryModuleType.ADMIRING_DISABLED, MemoryModuleType.DISABLE_WALK_TO_ADMIRE_ITEM, MemoryModuleType.CELEBRATE_LOCATION, MemoryModuleType.DANCING, MemoryModuleType.HUNTED_RECENTLY, MemoryModuleType.NEAREST_VISIBLE_BABY_HOGLIN, MemoryModuleType.NEAREST_VISIBLE_NEMESIS, MemoryModuleType.NEAREST_VISIBLE_ZOMBIFIED, MemoryModuleType.RIDE_TARGET, MemoryModuleType.VISIBLE_ADULT_PIGLIN_COUNT, MemoryModuleType.VISIBLE_ADULT_HOGLIN_COUNT, MemoryModuleType.NEAREST_VISIBLE_HUNTABLE_HOGLIN, MemoryModuleType.NEAREST_TARGETABLE_PLAYER_NOT_WEARING_GOLD, MemoryModuleType.NEAREST_PLAYER_HOLDING_WANTED_ITEM, MemoryModuleType.ATE_RECENTLY, MemoryModuleType.NEAREST_REPELLENT});
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
public EntityPiglin(EntityTypes<? extends EntityPiglinAbstract> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@@ -94,6 +110,14 @@
|
||||
@@ -97,6 +113,14 @@
|
||||
}
|
||||
|
||||
this.writeInventoryToTag(nbttagcompound, this.registryAccess());
|
||||
@@ -45,7 +45,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -102,6 +126,10 @@
|
||||
@@ -105,6 +129,10 @@
|
||||
this.setBaby(nbttagcompound.getBoolean("IsBaby"));
|
||||
this.setCannotHunt(nbttagcompound.getBoolean("CannotHunt"));
|
||||
this.readInventoryFromTag(nbttagcompound, this.registryAccess());
|
||||
@@ -56,7 +56,7 @@
|
||||
}
|
||||
|
||||
@VisibleForDebug
|
||||
@@ -221,7 +249,7 @@
|
||||
@@ -224,7 +252,7 @@
|
||||
|
||||
@Override
|
||||
public BehaviorController<EntityPiglin> getBrain() {
|
||||
@@ -65,7 +65,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -366,7 +394,7 @@
|
||||
@@ -374,7 +402,7 @@
|
||||
}
|
||||
|
||||
protected void holdInOffHand(ItemStack itemstack) {
|
||||
@@ -74,18 +74,18 @@
|
||||
this.setItemSlot(EnumItemSlot.OFFHAND, itemstack);
|
||||
this.setGuaranteedDrop(EnumItemSlot.OFFHAND);
|
||||
} else {
|
||||
@@ -392,8 +420,8 @@
|
||||
if (EnchantmentManager.has(itemstack1, EnchantmentEffectComponents.PREVENT_ARMOR_CHANGE)) {
|
||||
@@ -401,8 +429,8 @@
|
||||
return false;
|
||||
} else {
|
||||
- boolean flag = PiglinAI.isLovedItem(itemstack) || itemstack.is(Items.CROSSBOW);
|
||||
- boolean flag1 = PiglinAI.isLovedItem(itemstack1) || itemstack1.is(Items.CROSSBOW);
|
||||
+ boolean flag = PiglinAI.isLovedItem(itemstack, this) || itemstack.is(Items.CROSSBOW); // CraftBukkit
|
||||
+ boolean flag1 = PiglinAI.isLovedItem(itemstack1, this) || itemstack1.is(Items.CROSSBOW); // CraftBukkit
|
||||
TagKey<Item> tagkey = this.getPreferredWeaponType();
|
||||
- boolean flag = PiglinAI.isLovedItem(itemstack) || tagkey != null && itemstack.is(tagkey);
|
||||
- boolean flag1 = PiglinAI.isLovedItem(itemstack1) || tagkey != null && itemstack1.is(tagkey);
|
||||
+ boolean flag = PiglinAI.isLovedItem(itemstack, this) || tagkey != null && itemstack.is(tagkey); // CraftBukkit
|
||||
+ boolean flag1 = PiglinAI.isLovedItem(itemstack1, this) || tagkey != null && itemstack1.is(tagkey); // CraftBukkit
|
||||
|
||||
return flag && !flag1 ? true : (!flag && flag1 ? false : (this.isAdult() && !itemstack.is(Items.CROSSBOW) && itemstack1.is(Items.CROSSBOW) ? false : super.canReplaceCurrentItem(itemstack, itemstack1, enumitemslot)));
|
||||
return flag && !flag1 ? true : (!flag && flag1 ? false : super.canReplaceCurrentItem(itemstack, itemstack1, enumitemslot));
|
||||
}
|
||||
@@ -422,7 +450,7 @@
|
||||
@@ -431,7 +459,7 @@
|
||||
|
||||
@Override
|
||||
protected SoundEffect getAmbientSound() {
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
this.getBrain().eraseMemory(MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE);
|
||||
SonicBoom.setCooldown(this, 200);
|
||||
}
|
||||
@@ -582,12 +582,12 @@
|
||||
@@ -582,11 +582,11 @@
|
||||
|
||||
@Override
|
||||
protected NavigationAbstract createNavigation(World world) {
|
||||
@@ -36,7 +36,6 @@
|
||||
@Override
|
||||
protected Pathfinder createPathFinder(int i) {
|
||||
this.nodeEvaluator = new PathfinderNormal();
|
||||
this.nodeEvaluator.setCanPassDoors(true);
|
||||
- return new Pathfinder(this, this.nodeEvaluator, i) {
|
||||
+ return new Pathfinder(this.nodeEvaluator, i) { // CraftBukkit - decompile error
|
||||
@Override
|
||||
|
||||
@@ -95,8 +95,8 @@
|
||||
}).limit(5L).toList();
|
||||
|
||||
if (list1.size() >= j) {
|
||||
- if (!SpawnUtil.trySpawnMob(EntityTypes.IRON_GOLEM, EntitySpawnReason.MOB_SUMMONED, worldserver, this.blockPosition(), 10, 8, 6, SpawnUtil.a.LEGACY_IRON_GOLEM).isEmpty()) {
|
||||
+ if (!SpawnUtil.trySpawnMob(EntityTypes.IRON_GOLEM, EntitySpawnReason.MOB_SUMMONED, worldserver, this.blockPosition(), 10, 8, 6, SpawnUtil.a.LEGACY_IRON_GOLEM, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.VILLAGE_DEFENSE).isEmpty()) { // CraftBukkit
|
||||
- if (!SpawnUtil.trySpawnMob(EntityTypes.IRON_GOLEM, EntitySpawnReason.MOB_SUMMONED, worldserver, this.blockPosition(), 10, 8, 6, SpawnUtil.a.LEGACY_IRON_GOLEM, false).isEmpty()) {
|
||||
+ if (!SpawnUtil.trySpawnMob(EntityTypes.IRON_GOLEM, EntitySpawnReason.MOB_SUMMONED, worldserver, this.blockPosition(), 10, 8, 6, SpawnUtil.a.LEGACY_IRON_GOLEM, false, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.VILLAGE_DEFENSE).isEmpty()) { // CraftBukkit
|
||||
list.forEach(SensorGolemLastSeen::golemDetected);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
private static final DataWatcherObject<Float> DATA_PLAYER_ABSORPTION_ID = DataWatcher.defineId(EntityHuman.class, DataWatcherRegistry.FLOAT);
|
||||
private static final DataWatcherObject<Integer> DATA_SCORE_ID = DataWatcher.defineId(EntityHuman.class, DataWatcherRegistry.INT);
|
||||
protected static final DataWatcherObject<Byte> DATA_PLAYER_MODE_CUSTOMISATION = DataWatcher.defineId(EntityHuman.class, DataWatcherRegistry.BYTE);
|
||||
@@ -148,7 +162,7 @@
|
||||
protected static final DataWatcherObject<NBTTagCompound> DATA_SHOULDER_RIGHT = DataWatcher.defineId(EntityHuman.class, DataWatcherRegistry.COMPOUND_TAG);
|
||||
@@ -149,7 +163,7 @@
|
||||
public static final int CLIENT_LOADED_TIMEOUT_TIME = 60;
|
||||
private long timeEntitySatOnShoulder;
|
||||
final PlayerInventory inventory = new PlayerInventory(this);
|
||||
- protected InventoryEnderChest enderChestInventory = new InventoryEnderChest();
|
||||
@@ -39,7 +39,7 @@
|
||||
public final ContainerPlayer inventoryMenu;
|
||||
public Container containerMenu;
|
||||
protected FoodMetaData foodData = new FoodMetaData();
|
||||
@@ -186,6 +200,16 @@
|
||||
@@ -189,6 +203,16 @@
|
||||
private boolean ignoreFallDamageFromCurrentImpulse;
|
||||
private int currentImpulseContextResetGraceTime;
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
public EntityHuman(World world, BlockPosition blockposition, float f, GameProfile gameprofile) {
|
||||
super(EntityTypes.PLAYER, world);
|
||||
this.lastItemInMainHand = ItemStack.EMPTY;
|
||||
@@ -350,7 +374,7 @@
|
||||
@@ -353,7 +377,7 @@
|
||||
}
|
||||
|
||||
private void turtleHelmetTick() {
|
||||
@@ -65,7 +65,7 @@
|
||||
}
|
||||
|
||||
private boolean isEquipped(Item item) {
|
||||
@@ -520,8 +544,14 @@
|
||||
@@ -523,8 +547,14 @@
|
||||
public void rideTick() {
|
||||
if (!this.level().isClientSide && this.wantsToStopRiding() && this.isPassenger()) {
|
||||
this.stopRiding();
|
||||
@@ -82,7 +82,7 @@
|
||||
super.rideTick();
|
||||
this.oBob = this.bob;
|
||||
this.bob = 0.0F;
|
||||
@@ -716,6 +746,13 @@
|
||||
@@ -719,6 +749,13 @@
|
||||
|
||||
@Nullable
|
||||
public EntityItem drop(ItemStack itemstack, boolean flag, boolean flag1) {
|
||||
@@ -96,7 +96,7 @@
|
||||
if (!itemstack.isEmpty() && this.level().isClientSide) {
|
||||
this.swing(EnumHand.MAIN_HAND);
|
||||
}
|
||||
@@ -806,7 +843,7 @@
|
||||
@@ -809,7 +846,7 @@
|
||||
}
|
||||
|
||||
if (nbttagcompound.contains("LastDeathLocation", 10)) {
|
||||
@@ -105,7 +105,7 @@
|
||||
Logger logger = EntityHuman.LOGGER;
|
||||
|
||||
Objects.requireNonNull(logger);
|
||||
@@ -814,7 +851,7 @@
|
||||
@@ -817,7 +854,7 @@
|
||||
}
|
||||
|
||||
if (nbttagcompound.contains("current_explosion_impact_pos", 9)) {
|
||||
@@ -114,7 +114,7 @@
|
||||
Logger logger1 = EntityHuman.LOGGER;
|
||||
|
||||
Objects.requireNonNull(logger1);
|
||||
@@ -851,7 +888,7 @@
|
||||
@@ -854,7 +891,7 @@
|
||||
}
|
||||
|
||||
this.getLastDeathLocation().flatMap((globalpos) -> {
|
||||
@@ -123,7 +123,7 @@
|
||||
Logger logger = EntityHuman.LOGGER;
|
||||
|
||||
Objects.requireNonNull(logger);
|
||||
@@ -883,10 +920,10 @@
|
||||
@@ -886,10 +923,10 @@
|
||||
if (this.isDeadOrDying()) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -136,7 +136,7 @@
|
||||
}
|
||||
|
||||
if (worldserver.getDifficulty() == EnumDifficulty.EASY) {
|
||||
@@ -898,7 +935,13 @@
|
||||
@@ -901,7 +938,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -920,10 +963,29 @@
|
||||
@@ -923,10 +966,29 @@
|
||||
}
|
||||
|
||||
public boolean canHarmPlayer(EntityHuman entityhuman) {
|
||||
@@ -184,7 +184,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -963,8 +1025,13 @@
|
||||
@@ -966,8 +1028,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@
|
||||
if (!this.isInvulnerableTo(worldserver, damagesource)) {
|
||||
f = this.getDamageAfterArmorAbsorb(damagesource, f);
|
||||
f = this.getDamageAfterMagicAbsorb(damagesource, f);
|
||||
@@ -979,7 +1046,7 @@
|
||||
@@ -982,7 +1049,7 @@
|
||||
}
|
||||
|
||||
if (f != 0.0F) {
|
||||
@@ -208,7 +208,7 @@
|
||||
this.getCombatTracker().recordDamage(damagesource, f);
|
||||
this.setHealth(this.getHealth() - f);
|
||||
if (f < 3.4028235E37F) {
|
||||
@@ -989,6 +1056,7 @@
|
||||
@@ -992,6 +1059,7 @@
|
||||
this.gameEvent(GameEvent.ENTITY_DAMAGE);
|
||||
}
|
||||
}
|
||||
@@ -216,7 +216,7 @@
|
||||
}
|
||||
|
||||
public boolean isTextFilteringEnabled() {
|
||||
@@ -1141,10 +1209,15 @@
|
||||
@@ -1144,10 +1212,15 @@
|
||||
|
||||
f *= 0.2F + f2 * f2 * 0.8F;
|
||||
f1 *= f2;
|
||||
@@ -233,7 +233,7 @@
|
||||
if (iprojectile.deflect(ProjectileDeflection.AIM_DEFLECT, this, this, true)) {
|
||||
this.level().playSound((EntityHuman) null, this.getX(), this.getY(), this.getZ(), SoundEffects.PLAYER_ATTACK_NODAMAGE, this.getSoundSource());
|
||||
return;
|
||||
@@ -1220,8 +1293,13 @@
|
||||
@@ -1223,8 +1296,13 @@
|
||||
if (entityliving2 != this && entityliving2 != entity && !this.isAlliedTo((Entity) entityliving2) && (!(entityliving2 instanceof EntityArmorStand) || !((EntityArmorStand) entityliving2).isMarker()) && this.distanceToSqr((Entity) entityliving2) < 9.0D) {
|
||||
float f7 = this.getEnchantedDamage(entityliving2, f6, damagesource) * f2;
|
||||
|
||||
@@ -248,7 +248,7 @@
|
||||
World world = this.level();
|
||||
|
||||
if (world instanceof WorldServer) {
|
||||
@@ -1237,9 +1315,26 @@
|
||||
@@ -1240,9 +1318,26 @@
|
||||
}
|
||||
|
||||
if (entity instanceof EntityPlayer && entity.hurtMarked) {
|
||||
@@ -275,7 +275,7 @@
|
||||
}
|
||||
|
||||
if (flag2) {
|
||||
@@ -1305,9 +1400,14 @@
|
||||
@@ -1308,9 +1403,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -291,7 +291,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1348,7 +1448,14 @@
|
||||
@@ -1351,7 +1451,14 @@
|
||||
|
||||
@Override
|
||||
public void remove(Entity.RemovalReason entity_removalreason) {
|
||||
@@ -307,7 +307,7 @@
|
||||
this.inventoryMenu.removed(this);
|
||||
if (this.containerMenu != null && this.hasContainerOpen()) {
|
||||
this.doCloseContainer();
|
||||
@@ -1388,6 +1495,12 @@
|
||||
@@ -1391,6 +1498,12 @@
|
||||
}
|
||||
|
||||
public Either<EntityHuman.EnumBedResult, Unit> startSleepInBed(BlockPosition blockposition) {
|
||||
@@ -320,7 +320,7 @@
|
||||
this.startSleeping(blockposition);
|
||||
this.sleepCounter = 0;
|
||||
return Either.right(Unit.INSTANCE);
|
||||
@@ -1542,12 +1655,24 @@
|
||||
@@ -1545,12 +1658,24 @@
|
||||
}
|
||||
|
||||
public void startFallFlying() {
|
||||
@@ -346,7 +346,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1662,10 +1787,21 @@
|
||||
@@ -1665,10 +1790,21 @@
|
||||
return this.experienceLevel >= 30 ? 112 + (this.experienceLevel - 30) * 9 : (this.experienceLevel >= 15 ? 37 + (this.experienceLevel - 15) * 5 : 7 + this.experienceLevel * 2);
|
||||
}
|
||||
|
||||
@@ -369,7 +369,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1745,13 +1881,20 @@
|
||||
@@ -1748,13 +1884,20 @@
|
||||
|
||||
@Override
|
||||
public void setItemSlot(EnumItemSlot enumitemslot, ItemStack itemstack) {
|
||||
@@ -393,7 +393,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1795,26 +1938,31 @@
|
||||
@@ -1798,26 +1941,31 @@
|
||||
|
||||
protected void removeEntitiesOnShoulder() {
|
||||
if (this.timeEntitySatOnShoulder + 20L < this.level().getGameTime()) {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
public abstract class EntityArrow extends IProjectile {
|
||||
|
||||
private static final double ARROW_BASE_DAMAGE = 2.0D;
|
||||
@@ -86,7 +93,14 @@
|
||||
@@ -88,7 +95,14 @@
|
||||
}
|
||||
|
||||
protected EntityArrow(EntityTypes<? extends EntityArrow> entitytypes, double d0, double d1, double d2, World world, ItemStack itemstack, @Nullable ItemStack itemstack1) {
|
||||
@@ -29,7 +29,7 @@
|
||||
this.pickupItemStack = itemstack.copy();
|
||||
this.setCustomName((IChatBaseComponent) itemstack.get(DataComponents.CUSTOM_NAME));
|
||||
Unit unit = (Unit) itemstack.remove(DataComponents.INTANGIBLE_PROJECTILE);
|
||||
@@ -112,8 +126,8 @@
|
||||
@@ -114,8 +128,8 @@
|
||||
}
|
||||
|
||||
protected EntityArrow(EntityTypes<? extends EntityArrow> entitytypes, EntityLiving entityliving, World world, ItemStack itemstack, @Nullable ItemStack itemstack1) {
|
||||
@@ -40,7 +40,7 @@
|
||||
}
|
||||
|
||||
public void setSoundEvent(SoundEffect soundeffect) {
|
||||
@@ -276,7 +290,7 @@
|
||||
@@ -282,7 +296,7 @@
|
||||
|
||||
if (movingobjectpositionentity == null) {
|
||||
if (this.isAlive() && movingobjectpositionblock.getType() != MovingObjectPosition.EnumMovingObjectType.MISS) {
|
||||
@@ -49,7 +49,7 @@
|
||||
this.hasImpulse = true;
|
||||
}
|
||||
} else {
|
||||
@@ -284,7 +298,7 @@
|
||||
@@ -290,7 +304,7 @@
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
|
||||
this.hasImpulse = true;
|
||||
if (this.getPierceLevel() > 0 && projectiledeflection == ProjectileDeflection.NONE) {
|
||||
@@ -356,7 +370,7 @@
|
||||
@@ -357,7 +371,7 @@
|
||||
protected void tickDespawn() {
|
||||
++this.life;
|
||||
if (this.life >= 1200) {
|
||||
@@ -67,7 +67,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -408,7 +422,7 @@
|
||||
@@ -423,7 +437,7 @@
|
||||
}
|
||||
|
||||
if (this.piercingIgnoreEntityIds.size() >= this.getPierceLevel() + 1) {
|
||||
@@ -76,7 +76,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -429,7 +443,13 @@
|
||||
@@ -444,7 +458,13 @@
|
||||
int k = entity.getRemainingFireTicks();
|
||||
|
||||
if (this.isOnFire() && !flag) {
|
||||
@@ -91,7 +91,7 @@
|
||||
}
|
||||
|
||||
if (entity.hurtOrSimulate(damagesource, (float) i)) {
|
||||
@@ -475,7 +495,7 @@
|
||||
@@ -490,7 +510,7 @@
|
||||
|
||||
this.playSound(this.soundEvent, 1.0F, 1.2F / (this.random.nextFloat() * 0.2F + 0.9F));
|
||||
if (this.getPierceLevel() <= 0) {
|
||||
@@ -100,7 +100,7 @@
|
||||
}
|
||||
} else {
|
||||
entity.setRemainingFireTicks(k);
|
||||
@@ -491,7 +511,7 @@
|
||||
@@ -506,7 +526,7 @@
|
||||
this.spawnAtLocation(worldserver2, this.getPickupItem(), 0.1F);
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -660,7 +680,7 @@
|
||||
@@ -675,7 +695,7 @@
|
||||
}
|
||||
|
||||
if (nbttagcompound.contains("weapon", 10)) {
|
||||
@@ -118,7 +118,7 @@
|
||||
} else {
|
||||
this.firedFromWeapon = null;
|
||||
}
|
||||
@@ -673,34 +693,31 @@
|
||||
@@ -688,34 +708,31 @@
|
||||
Entity entity1 = entity;
|
||||
byte b0 = 0;
|
||||
|
||||
@@ -165,7 +165,7 @@
|
||||
}
|
||||
|
||||
this.pickup = entityarrow_pickupstatus;
|
||||
@@ -709,9 +726,24 @@
|
||||
@@ -724,9 +741,24 @@
|
||||
@Override
|
||||
public void playerTouch(EntityHuman entityhuman) {
|
||||
if (!this.level().isClientSide && (this.isInGround() || this.isNoPhysics()) && this.shakeTime <= 0) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityFireball.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityFireball.java
|
||||
@@ -19,11 +19,17 @@
|
||||
@@ -15,11 +15,17 @@
|
||||
import net.minecraft.world.phys.MovingObjectPosition;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
protected EntityFireball(EntityTypes<? extends EntityFireball> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@@ -73,7 +79,7 @@
|
||||
@@ -69,7 +75,7 @@
|
||||
|
||||
this.applyInertia();
|
||||
if (!this.level().isClientSide && (entity != null && entity.isRemoved() || !this.level().hasChunkAt(this.blockPosition()))) {
|
||||
@@ -27,7 +27,7 @@
|
||||
} else {
|
||||
MovingObjectPosition movingobjectposition = ProjectileHelper.getHitResultOnMoveVector(this, this::canHitEntity, this.getClipType());
|
||||
Vec3D vec3d;
|
||||
@@ -93,7 +99,7 @@
|
||||
@@ -89,7 +95,7 @@
|
||||
}
|
||||
|
||||
if (movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.MISS && this.isAlive()) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityThrownExpBottle.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityThrownExpBottle.java
|
||||
@@ -12,6 +12,10 @@
|
||||
@@ -10,6 +10,10 @@
|
||||
import net.minecraft.world.level.World;
|
||||
import net.minecraft.world.phys.MovingObjectPosition;
|
||||
|
||||
@@ -11,20 +11,20 @@
|
||||
public class EntityThrownExpBottle extends EntityProjectileThrowable {
|
||||
|
||||
public EntityThrownExpBottle(EntityTypes<? extends EntityThrownExpBottle> entitytypes, World world) {
|
||||
@@ -40,11 +44,20 @@
|
||||
@@ -38,11 +42,20 @@
|
||||
protected void onHit(MovingObjectPosition movingobjectposition) {
|
||||
super.onHit(movingobjectposition);
|
||||
if (this.level() instanceof WorldServer) {
|
||||
- this.level().levelEvent(2002, this.blockPosition(), PotionContents.getColor(Potions.WATER));
|
||||
- this.level().levelEvent(2002, this.blockPosition(), -13083194);
|
||||
+ // CraftBukkit - moved to after event
|
||||
+ // this.level().levelEvent(2002, this.blockPosition(), PotionContents.getColor(Potions.WATER));
|
||||
+ // this.level().levelEvent(2002, this.blockPosition(), -13083194);
|
||||
int i = 3 + this.level().random.nextInt(5) + this.level().random.nextInt(5);
|
||||
|
||||
+ // CraftBukkit start
|
||||
+ org.bukkit.event.entity.ExpBottleEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callExpBottleEvent(this, movingobjectposition, i);
|
||||
+ i = event.getExperience();
|
||||
+ if (event.getShowEffect()) {
|
||||
+ this.level().levelEvent(2002, this.blockPosition(), PotionContents.getColor(Potions.WATER));
|
||||
+ this.level().levelEvent(2002, this.blockPosition(), -13083194);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
public class EntityThrownTrident extends EntityArrow {
|
||||
|
||||
private static final DataWatcherObject<Byte> ID_LOYALTY = DataWatcher.defineId(EntityThrownTrident.class, DataWatcherRegistry.BYTE);
|
||||
@@ -75,10 +79,10 @@
|
||||
@@ -76,10 +80,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -136,7 +140,7 @@
|
||||
@@ -137,7 +141,7 @@
|
||||
|
||||
world = this.level();
|
||||
if (world instanceof WorldServer) {
|
||||
|
||||
@@ -29,15 +29,6 @@
|
||||
this.mob = entityraider;
|
||||
this.setFlags(EnumSet.of(PathfinderGoal.Type.MOVE));
|
||||
}
|
||||
@@ -524,7 +528,7 @@
|
||||
private final float hostileRadiusSqr;
|
||||
public final PathfinderTargetCondition shoutTargeting = PathfinderTargetCondition.forNonCombat().range(8.0D).ignoreLineOfSight().ignoreInvisibilityTesting();
|
||||
|
||||
- public a(final EntityRaider entityraider, final EntityIllagerAbstract entityillagerabstract, final float f) {
|
||||
+ public a(final EntityIllagerAbstract entityillagerabstract, final float f) { // CraftBukkit - decompile error
|
||||
this.mob = entityillagerabstract;
|
||||
this.hostileRadiusSqr = f * f;
|
||||
this.setFlags(EnumSet.of(PathfinderGoal.Type.MOVE, PathfinderGoal.Type.LOOK));
|
||||
@@ -547,7 +551,7 @@
|
||||
while (iterator.hasNext()) {
|
||||
EntityRaider entityraider = (EntityRaider) iterator.next();
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
+ public void remove(Entity.RemovalReason entity_removalreason, EntityRemoveEvent.Cause cause) {
|
||||
+ // CraftBukkit end
|
||||
if (!this.level().isClientSide && entity_removalreason.shouldDestroy() && this.isLeashed()) {
|
||||
this.dropLeash(true, true);
|
||||
this.dropLeash();
|
||||
}
|
||||
|
||||
- super.remove(entity_removalreason);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/vehicle/EntityMinecartCommandBlock.java
|
||||
+++ b/net/minecraft/world/entity/vehicle/EntityMinecartCommandBlock.java
|
||||
@@ -140,5 +140,12 @@
|
||||
@@ -135,5 +135,12 @@
|
||||
public boolean isValid() {
|
||||
return !EntityMinecartCommandBlock.this.isRemoved();
|
||||
}
|
||||
|
||||
@@ -12,22 +12,22 @@
|
||||
public class EntityMinecartTNT extends EntityMinecartAbstract {
|
||||
|
||||
private static final byte EVENT_PRIME = 10;
|
||||
@@ -33,6 +38,7 @@
|
||||
private static final float DEFAULT_EXPLOSION_POWER_BASE = 4.0F;
|
||||
@@ -37,6 +42,7 @@
|
||||
public int fuse = -1;
|
||||
public float explosionPowerBase = 4.0F;
|
||||
public float explosionSpeedFactor = 1.0F;
|
||||
+ public boolean isIncendiary = false; // CraftBukkit - add field
|
||||
|
||||
public EntityMinecartTNT(EntityTypes<? extends EntityMinecartTNT> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@@ -113,8 +119,16 @@
|
||||
@@ -117,8 +123,16 @@
|
||||
if (world instanceof WorldServer worldserver) {
|
||||
double d1 = Math.min(Math.sqrt(d0), 5.0D);
|
||||
|
||||
- worldserver.explode(this, damagesource, (ExplosionDamageCalculator) null, this.getX(), this.getY(), this.getZ(), (float) ((double) this.explosionPowerBase + this.random.nextDouble() * 1.5D * d1), false, World.a.TNT);
|
||||
- worldserver.explode(this, damagesource, (ExplosionDamageCalculator) null, this.getX(), this.getY(), this.getZ(), (float) ((double) this.explosionPowerBase + (double) this.explosionSpeedFactor * this.random.nextDouble() * 1.5D * d1), false, World.a.TNT);
|
||||
- this.discard();
|
||||
+ // CraftBukkit start
|
||||
+ ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), (float) ((double) this.explosionPowerBase + this.random.nextDouble() * 1.5D * d1), this.isIncendiary);
|
||||
+ ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), (float) ((double) this.explosionPowerBase + (double) this.explosionSpeedFactor * this.random.nextDouble() * 1.5D * d1), this.isIncendiary);
|
||||
+ worldserver.getCraftServer().getPluginManager().callEvent(event);
|
||||
+ if (event.isCancelled()) {
|
||||
+ fuse = -1;
|
||||
|
||||
Reference in New Issue
Block a user