diff --git a/patches/minecraft/net/minecraft/profiler/Profiler.java.patch b/patches/minecraft/net/minecraft/profiler/Profiler.java.patch new file mode 100644 index 00000000000..4023fecc55a --- /dev/null +++ b/patches/minecraft/net/minecraft/profiler/Profiler.java.patch @@ -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()); ++ } ++ } + } diff --git a/patches/minecraft/net/minecraft/world/World.java.patch b/patches/minecraft/net/minecraft/world/World.java.patch index 7e17a9aba9e..4b773568e55 100644 --- a/patches/minecraft/net/minecraft/world/World.java.patch +++ b/patches/minecraft/net/minecraft/world/World.java.patch @@ -405,7 +405,7 @@ throw new ReportedException(crashreport1); } } -@@ -1678,7 +1794,7 @@ +@@ -1678,11 +1794,11 @@ { BlockPos blockpos = tileentity.func_174877_v(); @@ -414,6 +414,11 @@ { try { +- this.field_72984_F.func_76320_a(tileentity.getClass().getSimpleName()); ++ this.field_72984_F.startSection(tileentity.getClass()); // Fix for MC-117087 + ((ITickable)tileentity).func_73660_a(); + this.field_72984_F.func_76319_b(); + } @@ -1691,6 +1807,13 @@ CrashReport crashreport2 = CrashReport.func_85055_a(throwable, "Ticking block entity"); CrashReportCategory crashreportcategory2 = crashreport2.func_85058_a("Block entity being ticked");