mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-29 22:13:42 +01:00
Properly check for running tasks in EAR
This commit is contained in:
parent
7329e19ce5
commit
60d4c80854
@ -1,4 +1,4 @@
|
|||||||
From d9e0d50063023dded73063f94de934d80adee185 Mon Sep 17 00:00:00 2001
|
From c6b2ab2e34eb91baeed7701d11692f5eb887b00c Mon Sep 17 00:00:00 2001
|
||||||
From: Aikar <aikar@aikar.co>
|
From: Aikar <aikar@aikar.co>
|
||||||
Date: Fri, 13 May 2016 01:38:06 -0400
|
Date: Fri, 13 May 2016 01:38:06 -0400
|
||||||
Subject: [PATCH] Activation Range Improvements
|
Subject: [PATCH] Activation Range Improvements
|
||||||
@ -10,7 +10,7 @@ Fixes and adds new Immunities to improve gameplay behavior
|
|||||||
Adds water Mobs to activation range config and nerfs fish
|
Adds water Mobs to activation range config and nerfs fish
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||||
index bbfbe4b1e..c1ffd6dc1 100644
|
index bbfbe4b1e9..c1ffd6dc1c 100644
|
||||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||||
@@ -554,6 +554,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
@@ -554,6 +554,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||||
@ -22,7 +22,7 @@ index bbfbe4b1e..c1ffd6dc1 100644
|
|||||||
if (vec3d.equals(Vec3D.a)) {
|
if (vec3d.equals(Vec3D.a)) {
|
||||||
return;
|
return;
|
||||||
diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java
|
diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java
|
||||||
index b40c8d2f8..4eda13075 100644
|
index b40c8d2f83..4eda130750 100644
|
||||||
--- a/src/main/java/net/minecraft/server/EntityCreature.java
|
--- a/src/main/java/net/minecraft/server/EntityCreature.java
|
||||||
+++ b/src/main/java/net/minecraft/server/EntityCreature.java
|
+++ b/src/main/java/net/minecraft/server/EntityCreature.java
|
||||||
@@ -7,6 +7,7 @@ import org.bukkit.event.entity.EntityUnleashEvent;
|
@@ -7,6 +7,7 @@ import org.bukkit.event.entity.EntityUnleashEvent;
|
||||||
@ -34,7 +34,7 @@ index b40c8d2f8..4eda13075 100644
|
|||||||
protected EntityCreature(EntityTypes<? extends EntityCreature> entitytypes, World world) {
|
protected EntityCreature(EntityTypes<? extends EntityCreature> entitytypes, World world) {
|
||||||
super(entitytypes, world);
|
super(entitytypes, world);
|
||||||
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
|
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||||
index 5fb3c948d..e0355d3a3 100644
|
index 5fb3c948d9..e0355d3a30 100644
|
||||||
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||||
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||||
@@ -112,6 +112,17 @@ public abstract class EntityInsentient extends EntityLiving {
|
@@ -112,6 +112,17 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||||
@ -56,7 +56,7 @@ index 5fb3c948d..e0355d3a3 100644
|
|||||||
if (this.isPassenger() && this.getVehicle() instanceof EntityInsentient) {
|
if (this.isPassenger() && this.getVehicle() instanceof EntityInsentient) {
|
||||||
EntityInsentient entityinsentient = (EntityInsentient) this.getVehicle();
|
EntityInsentient entityinsentient = (EntityInsentient) this.getVehicle();
|
||||||
diff --git a/src/main/java/net/minecraft/server/EntityLlama.java b/src/main/java/net/minecraft/server/EntityLlama.java
|
diff --git a/src/main/java/net/minecraft/server/EntityLlama.java b/src/main/java/net/minecraft/server/EntityLlama.java
|
||||||
index 6d4d41c88..193dbfc5f 100644
|
index 6d4d41c88c..193dbfc5f6 100644
|
||||||
--- a/src/main/java/net/minecraft/server/EntityLlama.java
|
--- a/src/main/java/net/minecraft/server/EntityLlama.java
|
||||||
+++ b/src/main/java/net/minecraft/server/EntityLlama.java
|
+++ b/src/main/java/net/minecraft/server/EntityLlama.java
|
||||||
@@ -382,6 +382,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
|
@@ -382,6 +382,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
|
||||||
@ -68,7 +68,7 @@ index 6d4d41c88..193dbfc5f 100644
|
|||||||
return this.bJ != null;
|
return this.bJ != null;
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/PathfinderGoal.java b/src/main/java/net/minecraft/server/PathfinderGoal.java
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoal.java b/src/main/java/net/minecraft/server/PathfinderGoal.java
|
||||||
index f22f12eeb..bdb90a346 100644
|
index f22f12eeb0..bdb90a3466 100644
|
||||||
--- a/src/main/java/net/minecraft/server/PathfinderGoal.java
|
--- a/src/main/java/net/minecraft/server/PathfinderGoal.java
|
||||||
+++ b/src/main/java/net/minecraft/server/PathfinderGoal.java
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoal.java
|
||||||
@@ -20,7 +20,10 @@ public abstract class PathfinderGoal {
|
@@ -20,7 +20,10 @@ public abstract class PathfinderGoal {
|
||||||
@ -84,7 +84,7 @@ index f22f12eeb..bdb90a346 100644
|
|||||||
public void e() {}
|
public void e() {}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java b/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java b/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java
|
||||||
index 41fb166ce..e93129f0b 100644
|
index 41fb166ce0..e93129f0b2 100644
|
||||||
--- a/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java
|
||||||
+++ b/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java
|
||||||
@@ -4,12 +4,12 @@ import java.util.EnumSet;
|
@@ -4,12 +4,12 @@ import java.util.EnumSet;
|
||||||
@ -125,7 +125,7 @@ index 41fb166ce..e93129f0b 100644
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java
|
||||||
index 44bb18c59..f8944f860 100644
|
index 44bb18c594..935136771e 100644
|
||||||
--- a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java
|
||||||
+++ b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java
|
||||||
@@ -24,10 +24,11 @@ public class PathfinderGoalSelector {
|
@@ -24,10 +24,11 @@ public class PathfinderGoalSelector {
|
||||||
@ -133,7 +133,7 @@ index 44bb18c59..f8944f860 100644
|
|||||||
};
|
};
|
||||||
private final Map<PathfinderGoal.Type, PathfinderGoalWrapped> c = new EnumMap(PathfinderGoal.Type.class);
|
private final Map<PathfinderGoal.Type, PathfinderGoalWrapped> c = new EnumMap(PathfinderGoal.Type.class);
|
||||||
- private final Set<PathfinderGoalWrapped> d = Sets.newLinkedHashSet();
|
- private final Set<PathfinderGoalWrapped> d = Sets.newLinkedHashSet();
|
||||||
+ private final Set<PathfinderGoalWrapped> d = Sets.newLinkedHashSet();private Set<PathfinderGoalWrapped> getExecutingTasks() { return d; }// Paper - OBFHELPER
|
+ private final Set<PathfinderGoalWrapped> d = Sets.newLinkedHashSet();private Set<PathfinderGoalWrapped> getTasks() { return d; }// Paper - OBFHELPER
|
||||||
private final GameProfilerFiller e;
|
private final GameProfilerFiller e;
|
||||||
private final EnumSet<PathfinderGoal.Type> f = EnumSet.noneOf(PathfinderGoal.Type.class);
|
private final EnumSet<PathfinderGoal.Type> f = EnumSet.noneOf(PathfinderGoal.Type.class);
|
||||||
- private int g = 3;
|
- private int g = 3;
|
||||||
@ -142,7 +142,7 @@ index 44bb18c59..f8944f860 100644
|
|||||||
|
|
||||||
public PathfinderGoalSelector(GameProfilerFiller gameprofilerfiller) {
|
public PathfinderGoalSelector(GameProfilerFiller gameprofilerfiller) {
|
||||||
this.e = gameprofilerfiller;
|
this.e = gameprofilerfiller;
|
||||||
@@ -37,6 +38,20 @@ public class PathfinderGoalSelector {
|
@@ -37,6 +38,25 @@ public class PathfinderGoalSelector {
|
||||||
this.d.add(new PathfinderGoalWrapped(i, pathfindergoal));
|
this.d.add(new PathfinderGoalWrapped(i, pathfindergoal));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,15 +156,32 @@ index 44bb18c59..f8944f860 100644
|
|||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ public boolean hasTasks() {
|
+ public boolean hasTasks() {
|
||||||
+ return !getExecutingTasks().isEmpty();
|
+ for (PathfinderGoalWrapped task : getTasks()) {
|
||||||
|
+ if (task.isRunning()) {
|
||||||
|
+ return true;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ return false;
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
+
|
+
|
||||||
public void a(PathfinderGoal pathfindergoal) {
|
public void a(PathfinderGoal pathfindergoal) {
|
||||||
this.d.stream().filter((pathfindergoalwrapped) -> {
|
this.d.stream().filter((pathfindergoalwrapped) -> {
|
||||||
return pathfindergoalwrapped.j() == pathfindergoal;
|
return pathfindergoalwrapped.j() == pathfindergoal;
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalWrapped.java b/src/main/java/net/minecraft/server/PathfinderGoalWrapped.java
|
||||||
|
index 5a8c60ad90..29657fed75 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalWrapped.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalWrapped.java
|
||||||
|
@@ -64,6 +64,7 @@ public class PathfinderGoalWrapped extends PathfinderGoal {
|
||||||
|
return this.a.i();
|
||||||
|
}
|
||||||
|
|
||||||
|
+ public boolean isRunning() { return this.g(); } // Paper - OBFHELPER
|
||||||
|
public boolean g() {
|
||||||
|
return this.c;
|
||||||
|
}
|
||||||
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
||||||
index 92601c581..6e165a164 100644
|
index 92601c581c..6e165a1649 100644
|
||||||
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
||||||
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
||||||
@@ -33,12 +33,18 @@ import net.minecraft.server.MathHelper;
|
@@ -33,12 +33,18 @@ import net.minecraft.server.MathHelper;
|
||||||
@ -257,7 +274,7 @@ index 92601c581..6e165a164 100644
|
|||||||
isActive = false;
|
isActive = false;
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
||||||
index c2906f20a..885512396 100644
|
index c2906f20a5..885512396f 100644
|
||||||
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
||||||
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
||||||
@@ -180,6 +180,7 @@ public class SpigotWorldConfig
|
@@ -180,6 +180,7 @@ public class SpigotWorldConfig
|
||||||
@ -277,5 +294,5 @@ index c2906f20a..885512396 100644
|
|||||||
log( "Entity Activation Range: An " + animalActivationRange + " / Mo " + monsterActivationRange + " / Ra " + raiderActivationRange + " / Mi " + miscActivationRange + " / Tiv " + tickInactiveVillagers );
|
log( "Entity Activation Range: An " + animalActivationRange + " / Mo " + monsterActivationRange + " / Ra " + raiderActivationRange + " / Mi " + miscActivationRange + " / Tiv " + tickInactiveVillagers );
|
||||||
}
|
}
|
||||||
--
|
--
|
||||||
2.25.0.windows.1
|
2.25.0
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user