even even even more work

This commit is contained in:
MiniDigger | Martin
2020-06-25 16:09:55 +02:00
parent 4aa7955818
commit e943ece469
125 changed files with 857 additions and 3512 deletions

View File

@@ -19,7 +19,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
import java.util.Random;
import java.util.UUID;
import java.util.function.Predicate;
@@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster {
@@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable {
setGoalTarget(entityliving, org.bukkit.event.entity.EntityTargetEvent.TargetReason.UNKNOWN, true);
}
@@ -32,37 +32,37 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@Override
public boolean setGoalTarget(EntityLiving entityliving, org.bukkit.event.entity.EntityTargetEvent.TargetReason reason, boolean fireEvent) {
if (!super.setGoalTarget(entityliving, reason, fireEvent)) {
@@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster {
if (this.world.isDay() && this.ticksLived >= this.bA + 600) {
float f = this.aI();
@@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable {
if (this.world.isDay() && this.ticksLived >= this.bz + 600) {
float f = this.aO();
- if (f > 0.5F && this.world.f(new BlockPosition(this)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) {
+ if (f > 0.5F && this.world.f(new BlockPosition(this)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.tryEscape(EndermanEscapeEvent.Reason.RUNAWAY)) { // Paper
- if (f > 0.5F && this.world.f(this.getChunkCoordinates()) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) {
+ if (f > 0.5F && this.world.f(this.getChunkCoordinates()) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.tryEscape(EndermanEscapeEvent.Reason.RUNAWAY)) { // Paper
this.setGoalTarget((EntityLiving) null);
this.eq();
this.eM();
}
@@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster {
} else if (!(damagesource instanceof EntityDamageSourceIndirect) && damagesource != DamageSource.FIREWORKS) {
boolean flag = super.damageEntity(damagesource, f);
- if (!this.world.p_() && damagesource.ignoresArmor() && this.random.nextInt(10) != 0) {
+ if (!this.world.p_() && damagesource.ignoresArmor() && this.random.nextInt(10) != 0 && this.tryEscape(damagesource == DamageSource.DROWN ? EndermanEscapeEvent.Reason.DROWN : EndermanEscapeEvent.Reason.CRITICAL_HIT)) { // Paper
this.eq();
}
return flag;
} else {
@@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable {
if (this.isInvulnerable(damagesource)) {
return false;
} else if (damagesource instanceof EntityDamageSourceIndirect) {
+ if (this.tryEscape(EndermanEscapeEvent.Reason.INDIRECT)) { // Paper start
for (int i = 0; i < 64; ++i) {
if (this.eq()) {
if (this.eM()) {
return true;
}
}
+ } // Paper end
return false;
}
@@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster {
} else {
boolean flag = super.damageEntity(damagesource, f);
- if (!this.world.s_() && this.random.nextInt(10) != 0) {
+ if (!this.world.s_() && this.random.nextInt(10) != 0 && this.tryEscape(damagesource == DamageSource.DROWN ? EndermanEscapeEvent.Reason.DROWN : EndermanEscapeEvent.Reason.CRITICAL_HIT)) { // Paper
this.eM();
}
@@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable {
static class PathfinderGoalPlayerWhoLookedAtTarget extends PathfinderGoalNearestAttackableTarget<EntityHuman> {
@@ -71,12 +71,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private EntityHuman j;
private int k;
private int l;
@@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster {
@@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable {
} else {
if (this.c != null && !this.i.isPassenger()) {
if (this.i.f((EntityHuman) this.c)) {
if (this.i.g((EntityHuman) this.c)) {
- if (this.c.h((Entity) this.i) < 16.0D) {
+ if (this.c.h((Entity) this.i) < 16.0D && this.getEnderman().tryEscape(EndermanEscapeEvent.Reason.STARE)) {
this.i.eq();
this.i.eM();
}