Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix MC-117087, prevent calling Class.getSimpleName on TEs unnecessari…
…ly (#3873)
- Loading branch information
Showing
2 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
patches/minecraft/net/minecraft/profiler/Profiler.java.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- ../src-base/minecraft/net/minecraft/profiler/Profiler.java | ||
+++ ../src-work/minecraft/net/minecraft/profiler/Profiler.java | ||
@@ -170,4 +170,15 @@ | ||
return (this.field_76331_c.hashCode() & 11184810) + 4473924; | ||
} | ||
} | ||
+ | ||
+ /** | ||
+ * Forge: Fix for MC-117087, World.updateEntities is wasting time calling Class.getSimpleName() when the profiler is not active | ||
+ */ | ||
+ public void startSection(Class<?> profiledClass) | ||
+ { | ||
+ if (this.field_76327_a) | ||
+ { | ||
+ func_76320_a(profiledClass.getSimpleName()); | ||
+ } | ||
+ } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters