NOT FINISHED! 1.13 pre-7 - Holy moley, more patches!

Really, don't touch! may harm your cat!
This commit is contained in:
Shane Freeder
2018-07-18 19:55:52 +01:00
parent 96f62ca759
commit 37f7038e10
35 changed files with 292 additions and 448 deletions

View File

@@ -8,18 +8,22 @@ Fires an event anytime an enderman intends to teleport away from the player
You may cancel this, enabling ranged attacks to damage the enderman for example.
diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java
index 2f59e7071..e8ea231dc 100644
index 96e29539b..a9020083d 100644
--- a/src/main/java/net/minecraft/server/EntityEnderman.java
+++ b/src/main/java/net/minecraft/server/EntityEnderman.java
@@ -0,0 +0,0 @@
package net.minecraft.server;
import java.util.Optional;
+import com.destroystokyo.paper.event.entity.EndermanEscapeEvent;
import com.google.common.base.Function;
import com.google.common.base.Optional;
import com.google.common.base.Predicate;
+import com.google.common.base.Function;
+import com.google.common.base.Predicate;
+
import java.util.Random;
import java.util.UUID;
import java.util.function.Function;
@@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster {
setGoalTarget(entityliving, EntityTargetEvent.TargetReason.UNKNOWN, true);
setGoalTarget(entityliving, org.bukkit.event.entity.EntityTargetEvent.TargetReason.UNKNOWN, true);
}
+ // Paper start
@@ -32,13 +36,13 @@ index 2f59e7071..e8ea231dc 100644
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.D() && this.ticksLived >= this.bA + 600) {
float f = this.aw();
if (this.world.K() && this.ticksLived >= this.bE + 600) {
float f = this.az();
- if (f > 0.5F && this.world.h(new BlockPosition(this)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) {
+ if (f > 0.5F && this.world.h(new BlockPosition(this)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && tryEscape(EndermanEscapeEvent.Reason.RUNAWAY)) { // Paper
- if (f > 0.5F && this.world.e(new BlockPosition(this)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) {
+ if (f > 0.5F && this.world.e(new BlockPosition(this)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && tryEscape(EndermanEscapeEvent.Reason.RUNAWAY)) { // Paper
this.setGoalTarget((EntityLiving) null);
this.dm();
this.dz();
}
@@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster {
public boolean damageEntity(DamageSource damagesource, float f) {
@@ -47,7 +51,7 @@ index 2f59e7071..e8ea231dc 100644
- } else if (damagesource instanceof EntityDamageSourceIndirect) {
+ } else if (damagesource instanceof EntityDamageSourceIndirect && tryEscape(EndermanEscapeEvent.Reason.INDIRECT)) { // Paper
for (int i = 0; i < 64; ++i) {
if (this.dm()) {
if (this.dz()) {
return true;
@@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster {
} else {
@@ -55,7 +59,7 @@ index 2f59e7071..e8ea231dc 100644
- if (damagesource.ignoresArmor() && this.random.nextInt(10) != 0) {
+ if (damagesource.ignoresArmor() && this.random.nextInt(10) != 0 && tryEscape(damagesource == DamageSource.DROWN ? EndermanEscapeEvent.Reason.DROWN : EndermanEscapeEvent.Reason.CRITICAL_HIT)) { // Paper
this.dm();
this.dz();
}
@@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster {
@@ -73,7 +77,7 @@ index 2f59e7071..e8ea231dc 100644
if (this.i.f((EntityHuman) this.d)) {
- if (((EntityHuman) this.d).h(this.i) < 16.0D) {
+ if (((EntityHuman) this.d).h(this.i) < 16.0D && this.getEnderman().tryEscape(EndermanEscapeEvent.Reason.STARE)) { // Paper
this.i.dm();
this.i.dz();
}
--