mirror of
https://github.com/YatopiaMC/Yatopia.git
synced 2024-11-05 10:23:15 +01:00
f541b93c6a
Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Tuinity Changes: 76777f0 Updated Upstream (Paper) 6465aba Merge branch 'master' of https://github.com/Spottedleaf/Tuinity into ver/1.16.3 ba4dbb6 Do not allow ticket level changes while unloading playerchunks e0e7144 Aggressive state checking in region manager Purpur Changes: 0743d38 PaperPR - Add hex color code support for console logging 081f5a7 Oopsie, lets fix these snowballs :3 4895a88 Improve output of plugins command 3424c40 Minor changes to projectile despawn rate patch 9d49a31 Updated Upstream (Paper) 09e0103 add snowball to despawn rate config Rainforest Changes: 5a187d6 Update to 1.16.3.
63 lines
2.5 KiB
Diff
63 lines
2.5 KiB
Diff
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
|
|
index 68ab5ccb2fcfe1de0503c9336572f28e11832b2d..4d4c25cb328b0ca2e16d3c823214aca5854e4deb 100644
|
|
--- 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
|
|
index 0fd68e787a0d7dd558c8de62239b0b5e3960756b..9a5a6a2276bb08a9b7bb88f498a0d0fe031f5265 100644
|
|
--- a/src/main/java/net/minecraft/server/NavigationAbstract.java
|
|
+++ b/src/main/java/net/minecraft/server/NavigationAbstract.java
|
|
@@ -29,6 +29,7 @@ public abstract class NavigationAbstract {
|
|
private float r;
|
|
private final Pathfinder s; public Pathfinder getPathfinder() { return this.s; } // Paper - OBFHELPER
|
|
private boolean t;
|
|
+ private co.aikar.timings.Timing timing; // Yatopia
|
|
|
|
// Tuinity start
|
|
public boolean isViableForPathRecalculationChecking() {
|
|
@@ -47,6 +48,7 @@ public abstract class NavigationAbstract {
|
|
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() {
|
|
@@ -230,6 +232,10 @@ public abstract class NavigationAbstract {
|
|
}
|
|
|
|
public void c() {
|
|
+ // Yatopia start
|
|
+ timing.startTiming();
|
|
+ try {
|
|
+ // Yatopia end
|
|
++this.e;
|
|
if (this.m) {
|
|
this.j();
|
|
@@ -257,6 +263,11 @@ public abstract class NavigationAbstract {
|
|
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() {
|