2016-12-28 06:19:58 +01:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Tue, 27 Dec 2016 22:38:06 -0500
|
|
|
|
Subject: [PATCH] Activation Range Improvements
|
|
|
|
|
|
|
|
Fixes and adds new Immunities to improve gameplay behavior
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java
|
2018-01-18 07:00:51 +01:00
|
|
|
index 0c82c6f5b..9659a45ef 100644
|
2016-12-28 06:19:58 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityCreature.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityCreature.java
|
|
|
|
@@ -0,0 +0,0 @@ public abstract class EntityCreature extends EntityInsentient {
|
|
|
|
|
2017-05-14 20:05:01 +02:00
|
|
|
public static final UUID bv = UUID.fromString("E199AD21-BA8A-4C53-8D13-6182D5C69D3A");
|
|
|
|
public static final AttributeModifier bw = (new AttributeModifier(EntityCreature.bv, "Fleeing speed bonus", 2.0D, 2)).a(false);
|
2016-12-28 06:19:58 +01:00
|
|
|
+ public BlockPosition movingTarget = null; public BlockPosition getMovingTarget() { return movingTarget; } // Paper
|
|
|
|
private BlockPosition a;
|
|
|
|
private float b;
|
2017-05-14 20:05:01 +02:00
|
|
|
private final float c;
|
2016-12-28 06:19:58 +01:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
2018-01-18 07:00:51 +01:00
|
|
|
index f76be4da0..3cd37f28d 100644
|
2016-12-28 06:19:58 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
|
|
|
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
|
|
|
|
public float aQ;
|
|
|
|
public float aR;
|
|
|
|
public EntityHuman killer;
|
|
|
|
- protected int lastDamageByPlayerTime;
|
|
|
|
+ public int lastDamageByPlayerTime; // Paper - public
|
|
|
|
protected boolean aU;
|
|
|
|
protected int ticksFarFromPlayer;
|
|
|
|
protected float aW;
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityLlama.java b/src/main/java/net/minecraft/server/EntityLlama.java
|
2018-01-18 07:00:51 +01:00
|
|
|
index dbda68dd0..af49b7273 100644
|
2016-12-28 06:19:58 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityLlama.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityLlama.java
|
|
|
|
@@ -0,0 +0,0 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
|
2017-05-14 20:05:01 +02:00
|
|
|
return this.bM != null;
|
2016-12-28 06:19:58 +01:00
|
|
|
}
|
|
|
|
|
2017-06-08 16:16:51 +02:00
|
|
|
+ public boolean inCaravan() { return this.dW(); } // Paper - OBFHELPER
|
|
|
|
public boolean dW() {
|
2017-05-14 20:05:01 +02:00
|
|
|
return this.bL != null;
|
2016-12-28 06:19:58 +01:00
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoal.java b/src/main/java/net/minecraft/server/PathfinderGoal.java
|
2018-01-18 07:00:51 +01:00
|
|
|
index 83d9c43f3..1cb6652c2 100644
|
2016-12-28 06:19:58 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoal.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoal.java
|
|
|
|
@@ -0,0 +0,0 @@ public abstract class PathfinderGoal {
|
|
|
|
|
|
|
|
public void c() {}
|
|
|
|
|
|
|
|
- public void d() {}
|
|
|
|
+ public void d() {
|
|
|
|
+ onTaskReset(); // Paper
|
|
|
|
+ }
|
|
|
|
+ public void onTaskReset() {} // Paper
|
|
|
|
|
|
|
|
public void e() {}
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java b/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java
|
2018-01-18 07:00:51 +01:00
|
|
|
index e5b5e9887..e3781f3a8 100644
|
2016-12-28 06:19:58 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java
|
|
|
|
@@ -0,0 +0,0 @@ package net.minecraft.server;
|
|
|
|
|
|
|
|
public abstract class PathfinderGoalGotoTarget extends PathfinderGoal {
|
|
|
|
|
|
|
|
- private final EntityCreature c;
|
|
|
|
+ private final EntityCreature c; public EntityCreature getEntity() { return c; } // Paper - OBFHELPER
|
|
|
|
private final double d;
|
|
|
|
protected int a;
|
|
|
|
private int e;
|
|
|
|
private int f;
|
|
|
|
- protected BlockPosition b;
|
|
|
|
+ protected BlockPosition b; public BlockPosition getTarget() { return b; } public void setTarget(BlockPosition pos) { this.b = pos; getEntity().movingTarget = pos != BlockPosition.ZERO ? pos : null; } // Paper - OBFHELPER
|
|
|
|
+
|
|
|
|
+ // Paper start
|
|
|
|
+ @Override
|
|
|
|
+ public void onTaskReset() {
|
|
|
|
+ super.onTaskReset();
|
|
|
|
+ setTarget(BlockPosition.ZERO);
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+
|
|
|
|
private boolean g;
|
|
|
|
private final int h;
|
|
|
|
|
|
|
|
@@ -0,0 +0,0 @@ public abstract class PathfinderGoalGotoTarget extends PathfinderGoal {
|
|
|
|
BlockPosition blockposition1 = blockposition.a(l, j - 1, i1);
|
|
|
|
|
|
|
|
if (this.c.f(blockposition1) && this.a(this.c.world, blockposition1)) {
|
|
|
|
- this.b = blockposition1;
|
|
|
|
+ setTarget(blockposition1); // Paper
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
2018-01-18 07:00:51 +01:00
|
|
|
index 47865c027..b08564618 100644
|
2016-12-28 06:19:58 +01:00
|
|
|
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
|
|
|
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
|
|
|
@@ -0,0 +0,0 @@ import net.minecraft.server.EntityFireball;
|
|
|
|
import net.minecraft.server.EntityFireworks;
|
|
|
|
import net.minecraft.server.EntityHuman;
|
|
|
|
import net.minecraft.server.EntityLiving;
|
|
|
|
+import net.minecraft.server.EntityLlama;
|
|
|
|
import net.minecraft.server.EntityMonster;
|
|
|
|
import net.minecraft.server.EntityProjectile;
|
|
|
|
import net.minecraft.server.EntitySheep;
|
|
|
|
@@ -0,0 +0,0 @@ public class ActivationRange
|
|
|
|
if ( entity instanceof EntityLiving )
|
|
|
|
{
|
|
|
|
EntityLiving living = (EntityLiving) entity;
|
|
|
|
- if ( /*TODO: Missed mapping? living.attackTicks > 0 || */ living.hurtTicks > 0 || living.effects.size() > 0 )
|
|
|
|
+ if ( living.lastDamageByPlayerTime > 0 || living.hurtTicks > 0 || living.effects.size() > 0 ) // Paper
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
- if ( entity instanceof EntityCreature && ( (EntityCreature) entity ).getGoalTarget() != null )
|
|
|
|
+ if ( entity instanceof EntityCreature )
|
2017-06-08 16:16:51 +02:00
|
|
|
{
|
|
|
|
- return true;
|
2016-12-28 06:19:58 +01:00
|
|
|
+ // Paper start
|
|
|
|
+ EntityCreature creature = (EntityCreature) entity;
|
|
|
|
+ if (creature.getGoalTarget() != null || creature.getMovingTarget() != null) {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
2017-06-08 16:16:51 +02:00
|
|
|
}
|
|
|
|
if ( entity instanceof EntityVillager && ( (EntityVillager) entity ).isInLove() )
|
2016-12-28 06:19:58 +01:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
+ // Paper start
|
|
|
|
+ if ( entity instanceof EntityLlama && ( (EntityLlama ) entity ).inCaravan() )
|
2017-06-08 16:16:51 +02:00
|
|
|
+ {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
2016-12-28 06:19:58 +01:00
|
|
|
+ // Paper end
|
|
|
|
if ( entity instanceof EntityAnimal )
|
|
|
|
{
|
|
|
|
EntityAnimal animal = (EntityAnimal) entity;
|
|
|
|
--
|