2020-08-16 13:01:55 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: MrIvanPlays <ivan@mrivanplays.com>
|
|
|
|
Date: Sun, 16 Aug 2020 13:45:32 +0300
|
|
|
|
Subject: [PATCH] Add timings for Pathfinder
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/co/aikar/timings/MinecraftTimings.java b/src/main/java/co/aikar/timings/MinecraftTimings.java
|
2020-10-02 16:54:16 +02:00
|
|
|
index d8c1a8dd867437443494ac169569139e25c9a635..0efdddc12247ed4aa6acce118c707090270bee39 100644
|
2020-08-16 13:01:55 +02:00
|
|
|
--- a/src/main/java/co/aikar/timings/MinecraftTimings.java
|
|
|
|
+++ b/src/main/java/co/aikar/timings/MinecraftTimings.java
|
|
|
|
@@ -54,6 +54,8 @@ public final class MinecraftTimings {
|
|
|
|
return Timings.ofSafe(taskName);
|
|
|
|
}
|
|
|
|
|
|
|
|
+ public static Timing getPathfinderTiming(String mobName) { return Timings.ofSafe("Pathfinder - " + mobName); } // Yatopia
|
|
|
|
+
|
|
|
|
/**
|
|
|
|
* Gets a timer associated with a plugins tasks.
|
|
|
|
* @param bukkitTask
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java
|
2020-09-30 15:32:49 +02:00
|
|
|
index 99060787e47314a6b609aee701d8055352d348cb..e106a418eaed83ae25ba1efb54e54d28cf8798d3 100644
|
2020-08-16 13:01:55 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/NavigationAbstract.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/NavigationAbstract.java
|
2020-09-11 08:03:00 +02:00
|
|
|
@@ -29,6 +29,7 @@ public abstract class NavigationAbstract {
|
2020-08-16 13:01:55 +02:00
|
|
|
private float r;
|
|
|
|
private final Pathfinder s; public Pathfinder getPathfinder() { return this.s; } // Paper - OBFHELPER
|
2020-09-11 08:03:00 +02:00
|
|
|
private boolean t;
|
2020-08-16 13:01:55 +02:00
|
|
|
+ private co.aikar.timings.Timing timing; // Yatopia
|
|
|
|
|
2020-09-30 15:32:49 +02:00
|
|
|
public NavigationAbstract(EntityInsentient entityinsentient, World world) {
|
|
|
|
this.g = Vec3D.ORIGIN;
|
|
|
|
@@ -40,6 +41,7 @@ public abstract class NavigationAbstract {
|
2020-08-16 13:01:55 +02:00
|
|
|
int i = MathHelper.floor(entityinsentient.b(GenericAttributes.FOLLOW_RANGE) * 16.0D);
|
|
|
|
|
|
|
|
this.s = this.a(i);
|
|
|
|
+ timing = co.aikar.timings.MinecraftTimings.getPathfinderTiming(entityinsentient.getClass().getSimpleName()); // Yatopia
|
|
|
|
}
|
|
|
|
|
|
|
|
public void g() {
|
2020-09-30 15:32:49 +02:00
|
|
|
@@ -223,6 +225,10 @@ public abstract class NavigationAbstract {
|
2020-08-16 13:01:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public void c() {
|
|
|
|
+ // Yatopia start
|
|
|
|
+ timing.startTiming();
|
|
|
|
+ try {
|
|
|
|
+ // Yatopia end
|
|
|
|
++this.e;
|
|
|
|
if (this.m) {
|
|
|
|
this.j();
|
2020-09-30 15:32:49 +02:00
|
|
|
@@ -250,6 +256,11 @@ public abstract class NavigationAbstract {
|
2020-08-16 13:01:55 +02:00
|
|
|
this.a.getControllerMove().a(vec3d.x, this.b.getType(blockposition.down()).isAir() ? vec3d.y : PathfinderNormal.a((IBlockAccess) this.b, blockposition), vec3d.z, this.d);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+ // Yatopia start
|
|
|
|
+ } finally {
|
|
|
|
+ timing.stopTiming();
|
|
|
|
+ }
|
|
|
|
+ // Yatopia end
|
|
|
|
}
|
|
|
|
|
|
|
|
protected void l() {
|