diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5dc89b9b5..9768c88f8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,7 +52,7 @@ jobs: path: jdmain - name: Validate Gradle Wrapper - uses: gradle/wrapper-validation-action@v1 + uses: gradle/wrapper-validation-action@v3 - name: Set up GraalVM ${{ matrix.base_jdk }} uses: graalvm/setup-graalvm@v1 @@ -72,9 +72,8 @@ jobs: - name: Apply Patches run: ./gradlew applyPatches --stacktrace - # TODO: fix tests - # - name: Build - # run: ./gradlew build --stacktrace + - name: Build + run: ./gradlew build --stacktrace - name: Create Reobf Jar run: ./gradlew createReobfPaperclipJar --stacktrace @@ -115,7 +114,7 @@ jobs: - name: Release Artifacts if: startsWith(github.ref_name, 'ver/') - uses: softprops/action-gh-release@v0.1.15 + uses: softprops/action-gh-release@v2 with: name: "Build #${{ env.BUILD_NUMBER }} for ${{ env.VERSION }}" tag_name: "build/${{ env.VERSION }}/${{ env.BUILD_NUMBER }}" @@ -126,7 +125,7 @@ jobs: - name: Release Artifacts (Latest/Stable) if: startsWith(github.ref_name, 'ver/') - uses: softprops/action-gh-release@v0.1.15 + uses: softprops/action-gh-release@v2 with: name: "Build #${{ env.BUILD_NUMBER }} for ${{ env.VERSION }}" tag_name: "build/${{ github.ref_name }}/latest" @@ -137,7 +136,7 @@ jobs: - name: Release Artifacts (Latest/Development) if: startsWith(github.ref_name, 'dev/') - uses: softprops/action-gh-release@v0.1.15 + uses: softprops/action-gh-release@v2 with: name: "Development Build for ${{ env.VERSION }}" tag_name: build/${{ env.VERSION }}/latest diff --git a/.gitignore b/.gitignore index e27ab2fe9..4ffa84416 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,9 @@ out/ nbproject/ nbactions.xml +# vscode +.vscode/ + # Gradle !gradle-wrapper.jar .gradle/ diff --git a/initDev b/initDev index 08ae1cbae..3d76d4aac 100755 --- a/initDev +++ b/initDev @@ -8,7 +8,9 @@ export PROJECT_DIR=$(pwd) alias api="cd $PROJECT_DIR/*-API" alias srv="cd $PROJECT_DIR/*-Server" +alias g="./gradlew" alias c="clear;" + alias ap="./gradlew --no-rebuild applyPatches" alias aap="./gradlew --no-rebuild applyAPIPatches" alias agp="./gradlew --no-rebuild applyGeneratedAPIPatches" @@ -19,6 +21,11 @@ alias rap="./gradlew --no-rebuild rebuildAPIPatches" alias rgp="./gradlew --no-rebuild rebuildGeneratedAPIPatches" alias rsp="./gradlew --no-rebuild rebuildServerPatches" +alias run="./gradlew runDevServer" +alias build="./gradlew build" +alias reobf="./gradlew createReobfPaperclipJar" +alias mojmap="./gradlew createMojmapPaperclipJar" + alias lg="git log --oneline base..HEAD" alias rc="git rebase --autosquash -i base" alias rcc="git rebase --continue" diff --git a/patches/unapplied/api/0001-Remove-remaining-timings-implementations.patch b/patches/api/0006-Completely-remove-timings-implementations.patch similarity index 70% rename from patches/unapplied/api/0001-Remove-remaining-timings-implementations.patch rename to patches/api/0006-Completely-remove-timings-implementations.patch index cd008ded9..b596074c7 100644 --- a/patches/unapplied/api/0001-Remove-remaining-timings-implementations.patch +++ b/patches/api/0006-Completely-remove-timings-implementations.patch @@ -1,22 +1,26 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: AlphaKR93 Date: Wed, 15 May 2024 12:43:03 +0900 -Subject: [PATCH] Remove remaining timings implementations +Subject: [PATCH] Completely remove timings implementations diff --git a/src/main/java/co/aikar/timings/FullServerTickHandler.java b/src/main/java/co/aikar/timings/FullServerTickHandler.java -index 36b8fe86335df851f9c85d6bb2a91368b4d945d1..0f27c3959806aa7a7e8968fdb3659df54bec92aa 100644 +deleted file mode 100644 +index 73b125979e2f2dfd13cbf689a90b29cc68a36e09..0000000000000000000000000000000000000000 --- a/src/main/java/co/aikar/timings/FullServerTickHandler.java -+++ b/src/main/java/co/aikar/timings/FullServerTickHandler.java -@@ -1,86 +1,4 @@ - package co.aikar.timings; - ++++ /dev/null +@@ -1,89 +0,0 @@ +-package co.aikar.timings; +- -import static co.aikar.timings.TimingsManager.*; - -import org.bukkit.Bukkit; -import org.jetbrains.annotations.NotNull; - - @Deprecated(forRemoval = true) +-/** +- * @deprecated Timings will be removed in the future +- */ +-@Deprecated(forRemoval = true) -public class FullServerTickHandler extends TimingHandler { - private static final TimingIdentifier IDENTITY = new TimingIdentifier("Minecraft", "Full Server Tick", null); - final TimingData minuteData; @@ -88,19 +92,19 @@ index 36b8fe86335df851f9c85d6bb2a91368b4d945d1..0f27c3959806aa7a7e8968fdb3659df5 - TimingsManager.HISTORY.add(new TimingHistory()); - TimingsManager.resetTimings(); - } -- Bukkit.getUnsafe().reportTimings(); +- //Bukkit.getUnsafe().reportTimings(); - } - - boolean isViolated() { - return record.getCurTickTotal() > 50000000; - } -} -+interface FullServerTickHandler {} // Thunderbolt - Remove remaining timings implementations diff --git a/src/main/java/co/aikar/timings/NullTimingHandler.java b/src/main/java/co/aikar/timings/NullTimingHandler.java -index 81671cf40feeed2844ee8d92348d48062aaf2c46..086213790ee15fe22a7d19452cdb498c49a95c4d 100644 +deleted file mode 100644 +index 42e7e712403676171d34d5f2be27e48e7a071ebd..0000000000000000000000000000000000000000 --- a/src/main/java/co/aikar/timings/NullTimingHandler.java -+++ b/src/main/java/co/aikar/timings/NullTimingHandler.java -@@ -1,69 +1,4 @@ ++++ /dev/null +@@ -1,72 +0,0 @@ -/* - * This file is licensed under the MIT License (MIT). - * @@ -124,12 +128,15 @@ index 81671cf40feeed2844ee8d92348d48062aaf2c46..086213790ee15fe22a7d19452cdb498c - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - package co.aikar.timings; - +-package co.aikar.timings; +- -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - - @Deprecated(forRemoval = true) +-/** +- * @deprecated Timings will be removed in the future +- */ +-@Deprecated(forRemoval = true) -public final class NullTimingHandler implements Timing { - public static final Timing NULL = new NullTimingHandler(); - @NotNull @@ -170,12 +177,12 @@ index 81671cf40feeed2844ee8d92348d48062aaf2c46..086213790ee15fe22a7d19452cdb498c - - } -} -+interface NullTimingHandler {} // Thunderbolt - Remove remaining timings implementations diff --git a/src/main/java/co/aikar/timings/TimedEventExecutor.java b/src/main/java/co/aikar/timings/TimedEventExecutor.java -index 6fbc64e0f214d0c8e5afcbe385e414a4e1fe1c72..4399d4ed4183ed9b91c2ea68fd0b07c4bf8a098f 100644 +deleted file mode 100644 +index 438a9c76381ea3f5b774e2232ff56c5dc6f82586..0000000000000000000000000000000000000000 --- a/src/main/java/co/aikar/timings/TimedEventExecutor.java -+++ b/src/main/java/co/aikar/timings/TimedEventExecutor.java -@@ -1,90 +1,4 @@ ++++ /dev/null +@@ -1,93 +0,0 @@ -/* - * This file is licensed under the MIT License (MIT). - * @@ -199,8 +206,8 @@ index 6fbc64e0f214d0c8e5afcbe385e414a4e1fe1c72..4399d4ed4183ed9b91c2ea68fd0b07c4 - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - package co.aikar.timings; - +-package co.aikar.timings; +- -import org.bukkit.Bukkit; -import org.bukkit.event.Event; -import org.bukkit.event.EventException; @@ -212,7 +219,10 @@ index 6fbc64e0f214d0c8e5afcbe385e414a4e1fe1c72..4399d4ed4183ed9b91c2ea68fd0b07c4 -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - - @Deprecated(forRemoval = true) +-/** +- * @deprecated Timings will be removed in the future +- */ +-@Deprecated(forRemoval = true) -public class TimedEventExecutor implements EventExecutor { - - private final EventExecutor executor; @@ -266,69 +276,110 @@ index 6fbc64e0f214d0c8e5afcbe385e414a4e1fe1c72..4399d4ed4183ed9b91c2ea68fd0b07c4 - return "TimedEventExecutor['" + this.executor.toString() + "']"; - } -} -+interface TimedEventExecutor {} // Thunderbolt - Remove remaining timings implementations diff --git a/src/main/java/co/aikar/timings/Timing.java b/src/main/java/co/aikar/timings/Timing.java -index 1d866e980abc542bdfee1ce082cd9cdd7761e9f7..e6b4d724f2a4540fbd59c36a5fe9526ab214df68 100644 +index 8709c955bac34bc546a8e022cfac808bc61ee793..228a9fa4ad569d69166ea990b5cc7e07b15e567a 100644 --- a/src/main/java/co/aikar/timings/Timing.java +++ b/src/main/java/co/aikar/timings/Timing.java -@@ -39,6 +39,7 @@ public interface Timing extends AutoCloseable { - * @return Timing +@@ -40,7 +40,12 @@ public interface Timing extends AutoCloseable { */ @NotNull -+ @Deprecated(forRemoval = true) // Thunderbolt - Remove remaining timings implementations @io.papermc.paper.annotation.DoNotUse // Purpur - Timing startTiming(); +- Timing startTiming(); ++ // Plazma start - Completely remove timings implementation ++ @Deprecated(forRemoval = true) ++ default Timing startTiming() { ++ throw new org.plazmamc.plazma.DeprecationException("Timings are deprecated and removed. Use spark instead."); ++ } ++ // Plazma end - Completely remove timings implementation -@@ -47,6 +48,7 @@ public interface Timing extends AutoCloseable { - * + /** + *

Stops timing and records the data. Propagates the data up to group handlers.

+@@ -48,7 +53,12 @@ public interface Timing extends AutoCloseable { * Will automatically be called when this Timing is used with try-with-resources */ -+ @Deprecated(forRemoval = true) // Thunderbolt - Remove remaining timings implementations @io.papermc.paper.annotation.DoNotUse // Purpur - void stopTiming(); +- void stopTiming(); ++ // Plazma start - Completely remove timings implementation ++ @Deprecated(forRemoval = true) ++ default void stopTiming() { ++ throw new org.plazmamc.plazma.DeprecationException("Timings are deprecated and removed. Use spark instead."); ++ } ++ // Plazma end - Completely remove timings implementation -@@ -58,6 +60,7 @@ public interface Timing extends AutoCloseable { - * @return Timing + /** + * Starts timing the execution until {@link #stopTiming()} is called. +@@ -59,7 +69,12 @@ public interface Timing extends AutoCloseable { */ @NotNull -+ @Deprecated(forRemoval = true) // Thunderbolt - Remove remaining timings implementations @io.papermc.paper.annotation.DoNotUse // Purpur - Timing startTimingIfSync(); +- Timing startTimingIfSync(); ++ // Plazma start - Completely remove timings implementation ++ @Deprecated(forRemoval = true) ++ default Timing startTimingIfSync() { ++ throw new org.plazmamc.plazma.DeprecationException("Timings are deprecated and removed. Use spark instead."); ++ } ++ // Plazma end - Completely remove timings implementation -@@ -68,13 +71,14 @@ public interface Timing extends AutoCloseable { - * + /** + *

Stops timing and records the data. Propagates the data up to group handlers.

+@@ -69,14 +84,23 @@ public interface Timing extends AutoCloseable { * But only if we are on the primary thread. */ -+ @Deprecated(forRemoval = true) // Thunderbolt - Remove remaining timings implementations @io.papermc.paper.annotation.DoNotUse // Purpur - void stopTimingIfSync(); +- void stopTimingIfSync(); ++ // Plazma start - Completely remove timings implementation ++ @Deprecated(forRemoval = true) ++ default void stopTimingIfSync() { ++ throw new org.plazmamc.plazma.DeprecationException("Timings are deprecated and removed. Use spark instead."); ++ } ++ // Plazma end - Completely remove timings implementation /** * @deprecated Doesn't do anything - Removed */ - @Deprecated -+ @Deprecated(forRemoval = true) // Thunderbolt - Remove remaining timings implementations ++ @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Purpur - void abort(); +- void abort(); ++ // Plazma start - Completely remove timings implementation ++ default void abort() { ++ throw new org.plazmamc.plazma.DeprecationException("Timings are deprecated and removed. Use spark instead."); ++ } ++ // Plazma end - Completely remove timings implementation -@@ -84,9 +88,11 @@ public interface Timing extends AutoCloseable { + /** + * Used internally to get the actual backing Handler in the case of delegated Handlers +@@ -84,9 +108,22 @@ public interface Timing extends AutoCloseable { * @return TimingHandler */ @Nullable - TimingHandler getTimingHandler(); -+ @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Thunderbolt - Remove remaining timings implementations -+ Object getTimingHandler(); // Thunderbolt - Remove remaining timings implementations ++ // Plazma start - Completely remove timings implementation ++ @Deprecated(forRemoval = true) ++ @io.papermc.paper.annotation.DoNotUse ++ default TimingHandler getTimingHandler() { ++ throw new org.plazmamc.plazma.DeprecationException("Timings are deprecated and removed. Use spark instead."); ++ } ++ // Plazma end - Completely remove timings implementation ++ @Override -+ @Deprecated(forRemoval = true) // Thunderbolt - Remove remaining timings implementations @io.papermc.paper.annotation.DoNotUse // Purpur - void close(); +- void close(); ++ // Plazma start - Completely remove timings implementation ++ @Deprecated(forRemoval = true) ++ default void close() { ++ throw new org.plazmamc.plazma.DeprecationException("Timings are deprecated and removed. Use spark instead."); ++ } ++ // Plazma end - Completely remove timings implementation ++ } diff --git a/src/main/java/co/aikar/timings/TimingData.java b/src/main/java/co/aikar/timings/TimingData.java -index a5d13a1e44edb861f45c83a9b4309fbf799d407d..596fc185ecd2e7552b6e8b06b0814fc5bc5416ed 100644 +deleted file mode 100644 +index a5d13a1e44edb861f45c83a9b4309fbf799d407d..0000000000000000000000000000000000000000 --- a/src/main/java/co/aikar/timings/TimingData.java -+++ b/src/main/java/co/aikar/timings/TimingData.java -@@ -1,122 +1,4 @@ ++++ /dev/null +@@ -1,122 +0,0 @@ -/* - * This file is licensed under the MIT License (MIT). - * @@ -352,8 +403,8 @@ index a5d13a1e44edb861f45c83a9b4309fbf799d407d..596fc185ecd2e7552b6e8b06b0814fc5 - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - package co.aikar.timings; - +-package co.aikar.timings; +- -import java.util.List; -import org.jetbrains.annotations.NotNull; - @@ -451,13 +502,11 @@ index a5d13a1e44edb861f45c83a9b4309fbf799d407d..596fc185ecd2e7552b6e8b06b0814fc5 - this.curTickTotal = curTickTotal; - } -} -+@Deprecated(forRemoval = true) // Thunderbolt - Remove remaining timings implementations -+interface TimingData {} // Thunderbolt - Remove remaining timings implementations diff --git a/src/main/java/co/aikar/timings/TimingHandler.java b/src/main/java/co/aikar/timings/TimingHandler.java -index 3b3bcfa6fa2dbcc7fef899cc7570da097437ab3a..c8872cc0f5ffd3036ac53358e3f2c37782685a5f 100644 +index 41d10421e1e79711e2e90ff2dc225bfd9cac9284..3bd19b990078a177a4bd197f617c0f871ceb9d3a 100644 --- a/src/main/java/co/aikar/timings/TimingHandler.java +++ b/src/main/java/co/aikar/timings/TimingHandler.java -@@ -1,226 +1,4 @@ +@@ -1,226 +1,3 @@ -/* - * This file is licensed under the MIT License (MIT). - * @@ -587,7 +636,7 @@ index 3b3bcfa6fa2dbcc7fef899cc7570da097437ab3a..c8872cc0f5ffd3036ac53358e3f2c377 - while ((last = TIMING_STACK.removeLast()) != this) { - last.timingDepth = 0; - if ("Minecraft".equalsIgnoreCase(last.identifier.group)) { -- Logger.getGlobal().log(Level.SEVERE, "TIMING_STACK_CORRUPTION - Look above this for any errors and report this to " + io.papermc.paper.ServerBuildInfo.buildInfo().brandName() + " unless it has a plugin in the stack trace (" + last.identifier + " did not stopTiming)"); +- Logger.getGlobal().log(Level.SEVERE, "TIMING_STACK_CORRUPTION - Look above this for any errors and report this to " + io.papermc.paper.ServerBuildInfo.buildInfo().brandName() + " unless it has a plugin in the stack trace (" + last.identifier + " did not stopTiming)"); // Plazma - Fork-friendly Rebranding - } else { - Logger.getGlobal().log(Level.SEVERE, "TIMING_STACK_CORRUPTION - Report this to the plugin " + last.identifier.group + " (Look for errors above this in the logs) (" + last.identifier + " did not stopTiming)", new Throwable()); - } @@ -684,13 +733,13 @@ index 3b3bcfa6fa2dbcc7fef899cc7570da097437ab3a..c8872cc0f5ffd3036ac53358e3f2c377 - return clonedChildren; - } -} -+@Deprecated(forRemoval = true) // Thunderbolt - Remove remaining timings implementations -+interface TimingHandler {} // Thunderbolt - Remove remaining timings implementations ++@Deprecated(forRemoval = true) interface TimingHandler {} // Plazma - Completely remove timings implementation diff --git a/src/main/java/co/aikar/timings/TimingHistory.java b/src/main/java/co/aikar/timings/TimingHistory.java -index 02e88db63be2d5e31da6b65157ba7b971b1f10f3..7ddaad45f563796b442ac3f5a757e78d5cb4bb5b 100644 +deleted file mode 100644 +index 6f6eb1a2e6c8d49014a7ae44540ee282bae5200e..0000000000000000000000000000000000000000 --- a/src/main/java/co/aikar/timings/TimingHistory.java -+++ b/src/main/java/co/aikar/timings/TimingHistory.java -@@ -1,355 +1,4 @@ ++++ /dev/null +@@ -1,357 +0,0 @@ -/* - * This file is licensed under the MIT License (MIT). - * @@ -714,8 +763,8 @@ index 02e88db63be2d5e31da6b65157ba7b971b1f10f3..7ddaad45f563796b442ac3f5a757e78d - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - package co.aikar.timings; - +-package co.aikar.timings; +- -import co.aikar.timings.TimingHistory.RegionData.RegionId; -import com.google.common.base.Function; -import com.google.common.collect.Sets; @@ -743,7 +792,12 @@ index 02e88db63be2d5e31da6b65157ba7b971b1f10f3..7ddaad45f563796b442ac3f5a757e78d -import static co.aikar.timings.TimingsManager.MINUTE_REPORTS; -import static co.aikar.util.JSONUtil.*; - - @Deprecated(forRemoval = true) +-/** +- * Internal. +- * +- * @deprecated Timings will be removed in the future +- */ +-@Deprecated(forRemoval = true) -@SuppressWarnings({"deprecation", "SuppressionAnnotation", "Convert2Lambda", "Anonymous2MethodRef"}) -public class TimingHistory { - public static long lastMinuteTime; @@ -844,17 +898,14 @@ index 02e88db63be2d5e31da6b65157ba7b971b1f10f3..7ddaad45f563796b442ac3f5a757e78d - } - } - ), -- toObjectMapper(input.tileEntityCounts.entrySet(), -- new Function, JSONPair>() { -- @NotNull -- @Override -- public JSONPair apply(Map.Entry entry) { -- tileEntityTypeSet.add(entry.getKey()); -- return pair( -- String.valueOf(entry.getKey().ordinal()), -- entry.getValue().count() -- ); -- } +- toObjectMapper( +- input.tileEntityCounts.entrySet(), +- entry -> { +- tileEntityTypeSet.add(entry.getKey()); +- return pair( +- String.valueOf(entry.getKey().ordinal()), +- entry.getValue().count() +- ); - } - ) - ); @@ -1046,12 +1097,12 @@ index 02e88db63be2d5e31da6b65157ba7b971b1f10f3..7ddaad45f563796b442ac3f5a757e78d - } - } -} -+interface TimingHistory {} // Thunderbolt - Remove remaining timings implementations diff --git a/src/main/java/co/aikar/timings/TimingHistoryEntry.java b/src/main/java/co/aikar/timings/TimingHistoryEntry.java -index 86d5ac6bd0d7d0003688761aceb3f3343575319f..96cb33a8b1282dd04fe00b69231c78d41b52d92b 100644 +deleted file mode 100644 +index 86d5ac6bd0d7d0003688761aceb3f3343575319f..0000000000000000000000000000000000000000 --- a/src/main/java/co/aikar/timings/TimingHistoryEntry.java -+++ b/src/main/java/co/aikar/timings/TimingHistoryEntry.java -@@ -1,58 +1,4 @@ ++++ /dev/null +@@ -1,58 +0,0 @@ -/* - * This file is licensed under the MIT License (MIT). - * @@ -1075,8 +1126,8 @@ index 86d5ac6bd0d7d0003688761aceb3f3343575319f..96cb33a8b1282dd04fe00b69231c78d4 - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - package co.aikar.timings; - +-package co.aikar.timings; +- -import com.google.common.base.Function; - -import java.util.List; @@ -1110,13 +1161,12 @@ index 86d5ac6bd0d7d0003688761aceb3f3343575319f..96cb33a8b1282dd04fe00b69231c78d4 - return result; - } -} -+@Deprecated(forRemoval = true) // Thunderbolt - Remove remaining timings implementations -+interface TimingHistoryEntry {} // Thunderbolt - Remove remaining timings implementations diff --git a/src/main/java/co/aikar/timings/TimingIdentifier.java b/src/main/java/co/aikar/timings/TimingIdentifier.java -index df142a89b8c43acb81eb383eac0ef048a1f49a6e..a921bd54d2e5346081e96ecf4da1553e2b23ac9c 100644 +deleted file mode 100644 +index df142a89b8c43acb81eb383eac0ef048a1f49a6e..0000000000000000000000000000000000000000 --- a/src/main/java/co/aikar/timings/TimingIdentifier.java -+++ b/src/main/java/co/aikar/timings/TimingIdentifier.java -@@ -1,116 +1,4 @@ ++++ /dev/null +@@ -1,116 +0,0 @@ -/* - * This file is licensed under the MIT License (MIT). - * @@ -1140,8 +1190,8 @@ index df142a89b8c43acb81eb383eac0ef048a1f49a6e..a921bd54d2e5346081e96ecf4da1553e - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - package co.aikar.timings; - +-package co.aikar.timings; +- -import co.aikar.util.LoadingMap; - -import java.util.ArrayList; @@ -1233,14 +1283,12 @@ index df142a89b8c43acb81eb383eac0ef048a1f49a6e..a921bd54d2e5346081e96ecf4da1553e - } - } -} -+@Deprecated(forRemoval = true) -+interface TimingIdentifier {} // Thunderbolt - Remove remaining timings implementations diff --git a/src/main/java/co/aikar/timings/Timings.java b/src/main/java/co/aikar/timings/Timings.java -index 752d54830aa8baa1450bf72da03ae55ed30293c2..8bbd2bfb06a9ba5ad7a87f9b54e048773a79490a 100644 +index 27a02f0c3261067d8e4ee6169c62cecbbfe50d42..3d0cf82b59d0d6ebc84fc589d75b508bf6acbded 100644 --- a/src/main/java/co/aikar/timings/Timings.java +++ b/src/main/java/co/aikar/timings/Timings.java @@ -44,18 +44,8 @@ import org.jetbrains.annotations.Nullable; - * @deprecated Timings will likely be replaced with Spark in the future + * @deprecated Timings will be removed in the future */ @Deprecated(forRemoval = true) -@SuppressWarnings({"UnusedDeclaration", "WeakerAccess", "SameParameterValue"}) @@ -1258,183 +1306,180 @@ index 752d54830aa8baa1450bf72da03ae55ed30293c2..8bbd2bfb06a9ba5ad7a87f9b54e04877 private Timings() {} /** -@@ -65,13 +55,9 @@ public final class Timings { - * @param name Name of Timing +@@ -66,12 +56,10 @@ public final class Timings { * @return Handler */ -- @NotNull -+ @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Thunderbolt - Remove remaining timings implementations + @NotNull ++ @Deprecated(forRemoval = true) // Plazma - Completely remove timings implementation ++ @io.papermc.paper.annotation.DoNotUse // Plazma - Completely remove timings implementation public static Timing of(@NotNull Plugin plugin, @NotNull String name) { - Timing pluginHandler = null; - if (plugin != null) { - pluginHandler = ofSafe(plugin.getName(), "Combined Total", TimingsManager.PLUGIN_GROUP_HANDLER); - } - return of(plugin, name, pluginHandler); -+ throw new org.plazmamc.thunderbolt.DeprecatedException("Timings is deprecated and will be removed in the future. Use Spark instead."); // Thunderbolt - Remove remaining timings implementations ++ throw new org.plazmamc.plazma.DeprecationException("Timings are deprecated and removed. Use spark instead."); // Plazma - Completely remove timings implementation } /** -@@ -86,11 +72,9 @@ public final class Timings { - * @param groupHandler Parent handler to mirror .start/stop calls to +@@ -87,10 +75,10 @@ public final class Timings { * @return Timing Handler */ -- @NotNull -+ @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Thunderbolt - Remove remaining timings implementations // Thunderbolt - Remove remaining timings implementations + @NotNull ++ @Deprecated(forRemoval = true) // Plazma - Completely remove timings implementation ++ @io.papermc.paper.annotation.DoNotUse // Plazma - Completely remove timings implementation public static Timing of(@NotNull Plugin plugin, @NotNull String name, @Nullable Timing groupHandler) { - Preconditions.checkNotNull(plugin, "Plugin can not be null"); - Bukkit.getLogger().warning(String.format("Plugin '%s' is creating timing '%s' - this is deprecated behavior, please report it to the authors: %s", plugin.getName(), name, String.join(", ", plugin.getDescription().getAuthors()))); - return TimingsManager.getHandler(plugin.getName(), name, groupHandler); -+ throw new org.plazmamc.thunderbolt.DeprecatedException("Timings is deprecated and will be removed in the future. Use Spark instead."); // Thunderbolt - Remove remaining timings implementations ++ throw new org.plazmamc.plazma.DeprecationException("Timings are deprecated and removed. Use spark instead."); // Plazma - Completely remove timings implementation } /** -@@ -104,9 +88,9 @@ public final class Timings { - * @param name Name of Timing +@@ -105,8 +93,10 @@ public final class Timings { * @return Timing Handler */ -- @NotNull -+ @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Thunderbolt - Remove remaining timings implementations + @NotNull ++ @Deprecated(forRemoval = true) // Plazma - Completely remove timings implementation ++ @io.papermc.paper.annotation.DoNotUse // Plazma - Completely remove timings implementation public static Timing ofStart(@NotNull Plugin plugin, @NotNull String name) { - return ofStart(plugin, name, null); -+ throw new org.plazmamc.thunderbolt.DeprecatedException("Timings is deprecated and will be removed in the future. Use Spark instead."); // Thunderbolt - Remove remaining timings implementations ++ throw new org.plazmamc.plazma.DeprecationException("Timings are deprecated and removed. Use spark instead."); // Plazma - Completely remove timings implementation } /** -@@ -121,11 +105,9 @@ public final class Timings { - * @param groupHandler Parent handler to mirror .start/stop calls to +@@ -122,10 +112,10 @@ public final class Timings { * @return Timing Handler */ -- @NotNull -+ @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Thunderbolt - Remove remaining timings implementations + @NotNull ++ @Deprecated(forRemoval = true) // Plazma - Completely remove timings implementation ++ @io.papermc.paper.annotation.DoNotUse // Plazma - Completely remove timings implementation public static Timing ofStart(@NotNull Plugin plugin, @NotNull String name, @Nullable Timing groupHandler) { - Timing timing = of(plugin, name, groupHandler); - //timing.startTiming(); // Purpur - return timing; -+ throw new org.plazmamc.thunderbolt.DeprecatedException("Timings is deprecated and will be removed in the future. Use Spark instead."); // Thunderbolt - Remove remaining timings implementations ++ throw new org.plazmamc.plazma.DeprecationException("Timings are deprecated and removed. Use spark instead."); // Plazma - Completely remove timings implementation } /** -@@ -133,8 +115,9 @@ public final class Timings { +@@ -133,8 +123,10 @@ public final class Timings { * * @return Enabled or not */ -+ @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Thunderbolt - Remove remaining timings implementations ++ @Deprecated(forRemoval = true) // Plazma - Completely remove timings implementation ++ @io.papermc.paper.annotation.DoNotUse // Plazma - Completely remove timings implementation public static boolean isTimingsEnabled() { - return timingsEnabled; -+ return false; // Thunderbolt - Remove remaining timings implementations ++ throw new org.plazmamc.plazma.DeprecationException("Timings are deprecated and removed. Use spark instead."); // Plazma - Completely remove timings implementation } /** -@@ -144,42 +127,9 @@ public final class Timings { +@@ -144,28 +136,16 @@ public final class Timings { * * @param enabled Should timings be reported */ -+ @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Thunderbolt - Remove remaining timings implementations ++ @Deprecated(forRemoval = true) // Plazma - Completely remove timings implementation ++ @io.papermc.paper.annotation.DoNotUse // Plazma - Completely remove timings implementation public static void setTimingsEnabled(boolean enabled) { -- // Purpur start - we don't do that here... -- timingsEnabled = false; -- //warnAboutDeprecationOnEnable(); -- //reset(); -- // Purpur end -- } -- -- private static void warnAboutDeprecationOnEnable() { -- if (timingsEnabled && !warnedAboutDeprecationOnEnable) { -- Bukkit.getLogger().warning(PlainTextComponentSerializer.plainText().serialize(deprecationMessage())); +- if (enabled && !warnedAboutDeprecationOnEnable) { +- //Bukkit.getLogger().severe(PlainTextComponentSerializer.plainText().serialize(deprecationMessage())); - warnedAboutDeprecationOnEnable = true; - } -- } -- -- public static Component deprecationMessage() { ++ throw new org.plazmamc.plazma.DeprecationException("Timings are deprecated and removed. Use spark instead."); // Plazma - Completely remove timings implementation + } + ++ @Deprecated(forRemoval = true) // Plazma - Completely remove timings implementation ++ @io.papermc.paper.annotation.DoNotUse // Plazma - Completely remove timings implementation + public static Component deprecationMessage() { - return Component.text() -- .color(TextColor.color(0xf3ef91)) -- .append(Component.text("[!] The timings profiler has been enabled but has been scheduled for removal from Paper in the future.")) +- .color(TextColor.color(0xffc93a)) +- .append(Component.text("[!] The timings profiler is in no-op mode and will be fully removed in a later update.")) - .append(Component.newline()) -- .append( -- Component.text(" We recommend installing the spark profiler as a replacement: ") -- .append( -- Component.text() -- .content("https://spark.lucko.me/") -- .clickEvent(ClickEvent.openUrl("https://spark.lucko.me/"))) -- ) +- .append(Component.text(" We recommend migrating to the spark profiler.")) - .append(Component.newline()) - .append( - Component.text(" For more information please visit: ") - .append( - Component.text() -- .content("https://github.com/PaperMC/Paper/issues/8948") -- .clickEvent(ClickEvent.openUrl("https://github.com/PaperMC/Paper/issues/8948"))) +- .content("https://github.com/PaperMC/Paper/discussions/10565") +- .clickEvent(ClickEvent.openUrl("https://github.com/PaperMC/Paper/discussions/10565"))) - ) - .build(); -+ throw new org.plazmamc.thunderbolt.DeprecatedException("Timings is deprecated and will be removed in the future. Use Spark instead."); // Thunderbolt - Remove remaining timings implementations ++ throw new org.plazmamc.plazma.DeprecationException("Timings are deprecated and removed. Use spark instead."); // Plazma - Completely remove timings implementation } /** -@@ -189,8 +139,9 @@ public final class Timings { +@@ -175,8 +155,10 @@ public final class Timings { * * @return Enabled or not */ -+ @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Thunderbolt - Remove remaining timings implementations ++ @Deprecated(forRemoval = true) // Plazma - Completely remove timings implementation ++ @io.papermc.paper.annotation.DoNotUse // Plazma - Completely remove timings implementation public static boolean isVerboseTimingsEnabled() { - return verboseEnabled; -+ return false; // Thunderbolt - Remove remaining timings implementations ++ throw new org.plazmamc.plazma.DeprecationException("Timings are deprecated and removed. Use spark instead."); // Plazma - Completely remove timings implementation } /** -@@ -201,9 +152,9 @@ public final class Timings { +@@ -187,9 +169,10 @@ public final class Timings { * * @param enabled Should high-frequency timings be reported */ -+ @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Thunderbolt - Remove remaining timings implementations ++ @Deprecated(forRemoval = true) // Plazma - Completely remove timings implementation ++ @io.papermc.paper.annotation.DoNotUse // Plazma - Completely remove timings implementation public static void setVerboseTimingsEnabled(boolean enabled) { - verboseEnabled = enabled; - TimingsManager.needsRecheckEnabled = true; -+ throw new org.plazmamc.thunderbolt.DeprecatedException("Timings is deprecated and will be removed in the future. Use Spark instead."); // Thunderbolt - Remove remaining timings implementations ++ throw new org.plazmamc.plazma.DeprecationException("Timings are deprecated and removed. Use spark instead."); // Plazma - Completely remove timings implementation } /** -@@ -213,8 +164,9 @@ public final class Timings { +@@ -199,8 +182,10 @@ public final class Timings { * * @return Interval in ticks */ -+ @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Thunderbolt - Remove remaining timings implementations ++ @Deprecated(forRemoval = true) // Plazma - Completely remove timings implementation ++ @io.papermc.paper.annotation.DoNotUse // Plazma - Completely remove timings implementation public static int getHistoryInterval() { - return historyInterval; -+ throw new org.plazmamc.thunderbolt.DeprecatedException("Timings is deprecated and will be removed in the future. Use Spark instead."); // Thunderbolt - Remove remaining timings implementations ++ throw new org.plazmamc.plazma.DeprecationException("Timings are deprecated and removed. Use spark instead."); // Plazma - Completely remove timings implementation } /** -@@ -227,12 +179,8 @@ public final class Timings { +@@ -213,12 +198,10 @@ public final class Timings { * * @param interval Interval in ticks */ -- public static void setHistoryInterval(int interval) { ++ @Deprecated(forRemoval = true) // Plazma - Completely remove timings implementation ++ @io.papermc.paper.annotation.DoNotUse // Plazma - Completely remove timings implementation + public static void setHistoryInterval(int interval) { - historyInterval = Math.max(20*60, interval); - // Recheck the history length with the new Interval - if (historyLength != -1) { - setHistoryLength(historyLength); - } -+ @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Thunderbolt - Remove remaining timings implementations -+ public static void setHistoryInterval(int interval) {throw new org.plazmamc.thunderbolt.DeprecatedException("Timings is deprecated and will be removed in the future. Use Spark instead."); // Thunderbolt - Remove remaining timings implementations ++ throw new org.plazmamc.plazma.DeprecationException("Timings are deprecated and removed. Use spark instead."); // Plazma - Completely remove timings implementation } /** -@@ -242,8 +190,9 @@ public final class Timings { +@@ -228,8 +211,10 @@ public final class Timings { * * @return Duration in Ticks */ -+ @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Thunderbolt - Remove remaining timings implementations ++ @Deprecated(forRemoval = true) // Plazma - Completely remove timings implementation ++ @io.papermc.paper.annotation.DoNotUse // Plazma - Completely remove timings implementation public static int getHistoryLength() { - return historyLength; -+ throw new org.plazmamc.thunderbolt.DeprecatedException("Timings is deprecated and will be removed in the future. Use Spark instead."); // Thunderbolt - Remove remaining timings implementations ++ throw new org.plazmamc.plazma.DeprecationException("Timings are deprecated and removed. Use spark instead."); // Plazma - Completely remove timings implementation } /** -@@ -257,30 +206,17 @@ public final class Timings { +@@ -243,30 +228,19 @@ public final class Timings { * * @param length Duration in ticks */ -+ @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Thunderbolt - Remove remaining timings implementations ++ @Deprecated(forRemoval = true) // Plazma - Completely remove timings implementation ++ @io.papermc.paper.annotation.DoNotUse // Plazma - Completely remove timings implementation public static void setHistoryLength(int length) { - // Cap at 12 History Frames, 1 hour at 5 minute frames. - int maxLength = historyInterval * MAX_HISTORY_FRAMES; @@ -1452,38 +1497,42 @@ index 752d54830aa8baa1450bf72da03ae55ed30293c2..8bbd2bfb06a9ba5ad7a87f9b54e04877 - } - TimingsManager.HISTORY = EvictingQueue.create(frames); - TimingsManager.HISTORY.addAll(oldQueue); -+ throw new org.plazmamc.thunderbolt.DeprecatedException("Timings is deprecated and will be removed in the future. Use Spark instead."); // Thunderbolt - Remove remaining timings implementations ++ throw new org.plazmamc.plazma.DeprecationException("Timings are deprecated and removed. Use spark instead."); // Plazma - Completely remove timings implementation } /** * Resets all Timing Data */ -+ @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Thunderbolt - Remove remaining timings implementations ++ @Deprecated(forRemoval = true) // Plazma - Completely remove timings implementation ++ @io.papermc.paper.annotation.DoNotUse // Plazma - Completely remove timings implementation public static void reset() { - TimingsManager.reset(); -+ throw new org.plazmamc.thunderbolt.DeprecatedException("Timings is deprecated and will be removed in the future. Use Spark instead."); // Thunderbolt - Remove remaining timings implementations ++ throw new org.plazmamc.plazma.DeprecationException("Timings are deprecated and removed. Use spark instead."); // Plazma - Completely remove timings implementation } /** -@@ -289,11 +225,9 @@ public final class Timings { +@@ -275,11 +249,10 @@ public final class Timings { * If sender is null, ConsoleCommandSender will be used. * @param sender The sender to send to, or null to use the ConsoleCommandSender */ -+ @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Thunderbolt - Remove remaining timings implementations ++ @Deprecated(forRemoval = true) // Plazma - Completely remove timings implementation ++ @io.papermc.paper.annotation.DoNotUse // Plazma - Completely remove timings implementation public static void generateReport(@Nullable CommandSender sender) { - if (sender == null) { - sender = Bukkit.getConsoleSender(); - } - requestingReport.add(sender); -+ throw new org.plazmamc.thunderbolt.DeprecatedException("Timings is deprecated and will be removed in the future. Use Spark instead."); // Thunderbolt - Remove remaining timings implementations ++ throw new org.plazmamc.plazma.DeprecationException("Timings are deprecated and removed. Use spark instead."); // Plazma - Completely remove timings implementation } /** -@@ -301,39 +235,10 @@ public final class Timings { +@@ -287,39 +260,11 @@ public final class Timings { * Use with {@link org.bukkit.command.BufferedCommandSender} to get full response when done! * @param sender The listener to send responses too. */ -- public static void generateReport(@NotNull TimingsReportListener sender) { ++ @Deprecated(forRemoval = true) // Plazma - Completely remove timings implementation ++ @io.papermc.paper.annotation.DoNotUse // Plazma - Completely remove timings implementation + public static void generateReport(@NotNull TimingsReportListener sender) { - Preconditions.checkNotNull(sender); - requestingReport.add(sender); - } @@ -1506,16 +1555,14 @@ index 752d54830aa8baa1450bf72da03ae55ed30293c2..8bbd2bfb06a9ba5ad7a87f9b54e04877 - pluginHandler = ofSafe(plugin.getName(), "Combined Total", TimingsManager.PLUGIN_GROUP_HANDLER); - } - return ofSafe(plugin != null ? plugin.getName() : "Minecraft - Invalid Plugin", name, pluginHandler); -+ @Deprecated(forRemoval = true) @io.papermc.paper.annotation.DoNotUse // Thunderbolt - Remove remaining timings implementations -+ public static void generateReport(@NotNull Object sender) { // Thunderbolt - Remove remaining timings implementations -+ throw new org.plazmamc.thunderbolt.DeprecatedException("Timings is deprecated and will be removed in the future. Use Spark instead."); // Thunderbolt - Remove remaining timings implementations - } - +- } +- - @NotNull - static TimingHandler ofSafe(@NotNull String name, @Nullable Timing groupHandler) { - return ofSafe(null, name, groupHandler); -- } -- ++ throw new org.plazmamc.plazma.DeprecationException("Timings are deprecated and removed. Use spark instead."); // Plazma - Completely remove timings implementation + } + - @NotNull - static TimingHandler ofSafe(@Nullable String groupName, @NotNull String name, @Nullable Timing groupHandler) { - return TimingsManager.getHandler(groupName, name, groupHandler); @@ -1523,33 +1570,74 @@ index 752d54830aa8baa1450bf72da03ae55ed30293c2..8bbd2bfb06a9ba5ad7a87f9b54e04877 } diff --git a/src/main/java/co/aikar/timings/TimingsCommand.java b/src/main/java/co/aikar/timings/TimingsCommand.java -index 1abfcee0f6d632f4cd8d74b4994a90c9ea9d254c..1a439fda970eec02c9da65b327da4a21f1afa795 100644 +deleted file mode 100644 +index f28eec202237461cb489a2b13289d813381a25bc..0000000000000000000000000000000000000000 --- a/src/main/java/co/aikar/timings/TimingsCommand.java -+++ b/src/main/java/co/aikar/timings/TimingsCommand.java -@@ -40,12 +40,12 @@ import static net.kyori.adventure.text.Component.text; - @Deprecated(forRemoval = true) - public class TimingsCommand extends BukkitCommand { - private static final List TIMINGS_SUBCOMMANDS = ImmutableList.of("report", "reset", "on", "off", "paste", "verbon", "verboff"); ++++ /dev/null +@@ -1,130 +0,0 @@ +-/* +- * This file is licensed under the MIT License (MIT). +- * +- * Copyright (c) 2014 Daniel Ennis +- * +- * Permission is hereby granted, free of charge, to any person obtaining a copy +- * of this software and associated documentation files (the "Software"), to deal +- * in the Software without restriction, including without limitation the rights +- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +- * copies of the Software, and to permit persons to whom the Software is +- * furnished to do so, subject to the following conditions: +- * +- * The above copyright notice and this permission notice shall be included in +- * all copies or substantial portions of the Software. +- * +- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +- * THE SOFTWARE. +- */ +-package co.aikar.timings; +- +-import com.google.common.base.Preconditions; +-import com.google.common.collect.ImmutableList; +-import net.kyori.adventure.text.format.NamedTextColor; +-import org.bukkit.command.CommandSender; +-import org.bukkit.command.defaults.BukkitCommand; +-import org.bukkit.util.StringUtil; +- +-import java.util.ArrayList; +-import java.util.List; +-import org.jetbrains.annotations.NotNull; +- +-import static net.kyori.adventure.text.Component.text; +- +-/** +- * @deprecated Timings will be removed in the future +- */ +-@Deprecated(forRemoval = true) +-public class TimingsCommand extends BukkitCommand { +- private static final List TIMINGS_SUBCOMMANDS = ImmutableList.of("report", "reset", "on", "off", "paste", "verbon", "verboff"); - private long lastResetAttempt = 0; -+ // private long lastResetAttempt = 0; - - public TimingsCommand(@NotNull String name) { - super(name); - this.description = "Manages Spigot Timings data to see performance of the server."; +- +- public TimingsCommand(@NotNull String name) { +- super(name); +- this.description = "Manages Spigot Timings data to see performance of the server."; - this.usageMessage = "/timings";// "; // Purpur -+ this.usageMessage = "/timings "; // Purpur // Thunderbolt - this.setPermission("bukkit.command.timings"); - } - -@@ -54,61 +54,12 @@ public class TimingsCommand extends BukkitCommand { - if (!testPermission(sender)) { - return true; - } +- this.setPermission("bukkit.command.timings"); +- } +- +- @Override +- public boolean execute(@NotNull CommandSender sender, @NotNull String currentAlias, @NotNull String[] args) { +- if (!testPermission(sender)) { +- return true; +- } - if (true) { - net.kyori.adventure.text.minimessage.MiniMessage mm = net.kyori.adventure.text.minimessage.MiniMessage.miniMessage(); - sender.sendMessage(mm.deserialize("Purpur has removed timings to save your performance. Please use /spark instead")); - sender.sendMessage(mm.deserialize("For more information, view its documentation at")); -- sender.sendMessage(mm.deserialize("https://spark.lucko.me/docs/Command-Usage")); +- sender.sendMessage(mm.deserialize("https://spark.lucko.me/docs/Command-Usage")); // Purpur - return true; - } - if (args.length < 1) { @@ -1600,32 +1688,29 @@ index 1abfcee0f6d632f4cd8d74b4994a90c9ea9d254c..1a439fda970eec02c9da65b327da4a21 - } else { - sender.sendMessage(text("Usage: " + this.usageMessage, NamedTextColor.RED)); - } -+ // Thunderbolt start - Remove remaining timings implementations -+ net.kyori.adventure.text.minimessage.MiniMessage mm = net.kyori.adventure.text.minimessage.MiniMessage.miniMessage(); -+ sender.sendMessage(mm.deserialize("Purpur has removed timings to save your performance. Please use /spark instead")); -+ sender.sendMessage(mm.deserialize("For more information, view its documentation at")); -+ sender.sendMessage(mm.deserialize("https://spark.lucko.me/docs/Command-Usage")); -+ // Thunderbolt end - Remove remaining timings implementations - return true; - } - -@@ -119,9 +70,9 @@ public class TimingsCommand extends BukkitCommand { - Preconditions.checkNotNull(args, "Arguments cannot be null"); - Preconditions.checkNotNull(alias, "Alias cannot be null"); - +- return true; +- } +- +- @NotNull +- @Override +- public List tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) { +- Preconditions.checkNotNull(sender, "Sender cannot be null"); +- Preconditions.checkNotNull(args, "Arguments cannot be null"); +- Preconditions.checkNotNull(alias, "Alias cannot be null"); +- - if (false && args.length == 1) { // Purpur -+ if (args.length == 1) { // Purpur // Thunderbolt - return StringUtil.copyPartialMatches(args[0], TIMINGS_SUBCOMMANDS, +- return StringUtil.copyPartialMatches(args[0], TIMINGS_SUBCOMMANDS, - new ArrayList(TIMINGS_SUBCOMMANDS.size())); -+ new ArrayList<>(TIMINGS_SUBCOMMANDS.size())); // Thunderbolt - } - return ImmutableList.of(); - } +- } +- return ImmutableList.of(); +- } +-} diff --git a/src/main/java/co/aikar/timings/TimingsManager.java b/src/main/java/co/aikar/timings/TimingsManager.java -index 5e1558ca3ffeeaf2645fa003965474a442d650bf..9d6038dbaa13c5bfa3e0cea8f62544b97b7541d1 100644 +deleted file mode 100644 +index e72ad05abada04426e32a73d02b21cb69079d268..0000000000000000000000000000000000000000 --- a/src/main/java/co/aikar/timings/TimingsManager.java -+++ b/src/main/java/co/aikar/timings/TimingsManager.java -@@ -1,192 +1,4 @@ ++++ /dev/null +@@ -1,192 +0,0 @@ -/* - * This file is licensed under the MIT License (MIT). - * @@ -1649,8 +1734,8 @@ index 5e1558ca3ffeeaf2645fa003965474a442d650bf..9d6038dbaa13c5bfa3e0cea8f62544b9 - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - package co.aikar.timings; - +-package co.aikar.timings; +- -import co.aikar.util.LoadingMap; -import com.google.common.collect.EvictingQueue; -import org.bukkit.Bukkit; @@ -1668,9 +1753,9 @@ index 5e1558ca3ffeeaf2645fa003965474a442d650bf..9d6038dbaa13c5bfa3e0cea8f62544b9 -import org.jetbrains.annotations.Nullable; - -/** -- * @deprecated Timings will likely be replaced with Spark in the future +- * @deprecated Timings will be removed in the future - */ - @Deprecated(forRemoval = true) +-@Deprecated(forRemoval = true) -public final class TimingsManager { - static final Map TIMING_MAP = LoadingMap.of( - new ConcurrentHashMap<>(4096, .5F), TimingHandler::new @@ -1818,12 +1903,11 @@ index 5e1558ca3ffeeaf2645fa003965474a442d650bf..9d6038dbaa13c5bfa3e0cea8f62544b9 - return null; - } -} -+interface TimingsManager {} // Thunderbolt - Remove remaining timings implementations diff --git a/src/main/java/co/aikar/timings/TimingsReportListener.java b/src/main/java/co/aikar/timings/TimingsReportListener.java -index 3af5b8ea795311582044c712de50d29412024b77..6c3c30f98a38b5f04118060b695ae3458607a226 100644 +index df066d6f8d55afbc0c1897c486d638657a5f8df9..2ff0c2f9771a39a01f7fee879487eaaed1fe4c8e 100644 --- a/src/main/java/co/aikar/timings/TimingsReportListener.java +++ b/src/main/java/co/aikar/timings/TimingsReportListener.java -@@ -1,87 +1,4 @@ +@@ -1,90 +1,3 @@ package co.aikar.timings; -import com.google.common.base.Preconditions; @@ -1838,7 +1922,10 @@ index 3af5b8ea795311582044c712de50d29412024b77..6c3c30f98a38b5f04118060b695ae345 - -import java.util.List; - - @Deprecated(forRemoval = true) +-/** +- * @deprecated Timings will be removed in the future +- */ +-@Deprecated(forRemoval = true) -@SuppressWarnings("WeakerAccess") -public class TimingsReportListener implements net.kyori.adventure.audience.ForwardingAudience, MessageCommandSender { - private final List senders; @@ -1911,12 +1998,13 @@ index 3af5b8ea795311582044c712de50d29412024b77..6c3c30f98a38b5f04118060b695ae345 - } - } -} -+interface TimingsReportListener {} // Thunderbolt - Remove remaining timings implementations ++@Deprecated(forRemoval = true) interface TimingsReportListener {} // Plazma - Completely remove timings implementation diff --git a/src/main/java/co/aikar/timings/UnsafeTimingHandler.java b/src/main/java/co/aikar/timings/UnsafeTimingHandler.java -index 632c4961515f5052551f841cfa840e60bba7a257..44df4bbde43d23027bf5d637aa933dcad7edc26a 100644 +deleted file mode 100644 +index 632c4961515f5052551f841cfa840e60bba7a257..0000000000000000000000000000000000000000 --- a/src/main/java/co/aikar/timings/UnsafeTimingHandler.java -+++ b/src/main/java/co/aikar/timings/UnsafeTimingHandler.java -@@ -1,53 +1,4 @@ ++++ /dev/null +@@ -1,53 +0,0 @@ -/* - * This file is licensed under the MIT License (MIT). - * @@ -1940,8 +2028,8 @@ index 632c4961515f5052551f841cfa840e60bba7a257..44df4bbde43d23027bf5d637aa933dca - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - package co.aikar.timings; - +-package co.aikar.timings; +- -import org.bukkit.Bukkit; -import org.jetbrains.annotations.NotNull; - @@ -1970,30 +2058,6 @@ index 632c4961515f5052551f841cfa840e60bba7a257..44df4bbde43d23027bf5d637aa933dca - super.stopTiming(); - } -} -+@Deprecated(forRemoval = true) -+interface UnsafeTimingHandler {} // Thunderbolt - Remove remaining timings implementations -diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java -index 0e9ccfee7a03d341e7c4d271f53b4ed168b404ef..d133ddba0355835412dd16d2bf1a8b4b4ed00545 100644 ---- a/src/main/java/org/bukkit/UnsafeValues.java -+++ b/src/main/java/org/bukkit/UnsafeValues.java -@@ -40,7 +40,7 @@ public interface UnsafeValues { - net.kyori.adventure.text.Component resolveWithContext(net.kyori.adventure.text.Component component, org.bukkit.command.CommandSender context, org.bukkit.entity.Entity scoreboardSubject, boolean bypassPermissions) throws java.io.IOException; - // Paper end - -- void reportTimings(); // Paper -+ // void reportTimings(); // Paper // Thunderbolt - Remove remaining timings implementations - Material toLegacy(Material material); - - Material fromLegacy(Material material); -@@ -154,7 +154,7 @@ public interface UnsafeValues { - * Server name to report to timings v2 - * @return name - */ -- String getTimingsServerName(); -+ // String getTimingsServerName(); // Thunderbolt - Remove remaining timings implementations - - /** - * Called once by the version command on first use, then cached. diff --git a/src/main/java/org/bukkit/command/FormattedCommandAlias.java b/src/main/java/org/bukkit/command/FormattedCommandAlias.java index abe256e1e45ce28036da4aa1586715bc8a1a3414..cf055d721c4c66eba9479ad88f3b6a514bf9677d 100644 --- a/src/main/java/org/bukkit/command/FormattedCommandAlias.java @@ -2008,81 +2072,230 @@ index abe256e1e45ce28036da4aa1586715bc8a1a3414..cf055d721c4c66eba9479ad88f3b6a51 } diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java -index fdedac32544be6534288c8ba28abe7f5c4c56f3b..2e40b577333e251c90871ee4b534e85f6b226c73 100644 +index 7740ad53796d08584bb0110f99af5639993e4d71..3806c3887d9ba58370747ed165c2a644d811f5e1 100644 --- a/src/main/java/org/bukkit/command/SimpleCommandMap.java +++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java -@@ -70,7 +70,7 @@ public class SimpleCommandMap implements CommandMap { +@@ -39,7 +39,7 @@ public class SimpleCommandMap implements CommandMap { + register("bukkit", new VersionCommand("version")); + register("bukkit", new ReloadCommand("reload")); + //register("bukkit", new PluginsCommand("plugins")); // Paper +- register("bukkit", new co.aikar.timings.TimingsCommand("timings")); // Paper ++ //register("bukkit", new co.aikar.timings.TimingsCommand("timings")); // Paper // Plazma - Completely remove timings implementation + } + + public void setFallbackCommands() { +@@ -71,7 +71,7 @@ public class SimpleCommandMap implements CommandMap { */ @Override public boolean register(@NotNull String label, @NotNull String fallbackPrefix, @NotNull Command command) { - command.timings = co.aikar.timings.TimingsManager.getCommandTiming(fallbackPrefix, command); // Paper -+ // command.timings = co.aikar.timings.TimingsManager.getCommandTiming(fallbackPrefix, command); // Paper // Thunderbolt - Remove remaining timings implementations - label = label.toLowerCase(java.util.Locale.ENGLISH).trim(); - fallbackPrefix = fallbackPrefix.toLowerCase(java.util.Locale.ENGLISH).trim(); ++ //command.timings = co.aikar.timings.TimingsManager.getCommandTiming(fallbackPrefix, command); // Paper // Plazma - Completely remove timings implementation + label = label.toLowerCase(Locale.ROOT).trim(); + fallbackPrefix = fallbackPrefix.toLowerCase(Locale.ROOT).trim(); boolean registered = register(label, command, false, fallbackPrefix); -@@ -165,11 +165,13 @@ public class SimpleCommandMap implements CommandMap { +@@ -166,11 +166,13 @@ public class SimpleCommandMap implements CommandMap { parsedArgs = event.getArgs(); // Purpur end -+ /* // Thunderbolt - Remove remaining timings implementations ++ /* // Plazma - Completely remove timings implementation // Paper start - Plugins do weird things to workaround normal registration if (target.timings == null) { target.timings = co.aikar.timings.TimingsManager.getCommandTiming(null, target); } // Paper end -+ */ // Thunderbolt - Remove remaining timings implementations ++ */ // Plazma - Completely remove timings implementation try { //try (co.aikar.timings.Timing ignored = target.timings.startTiming()) { // Paper - use try with resources // Purpur +diff --git a/src/main/java/org/bukkit/plugin/PluginManager.java b/src/main/java/org/bukkit/plugin/PluginManager.java +index 47153dee66782a00b980ecf15e8774ab6f3d887d..25d8b2f57c42890b05433fac04ce60efdc6ae34d 100644 +--- a/src/main/java/org/bukkit/plugin/PluginManager.java ++++ b/src/main/java/org/bukkit/plugin/PluginManager.java +@@ -312,7 +312,13 @@ public interface PluginManager extends io.papermc.paper.plugin.PermissionManager + * + * @return True if event timings are to be used + */ +- public boolean useTimings(); ++ // Plazma start - Completely remove timings implementation ++ @Deprecated(forRemoval = true) ++ @io.papermc.paper.annotation.DoNotUse ++ default boolean useTimings() { ++ return false; ++ } ++ // Plazma end - Completely remove timings implementation + + // Paper start + @org.jetbrains.annotations.ApiStatus.Internal diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java -index 5dc64d8c9aeae612fd31af0673f3530a9e777dfc..62242daa0bd7851479748cd62627f51cfe6bc6f1 100644 +index 6b6edf9007997d9672e4c850464c1b71cb55f6b4..11b973b70ce62a6e227d343bdef6dcb9ece3f97d 100644 --- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java -@@ -60,7 +60,7 @@ public final class SimplePluginManager implements PluginManager { +@@ -61,7 +61,7 @@ public final class SimplePluginManager implements PluginManager { public final Map> defSubs = new HashMap>(); public PluginManager paperPluginManager; // Paper end - private boolean useTimings = false; -+ // private boolean useTimings = false; // Thunderbolt - Remove remaining timings implementations ++ //private boolean useTimings = false; // Plazma - Completely remove timings implementation public SimplePluginManager(@NotNull Server instance, @NotNull SimpleCommandMap commandMap) { server = instance; -@@ -723,7 +723,7 @@ public final class SimplePluginManager implements PluginManager { - throw new IllegalPluginAccessException("Plugin attempted to register " + event + " while not enabled"); - } - +@@ -718,18 +718,7 @@ public final class SimplePluginManager implements PluginManager { + Preconditions.checkArgument(priority != null, "Priority cannot be null"); + Preconditions.checkArgument(executor != null, "Executor cannot be null"); + Preconditions.checkArgument(plugin != null, "Plugin cannot be null"); +- if (true) {this.paperPluginManager.registerEvent(event, listener, priority, executor, plugin, ignoreCancelled); return;} // Paper +- +- if (!plugin.isEnabled()) { +- throw new IllegalPluginAccessException("Plugin attempted to register " + event + " while not enabled"); +- } +- - executor = new co.aikar.timings.TimedEventExecutor(executor, plugin, null, event); // Paper -+ // executor = new co.aikar.timings.TimedEventExecutor(executor, plugin, null, event); // Paper // Thunderbolt - Remove remaining timings implementations - if (false) { // Spigot - RL handles useTimings check now // Paper - getEventListeners(event).register(new TimedRegisteredListener(listener, executor, priority, plugin, ignoreCancelled)); - } else { -@@ -958,8 +958,9 @@ public final class SimplePluginManager implements PluginManager { +- if (false) { // Spigot - RL handles useTimings check now // Paper +- getEventListeners(event).register(new TimedRegisteredListener(listener, executor, priority, plugin, ignoreCancelled)); +- } else { +- getEventListeners(event).register(new RegisteredListener(listener, executor, priority, plugin, ignoreCancelled)); +- } ++ this.paperPluginManager.registerEvent(event, listener, priority, executor, plugin, ignoreCancelled); // Paper // Plazma - Completely remove timings implementation + } + + @NotNull +@@ -959,8 +948,8 @@ public final class SimplePluginManager implements PluginManager { @Override public boolean useTimings() { - if (true) {return this.paperPluginManager.useTimings();} // Paper - return co.aikar.timings.Timings.isTimingsEnabled(); // Spigot -+ // if (true) {return this.paperPluginManager.useTimings();} // Paper -+ // return co.aikar.timings.Timings.isTimingsEnabled(); // Spigot -+ return false; // Thunderbolt - Remove remaining timings implementations ++ // TODO: Plazma - warn on use ++ return false; // Plazma - Completely remove timings implementation } /** -@@ -968,7 +969,8 @@ public final class SimplePluginManager implements PluginManager { - * @param use True if per event timing code should be used +@@ -970,7 +959,7 @@ public final class SimplePluginManager implements PluginManager { */ + @Deprecated(forRemoval = true) public void useTimings(boolean use) { - co.aikar.timings.Timings.setTimingsEnabled(use); // Paper -+ // co.aikar.timings.Timings.setTimingsEnabled(use); // Paper // Thunderbolt - Remove remaining timings implementations -+ throw new org.plazmamc.thunderbolt.DeprecatedException("Timings is deprecated and will be removed in the future. Use Spark instead."); // Thunderbolt - Remove remaining timings implementations // Thunderbolt - Remove remaining timings implementations ++ throw new org.plazmamc.plazma.DeprecationException("Timings are deprecated and removed. Use Spark instead."); // Plazma - Completely remove timings implementation } // Paper start +diff --git a/src/main/java/org/bukkit/plugin/TimedRegisteredListener.java b/src/main/java/org/bukkit/plugin/TimedRegisteredListener.java +deleted file mode 100644 +index 1d76e30b82ca56bb4cf3b9a33f5a129ab829e3f0..0000000000000000000000000000000000000000 +--- a/src/main/java/org/bukkit/plugin/TimedRegisteredListener.java ++++ /dev/null +@@ -1,101 +0,0 @@ +-package org.bukkit.plugin; +- +-import org.bukkit.event.Event; +-import org.bukkit.event.EventException; +-import org.bukkit.event.EventPriority; +-import org.bukkit.event.Listener; +-import org.jetbrains.annotations.NotNull; +-import org.jetbrains.annotations.Nullable; +- +-/** +- * Extends RegisteredListener to include timing information +- */ +-public class TimedRegisteredListener extends RegisteredListener { +- private int count; +- private long totalTime; +- private Class eventClass; +- private boolean multiple = false; +- +- public TimedRegisteredListener(@NotNull final Listener pluginListener, @NotNull final EventExecutor eventExecutor, @NotNull final EventPriority eventPriority, @NotNull final Plugin registeredPlugin, final boolean listenCancelled) { +- super(pluginListener, eventExecutor, eventPriority, registeredPlugin, listenCancelled); +- } +- +- @Override +- public void callEvent(@NotNull Event event) throws EventException { +- if (event.isAsynchronous()) { +- super.callEvent(event); +- return; +- } +- count++; +- Class newEventClass = event.getClass(); +- if (this.eventClass == null) { +- this.eventClass = newEventClass; +- } else if (!this.eventClass.equals(newEventClass)) { +- multiple = true; +- this.eventClass = getCommonSuperclass(newEventClass, this.eventClass).asSubclass(Event.class); +- } +- long start = System.nanoTime(); +- super.callEvent(event); +- totalTime += System.nanoTime() - start; +- } +- +- @NotNull +- private static Class getCommonSuperclass(@NotNull Class class1, @NotNull Class class2) { +- while (!class1.isAssignableFrom(class2)) { +- class1 = class1.getSuperclass(); +- } +- return class1; +- } +- +- /** +- * Resets the call count and total time for this listener +- */ +- public void reset() { +- count = 0; +- totalTime = 0; +- } +- +- /** +- * Gets the total times this listener has been called +- * +- * @return Times this listener has been called +- */ +- public int getCount() { +- return count; +- } +- +- /** +- * Gets the total time calls to this listener have taken +- * +- * @return Total time for all calls of this listener +- */ +- public long getTotalTime() { +- return totalTime; +- } +- +- /** +- * Gets the class of the events this listener handled. If it handled +- * multiple classes of event, the closest shared superclass will be +- * returned, such that for any event this listener has handled, +- * this.getEventClass().isAssignableFrom(event.getClass()) +- * and no class this.getEventClass().isAssignableFrom(clazz) +- * {@literal && this.getEventClass() != clazz &&} +- * event.getClass().isAssignableFrom(clazz) for all handled events. +- * +- * @return the event class handled by this RegisteredListener +- */ +- @Nullable +- public Class getEventClass() { +- return eventClass; +- } +- +- /** +- * Gets whether this listener has handled multiple events, such that for +- * some two events, eventA.getClass() != eventB.getClass(). +- * +- * @return true if this listener has handled multiple events +- */ +- public boolean hasMultiple() { +- return multiple; +- } +-} diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -index 0c6ca7588fb3d6b6497ddf032fe75e5c6c9719e5..e413370a3e1634483f75464cae7e81e1d03f665e 100644 +index 0c6ca7588fb3d6b6497ddf032fe75e5c6c9719e5..e20dc7bdbd7f6040af82f638576e5ccc2d48f12f 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -@@ -43,7 +43,7 @@ import org.bukkit.plugin.TimedRegisteredListener; +@@ -39,11 +39,11 @@ import org.bukkit.plugin.PluginDescriptionFile; + import org.bukkit.plugin.PluginLoader; + import org.bukkit.plugin.RegisteredListener; + import org.bukkit.plugin.SimplePluginManager; +-import org.bukkit.plugin.TimedRegisteredListener; ++//import org.bukkit.plugin.TimedRegisteredListener; // Plazma - Completely remove timings implementation import org.bukkit.plugin.UnknownDependencyException; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -2091,7 +2304,16 @@ index 0c6ca7588fb3d6b6497ddf032fe75e5c6c9719e5..e413370a3e1634483f75464cae7e81e1 import org.yaml.snakeyaml.error.YAMLException; /** -@@ -294,21 +294,21 @@ public final class JavaPluginLoader implements PluginLoader { +@@ -233,7 +233,7 @@ public final class JavaPluginLoader implements PluginLoader { + Preconditions.checkArgument(plugin != null, "Plugin can not be null"); + Preconditions.checkArgument(listener != null, "Listener can not be null"); + +- boolean useTimings = server.getPluginManager().useTimings(); ++ //boolean useTimings = server.getPluginManager().useTimings(); // Plazma - Completely remove timings implementation + Map, Set> ret = new HashMap, Set>(); + Set methods; + try { +@@ -294,26 +294,22 @@ public final class JavaPluginLoader implements PluginLoader { } } @@ -2121,72 +2343,116 @@ index 0c6ca7588fb3d6b6497ddf032fe75e5c6c9719e5..e413370a3e1634483f75464cae7e81e1 + throw new EventException(t); } - }, plugin, method, eventClass); // Paper +- if (false) { // Spigot - RL handles useTimings check now +- eventSet.add(new TimedRegisteredListener(listener, executor, eh.priority(), plugin, eh.ignoreCancelled())); +- } else { +- eventSet.add(new RegisteredListener(listener, executor, eh.priority(), plugin, eh.ignoreCancelled())); +- } + }; // Paper ++ eventSet.add(new RegisteredListener(listener, executor, eh.priority(), plugin, eh.ignoreCancelled())); + // Thunderbolt end - Remove remaining timings implementations - if (false) { // Spigot - RL handles useTimings check now - eventSet.add(new TimedRegisteredListener(listener, executor, eh.priority(), plugin, eh.ignoreCancelled())); - } else { -diff --git a/src/main/java/org/plazmamc/thunderbolt/DeprecatedException.java b/src/main/java/org/plazmamc/thunderbolt/DeprecatedException.java + } + return ret; + } +diff --git a/src/main/java/org/plazmamc/plazma/DeprecationException.java b/src/main/java/org/plazmamc/plazma/DeprecationException.java new file mode 100644 -index 0000000000000000000000000000000000000000..d7c6e3b39b3a9977b07b9761c3d884ff68d56ee9 +index 0000000000000000000000000000000000000000..70114a474f92bd605b27f7e610946c0467b78f24 --- /dev/null -+++ b/src/main/java/org/plazmamc/thunderbolt/DeprecatedException.java ++++ b/src/main/java/org/plazmamc/plazma/DeprecationException.java @@ -0,0 +1,7 @@ -+package org.plazmamc.thunderbolt; ++package org.plazmamc.plazma; + -+public class DeprecatedException extends RuntimeException { -+ public DeprecatedException(String message) { ++public class DeprecationException extends RuntimeException { ++ public DeprecationException(String message) { + super(message); + } +} diff --git a/src/main/java/org/spigotmc/CustomTimingsHandler.java b/src/main/java/org/spigotmc/CustomTimingsHandler.java -index 9c2d605c50cbf9aefa56ec209df9f6cea1392e89..ba99e25371031042b14fc483aab2697e17fb79b7 100644 +index 9c2d605c50cbf9aefa56ec209df9f6cea1392e89..d799c5131abd81a987472aaa7cf105f1e958337f 100644 --- a/src/main/java/org/spigotmc/CustomTimingsHandler.java +++ b/src/main/java/org/spigotmc/CustomTimingsHandler.java -@@ -26,9 +26,9 @@ package org.spigotmc; - import org.bukkit.Bukkit; - import org.jetbrains.annotations.NotNull; - import org.bukkit.plugin.AuthorNagException; +@@ -1,67 +1,28 @@ +-/* +- * This file is licensed under the MIT License (MIT). +- * +- * Copyright (c) 2014 Daniel Ennis +- * +- * Permission is hereby granted, free of charge, to any person obtaining a copy +- * of this software and associated documentation files (the "Software"), to deal +- * in the Software without restriction, including without limitation the rights +- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +- * copies of the Software, and to permit persons to whom the Software is +- * furnished to do so, subject to the following conditions: +- * +- * The above copyright notice and this permission notice shall be included in +- * all copies or substantial portions of the Software. +- * +- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +- * THE SOFTWARE. +- */ ++// Plazma start - Completely remove timings implementation + package org.spigotmc; + +-import org.bukkit.Bukkit; +-import org.jetbrains.annotations.NotNull; +-import org.bukkit.plugin.AuthorNagException; -import co.aikar.timings.Timing; -import co.aikar.timings.Timings; -import co.aikar.timings.TimingsManager; -+// import co.aikar.timings.Timing; // Thunderbolt - Remove remaining timings implementations -+// import co.aikar.timings.Timings; // Thunderbolt - Remove remaining timings implementations -+// import co.aikar.timings.TimingsManager; // Thunderbolt - Remove remaining timings implementations ++import io.papermc.paper.annotation.DoNotUse; - import java.lang.reflect.Method; - import java.util.logging.Level; -@@ -43,9 +43,10 @@ import java.util.logging.Level; - */ +-import java.lang.reflect.Method; +-import java.util.logging.Level; +- +-/** +- * This is here for legacy purposes incase any plugin used it. +- * +- * If you use this, migrate ASAP as this will be removed in the future! +- * +- * @deprecated +- * @see co.aikar.timings.Timings#of +- */ @Deprecated(forRemoval = true) public final class CustomTimingsHandler { - private final Timing handler; -+ // private final Timing handler; // Thunderbolt - Remove remaining timings implementations - public CustomTimingsHandler(@NotNull String name) { -+ throw new org.plazmamc.thunderbolt.DeprecatedException("Timings is deprecated and will be removed in the future. Use Spark instead."); /* // Thunderbolt - Remove remaining timings implementations /* - Timing timing; +- public CustomTimingsHandler(@NotNull String name) { +- Timing timing; ++ @Deprecated(forRemoval = true) ++ @DoNotUse ++ public CustomTimingsHandler(String name) { ++ throw new org.plazmamc.plazma.DeprecationException("Timings are deprecated and removed. Use Spark instead."); ++ } - new AuthorNagException("Deprecated use of CustomTimingsHandler. Please Switch to Timings.of ASAP").printStackTrace(); -@@ -59,9 +60,19 @@ public final class CustomTimingsHandler { - timing = Timings.NULL_HANDLER; - } - handler = timing; -+ */ // Thunderbolt - Remove remaining timings implementations +- new AuthorNagException("Deprecated use of CustomTimingsHandler. Please Switch to Timings.of ASAP").printStackTrace(); +- try { +- final Method ofSafe = TimingsManager.class.getDeclaredMethod("getHandler", String.class, String.class, Timing.class); +- ofSafe.setAccessible(true); +- timing = (Timing) ofSafe.invoke(null,"Minecraft", "(Deprecated API) " + name, null); +- } catch (Exception e) { +- e.printStackTrace(); +- Bukkit.getLogger().log(Level.SEVERE, "This handler could not be registered"); +- timing = Timings.NULL_HANDLER; +- } +- handler = timing; ++ @Deprecated(forRemoval = true) ++ @DoNotUse ++ public void startTiming() { ++ throw new org.plazmamc.plazma.DeprecationException("Timings are deprecated and removed. Use Spark instead."); } - public void startTiming() { /*handler.startTiming();*/ } // Purpur - public void stopTiming() { /*handler.stopTiming();*/ } // Purpur -+ // Thunderbolt start - Remove remaining timings implementations -+ public void startTiming() { -+ /*handler.startTiming();*/ // Purpur -+ throw new org.plazmamc.thunderbolt.DeprecatedException("Timings is deprecated and will be removed in the future. Use Spark instead."); // Thunderbolt - Remove remaining timings implementations -+ } -+ ++ @Deprecated(forRemoval = true) ++ @DoNotUse + public void stopTiming() { -+ /*handler.stopTiming();*/ // Purpur -+ throw new org.plazmamc.thunderbolt.DeprecatedException("Timings is deprecated and will be removed in the future. Use Spark instead."); // Thunderbolt - Remove remaining timings implementations ++ throw new org.plazmamc.plazma.DeprecationException("Timings are deprecated and removed. Use Spark instead."); + } -+ // Thunderbolt end - Remove remaining timings implementations } ++// Plazma end - Completely remove timings implementation diff --git a/patches/server/0038-Completely-remove-timings-implementation.patch b/patches/server/0038-Completely-remove-timings-implementation.patch new file mode 100644 index 000000000..d8d8ea6a1 --- /dev/null +++ b/patches/server/0038-Completely-remove-timings-implementation.patch @@ -0,0 +1,62 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: AlphaKR93 +Date: Wed, 15 May 2024 14:12:50 +0900 +Subject: [PATCH] Completely remove timings implementation + + +diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java +index 23594fb7eb4b2f33146592866608c2858ef23937..8acdea0f086129854cb44bc5ce8bbbc4e810b9ad 100644 +--- a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java ++++ b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java +@@ -1,6 +1,6 @@ + package io.papermc.paper.plugin.manager; + +-import co.aikar.timings.TimedEventExecutor; ++//import co.aikar.timings.TimedEventExecutor; // Plazma - Completely remove timings implementation + import com.destroystokyo.paper.event.server.ServerExceptionEvent; + import com.destroystokyo.paper.exception.ServerEventException; + import com.google.common.collect.Sets; +@@ -96,7 +96,7 @@ class PaperEventManager { + throw new IllegalPluginAccessException("Plugin attempted to register " + event + " while not enabled"); + } + +- executor = new TimedEventExecutor(executor, plugin, null, event); ++ //executor = new TimedEventExecutor(executor, plugin, null, event); // Plazma - Completely remove timings implementation + this.getEventListeners(event).register(new RegisteredListener(listener, executor, priority, plugin, ignoreCancelled)); + } + +@@ -183,7 +183,7 @@ class PaperEventManager { + } + } + +- EventExecutor executor = new TimedEventExecutor(EventExecutor.create(method, eventClass), plugin, method, eventClass); ++ EventExecutor executor = EventExecutor.create(method, eventClass); // Plazma - Completely remove timings implementation + eventSet.add(new RegisteredListener(listener, executor, eh.priority(), plugin, eh.ignoreCancelled())); + } + return ret; +diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperPluginManagerImpl.java b/src/main/java/io/papermc/paper/plugin/manager/PaperPluginManagerImpl.java +index 097500a59336db1bbfffcd1aa4cff7a8586e46ec..844e340c331c6dd12eaaac247f871b042ceb6c25 100644 +--- a/src/main/java/io/papermc/paper/plugin/manager/PaperPluginManagerImpl.java ++++ b/src/main/java/io/papermc/paper/plugin/manager/PaperPluginManagerImpl.java +@@ -232,7 +232,7 @@ public class PaperPluginManagerImpl implements PluginManager, DependencyContext + + @Override + public boolean useTimings() { +- return co.aikar.timings.Timings.isTimingsEnabled(); ++ return false; // Thunderbolt - Remove remaining timings implementations + } + + @Override +diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java +index 5cd9b92bccf8446df2a9341a006e2e6bbcba7257..2ccf6415ec36a998904df6d5c4cae435b3e948e7 100644 +--- a/src/main/java/net/minecraft/server/MinecraftServer.java ++++ b/src/main/java/net/minecraft/server/MinecraftServer.java +@@ -3,7 +3,7 @@ package net.minecraft.server; + import com.google.common.base.Preconditions; + import com.google.common.base.Splitter; + import com.google.common.collect.ImmutableList; +-import co.aikar.timings.Timings; ++//import co.aikar.timings.Timings; // Plazma - Completely remove timings implementation + import com.destroystokyo.paper.event.server.PaperServerListPingEvent; + import com.google.common.base.Stopwatch; + import com.google.common.collect.Lists; diff --git a/patches/unapplied/server/0015-Completely-remove-Mojang-Profiler.patch b/patches/server/0039-Remove-Mojang-Profiler-codes.patch similarity index 51% rename from patches/unapplied/server/0015-Completely-remove-Mojang-Profiler.patch rename to patches/server/0039-Remove-Mojang-Profiler-codes.patch index c8e7cb60f..8a91ebce1 100644 --- a/patches/unapplied/server/0015-Completely-remove-Mojang-Profiler.patch +++ b/patches/server/0039-Remove-Mojang-Profiler-codes.patch @@ -1,585 +1,14 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: AlphaKR93 Date: Wed, 27 Sep 2023 17:52:52 +0900 -Subject: [PATCH] Completely remove Mojang Profiler +Subject: [PATCH] Remove Mojang Profiler codes -diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java -index f3aad0d2411fcdde2845720e7d66a57a33b22742..17608cfa1e742761928e70c64f36a6bfeb77f104 100644 ---- a/src/main/java/net/minecraft/commands/Commands.java -+++ b/src/main/java/net/minecraft/commands/Commands.java -@@ -448,7 +448,7 @@ public class Commands { - int j = minecraftserver.getGameRules().getInt(GameRules.RULE_MAX_COMMAND_FORK_COUNT); - - try { -- ExecutionContext executioncontext1 = new ExecutionContext<>(i, j, minecraftserver.getProfiler()); -+ ExecutionContext executioncontext1 = new ExecutionContext<>(i, j/*, minecraftserver.getProfiler()*/); // Plazma - Completely remove Mojang's Profiler - - try { - Commands.CURRENT_EXECUTION_CONTEXT.set(executioncontext1); -diff --git a/src/main/java/net/minecraft/commands/execution/ExecutionContext.java b/src/main/java/net/minecraft/commands/execution/ExecutionContext.java -index f626a2f28f2aebb3237cebb6afef3c4fa1a6cb37..467e17bfce31d0919d603698c9d88a04b05033dc 100644 ---- a/src/main/java/net/minecraft/commands/execution/ExecutionContext.java -+++ b/src/main/java/net/minecraft/commands/execution/ExecutionContext.java -@@ -12,7 +12,7 @@ import net.minecraft.commands.ExecutionCommandSource; - import net.minecraft.commands.execution.tasks.BuildContexts; - import net.minecraft.commands.execution.tasks.CallFunction; - import net.minecraft.commands.functions.InstantiatedFunction; --import net.minecraft.util.profiling.ProfilerFiller; -+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler - import org.slf4j.Logger; - - public class ExecutionContext implements AutoCloseable { -@@ -20,7 +20,7 @@ public class ExecutionContext implements AutoCloseable { - private static final Logger LOGGER = LogUtils.getLogger(); - private final int commandLimit; - private final int forkLimit; -- private final ProfilerFiller profiler; -+ //private final ProfilerFiller profiler; // Plazma - Completely remove Mojang's Profiler - @Nullable - private TraceCallbacks tracer; - private int commandQuota; -@@ -29,10 +29,10 @@ public class ExecutionContext implements AutoCloseable { - private final List> newTopCommands = new ObjectArrayList<>(); - private int currentFrameDepth; - -- public ExecutionContext(int maxCommandChainLength, int maxCommandForkCount, ProfilerFiller profiler) { -+ public ExecutionContext(int maxCommandChainLength, int maxCommandForkCount/*, ProfilerFiller profiler*/) { // Plazma - Completely remove Mojang's Profiler - this.commandLimit = maxCommandChainLength; - this.forkLimit = maxCommandForkCount; -- this.profiler = profiler; -+ //this.profiler = profiler; // Plazma - Completely remove Mojang's Profiler - this.commandQuota = maxCommandChainLength; - } - -@@ -129,9 +129,11 @@ public class ExecutionContext implements AutoCloseable { - return this.tracer; - } - -+ /* // Plazma - Completely remove Mojang's Profiler - public ProfilerFiller profiler() { - return this.profiler; - } -+ */ // Plazma - Completely remove Mojang's Profiler - - public int forkLimit() { - return this.forkLimit; -diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 2452dae1e55165bd8c49c4670e3f2adb523de5da..703e3720cf28c669000b663cba56b070ac4ed96a 100644 ---- a/src/main/java/net/minecraft/server/MinecraftServer.java -+++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -103,18 +103,18 @@ import net.minecraft.util.datafix.DataFixers; - import net.minecraft.util.debugchart.RemoteDebugSampleType; - import net.minecraft.util.debugchart.SampleLogger; - import net.minecraft.util.debugchart.TpsDebugDimensions; --import net.minecraft.util.profiling.EmptyProfileResults; --import net.minecraft.util.profiling.ProfileResults; --import net.minecraft.util.profiling.ProfilerFiller; --import net.minecraft.util.profiling.ResultField; --import net.minecraft.util.profiling.SingleTickProfiler; -+// import net.minecraft.util.profiling.EmptyProfileResults; // Plazma - Completely remove Mojang's Profiler -+// import net.minecraft.util.profiling.ProfileResults; // Plazma - Completely remove Mojang's Profiler -+// import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler -+// import net.minecraft.util.profiling.ResultField; // Plazma - Completely remove Mojang's Profiler -+// import net.minecraft.util.profiling.SingleTickProfiler; // Plazma - Completely remove Mojang's Profiler - import net.minecraft.util.profiling.jfr.JvmProfiler; - import net.minecraft.util.profiling.jfr.callback.ProfiledDuration; --import net.minecraft.util.profiling.metrics.profiling.ActiveMetricsRecorder; --import net.minecraft.util.profiling.metrics.profiling.InactiveMetricsRecorder; --import net.minecraft.util.profiling.metrics.profiling.MetricsRecorder; --import net.minecraft.util.profiling.metrics.profiling.ServerMetricsSamplersProvider; --import net.minecraft.util.profiling.metrics.storage.MetricsPersister; -+// import net.minecraft.util.profiling.metrics.profiling.ActiveMetricsRecorder; // Plazma - Completely remove Mojang's Profiler -+// import net.minecraft.util.profiling.metrics.profiling.InactiveMetricsRecorder; // Plazma - Completely remove Mojang's Profiler -+// import net.minecraft.util.profiling.metrics.profiling.MetricsRecorder; // Plazma - Completely remove Mojang's Profiler -+// import net.minecraft.util.profiling.metrics.profiling.ServerMetricsSamplersProvider; // Plazma - Completely remove Mojang's Profiler -+// import net.minecraft.util.profiling.metrics.storage.MetricsPersister; // Plazma - Completely remove Mojang's Profiler - import net.minecraft.util.thread.ReentrantBlockableEventLoop; - import net.minecraft.world.Difficulty; - import net.minecraft.world.RandomSequences; -@@ -217,14 +217,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop tickables = Lists.newArrayList(); -- private MetricsRecorder metricsRecorder; -- private ProfilerFiller profiler; -- private Consumer onMetricsRecordingStopped; -- private Consumer onMetricsRecordingFinished; -- private boolean willStartRecordingMetrics; -- @Nullable -- private MinecraftServer.TimeProfiler debugCommandProfiler; -- private boolean debugCommandProfilerDelayStart; -+ // private MetricsRecorder metricsRecorder; // Plazma - Completely remove Mojang's Profiler -+ // private ProfilerFiller profiler; // Plazma - Completely remove Mojang's Profiler -+ // private Consumer onMetricsRecordingStopped; // Plazma - Completely remove Mojang's Profiler -+ // private Consumer onMetricsRecordingFinished; // Plazma - Completely remove Mojang's Profiler -+ // private boolean willStartRecordingMetrics; // Plazma - Completely remove Mojang's Profiler -+ // @Nullable // Plazma - Completely remove Mojang's Profiler -+ // private MinecraftServer.TimeProfiler debugCommandProfiler // Plazma - Completely remove Mojang's Profiler; -+ // private boolean debugCommandProfilerDelayStart; // Plazma - Completely remove Mojang's Profiler - private ServerConnectionListener connection; - public final ChunkProgressListenerFactory progressListenerFactory; - @Nullable -@@ -2601,10 +2601,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { -@@ -2874,12 +2877,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop resultConsumer, Consumer dumpConsumer) { -- /*this.onMetricsRecordingStopped = (methodprofilerresults) -> { // Purpur -+ this.onMetricsRecordingStopped = (methodprofilerresults) -> { // Purpur // Plazma - Parsing problem - this.stopRecordingMetrics(); - resultConsumer.accept(methodprofilerresults); - }; - this.onMetricsRecordingFinished = dumpConsumer; -- this.willStartRecordingMetrics = true;*/ // Purpur -+ this.willStartRecordingMetrics = true; // Purpur // Plazma - Parsing problem - } - - public void stopRecordingMetrics() { -@@ -2894,6 +2897,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop prepared, ResourceManager manager, ProfilerFiller profiler) { -+ protected void apply(Map prepared, ResourceManager manager/*, ProfilerFiller profiler*/) { // Plazma - Completely remove Mojang's Profiler - RegistryOps registryops = this.registries.createSerializationContext(JsonOps.INSTANCE); - Builder builder = ImmutableMap.builder(); - -diff --git a/src/main/java/net/minecraft/server/ServerFunctionLibrary.java b/src/main/java/net/minecraft/server/ServerFunctionLibrary.java -index bae0d208b31aa0a6977c30f2f8484ab3c316bc71..05d8ca83abf69226aae43ec6f75055726de06e8a 100644 ---- a/src/main/java/net/minecraft/server/ServerFunctionLibrary.java -+++ b/src/main/java/net/minecraft/server/ServerFunctionLibrary.java -@@ -26,7 +26,7 @@ import net.minecraft.server.packs.resources.PreparableReloadListener; - import net.minecraft.server.packs.resources.Resource; - import net.minecraft.server.packs.resources.ResourceManager; - import net.minecraft.tags.TagLoader; --import net.minecraft.util.profiling.ProfilerFiller; -+// import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler - import net.minecraft.world.phys.Vec2; - import net.minecraft.world.phys.Vec3; - import org.slf4j.Logger; -@@ -65,8 +65,8 @@ public class ServerFunctionLibrary implements PreparableReloadListener { - public CompletableFuture reload( - PreparableReloadListener.PreparationBarrier synchronizer, - ResourceManager manager, -- ProfilerFiller prepareProfiler, -- ProfilerFiller applyProfiler, -+ // ProfilerFiller prepareProfiler, // Plazma - Completely remove Mojang's Profiler -+ // ProfilerFiller applyProfiler, // Plazma - Completely remove Mojang's Profiler - Executor prepareExecutor, - Executor applyExecutor - ) { -diff --git a/src/main/java/net/minecraft/server/ServerFunctionManager.java b/src/main/java/net/minecraft/server/ServerFunctionManager.java -index 7aa1b3705ff548023f8b040678e4008cca3b8514..771a4ad40114961f3340a9100d136d4b3a567c4e 100644 ---- a/src/main/java/net/minecraft/server/ServerFunctionManager.java -+++ b/src/main/java/net/minecraft/server/ServerFunctionManager.java -@@ -16,7 +16,7 @@ import net.minecraft.commands.functions.CommandFunction; - import net.minecraft.commands.functions.InstantiatedFunction; - import net.minecraft.nbt.CompoundTag; - import net.minecraft.resources.ResourceLocation; --import net.minecraft.util.profiling.ProfilerFiller; -+// import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler - import org.slf4j.Logger; - - public class ServerFunctionManager { -diff --git a/src/main/java/net/minecraft/server/commands/PerfCommand.java b/src/main/java/net/minecraft/server/commands/PerfCommand.java -index 8c587f829c5e8c6b6df3150024c4ae704988c47b..319f484b535143a94ee2da11114acacce5d12ccf 100644 ---- a/src/main/java/net/minecraft/server/commands/PerfCommand.java -+++ b/src/main/java/net/minecraft/server/commands/PerfCommand.java -@@ -1,36 +1,39 @@ - package net.minecraft.server.commands; - -+// Plazma start - Completely remove Mojang's Profiler - import com.mojang.brigadier.CommandDispatcher; - import com.mojang.brigadier.exceptions.CommandSyntaxException; --import com.mojang.brigadier.exceptions.SimpleCommandExceptionType; --import com.mojang.logging.LogUtils; --import java.io.IOException; --import java.nio.file.Path; --import java.nio.file.Paths; --import java.util.Locale; --import java.util.function.Consumer; --import net.minecraft.FileUtil; --import net.minecraft.SharedConstants; --import net.minecraft.SystemReport; --import net.minecraft.Util; -+// import com.mojang.brigadier.exceptions.SimpleCommandExceptionType; -+// import com.mojang.logging.LogUtils; -+// import java.io.IOException; -+// import java.nio.file.Path; -+// import java.nio.file.Paths; -+// import java.util.Locale; -+// import java.util.function.Consumer; -+// import net.minecraft.FileUtil; -+// import net.minecraft.SharedConstants; -+// import net.minecraft.SystemReport; -+// import net.minecraft.Util; - import net.minecraft.commands.CommandSourceStack; - import net.minecraft.commands.Commands; - import net.minecraft.network.chat.Component; --import net.minecraft.server.MinecraftServer; --import net.minecraft.util.FileZipper; --import net.minecraft.util.TimeUtil; --import net.minecraft.util.profiling.EmptyProfileResults; --import net.minecraft.util.profiling.ProfileResults; --import net.minecraft.util.profiling.metrics.storage.MetricsPersister; --import org.apache.commons.io.FileUtils; --import org.slf4j.Logger; -+// import net.minecraft.server.MinecraftServer; -+// import net.minecraft.util.FileZipper; -+// import net.minecraft.util.TimeUtil; -+// import net.minecraft.util.profiling.EmptyProfileResults; -+// import net.minecraft.util.profiling.ProfileResults; -+// import net.minecraft.util.profiling.metrics.storage.MetricsPersister; -+// import org.apache.commons.io.FileUtils; -+// import org.slf4j.Logger; - - public class PerfCommand { -+ /* - private static final Logger LOGGER = LogUtils.getLogger(); - private static final SimpleCommandExceptionType ERROR_NOT_RUNNING = new SimpleCommandExceptionType(Component.translatable("commands.perf.notRunning")); - private static final SimpleCommandExceptionType ERROR_ALREADY_RUNNING = new SimpleCommandExceptionType( - Component.translatable("commands.perf.alreadyRunning") - ); -+ */ - - public static void register(CommandDispatcher dispatcher) { - dispatcher.register( -@@ -42,6 +45,9 @@ public class PerfCommand { - } - - private static int startProfilingDedicatedServer(CommandSourceStack source) throws CommandSyntaxException { -+ source.sendFailure(Component.literal("Vanilla Profiler is removed due to Performance issues. Use Spark instead.")); -+ return 1; -+ /* - MinecraftServer minecraftServer = source.getServer(); - if (minecraftServer.isRecordingMetrics()) { - throw ERROR_ALREADY_RUNNING.create(); -@@ -52,9 +58,13 @@ public class PerfCommand { - source.sendSuccess(() -> Component.translatable("commands.perf.started"), false); - return 0; - } -+ */ - } - - private static int stopProfilingDedicatedServer(CommandSourceStack source) throws CommandSyntaxException { -+ source.sendFailure(Component.literal("Vanilla Profiler is removed due to Performance issues. Use Spark instead.")); -+ return 1; -+ /* - MinecraftServer minecraftServer = source.getServer(); - if (!minecraftServer.isRecordingMetrics()) { - throw ERROR_NOT_RUNNING.create(); -@@ -62,8 +72,10 @@ public class PerfCommand { - minecraftServer.finishRecordingMetrics(); - return 0; - } -+ */ - } - -+ /* - private static void saveResults(CommandSourceStack source, Path tempProfilingDirectory, MinecraftServer server) { - String string = String.format( - Locale.ROOT, "%s-%s-%s", Util.getFilenameFormattedDateTime(), server.getWorldData().getLevelName(), SharedConstants.getCurrentVersion().getId() -@@ -104,4 +116,6 @@ public class PerfCommand { - ); - } - } -+ */ - } -+// Plazma end - Completely remove Mojang's Profiler -diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index c48f42815314e2fb106b0dff5f38a9e5c3498632..95105a7ffaa71f8eaa00c617fc112872aa2e2e78 100644 ---- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -926,11 +926,13 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface - return this.settings.getProperties().serverResourcePackInfo; - } - -+ /* // Plazma - Completely remove Mojang's Profiler - @Override - public void endMetricsRecordingTick() { - super.endMetricsRecordingTick(); - this.debugSampleSubscriptionTracker.tick(this.getTickCount()); - } -+ */ // Plazma - Completely remove Mojang's Profiler - - @Override - public SampleLogger getTickTimeLogger() { -diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index dd1a38488802080f961f87b73dfbb8229fb69e99..3ac70c2a2115e7ac97c739293ff540caf6ebb120 100644 ---- a/src/main/java/net/minecraft/server/level/ChunkMap.java -+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -68,7 +68,7 @@ import net.minecraft.server.level.progress.ChunkProgressListener; - import net.minecraft.server.network.ServerPlayerConnection; - import net.minecraft.util.CsvOutput; - import net.minecraft.util.Mth; --import net.minecraft.util.profiling.ProfilerFiller; -+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler - import net.minecraft.util.thread.BlockableEventLoop; - import net.minecraft.util.thread.ProcessorHandle; - import net.minecraft.util.thread.ProcessorMailbox; -diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index 697cb18bce2f2470a0a2347ba6709e1449b360fd..48d9af88c16f97f68c01e6d663189afbf7f1df29 100644 ---- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java -+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -@@ -21,7 +21,7 @@ import net.minecraft.core.SectionPos; - import net.minecraft.network.protocol.Packet; - import net.minecraft.server.level.progress.ChunkProgressListener; - import net.minecraft.util.VisibleForDebug; --import net.minecraft.util.profiling.ProfilerFiller; -+// import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler - import net.minecraft.util.thread.BlockableEventLoop; - import net.minecraft.world.entity.Entity; - import net.minecraft.world.entity.ai.village.poi.PoiManager; -diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index e2de0c343098d65d830f27b4f80c3f8a9f18a7ae..508e01e9ef41f006e6d9be71969c0d82dc646628 100644 ---- a/src/main/java/net/minecraft/server/level/ServerLevel.java -+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -79,7 +79,7 @@ import net.minecraft.util.ProgressListener; - import net.minecraft.util.RandomSource; - import net.minecraft.util.Unit; - import net.minecraft.util.datafix.DataFixTypes; --import net.minecraft.util.profiling.ProfilerFiller; -+// import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler - import net.minecraft.util.valueproviders.IntProvider; - import net.minecraft.util.valueproviders.UniformInt; - import net.minecraft.world.DifficultyInstance; -@@ -712,7 +712,7 @@ public class ServerLevel extends Level implements WorldGenLevel { - resourcekey, - minecraftserver.registryAccess(), - worlddimension.type(), -- minecraftserver::getProfiler, -+ // minecraftserver::getProfiler, // Plazma - Completely remove Mojang's Profiler - false, - flag, - i, -diff --git a/src/main/java/net/minecraft/server/packs/resources/PreparableReloadListener.java b/src/main/java/net/minecraft/server/packs/resources/PreparableReloadListener.java -index 60d33ac7ab7b610e9d5104ac9c7029ba4fc26cdf..097d7101c802070f554345057bf34dcb6f504cf3 100644 ---- a/src/main/java/net/minecraft/server/packs/resources/PreparableReloadListener.java -+++ b/src/main/java/net/minecraft/server/packs/resources/PreparableReloadListener.java -@@ -2,14 +2,14 @@ package net.minecraft.server.packs.resources; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.Executor; --import net.minecraft.util.profiling.ProfilerFiller; -+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler - - public interface PreparableReloadListener { - CompletableFuture reload( - PreparableReloadListener.PreparationBarrier synchronizer, - ResourceManager manager, -- ProfilerFiller prepareProfiler, -- ProfilerFiller applyProfiler, -+ //ProfilerFiller prepareProfiler, // Plazma - Completely remove Mojang's Profiler -+ //ProfilerFiller applyProfiler, // Plazma - Completely remove Mojang's Profiler - Executor prepareExecutor, - Executor applyExecutor - ); -diff --git a/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java b/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java -index 0c25f3ed0a8a538edc7cadd3476100c9b3631f7a..ea73502f9e2ac9422031ebc24bf94aaae34e6ba2 100644 ---- a/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java -+++ b/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java -@@ -3,15 +3,15 @@ package net.minecraft.server.packs.resources; - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.Executor; - import net.minecraft.util.Unit; --import net.minecraft.util.profiling.ProfilerFiller; -+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler - - public interface ResourceManagerReloadListener extends PreparableReloadListener { - @Override - default CompletableFuture reload( - PreparableReloadListener.PreparationBarrier synchronizer, - ResourceManager manager, -- ProfilerFiller prepareProfiler, -- ProfilerFiller applyProfiler, -+ //ProfilerFiller prepareProfiler, // Plazma - Completely remove Mojang's Profiler -+ //ProfilerFiller applyProfiler, // Plazma - Completely remove Mojang's Profiler - Executor prepareExecutor, - Executor applyExecutor - ) { -diff --git a/src/main/java/net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener.java b/src/main/java/net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener.java -index 8246e06392c06f70309c1876561bd00b59ba589f..0df1be595c6784f06eab328f6b7f6f62a5e056ec 100644 ---- a/src/main/java/net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener.java -+++ b/src/main/java/net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener.java -@@ -12,7 +12,7 @@ import java.util.Map.Entry; - import net.minecraft.resources.FileToIdConverter; - import net.minecraft.resources.ResourceLocation; - import net.minecraft.util.GsonHelper; --import net.minecraft.util.profiling.ProfilerFiller; -+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler - import org.slf4j.Logger; - - public abstract class SimpleJsonResourceReloadListener extends SimplePreparableReloadListener> { -@@ -26,7 +26,7 @@ public abstract class SimpleJsonResourceReloadListener extends SimplePreparableR - } - - @Override -- protected Map prepare(ResourceManager resourceManager, ProfilerFiller profilerFiller) { -+ protected Map prepare(ResourceManager resourceManager/*, ProfilerFiller profilerFiller*/) { // Plazma - Completely remove Mojang's Profiler - Map map = new HashMap<>(); - scanDirectory(resourceManager, this.directory, this.gson, map); - return map; -diff --git a/src/main/java/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java b/src/main/java/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java -index 298e3eddd600f0b2e48ce2d4080cf68adff59a3a..2bd55b0353b6db1e2d1ae7d7e0890c352283dc7f 100644 ---- a/src/main/java/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java -+++ b/src/main/java/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java -@@ -2,24 +2,24 @@ package net.minecraft.server.packs.resources; - - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.Executor; --import net.minecraft.util.profiling.ProfilerFiller; -+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler - - public abstract class SimplePreparableReloadListener implements PreparableReloadListener { - @Override - public final CompletableFuture reload( - PreparableReloadListener.PreparationBarrier synchronizer, - ResourceManager manager, -- ProfilerFiller prepareProfiler, -- ProfilerFiller applyProfiler, -+ //ProfilerFiller prepareProfiler, // Plazma - Completely remove Mojang's Profiler -+ //ProfilerFiller applyProfiler, // Plazma - Completely remove Mojang's Profiler - Executor prepareExecutor, - Executor applyExecutor - ) { -- return CompletableFuture.supplyAsync(() -> this.prepare(manager, prepareProfiler), prepareExecutor) -+ return CompletableFuture.supplyAsync(() -> this.prepare(manager/*, prepareProfiler*/), prepareExecutor) // Plazma - Completely remove Mojang's Profiler - .thenCompose(synchronizer::wait) -- .thenAcceptAsync(prepared -> this.apply((T)prepared, manager, applyProfiler), applyExecutor); -+ .thenAcceptAsync(prepared -> this.apply((T)prepared, manager/*, applyProfiler*/), applyExecutor); // Plazma - Completely remove Mojang's Profiler - } - -- protected abstract T prepare(ResourceManager manager, ProfilerFiller profiler); -+ protected abstract T prepare(ResourceManager manager/*, ProfilerFiller profiler*/); // Plazma - Completely remove Mojang's Profiler - -- protected abstract void apply(T prepared, ResourceManager manager, ProfilerFiller profiler); -+ protected abstract void apply(T prepared, ResourceManager manager/*, ProfilerFiller profiler*/); // Plazma - Completely remove Mojang's Profiler - } -diff --git a/src/main/java/net/minecraft/server/packs/resources/SimpleReloadInstance.java b/src/main/java/net/minecraft/server/packs/resources/SimpleReloadInstance.java -index 5a8ed7c2a0217366c0d7e6341006037c114f8097..8f3990ca74d00d8566255687a778b4ed749bbde0 100644 ---- a/src/main/java/net/minecraft/server/packs/resources/SimpleReloadInstance.java -+++ b/src/main/java/net/minecraft/server/packs/resources/SimpleReloadInstance.java -@@ -10,7 +10,7 @@ import java.util.concurrent.Executor; - import java.util.concurrent.atomic.AtomicInteger; - import net.minecraft.Util; - import net.minecraft.util.Unit; --import net.minecraft.util.profiling.InactiveProfiler; -+//import net.minecraft.util.profiling.InactiveProfiler; // Plazma - Completely remove Mojang's Profiler - - public class SimpleReloadInstance implements ReloadInstance { - private static final int PREPARATION_PROGRESS_WEIGHT = 2; -@@ -38,7 +38,7 @@ public class SimpleReloadInstance implements ReloadInstance { - manager, - reloaders, - (synchronizer, resourceManager, reloader, prepare, apply) -> reloader.reload( -- synchronizer, resourceManager, InactiveProfiler.INSTANCE, InactiveProfiler.INSTANCE, prepareExecutor, apply -+ synchronizer, resourceManager, /*InactiveProfiler.INSTANCE, InactiveProfiler.INSTANCE,*/ prepareExecutor, apply - ), - initialStage - ); -diff --git a/src/main/java/net/minecraft/tags/TagManager.java b/src/main/java/net/minecraft/tags/TagManager.java -index cd178d9a30263a3fc68d2b997974a1f9a0c8bab5..f81cd35f9babe7906d3738aa135ac88d78cdfdab 100644 ---- a/src/main/java/net/minecraft/tags/TagManager.java -+++ b/src/main/java/net/minecraft/tags/TagManager.java -@@ -14,7 +14,7 @@ import net.minecraft.resources.ResourceKey; - import net.minecraft.resources.ResourceLocation; - import net.minecraft.server.packs.resources.PreparableReloadListener; - import net.minecraft.server.packs.resources.ResourceManager; --import net.minecraft.util.profiling.ProfilerFiller; -+// import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler - - public class TagManager implements PreparableReloadListener { - private static final Map>, String> CUSTOM_REGISTRY_DIRECTORIES = Map.of( -@@ -49,8 +49,8 @@ public class TagManager implements PreparableReloadListener { - public CompletableFuture reload( - PreparableReloadListener.PreparationBarrier synchronizer, - ResourceManager manager, -- ProfilerFiller prepareProfiler, -- ProfilerFiller applyProfiler, -+ // ProfilerFiller prepareProfiler, // Plazma - Completely remove Mojang's Profiler -+ // ProfilerFiller applyProfiler, // Plazma - Completely remove Mojang's Profiler - Executor prepareExecutor, - Executor applyExecutor - ) { diff --git a/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java b/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java -index 600a7036b503f60cc9c95f189f73c2dbf020e2e1..0766e7874a16401e8715c94b26d7dbb92f55064b 100644 +index 600a7036b503f60cc9c95f189f73c2dbf020e2e1..aacfd9b8d71a47a75eefa3a0f87636e58a5b6370 100644 --- a/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java +++ b/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java -@@ -1,206 +1,4 @@ +@@ -1,206 +1,3 @@ package net.minecraft.util.profiling; -import com.google.common.collect.Lists; @@ -786,13 +215,12 @@ index 600a7036b503f60cc9c95f189f73c2dbf020e2e1..0766e7874a16401e8715c94b26d7dbb9 - } - } -} -+@Deprecated(forRemoval = true) // Plazma - Completely remove Mojang's Profiler -+interface ActiveProfiler {} // Plazma - Completely remove Mojang's Profiler ++@Deprecated(forRemoval = true) interface ActiveProfiler {} // Plazma - Completely remove Mojang's Profiler diff --git a/src/main/java/net/minecraft/util/profiling/ContinuousProfiler.java b/src/main/java/net/minecraft/util/profiling/ContinuousProfiler.java -index 4424bca7effa4fef26453afcd06d86e6a30d7b8f..8d266c417cb77557548dc1c167d60017bc2d80ea 100644 +index 4424bca7effa4fef26453afcd06d86e6a30d7b8f..ed0329b8ab3272048a2c1d459a3c091ca32f7d42 100644 --- a/src/main/java/net/minecraft/util/profiling/ContinuousProfiler.java +++ b/src/main/java/net/minecraft/util/profiling/ContinuousProfiler.java -@@ -1,35 +1,4 @@ +@@ -1,35 +1,3 @@ package net.minecraft.util.profiling; -import java.util.function.IntSupplier; @@ -828,13 +256,12 @@ index 4424bca7effa4fef26453afcd06d86e6a30d7b8f..8d266c417cb77557548dc1c167d60017 - return this.profiler.getResults(); - } -} -+@Deprecated(forRemoval = true) // Plazma - Completely remove Mojang's Profiler -+interface ContinuousProfiler {} // Plazma - Completely remove Mojang's Profiler ++@Deprecated(forRemoval = true) interface ContinuousProfiler {} // Plazma - Completely remove Mojang's Profiler diff --git a/src/main/java/net/minecraft/util/profiling/EmptyProfileResults.java b/src/main/java/net/minecraft/util/profiling/EmptyProfileResults.java -index 843e28baf089349851d7794c496e518ca396e92d..de7a4de6bb2eb5f34076e9fc9f6bb8479bc5f500 100644 +index 843e28baf089349851d7794c496e518ca396e92d..5900697867a589d272b1c00be75cfd9a838098b1 100644 --- a/src/main/java/net/minecraft/util/profiling/EmptyProfileResults.java +++ b/src/main/java/net/minecraft/util/profiling/EmptyProfileResults.java -@@ -1,47 +1,4 @@ +@@ -1,47 +1,3 @@ package net.minecraft.util.profiling; -import java.nio.file.Path; @@ -882,13 +309,12 @@ index 843e28baf089349851d7794c496e518ca396e92d..de7a4de6bb2eb5f34076e9fc9f6bb847 - return ""; - } -} -+@Deprecated(forRemoval = true) // Plazma - Completely remove Mojang's Profiler -+interface EmptyProfileResults {} // Plazma - Completely remove Mojang's Profiler ++@Deprecated(forRemoval = true) interface EmptyProfileResults {} // Plazma - Completely remove Mojang's Profiler diff --git a/src/main/java/net/minecraft/util/profiling/FilledProfileResults.java b/src/main/java/net/minecraft/util/profiling/FilledProfileResults.java -index fc3a3a32e6432c284b29216989385f8b0993c315..600ba9b1730c2b6283379066435160b1a1cfe65a 100644 +index 81683f9f24263f663b9e51e429cd2c9e5acf2b1c..eb5dad1cb2e52557dbdee961b26aa97bc0bfbc20 100644 --- a/src/main/java/net/minecraft/util/profiling/FilledProfileResults.java +++ b/src/main/java/net/minecraft/util/profiling/FilledProfileResults.java -@@ -1,341 +1,4 @@ +@@ -1,312 +1,3 @@ package net.minecraft.util.profiling; -import com.google.common.base.Splitter; @@ -908,8 +334,8 @@ index fc3a3a32e6432c284b29216989385f8b0993c315..600ba9b1730c2b6283379066435160b1 -import java.util.Locale; -import java.util.Map; -import java.util.Map.Entry; +-import net.minecraft.ReportType; -import net.minecraft.SharedConstants; --import net.minecraft.Util; -import org.apache.commons.io.IOUtils; -import org.apache.commons.lang3.ObjectUtils; -import org.slf4j.Logger; @@ -1076,10 +502,7 @@ index fc3a3a32e6432c284b29216989385f8b0993c315..600ba9b1730c2b6283379066435160b1 - - protected String getProfilerResults(long timeSpan, int tickSpan) { - StringBuilder stringBuilder = new StringBuilder(); -- stringBuilder.append("---- Minecraft Profiler Results ----\n"); -- stringBuilder.append("// "); -- stringBuilder.append(getComment()); -- stringBuilder.append("\n\n"); +- ReportType.PROFILE.appendHeader(stringBuilder, List.of()); - stringBuilder.append("Version: ").append(SharedConstants.getCurrentVersion().getId()).append('\n'); - stringBuilder.append("Time span: ").append(timeSpan / 1000000L).append(" ms\n"); - stringBuilder.append("Tick span: ").append(tickSpan).append(" ticks\n"); @@ -1184,32 +607,6 @@ index fc3a3a32e6432c284b29216989385f8b0993c315..600ba9b1730c2b6283379066435160b1 - }); - } - -- private static String getComment() { -- String[] strings = new String[]{ -- "I'd Rather Be Surfing", -- "Shiny numbers!", -- "Am I not running fast enough? :(", -- "I'm working as hard as I can!", -- "Will I ever be good enough for you? :(", -- "Speedy. Zoooooom!", -- "Hello world", -- "40% better than a crash report.", -- "Now with extra numbers", -- "Now with less numbers", -- "Now with the same numbers", -- "You should add flames to things, it makes them go faster!", -- "Do you feel the need for... optimization?", -- "*cracks redstone whip*", -- "Maybe if you treated it better then it'll have more motivation to work faster! Poor server." -- }; -- -- try { -- return strings[(int)(Util.getNanos() % (long)strings.length)]; -- } catch (Throwable var2) { -- return "Witty comment unavailable :("; -- } -- } -- - @Override - public int getTickDuration() { - return this.tickDuration; @@ -1230,13 +627,12 @@ index fc3a3a32e6432c284b29216989385f8b0993c315..600ba9b1730c2b6283379066435160b1 - } - } -} -+@Deprecated(forRemoval = true) // Plazma - Completely remove Mojang's Profiler -+interface FilledProfileResults {} // Plazma - Completely remove Mojang's Profiler ++@Deprecated(forRemoval = true) interface FilledProfileResults {} // Plazma - Completely remove Mojang's Profiler diff --git a/src/main/java/net/minecraft/util/profiling/InactiveProfiler.java b/src/main/java/net/minecraft/util/profiling/InactiveProfiler.java -index 5d2d8018460c04f7314c872441a8b21bc296c1ea..33ef6f8fa11347ab69fbed5f3030b09744ac3822 100644 +index af326c4396d0af69208c5418c8329b163f7e3d73..9c8859f264f0a57d0c74a3870cd9f38595757b12 100644 --- a/src/main/java/net/minecraft/util/profiling/InactiveProfiler.java +++ b/src/main/java/net/minecraft/util/profiling/InactiveProfiler.java -@@ -1,71 +1,4 @@ +@@ -1,81 +1,3 @@ package net.minecraft.util.profiling; -import com.google.common.collect.ImmutableSet; @@ -1285,6 +681,16 @@ index 5d2d8018460c04f7314c872441a8b21bc296c1ea..33ef6f8fa11347ab69fbed5f3030b097 - } - - @Override +- public Zone zone(String name) { +- return Zone.INACTIVE; +- } +- +- @Override +- public Zone zone(Supplier nameSupplier) { +- return Zone.INACTIVE; +- } +- +- @Override - public void incrementCounter(String marker, int num) { - } - @@ -1308,13 +714,12 @@ index 5d2d8018460c04f7314c872441a8b21bc296c1ea..33ef6f8fa11347ab69fbed5f3030b097 - return ImmutableSet.of(); - } -} -+@Deprecated(forRemoval = true) // Plazma - Completely remove Mojang's Profiler -+interface InactiveProfiler {} // Plazma - Completely remove Mojang's Profiler ++@Deprecated(forRemoval = true) interface InactiveProfiler {} // Plazma - Completely remove Mojang's Profiler diff --git a/src/main/java/net/minecraft/util/profiling/ProfileCollector.java b/src/main/java/net/minecraft/util/profiling/ProfileCollector.java -index fe47a3ce6318ad74bd4d9b10dbf5ee06c94b6939..a82641d6dd2375f6e3eb322fc7f8360c676fb55a 100644 +index fe47a3ce6318ad74bd4d9b10dbf5ee06c94b6939..f8b0a1ce259ccee9e46a09ee0a114d210a4704ce 100644 --- a/src/main/java/net/minecraft/util/profiling/ProfileCollector.java +++ b/src/main/java/net/minecraft/util/profiling/ProfileCollector.java -@@ -1,15 +1,4 @@ +@@ -1,15 +1,3 @@ package net.minecraft.util.profiling; -import java.util.Set; @@ -1330,13 +735,12 @@ index fe47a3ce6318ad74bd4d9b10dbf5ee06c94b6939..a82641d6dd2375f6e3eb322fc7f8360c - - Set> getChartedPaths(); -} -+@Deprecated(forRemoval = true) // Plazma - Completely remove Mojang's Profiler -+interface ProfileCollector {} // Plazma - Completely remove Mojang's Profiler ++@Deprecated(forRemoval = true) interface ProfileCollector {} // Plazma - Completely remove Mojang's Profiler diff --git a/src/main/java/net/minecraft/util/profiling/ProfileResults.java b/src/main/java/net/minecraft/util/profiling/ProfileResults.java -index afefd549cf9792a91dd8919c12697a693200d042..22559c58e7692c6fafb8f6862a7bc02e223a50dc 100644 +index afefd549cf9792a91dd8919c12697a693200d042..313a37de769e74b949fa36ca516a32297622d918 100644 --- a/src/main/java/net/minecraft/util/profiling/ProfileResults.java +++ b/src/main/java/net/minecraft/util/profiling/ProfileResults.java -@@ -1,34 +1,4 @@ +@@ -1,34 +1,3 @@ package net.minecraft.util.profiling; -import java.nio.file.Path; @@ -1371,13 +775,76 @@ index afefd549cf9792a91dd8919c12697a693200d042..22559c58e7692c6fafb8f6862a7bc02e - return path.replace('\u001e', '.'); - } -} -+@Deprecated(forRemoval = true) // Plazma - Completely remove Mojang's Profiler -+interface ProfileResults {} // Plazma - Completely remove Mojang's Profiler ++@Deprecated interface ProfileResults {} // Plazma - Completely remove Mojang's Profiler +diff --git a/src/main/java/net/minecraft/util/profiling/Profiler.java b/src/main/java/net/minecraft/util/profiling/Profiler.java +index fe8a8ee1f88c58a9fe730c4c0cc5fc4e3651e9f8..09d2768bd51e0bd8917e870387fd187798c809bb 100644 +--- a/src/main/java/net/minecraft/util/profiling/Profiler.java ++++ b/src/main/java/net/minecraft/util/profiling/Profiler.java +@@ -1,58 +1,3 @@ + package net.minecraft.util.profiling; + +-import com.mojang.jtracy.TracyClient; +-import java.util.Objects; +-import java.util.concurrent.atomic.AtomicInteger; +- +-public final class Profiler { +- private static final ThreadLocal TRACY_FILLER = ThreadLocal.withInitial(TracyZoneFiller::new); +- private static final ThreadLocal ACTIVE = new ThreadLocal<>(); +- private static final AtomicInteger ACTIVE_COUNT = new AtomicInteger(); +- +- private Profiler() { +- } +- +- public static Profiler.Scope use(ProfilerFiller profiler) { +- startUsing(profiler); +- return Profiler::stopUsing; +- } +- +- private static void startUsing(ProfilerFiller profiler) { +- if (ACTIVE.get() != null) { +- throw new IllegalStateException("Profiler is already active"); +- } else { +- ProfilerFiller profilerFiller = decorateFiller(profiler); +- ACTIVE.set(profilerFiller); +- ACTIVE_COUNT.incrementAndGet(); +- profilerFiller.startTick(); +- } +- } +- +- private static void stopUsing() { +- ProfilerFiller profilerFiller = ACTIVE.get(); +- if (profilerFiller == null) { +- throw new IllegalStateException("Profiler was not active"); +- } else { +- ACTIVE.remove(); +- ACTIVE_COUNT.decrementAndGet(); +- profilerFiller.endTick(); +- } +- } +- +- private static ProfilerFiller decorateFiller(ProfilerFiller builtinProfiler) { +- return ProfilerFiller.combine(getDefaultFiller(), builtinProfiler); +- } +- +- public static ProfilerFiller get() { +- return ACTIVE_COUNT.get() == 0 ? getDefaultFiller() : Objects.requireNonNullElseGet(ACTIVE.get(), Profiler::getDefaultFiller); +- } +- +- private static ProfilerFiller getDefaultFiller() { +- return (ProfilerFiller)(TracyClient.isAvailable() ? TRACY_FILLER.get() : InactiveProfiler.INSTANCE); +- } +- +- public interface Scope extends AutoCloseable { +- @Override +- void close(); +- } +-} ++@Deprecated(forRemoval = true) interface Profiler {} // Plazma - Completely remove Mojang's Profiler diff --git a/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java b/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java -index 223c3665126c576eddb1a8f7c9f5bc60c6ff9818..87f2718c8a293e2836203dcc2be964669ce5b88c 100644 +index ce81d6bd87f688a24003f2fbf6d5010ad6273917..1bce6008d63c371c666db13633902e303142127f 100644 --- a/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java +++ b/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java -@@ -1,116 +1,4 @@ +@@ -1,168 +1,3 @@ package net.minecraft.util.profiling; -import java.util.function.Supplier; @@ -1408,6 +875,30 @@ index 223c3665126c576eddb1a8f7c9f5bc60c6ff9818..87f2718c8a293e2836203dcc2be96466 - void popPush(Supplier locationGetter); - - @io.papermc.paper.annotation.DoNotUse // Purpur +- default void addZoneText(String label) { +- } +- +- @io.papermc.paper.annotation.DoNotUse // Purpur +- default void addZoneValue(long value) { +- } +- +- @io.papermc.paper.annotation.DoNotUse // Purpur +- default void setZoneColor(int color) { +- } +- +- @io.papermc.paper.annotation.DoNotUse // Purpur +- default Zone zone(String name) { +- this.push(name); +- return new Zone(this); +- } +- +- @io.papermc.paper.annotation.DoNotUse // Purpur +- default Zone zone(Supplier nameSupplier) { +- this.push(nameSupplier); +- return new Zone(this); +- } +- +- @io.papermc.paper.annotation.DoNotUse // Purpur - void markForCharting(MetricCategory type); - - @io.papermc.paper.annotation.DoNotUse // Purpur @@ -1426,81 +917,108 @@ index 223c3665126c576eddb1a8f7c9f5bc60c6ff9818..87f2718c8a293e2836203dcc2be96466 - @io.papermc.paper.annotation.DoNotUse // Purpur - void incrementCounter(Supplier markerGetter, int num); - -- static ProfilerFiller tee(ProfilerFiller a, ProfilerFiller b) { -- if (a == InactiveProfiler.INSTANCE) { -- return b; +- static ProfilerFiller combine(ProfilerFiller first, ProfilerFiller second) { +- if (first == InactiveProfiler.INSTANCE) { +- return second; - } else { -- return b == InactiveProfiler.INSTANCE ? a : new ProfilerFiller() { -- @Override -- public void startTick() { -- //a.startTick(); // Purpur -- //b.startTick(); // Purpur -- } +- return (ProfilerFiller)(second == InactiveProfiler.INSTANCE ? first : new ProfilerFiller.CombinedProfileFiller(first, second)); +- } +- } - -- @Override -- public void endTick() { -- //a.endTick(); // Purpur -- //b.endTick(); // Purpur -- } +- public static class CombinedProfileFiller implements ProfilerFiller { +- private final ProfilerFiller first; +- private final ProfilerFiller second; - -- @Override -- public void push(String location) { -- //a.push(location); // Purpur -- //b.push(location); // Purpur -- } +- public CombinedProfileFiller(ProfilerFiller first, ProfilerFiller second) { +- this.first = first; +- this.second = second; +- } - -- @Override -- public void push(Supplier locationGetter) { -- //a.push(locationGetter); // Purpur -- //b.push(locationGetter); // Purpur -- } +- @Override +- public void startTick() { +- //this.first.startTick(); // Purpur +- //this.second.startTick(); // Purpur +- } - -- @Override -- public void markForCharting(MetricCategory type) { -- //a.markForCharting(type); // Purpur -- //b.markForCharting(type); // Purpur -- } +- @Override +- public void endTick() { +- //this.first.endTick(); // Purpur +- //this.second.endTick(); // Purpur +- } - -- @Override -- public void pop() { -- //a.pop(); // Purpur -- //b.pop(); // Purpur -- } +- @Override +- public void push(String location) { +- //this.first.push(location); // Purpur +- //this.second.push(location); // Purpur +- } - -- @Override -- public void popPush(String location) { -- //a.popPush(location); // Purpur -- //b.popPush(location); // Purpur -- } +- @Override +- public void push(Supplier locationGetter) { +- //this.first.push(locationGetter); // Purpur +- //this.second.push(locationGetter); // Purpur +- } - -- @Override -- public void popPush(Supplier locationGetter) { -- //a.popPush(locationGetter); // Purpur -- //b.popPush(locationGetter); // Purpur -- } +- @Override +- public void markForCharting(MetricCategory type) { +- //this.first.markForCharting(type); // Purpur +- //this.second.markForCharting(type); // Purpur +- } - -- @Override -- public void incrementCounter(String marker, int num) { -- //a.incrementCounter(marker, num); // Purpur -- //b.incrementCounter(marker, num); // Purpur -- } +- @Override +- public void pop() { +- //this.first.pop(); // Purpur +- //this.second.pop(); // Purpur +- } - -- @Override -- public void incrementCounter(Supplier markerGetter, int num) { -- //a.incrementCounter(markerGetter, num); // Purpur -- //b.incrementCounter(markerGetter, num); // Purpur -- } -- }; +- @Override +- public void popPush(String location) { +- //this.first.popPush(location); // Purpur +- //this.second.popPush(location); // Purpur +- } +- +- @Override +- public void popPush(Supplier locationGetter) { +- //this.first.popPush(locationGetter); // Purpur +- //this.second.popPush(locationGetter); // Purpur +- } +- +- @Override +- public void incrementCounter(String marker, int num) { +- //this.first.incrementCounter(marker, num); // Purpur +- //this.second.incrementCounter(marker, num); // Purpur +- } +- +- @Override +- public void incrementCounter(Supplier markerGetter, int num) { +- //this.first.incrementCounter(markerGetter, num); // Purpur +- //this.second.incrementCounter(markerGetter, num); // Purpur +- } +- +- @Override +- public void addZoneText(String label) { +- //this.first.addZoneText(label); // Purpur +- //this.second.addZoneText(label); // Purpur +- } +- +- @Override +- public void addZoneValue(long value) { +- //this.first.addZoneValue(value); // Purpur +- //this.second.addZoneValue(value); // Purpur +- } +- +- @Override +- public void setZoneColor(int color) { +- //this.first.setZoneColor(color); // Purpur +- //this.second.setZoneColor(color); // Purpur - } - } -} -+@Deprecated(forRemoval = true) // Plazma - Completely remove Mojang's Profiler -+interface ProfilerFiller {} // Plazma - Completely remove Mojang's Profiler ++@Deprecated(forRemoval = true) interface ProfilerFiller {} // Plazma - Completely remove Mojang's Profiler diff --git a/src/main/java/net/minecraft/util/profiling/ProfilerPathEntry.java b/src/main/java/net/minecraft/util/profiling/ProfilerPathEntry.java -index c073262f663309e6f73e67b303927b3996ea0c16..bf7c660d94bc7ad2e1a3695c60032010526fbb83 100644 +index c073262f663309e6f73e67b303927b3996ea0c16..01f2ea7461197c904038edd8920cfd4657539414 100644 --- a/src/main/java/net/minecraft/util/profiling/ProfilerPathEntry.java +++ b/src/main/java/net/minecraft/util/profiling/ProfilerPathEntry.java -@@ -1,13 +1,4 @@ +@@ -1,13 +1,3 @@ package net.minecraft.util.profiling; -import it.unimi.dsi.fastutil.objects.Object2LongMap; @@ -1514,13 +1032,12 @@ index c073262f663309e6f73e67b303927b3996ea0c16..bf7c660d94bc7ad2e1a3695c60032010 - - Object2LongMap getCounters(); -} -+@Deprecated(forRemoval = true) // Plazma - Completely remove Mojang's Profiler -+interface ProfilerPathEntry {} // Plazma - Completely remove Mojang's Profiler ++@Deprecated(forRemoval = true) interface ProfilerPathEntry {} // Plazma - Completely remove Mojang's Profiler diff --git a/src/main/java/net/minecraft/util/profiling/ResultField.java b/src/main/java/net/minecraft/util/profiling/ResultField.java -index 179dd48aeeacc0b2a42c99f6213dd23683159681..0ec107268ce6068f9cbbca151a79ea00b33d9aaf 100644 +index 179dd48aeeacc0b2a42c99f6213dd23683159681..06282475e1300e095a5ba47ca14066b98f29c79f 100644 --- a/src/main/java/net/minecraft/util/profiling/ResultField.java +++ b/src/main/java/net/minecraft/util/profiling/ResultField.java -@@ -1,28 +1,4 @@ +@@ -1,28 +1,3 @@ package net.minecraft.util.profiling; -public final class ResultField implements Comparable { @@ -1549,13 +1066,12 @@ index 179dd48aeeacc0b2a42c99f6213dd23683159681..0ec107268ce6068f9cbbca151a79ea00 - return (this.name.hashCode() & 11184810) + 4473924; - } -} -+@Deprecated(forRemoval = true) // Plazma - Completely remove Mojang's Profiler -+interface ResultField {} // Plazma - Completely remove Mojang's Profiler ++@Deprecated(forRemoval = true) interface ResultField {} // Plazma - Completely remove Mojang's Profiler diff --git a/src/main/java/net/minecraft/util/profiling/SingleTickProfiler.java b/src/main/java/net/minecraft/util/profiling/SingleTickProfiler.java -index 563d82c9153c88b651d6991caae4374c285a3065..59a5bd55f9a53be542e7770cbf5850a8975e2fe6 100644 +index 242237c605b4cd46958089063cf096ed29e73918..5ca52264bad74529f0a652efb91c3d5aa515e3d9 100644 --- a/src/main/java/net/minecraft/util/profiling/SingleTickProfiler.java +++ b/src/main/java/net/minecraft/util/profiling/SingleTickProfiler.java -@@ -1,50 +1,4 @@ +@@ -1,50 +1,3 @@ package net.minecraft.util.profiling; -import com.mojang.logging.LogUtils; @@ -1603,22 +1119,226 @@ index 563d82c9153c88b651d6991caae4374c285a3065..59a5bd55f9a53be542e7770cbf5850a8 - } - - public static ProfilerFiller decorateFiller(ProfilerFiller profiler, @Nullable SingleTickProfiler monitor) { -- return monitor != null ? ProfilerFiller.tee(monitor.startTick(), profiler) : profiler; +- return monitor != null ? ProfilerFiller.combine(monitor.startTick(), profiler) : profiler; - } -} -+@Deprecated(forRemoval = true) // Plazma - Completely remove Mojang's Profiler -+interface SingleTickProfiler {} // Plazma - Completely remove Mojang's Profiler ++@Deprecated(forRemoval = true) interface SingleTickProfiler {} // Plazma - Completely remove Mojang's Profiler +diff --git a/src/main/java/net/minecraft/util/profiling/TracyZoneFiller.java b/src/main/java/net/minecraft/util/profiling/TracyZoneFiller.java +index 8a3df14ef0cf135c5a1d2e251a51a860a3481064..73afff34ce603a9d4df725a44b3f3396d768fec7 100644 +--- a/src/main/java/net/minecraft/util/profiling/TracyZoneFiller.java ++++ b/src/main/java/net/minecraft/util/profiling/TracyZoneFiller.java +@@ -1,140 +1,3 @@ + package net.minecraft.util.profiling; + +-import com.mojang.jtracy.Plot; +-import com.mojang.jtracy.TracyClient; +-import com.mojang.logging.LogUtils; +-import java.lang.StackWalker.Option; +-import java.lang.StackWalker.StackFrame; +-import java.util.ArrayList; +-import java.util.HashMap; +-import java.util.List; +-import java.util.Map; +-import java.util.Optional; +-import java.util.Set; +-import java.util.function.Supplier; +-import net.minecraft.SharedConstants; +-import net.minecraft.util.profiling.metrics.MetricCategory; +-import org.slf4j.Logger; +- +-public class TracyZoneFiller implements ProfilerFiller { +- private static final Logger LOGGER = LogUtils.getLogger(); +- private static final StackWalker STACK_WALKER = StackWalker.getInstance(Set.of(Option.RETAIN_CLASS_REFERENCE), 5); +- private final List activeZones = new ArrayList<>(); +- private final Map plots = new HashMap<>(); +- private final String name = Thread.currentThread().getName(); +- +- @Override +- public void startTick() { +- } +- +- @Override +- public void endTick() { +- for (TracyZoneFiller.PlotAndValue plotAndValue : this.plots.values()) { +- plotAndValue.set(0); +- } +- } +- +- @Override +- public void push(String location) { +- String string = ""; +- String string2 = ""; +- int i = 0; +- if (SharedConstants.IS_RUNNING_IN_IDE) { +- Optional optional = STACK_WALKER.walk( +- stream -> stream.filter( +- frame -> frame.getDeclaringClass() != TracyZoneFiller.class +- && frame.getDeclaringClass() != ProfilerFiller.CombinedProfileFiller.class +- ) +- .findFirst() +- ); +- if (optional.isPresent()) { +- StackFrame stackFrame = optional.get(); +- string = stackFrame.getMethodName(); +- string2 = stackFrame.getFileName(); +- i = stackFrame.getLineNumber(); +- } +- } +- +- com.mojang.jtracy.Zone zone = TracyClient.beginZone(location, string, string2, i); +- this.activeZones.add(zone); +- } +- +- @Override +- public void push(Supplier locationGetter) { +- this.push(locationGetter.get()); +- } +- +- @Override +- public void pop() { +- if (this.activeZones.isEmpty()) { +- LOGGER.error("Tried to pop one too many times! Mismatched push() and pop()?"); +- } else { +- com.mojang.jtracy.Zone zone = this.activeZones.removeLast(); +- zone.close(); +- } +- } +- +- @Override +- public void popPush(String location) { +- this.pop(); +- this.push(location); +- } +- +- @Override +- public void popPush(Supplier locationGetter) { +- this.pop(); +- this.push(locationGetter.get()); +- } +- +- @Override +- public void markForCharting(MetricCategory type) { +- } +- +- @Override +- public void incrementCounter(String marker, int num) { +- this.plots.computeIfAbsent(marker, markerName -> new TracyZoneFiller.PlotAndValue(this.name + " " + marker)).add(num); +- } +- +- @Override +- public void incrementCounter(Supplier markerGetter, int num) { +- this.incrementCounter(markerGetter.get(), num); +- } +- +- private com.mojang.jtracy.Zone activeZone() { +- return this.activeZones.getLast(); +- } +- +- @Override +- public void addZoneText(String label) { +- this.activeZone().addText(label); +- } +- +- @Override +- public void addZoneValue(long value) { +- this.activeZone().addValue(value); +- } +- +- @Override +- public void setZoneColor(int color) { +- this.activeZone().setColor(color); +- } +- +- static final class PlotAndValue { +- private final Plot plot; +- private int value; +- +- PlotAndValue(String name) { +- this.plot = TracyClient.createPlot(name); +- this.value = 0; +- } +- +- void set(int count) { +- this.value = count; +- this.plot.setValue((double)count); +- } +- +- void add(int count) { +- this.set(this.value + count); +- } +- } +-} ++@Deprecated(forRemoval = true) interface TracyZoneFiller {} // Plazma - Completely remove Mojang's Profiler +diff --git a/src/main/java/net/minecraft/util/profiling/Zone.java b/src/main/java/net/minecraft/util/profiling/Zone.java +index 33d0790b08d92acabc7892fcac2109fa7cba6651..276ef2b2e3b936b1a243bc8bf59110173d964d72 100644 +--- a/src/main/java/net/minecraft/util/profiling/Zone.java ++++ b/src/main/java/net/minecraft/util/profiling/Zone.java +@@ -1,53 +1,3 @@ + package net.minecraft.util.profiling; + +-import java.util.function.Supplier; +-import javax.annotation.Nullable; +- +-public class Zone implements AutoCloseable { +- public static final Zone INACTIVE = new Zone(null); +- @Nullable +- private final ProfilerFiller profiler; +- +- Zone(@Nullable ProfilerFiller wrapped) { +- this.profiler = wrapped; +- } +- +- public Zone addText(String label) { +- if (this.profiler != null) { +- this.profiler.addZoneText(label); +- } +- +- return this; +- } +- +- public Zone addText(Supplier labelSupplier) { +- if (this.profiler != null) { +- this.profiler.addZoneText(labelSupplier.get()); +- } +- +- return this; +- } +- +- public Zone addValue(long value) { +- if (this.profiler != null) { +- this.profiler.addZoneValue(value); +- } +- +- return this; +- } +- +- public Zone setColor(int color) { +- if (this.profiler != null) { +- this.profiler.setZoneColor(color); +- } +- +- return this; +- } +- +- @Override +- public void close() { +- if (this.profiler != null) { +- this.profiler.pop(); +- } +- } +-} ++@Deprecated(forRemoval = true) interface Zone {} // Plazma - Completely remove Mojang's Profiler diff --git a/src/main/java/net/minecraft/util/profiling/metrics/MetricCategory.java b/src/main/java/net/minecraft/util/profiling/metrics/MetricCategory.java -index fc84538abcb3e8617e91a4b54c968f1ab2900cf8..8ac2e1de1991feb7619631144c62984d306a3e15 100644 +index 2e6edbb481d1716c5d0bd30cf518809a7953ceea..cbfe67beb6e1962455bbcf18253b67fd4047f914 100644 --- a/src/main/java/net/minecraft/util/profiling/metrics/MetricCategory.java +++ b/src/main/java/net/minecraft/util/profiling/metrics/MetricCategory.java -@@ -1,23 +1,4 @@ +@@ -1,23 +1,3 @@ package net.minecraft.util.profiling.metrics; -public enum MetricCategory { - PATH_FINDING("pathfinding"), - EVENT_LOOPS("event-loops"), -- MAIL_BOXES("mailboxes"), +- CONSECUTIVE_EXECUTORS("consecutive-executors"), - TICK_LOOP("ticking"), - JVM("jvm"), - CHUNK_RENDERING("chunk rendering"), @@ -1636,13 +1356,12 @@ index fc84538abcb3e8617e91a4b54c968f1ab2900cf8..8ac2e1de1991feb7619631144c62984d - return this.description; - } -} -+@Deprecated(forRemoval = true) // Plazma - Completely remove Mojang's Profiler -+interface MetricCategory {} // Plazma - Completely remove Mojang's Profiler ++@Deprecated(forRemoval = true) interface MetricCategory {} // Plazma - Completely remove Mojang's Profiler diff --git a/src/main/java/net/minecraft/util/profiling/metrics/MetricSampler.java b/src/main/java/net/minecraft/util/profiling/metrics/MetricSampler.java -index dd2bf15d22e5839ca986d3e824fb785786af86c8..866bc97498a68edde2027eb2c423f8f4db4cf1b3 100644 +index dd2bf15d22e5839ca986d3e824fb785786af86c8..87d3c172cffd4e6f3400895594fee540d838a911 100644 --- a/src/main/java/net/minecraft/util/profiling/metrics/MetricSampler.java +++ b/src/main/java/net/minecraft/util/profiling/metrics/MetricSampler.java -@@ -1,213 +1,4 @@ +@@ -1,213 +1,3 @@ package net.minecraft.util.profiling.metrics; -import io.netty.buffer.ByteBuf; @@ -1856,13 +1575,12 @@ index dd2bf15d22e5839ca986d3e824fb785786af86c8..866bc97498a68edde2027eb2c423f8f4 - } - } -} -+@Deprecated(forRemoval = true) // Plazma - Completely remove Mojang's Profiler -+interface MetricSampler {} // Plazma - Completely remove Mojang's Profiler ++@Deprecated(forRemoval = true) interface MetricSampler {} // Plazma - Completely remove Mojang's Profiler diff --git a/src/main/java/net/minecraft/util/profiling/metrics/MetricsRegistry.java b/src/main/java/net/minecraft/util/profiling/metrics/MetricsRegistry.java -index c22a91ee393744a4eaffe1fff168b18ac1bc55bd..8f21991241b2c98eb8faef2f90caf9ad791b20b9 100644 +index c22a91ee393744a4eaffe1fff168b18ac1bc55bd..2a0885bed637afe31710229c6186b79389f3cb4f 100644 --- a/src/main/java/net/minecraft/util/profiling/metrics/MetricsRegistry.java +++ b/src/main/java/net/minecraft/util/profiling/metrics/MetricsRegistry.java -@@ -1,85 +1,4 @@ +@@ -1,85 +1,3 @@ package net.minecraft.util.profiling.metrics; -import java.util.List; @@ -1948,13 +1666,12 @@ index c22a91ee393744a4eaffe1fff168b18ac1bc55bd..8f21991241b2c98eb8faef2f90caf9ad - } - } -} -+@Deprecated(forRemoval = true) // Plazma - Completely remove Mojang's Profiler -+interface MetricsRegistry {} // Plazma - Completely remove Mojang's Profiler ++@Deprecated(forRemoval = true) interface MetricsRegistry {} // Plazma - Completely remove Mojang's Profiler diff --git a/src/main/java/net/minecraft/util/profiling/metrics/MetricsSamplerProvider.java b/src/main/java/net/minecraft/util/profiling/metrics/MetricsSamplerProvider.java -index 07f78c451e5330296c38f6b599d979610a03381f..0d8880b782ab8c63de7021283a92edde734fcb6c 100644 +index 07f78c451e5330296c38f6b599d979610a03381f..2520855b7ca25520d5cba8ba072b16e256d5a0d8 100644 --- a/src/main/java/net/minecraft/util/profiling/metrics/MetricsSamplerProvider.java +++ b/src/main/java/net/minecraft/util/profiling/metrics/MetricsSamplerProvider.java -@@ -1,9 +1,4 @@ +@@ -1,9 +1,3 @@ package net.minecraft.util.profiling.metrics; -import java.util.Set; @@ -1964,13 +1681,12 @@ index 07f78c451e5330296c38f6b599d979610a03381f..0d8880b782ab8c63de7021283a92edde -public interface MetricsSamplerProvider { - Set samplers(Supplier profilerSupplier); -} -+@Deprecated(forRemoval = true) // Plazma - Completely remove Mojang's Profiler -+interface MetricsSamplerProvider {} // Plazma - Completely remove Mojang's Profiler ++@Deprecated(forRemoval = true) interface MetricsSamplerProvider {} // Plazma - Completely remove Mojang's Profiler diff --git a/src/main/java/net/minecraft/util/profiling/metrics/ProfilerMeasured.java b/src/main/java/net/minecraft/util/profiling/metrics/ProfilerMeasured.java -index 3057e9caa1936d114e07b3dfbd0dffd8aca1223c..5d3df5b0ee1ba281ab293613a6ff848bf6c8a30f 100644 +index 3057e9caa1936d114e07b3dfbd0dffd8aca1223c..51cde2a829dea51513ca8f689829cd3a8d4fbd48 100644 --- a/src/main/java/net/minecraft/util/profiling/metrics/ProfilerMeasured.java +++ b/src/main/java/net/minecraft/util/profiling/metrics/ProfilerMeasured.java -@@ -1,7 +1,4 @@ +@@ -1,7 +1,3 @@ package net.minecraft.util.profiling.metrics; -import java.util.List; @@ -1978,13 +1694,12 @@ index 3057e9caa1936d114e07b3dfbd0dffd8aca1223c..5d3df5b0ee1ba281ab293613a6ff848b -public interface ProfilerMeasured { - List profiledMetrics(); -} -+@Deprecated(forRemoval = true) // Plazma - Completely remove Mojang's Profiler -+interface ProfilerMeasured {} // Plazma - Completely remove Mojang's Profiler ++@Deprecated(forRemoval = true) interface ProfilerMeasured {} // Plazma - Completely remove Mojang's Profiler diff --git a/src/main/java/net/minecraft/util/profiling/metrics/profiling/ActiveMetricsRecorder.java b/src/main/java/net/minecraft/util/profiling/metrics/profiling/ActiveMetricsRecorder.java -index 9b8e774dfbfc9e06e9bf04ff789737511d6966ba..bf8b88a7e41712bddff8052ef953754bae03194a 100644 +index c64e1afbff4a0e32beb465ae10fff6e9f21f6af6..b0bad6ab38d118f07b0da718c99df01639f64af9 100644 --- a/src/main/java/net/minecraft/util/profiling/metrics/profiling/ActiveMetricsRecorder.java +++ b/src/main/java/net/minecraft/util/profiling/metrics/profiling/ActiveMetricsRecorder.java -@@ -1,168 +1,4 @@ +@@ -1,168 +1,3 @@ package net.minecraft.util.profiling.metrics.profiling; -import com.google.common.collect.ImmutableSet; @@ -2122,7 +1837,7 @@ index 9b8e774dfbfc9e06e9bf04ff789737511d6966ba..bf8b88a7e41712bddff8052ef953754b - - @Override - public ProfilerFiller getProfiler() { -- return ProfilerFiller.tee(this.taskProfiler.getFiller(), this.singleTickProfiler); +- return ProfilerFiller.combine(this.taskProfiler.getFiller(), this.singleTickProfiler); - } - - private void verifyStarted() { @@ -2153,13 +1868,12 @@ index 9b8e774dfbfc9e06e9bf04ff789737511d6966ba..bf8b88a7e41712bddff8052ef953754b - globalOnReportFinished = consumer; - } -} -+@Deprecated(forRemoval = true) // Plazma - Completely remove Mojang's Profiler -+interface ActiveMetricsRecorder {} // Plazma - Completely remove Mojang's Profiler ++@Deprecated(forRemoval = true) interface ActiveMetricsRecorder {} // Plazma - Completely remove Mojang's Profiler diff --git a/src/main/java/net/minecraft/util/profiling/metrics/profiling/InactiveMetricsRecorder.java b/src/main/java/net/minecraft/util/profiling/metrics/profiling/InactiveMetricsRecorder.java -index 12d7b7c86115b667bd8f940206985d9ed4b837d4..9e70fb946e5fae6da13e2bdbba39818f38706fa4 100644 +index 12d7b7c86115b667bd8f940206985d9ed4b837d4..97dcd747868e0fd61de5731aee8abd9e49f14d88 100644 --- a/src/main/java/net/minecraft/util/profiling/metrics/profiling/InactiveMetricsRecorder.java +++ b/src/main/java/net/minecraft/util/profiling/metrics/profiling/InactiveMetricsRecorder.java -@@ -1,34 +1,4 @@ +@@ -1,34 +1,3 @@ package net.minecraft.util.profiling.metrics.profiling; -import net.minecraft.util.profiling.InactiveProfiler; @@ -2194,13 +1908,12 @@ index 12d7b7c86115b667bd8f940206985d9ed4b837d4..9e70fb946e5fae6da13e2bdbba39818f - public void endTick() { - } -} -+@Deprecated(forRemoval = true) // Plazma - Completely remove Mojang's Profiler -+interface InactiveMetricsRecorder {} // Plazma - Completely remove Mojang's Profiler ++@Deprecated(forRemoval = true) interface InactiveMetricsRecorder {} // Plazma - Completely remove Mojang's Profiler diff --git a/src/main/java/net/minecraft/util/profiling/metrics/profiling/MetricsRecorder.java b/src/main/java/net/minecraft/util/profiling/metrics/profiling/MetricsRecorder.java -index 48e7211e01691a677c52cf1f5982b0c179eaf83b..d28a917da94163ae590ad59ecadc1379ac83f5d8 100644 +index 48e7211e01691a677c52cf1f5982b0c179eaf83b..15da03b91bb494e2155529962e9afb42db4073b9 100644 --- a/src/main/java/net/minecraft/util/profiling/metrics/profiling/MetricsRecorder.java +++ b/src/main/java/net/minecraft/util/profiling/metrics/profiling/MetricsRecorder.java -@@ -1,17 +1,4 @@ +@@ -1,17 +1,3 @@ package net.minecraft.util.profiling.metrics.profiling; -import net.minecraft.util.profiling.ProfilerFiller; @@ -2218,13 +1931,12 @@ index 48e7211e01691a677c52cf1f5982b0c179eaf83b..d28a917da94163ae590ad59ecadc1379 - - void endTick(); -} -+@Deprecated(forRemoval = true) // Plazma - Completely remove Mojang's Profiler -+interface MetricsRecorder {} // Plazma - Completely remove Mojang's Profiler ++@Deprecated(forRemoval = true) interface MetricsRecorder {} // Plazma - Completely remove Mojang's Profiler diff --git a/src/main/java/net/minecraft/util/profiling/metrics/profiling/ProfilerSamplerAdapter.java b/src/main/java/net/minecraft/util/profiling/metrics/profiling/ProfilerSamplerAdapter.java -index cf47ee0f4ec9ffb130b04c7cf92e7907f9b791ef..c25d616cd21d84a4b2313e9d2772fb6c97d1b0e9 100644 +index cf47ee0f4ec9ffb130b04c7cf92e7907f9b791ef..a1490bd2f5a2eaf0f277feb728c02b036d85fcaa 100644 --- a/src/main/java/net/minecraft/util/profiling/metrics/profiling/ProfilerSamplerAdapter.java +++ b/src/main/java/net/minecraft/util/profiling/metrics/profiling/ProfilerSamplerAdapter.java -@@ -1,37 +1,4 @@ +@@ -1,37 +1,3 @@ package net.minecraft.util.profiling.metrics.profiling; -import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; @@ -2262,13 +1974,12 @@ index cf47ee0f4ec9ffb130b04c7cf92e7907f9b791ef..c25d616cd21d84a4b2313e9d2772fb6c - }); - } -} -+@Deprecated(forRemoval = true) // Plazma - Completely remove Mojang's Profiler -+interface ProfilerSamplerAdapter {} // Plazma - Completely remove Mojang's Profiler ++@Deprecated(forRemoval = true) interface ProfilerSamplerAdapter {} // Plazma - Completely remove Mojang's Profiler diff --git a/src/main/java/net/minecraft/util/profiling/metrics/profiling/ServerMetricsSamplersProvider.java b/src/main/java/net/minecraft/util/profiling/metrics/profiling/ServerMetricsSamplersProvider.java -index 978412a8b9e24d7d79c94911f0cf7d20796389e1..f4e010f91e3f3b973b9f4c319a1013397af98d5a 100644 +index c82ea3278c9631f0575a57ff1000fea4fbfa1fd9..dc65068e952c604ac67c8b1e8f3341437a2b3410 100644 --- a/src/main/java/net/minecraft/util/profiling/metrics/profiling/ServerMetricsSamplersProvider.java +++ b/src/main/java/net/minecraft/util/profiling/metrics/profiling/ServerMetricsSamplersProvider.java -@@ -1,105 +1,4 @@ +@@ -1,106 +1,3 @@ package net.minecraft.util.profiling.metrics.profiling; -import com.google.common.base.Stopwatch; @@ -2283,6 +1994,7 @@ index 978412a8b9e24d7d79c94911f0cf7d20796389e1..f4e010f91e3f3b973b9f4c319a101339 -import java.util.function.Supplier; -import java.util.function.ToDoubleFunction; -import java.util.stream.IntStream; +-import net.minecraft.SystemReport; -import net.minecraft.util.profiling.ProfileCollector; -import net.minecraft.util.profiling.metrics.MetricCategory; -import net.minecraft.util.profiling.metrics.MetricSampler; @@ -2318,7 +2030,7 @@ index 978412a8b9e24d7d79c94911f0cf7d20796389e1..f4e010f91e3f3b973b9f4c319a101339 - - builder.add( - MetricSampler.create( -- "heap MiB", MetricCategory.JVM, () -> (double)((float)(Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1048576.0F) +- "heap MiB", MetricCategory.JVM, () -> (double)SystemReport.sizeInMiB(Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) - ) - ); - builder.addAll(MetricsRegistry.INSTANCE.getRegisteredSamplers()); @@ -2374,13 +2086,12 @@ index 978412a8b9e24d7d79c94911f0cf7d20796389e1..f4e010f91e3f3b973b9f4c319a101339 - } - } -} -+@Deprecated(forRemoval = true) // Plazma - Completely remove Mojang's Profiler -+interface ServerMetricsSamplersProvider {} // Plazma - Completely remove Mojang's Profiler ++@Deprecated(forRemoval = true) interface ServerMetricsSamplersProvider {} // Plazma - Completely remove Mojang's Profiler diff --git a/src/main/java/net/minecraft/util/profiling/metrics/storage/MetricsPersister.java b/src/main/java/net/minecraft/util/profiling/metrics/storage/MetricsPersister.java -index 8579309bf1b6ad0e42aa9431a8d274ee810911fd..ded83ce063cd89921b76b91b368b488fef7c3618 100644 +index 8579309bf1b6ad0e42aa9431a8d274ee810911fd..31638f0a0e5c0b7a6f22cb10dbfa861efde4c178 100644 --- a/src/main/java/net/minecraft/util/profiling/metrics/storage/MetricsPersister.java +++ b/src/main/java/net/minecraft/util/profiling/metrics/storage/MetricsPersister.java -@@ -1,125 +1,4 @@ +@@ -1,125 +1,3 @@ package net.minecraft.util.profiling.metrics.storage; -import com.mojang.logging.LogUtils; @@ -2506,13 +2217,12 @@ index 8579309bf1b6ad0e42aa9431a8d274ee810911fd..ded83ce063cd89921b76b91b368b488f - result.saveResults(directory.resolve("profiling.txt")); - } -} -+@Deprecated(forRemoval = true) // Plazma - Completely remove Mojang's Profiler -+interface MetricsPersister {} // Plazma - Completely remove Mojang's Profiler ++@Deprecated(forRemoval = true) interface MetricsPersister {} // Plazma - Completely remove Mojang's Profiler diff --git a/src/main/java/net/minecraft/util/profiling/metrics/storage/RecordedDeviation.java b/src/main/java/net/minecraft/util/profiling/metrics/storage/RecordedDeviation.java -index f012d23b22b1a9d1acb6c020c66dc727f7fe9e1a..ec85d23d1097338c15663cb2c73dccd3a53bc3b3 100644 +index f012d23b22b1a9d1acb6c020c66dc727f7fe9e1a..4ba8dd84105290674ee4c688f6912b5dd2e41f97 100644 --- a/src/main/java/net/minecraft/util/profiling/metrics/storage/RecordedDeviation.java +++ b/src/main/java/net/minecraft/util/profiling/metrics/storage/RecordedDeviation.java -@@ -1,16 +1,4 @@ +@@ -1,16 +1,3 @@ package net.minecraft.util.profiling.metrics.storage; -import java.time.Instant; @@ -2529,355 +2239,4 @@ index f012d23b22b1a9d1acb6c020c66dc727f7fe9e1a..ec85d23d1097338c15663cb2c73dccd3 - this.profilerResultAtTick = result; - } -} -+@Deprecated(forRemoval = true) // Plazma - Completely remove Mojang's Profiler -+interface RecordedDeviation {} // Plazma - Completely remove Mojang's Profiler -diff --git a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java b/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java -index 43487a9ee202c5b0e5a416519939111f77b3059c..dee5cab2d8e28d968de5beb7084efeaf1a20da3a 100644 ---- a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java -+++ b/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java -@@ -11,13 +11,13 @@ import java.util.concurrent.locks.LockSupport; - import java.util.function.BooleanSupplier; - import java.util.function.Supplier; - import javax.annotation.CheckReturnValue; --import net.minecraft.util.profiling.metrics.MetricCategory; --import net.minecraft.util.profiling.metrics.MetricSampler; --import net.minecraft.util.profiling.metrics.MetricsRegistry; --import net.minecraft.util.profiling.metrics.ProfilerMeasured; -+// import net.minecraft.util.profiling.metrics.MetricCategory; // Plazma - Completely remove Mojang's Profiler -+// import net.minecraft.util.profiling.metrics.MetricSampler; // Plazma - Completely remove Mojang's Profiler -+// import net.minecraft.util.profiling.metrics.MetricsRegistry; // Plazma - Completely remove Mojang's Profiler -+// import net.minecraft.util.profiling.metrics.ProfilerMeasured; // Plazma - Completely remove Mojang's Profiler - import org.slf4j.Logger; - --public abstract class BlockableEventLoop implements ProfilerMeasured, ProcessorHandle, Executor { -+public abstract class BlockableEventLoop implements /*ProfilerMeasured,*/ ProcessorHandle, Executor { // Plazma - Completely remove Mojang's Profiler - private final String name; - private static final Logger LOGGER = LogUtils.getLogger(); - private final Queue pendingRunnables = Queues.newConcurrentLinkedQueue(); -@@ -25,7 +25,7 @@ public abstract class BlockableEventLoop implements Profiler - - protected BlockableEventLoop(String name) { - this.name = name; -- MetricsRegistry.INSTANCE.add(this); -+ // MetricsRegistry.INSTANCE.add(this); // Plazma - Completely remove Mojang's Profiler - } - - protected abstract R wrapRunnable(Runnable runnable); -@@ -155,8 +155,10 @@ public abstract class BlockableEventLoop implements Profiler - } - } - -+ /* // Plazma - Completely remove Mojang's Profiler - @Override - public List profiledMetrics() { - return ImmutableList.of(MetricSampler.create(this.name + "-pending-tasks", MetricCategory.EVENT_LOOPS, this::getPendingTasksCount)); - } -+ */ // Plazma - Completely remove Mojang's Profiler - } -diff --git a/src/main/java/net/minecraft/util/thread/ProcessorMailbox.java b/src/main/java/net/minecraft/util/thread/ProcessorMailbox.java -index 97c129f5949ca7cb7430e1cf56e881c00f129530..5c4d902a6febe8ffadecbbc64b50ecdc60307588 100644 ---- a/src/main/java/net/minecraft/util/thread/ProcessorMailbox.java -+++ b/src/main/java/net/minecraft/util/thread/ProcessorMailbox.java -@@ -9,13 +9,13 @@ import java.util.concurrent.Executor; - import java.util.concurrent.RejectedExecutionException; - import java.util.concurrent.atomic.AtomicInteger; - import net.minecraft.Util; --import net.minecraft.util.profiling.metrics.MetricCategory; --import net.minecraft.util.profiling.metrics.MetricSampler; --import net.minecraft.util.profiling.metrics.MetricsRegistry; --import net.minecraft.util.profiling.metrics.ProfilerMeasured; -+//import net.minecraft.util.profiling.metrics.MetricCategory; // Plazma - Completely remove Mojang's Profiler -+//import net.minecraft.util.profiling.metrics.MetricSampler; // Plazma - Completely remove Mojang's Profiler -+//import net.minecraft.util.profiling.metrics.MetricsRegistry; // Plazma - Completely remove Mojang's Profiler -+//import net.minecraft.util.profiling.metrics.ProfilerMeasured; // Plazma - Completely remove Mojang's Profiler - import org.slf4j.Logger; - --public class ProcessorMailbox implements ProfilerMeasured, ProcessorHandle, AutoCloseable, Runnable { -+public class ProcessorMailbox implements /*ProfilerMeasured,*/ ProcessorHandle, AutoCloseable, Runnable { - private static final Logger LOGGER = LogUtils.getLogger(); - private static final int CLOSED_BIT = 1; - private static final int SCHEDULED_BIT = 2; -@@ -32,7 +32,7 @@ public class ProcessorMailbox implements ProfilerMeasured, ProcessorHandle - this.dispatcher = executor; - this.queue = queue; - this.name = name; -- MetricsRegistry.INSTANCE.add(this); -+ //MetricsRegistry.INSTANCE.add(this); // Plazma - Completely remove Mojang's Profiler - } - - private boolean setAsScheduled() { -@@ -151,8 +151,10 @@ public class ProcessorMailbox implements ProfilerMeasured, ProcessorHandle - return this.name; - } - -+ /* // Plazma - Completely remove Mojang's Profiler - @Override - public List profiledMetrics() { - return ImmutableList.of(MetricSampler.create(this.name + "-queue-size", MetricCategory.MAIL_BOXES, this::size)); - } -+ */ // Plazma - Completely remove Mojang's Profiler - } -diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 1708d9b3500d907449bce86040bf5baea5b269b8..05c41e1c2f4a1c714dc842dc019acda46fc41e7b 100644 ---- a/src/main/java/net/minecraft/world/entity/Mob.java -+++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -37,7 +37,7 @@ import net.minecraft.sounds.SoundEvent; - import net.minecraft.tags.TagKey; - import net.minecraft.util.Mth; - import net.minecraft.util.RandomSource; --import net.minecraft.util.profiling.ProfilerFiller; -+// import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler - import net.minecraft.world.Difficulty; - import net.minecraft.world.DifficultyInstance; - import net.minecraft.world.InteractionHand; -@@ -165,8 +165,8 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti - this.pathfindingMalus = Maps.newEnumMap(PathType.class); - this.restrictCenter = BlockPos.ZERO; - this.restrictRadius = -1.0F; -- this.goalSelector = new GoalSelector(world.getProfilerSupplier()); -- this.targetSelector = new GoalSelector(world.getProfilerSupplier()); -+ this.goalSelector = new GoalSelector(/*world.getProfilerSupplier()*/); // Plazma - Completely remove Mojang's Profiler -+ this.targetSelector = new GoalSelector(/*world.getProfilerSupplier()*/); // Plazma - Completely remove Mojang's Profiler - this.lookControl = new org.purpurmc.purpur.controller.LookControllerWASD(this); // Purpur - this.moveControl = new org.purpurmc.purpur.controller.MoveControllerWASD(this); // Purpur - this.jumpControl = new JumpControl(this); -diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java -index 45be322111556f113d6c74c497b623d82275281e..a8b086b5512803d165bf2b5a249dcc253972f2b6 100644 ---- a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java -+++ b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java -@@ -8,7 +8,7 @@ import java.util.Map; - import java.util.Set; - import java.util.function.Predicate; - import java.util.function.Supplier; --import net.minecraft.util.profiling.ProfilerFiller; -+// import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler - - public class GoalSelector { - private static final WrappedGoal NO_GOAL = new WrappedGoal(Integer.MAX_VALUE, new Goal() { -@@ -24,14 +24,16 @@ public class GoalSelector { - }; - private final Map lockedFlags = new EnumMap<>(Goal.Flag.class); - private final Set availableGoals = new ObjectLinkedOpenHashSet<>(); -- private final Supplier profiler; -+ // private final Supplier profiler; // Plazma - Completely remove Mojang's Profiler - private static final Goal.Flag[] GOAL_FLAG_VALUES = Goal.Flag.values(); // Paper - remove streams from pathfindergoalselector - private final com.destroystokyo.paper.util.set.OptimizedSmallEnumSet goalTypes = new com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<>(Goal.Flag.class); // Paper - remove streams from pathfindergoalselector - private int curRate; - -+ /* // Plazma - Completely remove Mojang's Profiler - public GoalSelector(Supplier profiler) { - this.profiler = profiler; - } -+ */ // Plazma - Completely remove Mojang's Profiler - - public void addGoal(int priority, Goal goal) { - this.availableGoals.add(new WrappedGoal(priority, goal)); -diff --git a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java -index a31326e24cb68472c81cd781c5e3041772712862..03323be2a120c53ac5a3607f6154c99d0b990308 100644 ---- a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java -+++ b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java -@@ -28,7 +28,7 @@ import net.minecraft.resources.RegistryOps; - import net.minecraft.resources.ResourceLocation; - import net.minecraft.server.packs.resources.ResourceManager; - import net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener; --import net.minecraft.util.profiling.ProfilerFiller; -+// import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler - import net.minecraft.world.Container; - import net.minecraft.world.item.ItemStack; - import net.minecraft.world.level.Level; -@@ -53,7 +53,7 @@ public class RecipeManager extends SimpleJsonResourceReloadListener { - this.registries = registryLookup; - } - -- protected void apply(Map prepared, ResourceManager manager, ProfilerFiller profiler) { -+ protected void apply(Map prepared, ResourceManager manager/*, ProfilerFiller profiler*/) { // Plazma - Completely remove Mojang's Profiler - this.hasErrors = false; - Builder, RecipeHolder> builder = ImmutableMultimap.builder(); - com.google.common.collect.ImmutableMap.Builder> com_google_common_collect_immutablemap_builder = ImmutableMap.builder(); -diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 5712ab081e9534f60248caaceea44445ff855e30..0a0ab76144aa7d0970638924878f1eb130b2e3e3 100644 ---- a/src/main/java/net/minecraft/world/level/Level.java -+++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -35,7 +35,7 @@ import net.minecraft.sounds.SoundSource; - import net.minecraft.util.AbortableIterationConsumer; - import net.minecraft.util.Mth; - import net.minecraft.util.RandomSource; --import net.minecraft.util.profiling.ProfilerFiller; -+// import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler - import net.minecraft.world.DifficultyInstance; - import net.minecraft.world.TickRateManager; - import net.minecraft.world.damagesource.DamageSource; -@@ -133,7 +133,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { - private final RandomSource threadSafeRandom = RandomSource.createThreadSafe(); - private final Holder dimensionTypeRegistration; - public final WritableLevelData levelData; -- private final Supplier profiler; -+ // private final Supplier profiler; // Plazma - Completely remove Mojang's Profiler - public final boolean isClientSide; - private final WorldBorder worldBorder; - private final BiomeManager biomeManager; -@@ -263,7 +263,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { - ResourceKey resourcekey, - RegistryAccess iregistrycustom, - Holder holder, -- Supplier supplier, -+ // Supplier supplier, // Plazma - Completely remove Mojang's Profiler - boolean flag, - boolean flag1, - long i, -@@ -292,7 +292,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { - } - - // CraftBukkit end -- this.profiler = supplier; -+ // this.profiler = supplier; // Plazma - Completely remove Mojang's Profiler - this.levelData = worlddatamutable; - this.dimensionTypeRegistration = holder; - final DimensionType dimensionmanager = (DimensionType) holder.value(); -@@ -1869,14 +1869,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable { - return false; - } - -+ /* // Plazma - Completely remove Mojang's Profiler - public ProfilerFiller getProfiler() { - if (true || gg.pufferfish.pufferfish.PufferfishConfig.disableMethodProfiler) return net.minecraft.util.profiling.InactiveProfiler.INSTANCE; // Pufferfish // Purpur - return (ProfilerFiller) this.profiler.get(); -- } - - public Supplier getProfilerSupplier() { - return this.profiler; -- } -+ }} -+ */ // Plazma - Completely remove Mojang's Profiler - - @Override - public BiomeManager getBiomeManager() { -diff --git a/src/main/java/net/minecraft/world/level/PathNavigationRegion.java b/src/main/java/net/minecraft/world/level/PathNavigationRegion.java -index c5454b92ca2565461c799d7340160f9fb72c1b0f..760a4f4b15a02f9cbb7a368961286ae3c64d9db3 100644 ---- a/src/main/java/net/minecraft/world/level/PathNavigationRegion.java -+++ b/src/main/java/net/minecraft/world/level/PathNavigationRegion.java -@@ -8,7 +8,7 @@ import net.minecraft.core.BlockPos; - import net.minecraft.core.Holder; - import net.minecraft.core.SectionPos; - import net.minecraft.core.registries.Registries; --import net.minecraft.util.profiling.ProfilerFiller; -+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler - import net.minecraft.server.level.ServerLevel; - import net.minecraft.world.entity.Entity; - import net.minecraft.world.level.biome.Biome; -@@ -152,7 +152,9 @@ public class PathNavigationRegion implements BlockGetter, CollisionGetter { - return this.level.getHeight(); - } - -+ /* // Plazma - Completely remove Mojang's Profiler - public ProfilerFiller getProfiler() { - return this.level.getProfiler(); - } -+ */ // Plazma - Completely remove Mojang's Profiler - } -diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -index e026dc9ed15284f55cdd4bc99c0718aba6d2e8c6..a1b60280b25452efca4f77f079734c50d9eec983 100644 ---- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -@@ -26,7 +26,7 @@ import net.minecraft.network.FriendlyByteBuf; - import net.minecraft.network.protocol.game.ClientboundLevelChunkPacketData; - import net.minecraft.server.level.FullChunkStatus; - import net.minecraft.server.level.ServerLevel; --import net.minecraft.util.profiling.ProfilerFiller; -+// import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler - import net.minecraft.world.entity.Entity; - import net.minecraft.world.level.ChunkPos; - import net.minecraft.world.level.Level; -@@ -457,7 +457,7 @@ public class LevelChunk extends ChunkAccess { - } - - if (LightEngine.hasDifferentLightProperties(this, blockposition, iblockdata1, iblockdata)) { -- ProfilerFiller gameprofilerfiller = this.level.getProfiler(); -+ // ProfilerFiller gameprofilerfiller = this.level.getProfiler(); // Plazma - Completely remove Mojang's Profiler - - //gameprofilerfiller.push("updateSkyLightSources"); // Purpur - // Paper - starlight - remove skyLightSources -diff --git a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java -index 404080976208c30e9e95e5bee47c2a749e709a45..97a81d749d9fece6283fdd1b0ed89ce04be32c78 100644 ---- a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java -+++ b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java -@@ -12,8 +12,8 @@ import java.util.function.Function; - import java.util.stream.Collectors; - import javax.annotation.Nullable; - import net.minecraft.core.BlockPos; --import net.minecraft.util.profiling.ProfilerFiller; --import net.minecraft.util.profiling.metrics.MetricCategory; -+// import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler -+// import net.minecraft.util.profiling.metrics.MetricCategory; // Plazma - Completely remove Mojang's Profiler - import net.minecraft.world.entity.Mob; - import net.minecraft.world.level.PathNavigationRegion; - -@@ -44,7 +44,7 @@ public class PathFinder { - map.add(new java.util.AbstractMap.SimpleEntry<>(this.nodeEvaluator.getTarget(pos.getX(), pos.getY(), pos.getZ()), pos)); - } - // Paper end - Perf: remove streams and optimize collection -- Path path = this.findPath(world.getProfiler(), node, map, followRange, distance, rangeMultiplier); -+ Path path = this.findPath(/*world.getProfiler(), */node, map, followRange, distance, rangeMultiplier); // Plazma - Completely remove Mojang's Profiler - this.nodeEvaluator.done(); - return path; - } -@@ -52,7 +52,7 @@ public class PathFinder { - - @Nullable - // Paper start - Perf: remove streams and optimize collection -- private Path findPath(ProfilerFiller profiler, Node startNode, List> positions, float followRange, int distance, float rangeMultiplier) { -+ private Path findPath(/*ProfilerFiller profiler, */Node startNode, List> positions, float followRange, int distance, float rangeMultiplier) { // Plazma - Completely remove Mojang's Profiler - //profiler.push("find_path"); // Purpur - //profiler.markForCharting(MetricCategory.PATH_FINDING); // Purpur - // Set set = positions.keySet(); -diff --git a/src/main/java/net/minecraft/world/ticks/LevelTicks.java b/src/main/java/net/minecraft/world/ticks/LevelTicks.java -index a6d62abd3102770652f914b9d697c6d3c2533cfc..7ad353388f975e271f597de8c262b9b8866547b4 100644 ---- a/src/main/java/net/minecraft/world/ticks/LevelTicks.java -+++ b/src/main/java/net/minecraft/world/ticks/LevelTicks.java -@@ -24,14 +24,14 @@ import net.minecraft.Util; - import net.minecraft.core.BlockPos; - import net.minecraft.core.SectionPos; - import net.minecraft.core.Vec3i; --import net.minecraft.util.profiling.ProfilerFiller; -+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler - import net.minecraft.world.level.ChunkPos; - import net.minecraft.world.level.levelgen.structure.BoundingBox; - - public class LevelTicks implements LevelTickAccess { - private static final Comparator> CONTAINER_DRAIN_ORDER = (a, b) -> ScheduledTick.INTRA_TICK_DRAIN_ORDER.compare(a.peek(), b.peek()); - private final LongPredicate tickCheck; -- private final Supplier profiler; -+ //private final Supplier profiler; // Plazma - Completely remove Mojang's Profiler - private final Long2ObjectMap> allContainers = new Long2ObjectOpenHashMap<>(); - private final Long2LongMap nextTickForContainer = Util.make(new Long2LongOpenHashMap(), map -> map.defaultReturnValue(Long.MAX_VALUE)); - private final Queue> containersToTick = new PriorityQueue<>(CONTAINER_DRAIN_ORDER); -@@ -44,9 +44,9 @@ public class LevelTicks implements LevelTickAccess { - } - }; - -- public LevelTicks(LongPredicate tickingFutureReadyPredicate, Supplier profilerGetter) { -+ public LevelTicks(LongPredicate tickingFutureReadyPredicate/*, Supplier profilerGetter*/) { // Plazma - Completely remove Mojang's Profiler - this.tickCheck = tickingFutureReadyPredicate; -- this.profiler = profilerGetter; -+ //this.profiler = profilerGetter; // Plazma - Completely remove Mojang's Profiler - } - - public void addContainer(ChunkPos pos, LevelChunkTicks scheduler) { -@@ -83,7 +83,7 @@ public class LevelTicks implements LevelTickAccess { - public void tick(long time, int maxTicks, BiConsumer ticker) { - //ProfilerFiller profilerFiller = this.profiler.get(); // Purpur - //profilerFiller.push("collect"); // Purpur -- this.collectTicks(time, maxTicks, null); // Purpur -+ this.collectTicks(time, maxTicks/*, null*/); // Purpur // Plazma - Completely remove Mojang's Profiler - //profilerFiller.popPush("run"); // Purpur - //profilerFiller.incrementCounter("ticksToRun", this.toRunThisTick.size()); // Purpur - this.runCollectedTicks(ticker); -@@ -92,7 +92,7 @@ public class LevelTicks implements LevelTickAccess { - //profilerFiller.pop(); // Purpur - } - -- private void collectTicks(long time, int maxTicks, ProfilerFiller profiler) { -+ private void collectTicks(long time, int maxTicks/*, ProfilerFiller profiler*/) { // Plazma - Completely remove Mojang's Profiler - this.sortContainersToTick(time); - //profiler.incrementCounter("containersToTick", this.containersToTick.size()); // Purpur - this.drainContainers(time, maxTicks); ++@Deprecated(forRemoval = true) interface RecordedDeviation {} // Plazma - Completely remove Mojang's Profiler diff --git a/patches/server/0040-Completely-remove-Mojang-Profiler.patch b/patches/server/0040-Completely-remove-Mojang-Profiler.patch new file mode 100644 index 000000000..6c0b8cecc --- /dev/null +++ b/patches/server/0040-Completely-remove-Mojang-Profiler.patch @@ -0,0 +1,1356 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: AlphaKR93 +Date: Wed, 27 Sep 2023 17:52:52 +0900 +Subject: [PATCH] Completely remove Mojang Profiler + + +diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java +index 647a3ac2aea4dadd638836f831cc3768d10c7b74..c3e1e9a8e82f23417138b91aa062a83ec3ef6f24 100644 +--- a/src/main/java/net/minecraft/commands/Commands.java ++++ b/src/main/java/net/minecraft/commands/Commands.java +@@ -132,7 +132,7 @@ import net.minecraft.server.commands.WorldBorderCommand; + import net.minecraft.server.commands.data.DataCommands; + import net.minecraft.server.level.ServerPlayer; + import net.minecraft.tags.TagKey; +-import net.minecraft.util.profiling.Profiler; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.util.profiling.jfr.JvmProfiler; + import net.minecraft.world.flag.FeatureFlagSet; + import net.minecraft.world.flag.FeatureFlags; +@@ -448,7 +448,7 @@ public class Commands { + int j = minecraftserver.getGameRules().getInt(GameRules.RULE_MAX_COMMAND_FORK_COUNT); + + try { +- ExecutionContext executioncontext1 = new ExecutionContext<>(i, j, Profiler.get()); ++ ExecutionContext executioncontext1 = new ExecutionContext<>(i, j); // Plazma - Completely remove Mojang's profiler + + try { + Commands.CURRENT_EXECUTION_CONTEXT.set(executioncontext1); +diff --git a/src/main/java/net/minecraft/commands/execution/ExecutionContext.java b/src/main/java/net/minecraft/commands/execution/ExecutionContext.java +index f626a2f28f2aebb3237cebb6afef3c4fa1a6cb37..467e17bfce31d0919d603698c9d88a04b05033dc 100644 +--- a/src/main/java/net/minecraft/commands/execution/ExecutionContext.java ++++ b/src/main/java/net/minecraft/commands/execution/ExecutionContext.java +@@ -12,7 +12,7 @@ import net.minecraft.commands.ExecutionCommandSource; + import net.minecraft.commands.execution.tasks.BuildContexts; + import net.minecraft.commands.execution.tasks.CallFunction; + import net.minecraft.commands.functions.InstantiatedFunction; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + import org.slf4j.Logger; + + public class ExecutionContext implements AutoCloseable { +@@ -20,7 +20,7 @@ public class ExecutionContext implements AutoCloseable { + private static final Logger LOGGER = LogUtils.getLogger(); + private final int commandLimit; + private final int forkLimit; +- private final ProfilerFiller profiler; ++ //private final ProfilerFiller profiler; // Plazma - Completely remove Mojang's Profiler + @Nullable + private TraceCallbacks tracer; + private int commandQuota; +@@ -29,10 +29,10 @@ public class ExecutionContext implements AutoCloseable { + private final List> newTopCommands = new ObjectArrayList<>(); + private int currentFrameDepth; + +- public ExecutionContext(int maxCommandChainLength, int maxCommandForkCount, ProfilerFiller profiler) { ++ public ExecutionContext(int maxCommandChainLength, int maxCommandForkCount/*, ProfilerFiller profiler*/) { // Plazma - Completely remove Mojang's Profiler + this.commandLimit = maxCommandChainLength; + this.forkLimit = maxCommandForkCount; +- this.profiler = profiler; ++ //this.profiler = profiler; // Plazma - Completely remove Mojang's Profiler + this.commandQuota = maxCommandChainLength; + } + +@@ -129,9 +129,11 @@ public class ExecutionContext implements AutoCloseable { + return this.tracer; + } + ++ /* // Plazma - Completely remove Mojang's Profiler + public ProfilerFiller profiler() { + return this.profiler; + } ++ */ // Plazma - Completely remove Mojang's Profiler + + public int forkLimit() { + return this.forkLimit; +diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java +index 2ccf6415ec36a998904df6d5c4cae435b3e948e7..156314e53fef1c3714c734df3b7e01ea3bba423c 100644 +--- a/src/main/java/net/minecraft/server/MinecraftServer.java ++++ b/src/main/java/net/minecraft/server/MinecraftServer.java +@@ -111,19 +111,19 @@ import net.minecraft.util.datafix.DataFixers; + import net.minecraft.util.debugchart.RemoteDebugSampleType; + import net.minecraft.util.debugchart.SampleLogger; + import net.minecraft.util.debugchart.TpsDebugDimensions; +-import net.minecraft.util.profiling.EmptyProfileResults; +-import net.minecraft.util.profiling.ProfileResults; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; +-import net.minecraft.util.profiling.ResultField; +-import net.minecraft.util.profiling.SingleTickProfiler; ++//import net.minecraft.util.profiling.EmptyProfileResults; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfileResults; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ResultField; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.SingleTickProfiler; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.util.profiling.jfr.JvmProfiler; + import net.minecraft.util.profiling.jfr.callback.ProfiledDuration; +-import net.minecraft.util.profiling.metrics.profiling.ActiveMetricsRecorder; +-import net.minecraft.util.profiling.metrics.profiling.InactiveMetricsRecorder; +-import net.minecraft.util.profiling.metrics.profiling.MetricsRecorder; +-import net.minecraft.util.profiling.metrics.profiling.ServerMetricsSamplersProvider; +-import net.minecraft.util.profiling.metrics.storage.MetricsPersister; ++//import net.minecraft.util.profiling.metrics.profiling.ActiveMetricsRecorder; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.metrics.profiling.InactiveMetricsRecorder; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.metrics.profiling.MetricsRecorder; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.metrics.profiling.ServerMetricsSamplersProvider; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.metrics.storage.MetricsPersister; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.util.thread.ReentrantBlockableEventLoop; + import net.minecraft.world.Difficulty; + import net.minecraft.world.RandomSequences; +@@ -229,12 +229,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop tickables = Lists.newArrayList(); +- private MetricsRecorder metricsRecorder; +- private Consumer onMetricsRecordingStopped; +- private Consumer onMetricsRecordingFinished; +- private boolean willStartRecordingMetrics; +- @Nullable +- private MinecraftServer.TimeProfiler debugCommandProfiler; ++ //private MetricsRecorder metricsRecorder; // Plazma - Completely remove Mojang's Profiler ++ //private Consumer onMetricsRecordingStopped; // Plazma - Completely remove Mojang's Profiler ++ //private Consumer onMetricsRecordingFinished; // Plazma - Completely remove Mojang's Profiler ++ //private boolean willStartRecordingMetrics; // Plazma - Completely remove Mojang's Profiler ++ //@Nullable // Plazma - Completely remove Mojang's Profiler ++ //private MinecraftServer.TimeProfiler debugCommandProfiler; // Plazma - Completely remove Mojang's Profiler + private boolean debugCommandProfilerDelayStart; + private ServerConnectionListener connection; + public final ChunkProgressListenerFactory progressListenerFactory; +@@ -1410,7 +1410,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0 && this.tickCount % autosavePeriod == 0; + try { + this.isSaving = true; +@@ -1726,7 +1726,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { + entityplayer.connection.suspendFlushing(); +@@ -2922,6 +2922,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { +@@ -2947,12 +2948,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop resultConsumer, Consumer dumpConsumer) { +- /*this.onMetricsRecordingStopped = (methodprofilerresults) -> { // Purpur ++ this.onMetricsRecordingStopped = (methodprofilerresults) -> { // Purpur // Plazma - Completely remove Mojang's Profiler + this.stopRecordingMetrics(); + resultConsumer.accept(methodprofilerresults); + }; + this.onMetricsRecordingFinished = dumpConsumer; +- this.willStartRecordingMetrics = true;*/ // Purpur ++ this.willStartRecordingMetrics = true; // Purpur // Plazma - Completely remove Mojang's Profiler + } + + public void stopRecordingMetrics() { +@@ -2966,6 +2967,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop prepared, ResourceManager manager, ProfilerFiller profiler) { ++ protected void apply(Map prepared, ResourceManager manager) { // Plazma - Completely remove Mojang's Profiler + Builder builder = ImmutableMap.builder(); + + prepared.forEach((minecraftkey, advancement) -> { +diff --git a/src/main/java/net/minecraft/server/ServerFunctionManager.java b/src/main/java/net/minecraft/server/ServerFunctionManager.java +index ebd4d2463f88535edd69a1b63a65a635a5592ca2..9523a2fa1e7019339bd166993ca04e1c0eab750b 100644 +--- a/src/main/java/net/minecraft/server/ServerFunctionManager.java ++++ b/src/main/java/net/minecraft/server/ServerFunctionManager.java +@@ -16,8 +16,8 @@ import net.minecraft.commands.functions.CommandFunction; + import net.minecraft.commands.functions.InstantiatedFunction; + import net.minecraft.nbt.CompoundTag; + import net.minecraft.resources.ResourceLocation; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + import org.slf4j.Logger; + + public class ServerFunctionManager { +diff --git a/src/main/java/net/minecraft/server/commands/DebugCommand.java b/src/main/java/net/minecraft/server/commands/DebugCommand.java +index 06568cc308e06b16f43ec7facd5e2c4e36f3fee9..fd288704150960750b4e1d09031cfae8730e8b11 100644 +--- a/src/main/java/net/minecraft/server/commands/DebugCommand.java ++++ b/src/main/java/net/minecraft/server/commands/DebugCommand.java +@@ -35,8 +35,9 @@ import net.minecraft.network.chat.Component; + import net.minecraft.resources.ResourceLocation; + import net.minecraft.server.MinecraftServer; + import net.minecraft.util.TimeUtil; +-import net.minecraft.util.profiling.ProfileResults; ++//import net.minecraft.util.profiling.ProfileResults; // Plazma - Completely remove Mojang's Profiler + import org.apache.commons.io.IOUtils; ++import org.bukkit.command.CommandSender; + import org.slf4j.Logger; + + public class DebugCommand { +@@ -67,36 +68,22 @@ public class DebugCommand { + } + + private static int start(CommandSourceStack source) throws CommandSyntaxException { +- MinecraftServer minecraftServer = source.getServer(); +- if (minecraftServer.isTimeProfilerRunning()) { +- throw ERROR_ALREADY_RUNNING.create(); +- } else { +- minecraftServer.startTimeProfiler(); +- source.sendSuccess(() -> Component.translatable("commands.debug.started"), true); +- return 0; +- } ++ return removedMessage(source); // Plazma - Completely remove Mojang's Profiler + } + + private static int stop(CommandSourceStack source) throws CommandSyntaxException { +- MinecraftServer minecraftServer = source.getServer(); +- if (!minecraftServer.isTimeProfilerRunning()) { +- throw ERROR_NOT_RUNNING.create(); +- } else { +- ProfileResults profileResults = minecraftServer.stopTimeProfiler(); +- double d = (double)profileResults.getNanoDuration() / (double)TimeUtil.NANOSECONDS_PER_SECOND; +- double e = (double)profileResults.getTickDuration() / d; +- source.sendSuccess( +- () -> Component.translatable( +- "commands.debug.stopped", +- String.format(Locale.ROOT, "%.2f", d), +- profileResults.getTickDuration(), +- String.format(Locale.ROOT, "%.2f", e) +- ), +- true +- ); +- return (int)e; +- } ++ return removedMessage(source); // Plazma - Completely remove Mojang's Profiler ++ } ++ ++ // Plazma start - Completely remove Mojang's Profiler ++ private static int removedMessage(CommandSourceStack source) { ++ net.kyori.adventure.text.minimessage.MiniMessage mm = net.kyori.adventure.text.minimessage.MiniMessage.miniMessage(); ++ source.getSender().sendMessage(mm.deserialize("Purpur has removed Mojang's Profiler to save your performance. Please use /spark instead")); ++ source.getSender().sendMessage(mm.deserialize("For more information, view its documentation at")); ++ source.getSender().sendMessage(mm.deserialize("https://spark.lucko.me/docs/Command-Usage")); ++ return 0; + } ++ // Plazma end - Completely remove Mojang's Profiler + + static class TraceCustomExecutor + extends CustomCommandExecutor.WithErrorHandling +@@ -267,6 +254,13 @@ public class DebugCommand { + return true; + } + ++ // Plazma start - fix build ++ @Override ++ public CommandSender getBukkitSender(final CommandSourceStack wrapper) { ++ return wrapper.getBukkitSender(); ++ } ++ // Plazma end - fix build ++ + @Override + public void close() { + IOUtils.closeQuietly((Writer)this.output); +diff --git a/src/main/java/net/minecraft/server/commands/PerfCommand.java b/src/main/java/net/minecraft/server/commands/PerfCommand.java +index 8ac4d5dbe7f8febf4226f26a6b035282dcdf1b0f..3d6f649ab1efcc71f70f055cff0854c933672526 100644 +--- a/src/main/java/net/minecraft/server/commands/PerfCommand.java ++++ b/src/main/java/net/minecraft/server/commands/PerfCommand.java +@@ -19,9 +19,9 @@ import net.minecraft.network.chat.Component; + import net.minecraft.server.MinecraftServer; + import net.minecraft.util.FileZipper; + import net.minecraft.util.TimeUtil; +-import net.minecraft.util.profiling.EmptyProfileResults; +-import net.minecraft.util.profiling.ProfileResults; +-import net.minecraft.util.profiling.metrics.storage.MetricsPersister; ++//import net.minecraft.util.profiling.EmptyProfileResults; // Plazma - Completely remove Mojang's profiler ++//import net.minecraft.util.profiling.ProfileResults; // Plazma - Completely remove Mojang's profiler ++//import net.minecraft.util.profiling.metrics.storage.MetricsPersister; // Plazma - Completely remove Mojang's profiler + import org.apache.commons.io.FileUtils; + import org.slf4j.Logger; + +@@ -42,7 +42,8 @@ public class PerfCommand { + } + + private static int startProfilingDedicatedServer(CommandSourceStack source) throws CommandSyntaxException { +- if (true) return removedMessage(source); // Purpur ++ return removedMessage(source); // Purpur // Plazma - Completely remove Mojang's profiler ++ /* // Plazma - Completely remove Mojang's profiler + MinecraftServer minecraftServer = source.getServer(); + if (minecraftServer.isRecordingMetrics()) { + throw ERROR_ALREADY_RUNNING.create(); +@@ -53,10 +54,12 @@ public class PerfCommand { + source.sendSuccess(() -> Component.translatable("commands.perf.started"), false); + return 0; + } ++ */ // Plazma - Completely remove Mojang's profiler + } + + private static int stopProfilingDedicatedServer(CommandSourceStack source) throws CommandSyntaxException { +- if (true) return removedMessage(source); // Purpur ++ return removedMessage(source); // Purpur // Plazma - Completely remove Mojang's profiler ++ /* // Plazma - Completely remove Mojang's profiler + MinecraftServer minecraftServer = source.getServer(); + if (!minecraftServer.isRecordingMetrics()) { + throw ERROR_NOT_RUNNING.create(); +@@ -64,6 +67,7 @@ public class PerfCommand { + minecraftServer.finishRecordingMetrics(); + return 0; + } ++ */ // Plazma - Completely remove Mojang's profiler + } + + // Purpur start +@@ -78,6 +82,7 @@ public class PerfCommand { + } + // Purpur end + ++ /* // Plazma - Completely remove Mojang's profiler + private static void saveResults(CommandSourceStack source, Path tempProfilingDirectory, MinecraftServer server) { + String string = String.format( + Locale.ROOT, "%s-%s-%s", Util.getFilenameFormattedDateTime(), server.getWorldData().getLevelName(), SharedConstants.getCurrentVersion().getId() +@@ -118,4 +123,6 @@ public class PerfCommand { + ); + } + } ++ */ // Plazma - Completely remove Mojang's profiler ++ + } +diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +index 808cf602ee77d8156b032fb1a2bd1f5a3a2c2579..77244ec4257bfe3b0f1fdcaf189a0d34a6b84707 100644 +--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java ++++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +@@ -871,11 +871,13 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface + return this.settings.getProperties().serverResourcePackInfo; + } + ++ /* // Plazma - Completely remove Mojang's Profiler + @Override + public void endMetricsRecordingTick() { + super.endMetricsRecordingTick(); + this.debugSampleSubscriptionTracker.tick(this.getTickCount()); + } ++ */ // Plazma - Completely remove Mojang's Profiler + + @Override + public SampleLogger getTickTimeLogger() { +diff --git a/src/main/java/net/minecraft/server/level/ChunkGenerationTask.java b/src/main/java/net/minecraft/server/level/ChunkGenerationTask.java +index 7ea8c13c9993576c1408e710d3ceb9947b09090d..f49000bed3b273a170258ca3816b0b6d7b1e6bcf 100644 +--- a/src/main/java/net/minecraft/server/level/ChunkGenerationTask.java ++++ b/src/main/java/net/minecraft/server/level/ChunkGenerationTask.java +@@ -5,8 +5,8 @@ import java.util.List; + import java.util.concurrent.CompletableFuture; + import javax.annotation.Nullable; + import net.minecraft.util.StaticCache2D; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.Zone; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.Zone; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.world.level.ChunkPos; + import net.minecraft.world.level.chunk.ChunkAccess; + import net.minecraft.world.level.chunk.status.ChunkDependencies; +@@ -113,8 +113,8 @@ public class ChunkGenerationTask { + } + + private void scheduleLayer(ChunkStatus targetStatus, boolean allowGeneration) { +- try (Zone zone = Profiler.get().zone("scheduleLayer")) { +- zone.addText(targetStatus::getName); ++ //try (Zone zone = Profiler.get().zone("scheduleLayer")) { // Plazma - Completely remove Mojang's Profiler ++ //zone.addText(targetStatus::getName); // Plazma - Completely remove Mojang's Profiler + int i = this.getRadiusForLayer(targetStatus, allowGeneration); + + for (int j = this.pos.x - i; j <= this.pos.x + i; j++) { +@@ -125,7 +125,7 @@ public class ChunkGenerationTask { + } + } + } +- } ++ //} // Plazma - Completely remove Mojang's Profiler + } + + private int getRadiusForLayer(ChunkStatus status, boolean generate) { +diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java +index 214c38ff42075003fc0063ef46ad0d14557d2082..98cc08dfeb444993648a8be71c2b7ddbfd6017e8 100644 +--- a/src/main/java/net/minecraft/server/level/ChunkMap.java ++++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +@@ -65,8 +65,8 @@ import net.minecraft.server.network.ServerPlayerConnection; + import net.minecraft.util.CsvOutput; + import net.minecraft.util.Mth; + import net.minecraft.util.StaticCache2D; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's profiler + import net.minecraft.util.thread.BlockableEventLoop; + import net.minecraft.util.thread.ConsecutiveExecutor; + import net.minecraft.world.entity.Entity; +diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java +index bb168636cbf23b5b0c7232529e390f434546dc37..ffe43a82366355ac0a773ea90b4f2dab3858a8e0 100644 +--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java ++++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java +@@ -26,8 +26,8 @@ import net.minecraft.network.protocol.Packet; + import net.minecraft.server.MinecraftServer; + import net.minecraft.server.level.progress.ChunkProgressListener; + import net.minecraft.util.VisibleForDebug; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.util.thread.BlockableEventLoop; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.ai.village.poi.PoiManager; +@@ -497,19 +497,19 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon + this.shuffleRandom.setSeed(this.level.random.nextLong()); + if (!this.level.paperConfig().entities.spawning.perPlayerMobSpawns) Util.shuffle(list, this.shuffleRandom); // Paper - Optional per player mob spawns; do not need this when per-player is enabled + // Paper end - chunk tick iteration optimisation +- this.tickChunks(null, j, list); // Purpur ++ this.tickChunks(j, list); // Purpur // Plazma - Completely remove Mojang's Profiler + //gameprofilerfiller.pop(); // Purpur + } finally { + list.clear(); + } + } + +- this.broadcastChangedChunks(null); // Purpur ++ this.broadcastChangedChunks(); // Purpur // Plazma - Completely remove Mojang's Profiler + //gameprofilerfiller.pop(); // Purpur + } + } + +- private void broadcastChangedChunks(ProfilerFiller profiler) { // Purpur ++ private void broadcastChangedChunks() { // Purpur // Plazma - Completely remove Mojang's Profiler + //profiler.push("broadcast"); // Purpur + Iterator iterator = this.chunkHoldersToBroadcast.iterator(); + +@@ -549,7 +549,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon + // Paper end - chunk tick iteration optimisation + } + +- private void tickChunks(ProfilerFiller profiler, long timeDelta, List chunks) { ++ private void tickChunks(long timeDelta, List chunks) { // Plazma - Completely remove Mojang's Profiler + //profiler.popPush("naturalSpawnCount"); // Purpur + int j = this.distanceManager.getNaturalSpawnChunkCount(); + // Paper start - Optional per player mob spawns +diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java +index d5662fd0bc124ce5fb5716f77769c33d2f9f4dd7..e89aa046dfda1af1090a1466310def0f7205c9c3 100644 +--- a/src/main/java/net/minecraft/server/level/ServerLevel.java ++++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +@@ -79,8 +79,8 @@ import net.minecraft.util.ProgressListener; + import net.minecraft.util.RandomSource; + import net.minecraft.util.Unit; + import net.minecraft.util.datafix.DataFixTypes; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.util.valueproviders.IntProvider; + import net.minecraft.util.valueproviders.UniformInt; + import net.minecraft.world.DifficultyInstance; +@@ -868,9 +868,9 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe + long i = this.levelData.getGameTime() + 1L; + + this.serverLevelData.setGameTime(i); +- Profiler.get().push("scheduledFunctions"); ++ //Profiler.get().push("scheduledFunctions"); // Plazma - Completely remove Mojang's Profiler + this.serverLevelData.getScheduledEvents().tick(this.server, i); +- Profiler.get().pop(); ++ //Profiler.get().pop(); // Plazma - Completely remove Mojang's Profiler + if (this.serverLevelData.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT)) { + // Purpur start + int incrementTicks = isDay() ? this.purpurConfig.daytimeTicks : this.purpurConfig.nighttimeTicks; +diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java +index 627b69f08f609dc0a4d87327a187009651046cf4..7238c7224f985279799e84eeaed6916e0c76964d 100644 +--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java ++++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +@@ -102,8 +102,8 @@ import net.minecraft.tags.FluidTags; + import net.minecraft.util.Mth; + import net.minecraft.util.RandomSource; + import net.minecraft.util.Unit; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.world.damagesource.DamageSource; + import net.minecraft.world.damagesource.DamageTypes; + import net.minecraft.world.effect.MobEffectInstance; +diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +index 49cb116fd55e6d5cd36b9773b39191e4ab06b7e0..7a5c3210401e5833188f45619243afe5e08cd6a1 100644 +--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java ++++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +@@ -30,7 +30,7 @@ import net.minecraft.server.MinecraftServer; + import net.minecraft.server.level.ClientInformation; + import net.minecraft.server.level.ServerPlayer; + import net.minecraft.util.VisibleForDebug; +-import net.minecraft.util.profiling.Profiler; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.util.thread.BlockableEventLoop; + import org.slf4j.Logger; + +diff --git a/src/main/java/net/minecraft/server/packs/resources/ProfiledReloadInstance.java b/src/main/java/net/minecraft/server/packs/resources/ProfiledReloadInstance.java +index 5a2b07340c63577f6d32c0658ce5f9b616c82f91..a5bb5f3fa3b5a232cdf9261c388bbb04a2d96b20 100644 +--- a/src/main/java/net/minecraft/server/packs/resources/ProfiledReloadInstance.java ++++ b/src/main/java/net/minecraft/server/packs/resources/ProfiledReloadInstance.java +@@ -9,8 +9,8 @@ import java.util.concurrent.TimeUnit; + import java.util.concurrent.atomic.AtomicLong; + import net.minecraft.Util; + import net.minecraft.util.Unit; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + import org.slf4j.Logger; + + public class ProfiledReloadInstance extends SimpleReloadInstance { +@@ -51,12 +51,12 @@ public class ProfiledReloadInstance extends SimpleReloadInstance executor.execute(() -> { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push(string); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Completely remove Mojang's Profiler ++ //profilerFiller.push(string); // Plazma - Completely remove Mojang's Profiler + long l = Util.getNanos(); + runnable.run(); + atomicLong.addAndGet(Util.getNanos() - l); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Completely remove Mojang's Profiler + }); + } + +diff --git a/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java b/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java +index abc92e09b7bb636612f04ace8232947c8d454e68..7c8990a713bf986cbb4e65f52aa1a3fdea7b14af 100644 +--- a/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java ++++ b/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java +@@ -3,8 +3,8 @@ package net.minecraft.server.packs.resources; + import java.util.concurrent.CompletableFuture; + import java.util.concurrent.Executor; + import net.minecraft.util.Unit; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + + public interface ResourceManagerReloadListener extends PreparableReloadListener { + @Override +diff --git a/src/main/java/net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener.java b/src/main/java/net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener.java +index eb54f0cc67ca25e0ff6e423bcbcebab294bd5d95..11e2efcf07ab5a758812c598468d2f4561fa5264 100644 +--- a/src/main/java/net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener.java ++++ b/src/main/java/net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener.java +@@ -15,7 +15,7 @@ import java.util.Map.Entry; + import net.minecraft.core.HolderLookup; + import net.minecraft.resources.FileToIdConverter; + import net.minecraft.resources.ResourceLocation; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + import org.slf4j.Logger; + + public abstract class SimpleJsonResourceReloadListener extends SimplePreparableReloadListener> { +@@ -39,7 +39,7 @@ public abstract class SimpleJsonResourceReloadListener extends SimplePreparab + } + + @Override +- protected Map prepare(ResourceManager resourceManager, ProfilerFiller profilerFiller) { ++ protected Map prepare(ResourceManager resourceManager) { // Plazma - Completely remove Mojang's Profiler + Map map = new HashMap<>(); + scanDirectory(resourceManager, this.directory, this.ops, this.codec, map); + return map; +diff --git a/src/main/java/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java b/src/main/java/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java +index 0aaab6a2a10bf012c9d275f7cee2095c8fbb8809..4d986ee7bd823386c0ed0e54c1980c9c349bb791 100644 +--- a/src/main/java/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java ++++ b/src/main/java/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java +@@ -2,20 +2,20 @@ package net.minecraft.server.packs.resources; + + import java.util.concurrent.CompletableFuture; + import java.util.concurrent.Executor; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + + public abstract class SimplePreparableReloadListener implements PreparableReloadListener { + @Override + public final CompletableFuture reload( + PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, Executor prepareExecutor, Executor applyExecutor + ) { +- return CompletableFuture.supplyAsync(() -> this.prepare(manager, Profiler.get()), prepareExecutor) ++ return CompletableFuture.supplyAsync(() -> this.prepare(manager), prepareExecutor) // Plazma - Completely remove Mojang's Profiler + .thenCompose(synchronizer::wait) +- .thenAcceptAsync(prepared -> this.apply((T)prepared, manager, Profiler.get()), applyExecutor); ++ .thenAcceptAsync(prepared -> this.apply(prepared, manager), applyExecutor); // Plazma - Completely remove Mojang's Profiler + } + +- protected abstract T prepare(ResourceManager manager, ProfilerFiller profiler); ++ protected abstract T prepare(ResourceManager manager); // Plazma - Completely remove Mojang's Profiler + +- protected abstract void apply(T prepared, ResourceManager manager, ProfilerFiller profiler); ++ protected abstract void apply(T prepared, ResourceManager manager); // Plazma - Completely remove Mojang's Profiler + } +diff --git a/src/main/java/net/minecraft/util/thread/AbstractConsecutiveExecutor.java b/src/main/java/net/minecraft/util/thread/AbstractConsecutiveExecutor.java +index 805532c7acc4ad81b83e305d669f5cee0e7597e9..699f69421a36c78bd0cd728e86fe0e20bb515de4 100644 +--- a/src/main/java/net/minecraft/util/thread/AbstractConsecutiveExecutor.java ++++ b/src/main/java/net/minecraft/util/thread/AbstractConsecutiveExecutor.java +@@ -7,13 +7,13 @@ import java.util.concurrent.Executor; + import java.util.concurrent.RejectedExecutionException; + import java.util.concurrent.atomic.AtomicReference; + import net.minecraft.Util; +-import net.minecraft.util.profiling.metrics.MetricCategory; +-import net.minecraft.util.profiling.metrics.MetricSampler; +-import net.minecraft.util.profiling.metrics.MetricsRegistry; +-import net.minecraft.util.profiling.metrics.ProfilerMeasured; ++//import net.minecraft.util.profiling.metrics.MetricCategory; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.metrics.MetricSampler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.metrics.MetricsRegistry; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.metrics.ProfilerMeasured; // Plazma - Completely remove Mojang's Profiler + import org.slf4j.Logger; + +-public abstract class AbstractConsecutiveExecutor implements ProfilerMeasured, TaskScheduler, Runnable { ++public abstract class AbstractConsecutiveExecutor implements TaskScheduler, Runnable { // Plazma - Completely remove Mojang's Profiler + private static final Logger LOGGER = LogUtils.getLogger(); + private final AtomicReference status = new AtomicReference<>(AbstractConsecutiveExecutor.Status.SLEEPING); + private final StrictQueue queue; +@@ -24,7 +24,7 @@ public abstract class AbstractConsecutiveExecutor implements + this.executor = executor; + this.queue = queue; + this.name = name; +- MetricsRegistry.INSTANCE.add(this); ++ //MetricsRegistry.INSTANCE.add(this); // Plazma - Completely remove Mojang's Profiler + } + + private boolean canBeScheduled() { +@@ -108,10 +108,12 @@ public abstract class AbstractConsecutiveExecutor implements + return this.name; + } + ++ /* // Plazma - Completely remove Mojang's Profiler + @Override + public List profiledMetrics() { + return ImmutableList.of(MetricSampler.create(this.name + "-queue-size", MetricCategory.CONSECUTIVE_EXECUTORS, this::size)); + } ++ */ // Plazma - Completely remove Mojang's Profiler + + private boolean setRunning() { + return this.status.compareAndSet(AbstractConsecutiveExecutor.Status.SLEEPING, AbstractConsecutiveExecutor.Status.RUNNING); +diff --git a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java b/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java +index 9b706276dc5b5f55b966c5472c6c4e864342b916..f91227bc1a7c650483c9b46b30ac06a9597997f2 100644 +--- a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java ++++ b/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java +@@ -15,13 +15,13 @@ import java.util.function.Supplier; + import javax.annotation.CheckReturnValue; + import net.minecraft.ReportedException; + import net.minecraft.SharedConstants; +-import net.minecraft.util.profiling.metrics.MetricCategory; +-import net.minecraft.util.profiling.metrics.MetricSampler; +-import net.minecraft.util.profiling.metrics.MetricsRegistry; +-import net.minecraft.util.profiling.metrics.ProfilerMeasured; ++//import net.minecraft.util.profiling.metrics.MetricCategory; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.metrics.MetricSampler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.metrics.MetricsRegistry; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.metrics.ProfilerMeasured; // Plazma - Completely remove Mojang's Profiler + import org.slf4j.Logger; + +-public abstract class BlockableEventLoop implements ProfilerMeasured, TaskScheduler, Executor { ++public abstract class BlockableEventLoop implements TaskScheduler, Executor { // Plazma - Completely remove Mojang's Profiler + public static final long BLOCK_TIME_NANOS = 100000L; + private final String name; + private static final Logger LOGGER = LogUtils.getLogger(); +@@ -30,7 +30,7 @@ public abstract class BlockableEventLoop implements Profiler + + protected BlockableEventLoop(String name) { + this.name = name; +- MetricsRegistry.INSTANCE.add(this); ++ //MetricsRegistry.INSTANCE.add(this); // Plazma - Completely remove Mojang's Profiler + } + + protected abstract boolean shouldRun(R task); +@@ -160,10 +160,12 @@ public abstract class BlockableEventLoop implements Profiler + } + } + ++ /* // Plazma - Completely remove Mojang's Profiler + @Override + public List profiledMetrics() { + return ImmutableList.of(MetricSampler.create(this.name + "-pending-tasks", MetricCategory.EVENT_LOOPS, this::getPendingTasksCount)); + } ++ */ // Plazma - Completely remove Mojang's Profiler + + public static boolean isNonRecoverable(Throwable exception) { + return exception instanceof ReportedException reportedException +diff --git a/src/main/java/net/minecraft/util/thread/PriorityConsecutiveExecutor.java b/src/main/java/net/minecraft/util/thread/PriorityConsecutiveExecutor.java +index c67846e4d5583d79c6e9760c10d2581f0d54f45c..61f704fc25c45367185633708852ee4bc4084528 100644 +--- a/src/main/java/net/minecraft/util/thread/PriorityConsecutiveExecutor.java ++++ b/src/main/java/net/minecraft/util/thread/PriorityConsecutiveExecutor.java +@@ -3,12 +3,12 @@ package net.minecraft.util.thread; + import java.util.concurrent.CompletableFuture; + import java.util.concurrent.Executor; + import java.util.function.Consumer; +-import net.minecraft.util.profiling.metrics.MetricsRegistry; ++//import net.minecraft.util.profiling.metrics.MetricsRegistry; // Plazma - Completely remove Mojang's Profiler + + public class PriorityConsecutiveExecutor extends AbstractConsecutiveExecutor { + public PriorityConsecutiveExecutor(int priorityCount, Executor executor, String name) { + super(new StrictQueue.FixedPriorityQueue(priorityCount), executor, name); +- MetricsRegistry.INSTANCE.add(this); ++ //MetricsRegistry.INSTANCE.add(this); // Plazma - Completely remove Mojang's Profiler + } + + @Override +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +index b94f3e2071e71b2b038e875b25c985b0c7c00fc0..d16c34c3bcebcd43e1fc35da4d089fac55d59102 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -84,8 +84,8 @@ import net.minecraft.tags.FluidTags; + import net.minecraft.tags.TagKey; + import net.minecraft.util.Mth; + import net.minecraft.util.RandomSource; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.world.InteractionHand; + import net.minecraft.world.InteractionResult; + import net.minecraft.world.Nameable; +@@ -4058,16 +4058,16 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess + entity.teleport(this.calculatePassengerTransition(teleportTarget, entity)); + } + +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Plazma - Completely remove Mojang's Profiler + +- gameprofilerfiller.push("teleportSameDimension"); ++ //gameprofilerfiller.push("teleportSameDimension"); // Plazma - Completely remove Mojang's Profiler + this.teleportSetPosition(PositionMoveRotation.of(teleportTarget), teleportTarget.relatives()); + if (!teleportTarget.asPassenger()) { + this.sendTeleportTransitionToRidingPlayers(teleportTarget); + } + + teleportTarget.postTeleportTransition().onTransition(this); +- gameprofilerfiller.pop(); ++ //gameprofilerfiller.pop(); // Plazma - Completely remove Mojang's Profiler + return this; + } + +diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java +index 4653b25a818ebe18980864e6e450bd0ab8db99e9..119df9ab026de60bcb0c04058910aaeef66bc1c1 100644 +--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java ++++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +@@ -73,8 +73,8 @@ import net.minecraft.tags.FluidTags; + import net.minecraft.tags.ItemTags; + import net.minecraft.tags.TagKey; + import net.minecraft.util.Mth; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.world.Difficulty; + import net.minecraft.world.InteractionHand; + import net.minecraft.world.damagesource.CombatRules; +diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java +index 8e5ad4cd6c8f61661b87dc96ba914c0bcd199879..d242eeb3dde8f379a7baad430f2c22ab3ca8a3c9 100644 +--- a/src/main/java/net/minecraft/world/entity/Mob.java ++++ b/src/main/java/net/minecraft/world/entity/Mob.java +@@ -34,8 +34,8 @@ import net.minecraft.sounds.SoundEvent; + import net.minecraft.tags.TagKey; + import net.minecraft.util.Mth; + import net.minecraft.util.RandomSource; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.world.Difficulty; + import net.minecraft.world.DifficultyInstance; + import net.minecraft.world.InteractionHand; +diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java +index 74c5914bc51cff128d4b86853316e5e51e02b416..129c907e842f4f16ad13c490672bfec6eaba620e 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java ++++ b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java +@@ -7,8 +7,8 @@ import java.util.EnumSet; + import java.util.Map; + import java.util.Set; + import java.util.function.Predicate; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + + public class GoalSelector { + private static final WrappedGoal NO_GOAL = new WrappedGoal(Integer.MAX_VALUE, new Goal() { +diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java +index a5289b6c453c24cb7b8b3a301b72c3adf92c1d13..c7c6385c71c5bfae5818976008feececf5890654 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java ++++ b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java +@@ -10,8 +10,8 @@ import net.minecraft.core.Vec3i; + import net.minecraft.network.protocol.game.DebugPackets; + import net.minecraft.tags.BlockTags; + import net.minecraft.util.Mth; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.Mob; + import net.minecraft.world.entity.ai.attributes.Attributes; +diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensing.java b/src/main/java/net/minecraft/world/entity/ai/sensing/Sensing.java +index 8f5a5db1a07fa6a95ecfacaab2f9de609202faf4..8bd18b5bf660cb307b7d405a497906ae6608b6b4 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensing.java ++++ b/src/main/java/net/minecraft/world/entity/ai/sensing/Sensing.java +@@ -2,8 +2,8 @@ package net.minecraft.world.entity.ai.sensing; + + import it.unimi.dsi.fastutil.ints.IntOpenHashSet; + import it.unimi.dsi.fastutil.ints.IntSet; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.Mob; + +diff --git a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java +index 026cd57df33476841ed3a8f9fdc4d17a77e037b0..9ed118034e738f662a507553869526328b2a0795 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java ++++ b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java +@@ -31,8 +31,8 @@ import net.minecraft.tags.GameEventTags; + import net.minecraft.tags.ItemTags; + import net.minecraft.tags.TagKey; + import net.minecraft.util.Mth; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.world.InteractionHand; + import net.minecraft.world.InteractionResult; + import net.minecraft.world.SimpleContainer; +diff --git a/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java b/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java +index 84516dcfc6cd0fe16c26538ccb86fb5c85b44ffa..b4ec352826aef4fa1e9d912eb26b3f2470d811e8 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java ++++ b/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java +@@ -23,8 +23,8 @@ import net.minecraft.util.ByIdMap; + import net.minecraft.util.RandomSource; + import net.minecraft.util.StringRepresentable; + import net.minecraft.util.TimeUtil; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.world.InteractionHand; + import net.minecraft.world.InteractionResult; + import net.minecraft.world.damagesource.DamageSource; +diff --git a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java +index c80d74caa393a31e09f2776cdb3cb950ef99e2ef..8a20f056bde735ac896282918c2bed036178fbc7 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java ++++ b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java +@@ -26,8 +26,8 @@ import net.minecraft.util.ByIdMap; + import net.minecraft.util.Mth; + import net.minecraft.util.RandomSource; + import net.minecraft.util.StringRepresentable; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.world.DifficultyInstance; + import net.minecraft.world.InteractionHand; + import net.minecraft.world.InteractionResult; +diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java +index 39cdecc382a71ef643d382ac506249bbb8df3d34..a8c68b4e17456221d601696571135a281eb1555e 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java ++++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java +@@ -17,8 +17,8 @@ import net.minecraft.sounds.SoundSource; + import net.minecraft.tags.BlockTags; + import net.minecraft.tags.ItemTags; + import net.minecraft.util.Mth; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.world.DifficultyInstance; + import net.minecraft.world.InteractionHand; + import net.minecraft.world.InteractionResult; +diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java +index 94ca735513901a180d42ac1cfd48d841142a6ef5..542cd59bb0eecac3845c3eefdd20e9105b1448c0 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java ++++ b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java +@@ -28,8 +28,8 @@ import net.minecraft.tags.ItemTags; + import net.minecraft.util.Mth; + import net.minecraft.util.RandomSource; + import net.minecraft.util.Unit; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.world.DifficultyInstance; + import net.minecraft.world.damagesource.DamageSource; + import net.minecraft.world.entity.AgeableMob; +diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java +index cc5c172b2fccc5fc59337203ed2b6edb2abc0c22..7b9e7d3595bd6add8f76c4d9bf9758c78ecce962 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java ++++ b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java +@@ -12,8 +12,8 @@ import net.minecraft.server.level.ServerLevel; + import net.minecraft.sounds.SoundEvent; + import net.minecraft.sounds.SoundEvents; + import net.minecraft.tags.ItemTags; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.world.InteractionHand; + import net.minecraft.world.InteractionResult; + import net.minecraft.world.damagesource.DamageSource; +diff --git a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java +index ebf53d48b09918c7453f982a5e4f9a1584dfc544..c1f79d16fd2fc1b5642d9be68df81465c4b2eb2b 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java ++++ b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java +@@ -20,8 +20,8 @@ import net.minecraft.tags.ItemTags; + import net.minecraft.tags.TagKey; + import net.minecraft.util.Mth; + import net.minecraft.util.RandomSource; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.world.DifficultyInstance; + import net.minecraft.world.InteractionHand; + import net.minecraft.world.InteractionResult; +diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java +index f853730cee4fad2f3a5711e38918c65dcb1dc038..cd1845f6d7552670ae29c7a5b087220f3b4fc0e9 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java ++++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java +@@ -30,8 +30,8 @@ import net.minecraft.tags.BlockTags; + import net.minecraft.tags.ItemTags; + import net.minecraft.util.ByIdMap; + import net.minecraft.util.Mth; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.world.InteractionHand; + import net.minecraft.world.InteractionResult; + import net.minecraft.world.damagesource.DamageSource; +diff --git a/src/main/java/net/minecraft/world/entity/monster/Zoglin.java b/src/main/java/net/minecraft/world/entity/monster/Zoglin.java +index f30ad422f19757664228f2064465fbcb22bb54f6..0cff4d4ee945ab5b6362648bf932af796d16a601 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/Zoglin.java ++++ b/src/main/java/net/minecraft/world/entity/monster/Zoglin.java +@@ -15,8 +15,8 @@ import net.minecraft.network.syncher.SynchedEntityData; + import net.minecraft.server.level.ServerLevel; + import net.minecraft.sounds.SoundEvent; + import net.minecraft.sounds.SoundEvents; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.util.valueproviders.UniformInt; + import net.minecraft.world.DifficultyInstance; + import net.minecraft.world.damagesource.DamageSource; +diff --git a/src/main/java/net/minecraft/world/entity/monster/breeze/Breeze.java b/src/main/java/net/minecraft/world/entity/monster/breeze/Breeze.java +index 0bc771e20a9bab139cd3fc03ff40baabf787b2f7..e60c2dbc2188ea32459b536b0e3f3fea36f70776 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/breeze/Breeze.java ++++ b/src/main/java/net/minecraft/world/entity/monster/breeze/Breeze.java +@@ -12,8 +12,8 @@ import net.minecraft.sounds.SoundEvent; + import net.minecraft.sounds.SoundEvents; + import net.minecraft.sounds.SoundSource; + import net.minecraft.tags.EntityTypeTags; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.world.damagesource.DamageSource; + import net.minecraft.world.entity.AnimationState; + import net.minecraft.world.entity.Entity; +diff --git a/src/main/java/net/minecraft/world/entity/monster/creaking/Creaking.java b/src/main/java/net/minecraft/world/entity/monster/creaking/Creaking.java +index 7b5f9284972b3a6bd8125891b23f73438e875c08..6a17c30afc7863dfa55f1e07ea29b1fb0166adc7 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/creaking/Creaking.java ++++ b/src/main/java/net/minecraft/world/entity/monster/creaking/Creaking.java +@@ -13,8 +13,8 @@ import net.minecraft.network.syncher.SynchedEntityData; + import net.minecraft.server.level.ServerLevel; + import net.minecraft.sounds.SoundEvent; + import net.minecraft.sounds.SoundEvents; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.world.damagesource.DamageSource; + import net.minecraft.world.entity.AnimationState; + import net.minecraft.world.entity.Entity; +@@ -121,10 +121,10 @@ public class Creaking extends Monster { + + @Override + protected void customServerAiStep(ServerLevel world) { +- ProfilerFiller profilerFiller = Profiler.get(); +- profilerFiller.push("creakingBrain"); ++ //ProfilerFiller profilerFiller = Profiler.get(); // Plazma - Completely remove Mojang's Profiler ++ //profilerFiller.push("creakingBrain"); // Plazma - Completely remove Mojang's Profiler + this.getBrain().tick((ServerLevel)this.level(), this); +- profilerFiller.pop(); ++ //profilerFiller.pop(); // Plazma - Completely remove Mojang's Profiler + CreakingAi.updateActivity(this); + } + +diff --git a/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java b/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java +index 7afde99f81ec222ecbffbdcdad3aa6404e8221e0..8b91472441a17572d8bb47e42402c585b26aeeb6 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java ++++ b/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java +@@ -16,8 +16,8 @@ import net.minecraft.sounds.SoundEvents; + import net.minecraft.sounds.SoundSource; + import net.minecraft.tags.ItemTags; + import net.minecraft.util.RandomSource; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.world.DifficultyInstance; + import net.minecraft.world.InteractionHand; + import net.minecraft.world.InteractionResult; +diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java +index b53e4a312ea0dbbd16e948e61c3f6b836d46f3b8..8e7c737263f55fdd4a2adbab4a9d208674a55639 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java ++++ b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java +@@ -6,8 +6,8 @@ import java.util.List; + import javax.annotation.Nullable; + import net.minecraft.util.RandomSource; + import net.minecraft.util.VisibleForDebug; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.world.DifficultyInstance; + import net.minecraft.world.InteractionHand; + import net.minecraft.world.InteractionResult; +diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java +index 719179fb232a4f39a2c1642cc0e9593f4dea4bb8..f5c5abbb919455709636d4037b8daa63a2c212e2 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java ++++ b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java +@@ -8,8 +8,8 @@ import net.minecraft.server.level.ServerLevel; + import net.minecraft.sounds.SoundEvent; + import net.minecraft.sounds.SoundEvents; + import net.minecraft.util.RandomSource; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.world.DifficultyInstance; + import net.minecraft.world.damagesource.DamageSource; + import net.minecraft.world.entity.EntitySpawnReason; +diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java +index 9f542e4f0077a6abc89fdec1a4bf3e8f40203b2a..5350c7a6085edc4f8529f443091d52cb70c62efd 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java ++++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java +@@ -32,8 +32,8 @@ import net.minecraft.tags.TagKey; + import net.minecraft.util.Mth; + import net.minecraft.util.RandomSource; + import net.minecraft.util.Unit; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.world.DifficultyInstance; + import net.minecraft.world.damagesource.DamageSource; + import net.minecraft.world.effect.MobEffectInstance; +@@ -318,7 +318,7 @@ public class Warden extends Monster implements VibrationSystem { + + @Override + protected void customServerAiStep(ServerLevel world) { +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Plazma - Completely remove Mojang's Profiler + + //gameprofilerfiller.push("wardenBrain"); // Purpur + this.getBrain().tick(world, this); +diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java +index b4ffad429ace965f16ebf47119c880b709b27f2e..50bed3677f7e38d19ceda0dff0c499957312b2ad 100644 +--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java ++++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java +@@ -38,8 +38,8 @@ import net.minecraft.stats.Stats; + import net.minecraft.tags.ItemTags; + import net.minecraft.util.Mth; + import net.minecraft.util.SpawnUtil; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.world.Difficulty; + import net.minecraft.world.DifficultyInstance; + import net.minecraft.world.InteractionHand; +diff --git a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java +index 26814c13559d82e44546f8b2834a90cc58941a49..22ecef07399ab9d9bde3cd9a3024d070f129c6bd 100644 +--- a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java ++++ b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java +@@ -29,7 +29,7 @@ import net.minecraft.server.level.ServerLevel; + import net.minecraft.server.packs.resources.ResourceManager; + import net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener; + import net.minecraft.server.packs.resources.SimplePreparableReloadListener; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.world.flag.FeatureFlagSet; + import net.minecraft.world.item.Item; + import net.minecraft.world.item.crafting.display.RecipeDisplay; +@@ -93,7 +93,7 @@ public class RecipeManager extends SimplePreparableReloadListener imp + } + + @Override +- protected RecipeMap prepare(ResourceManager manager, ProfilerFiller profiler) { ++ protected RecipeMap prepare(ResourceManager manager) { // Plazma - Completely remove Mojang's Profiler + SortedMap> sortedmap = new TreeMap(); + + SimpleJsonResourceReloadListener.scanDirectory(manager, Registries.elementsDirPath(Registries.RECIPE), this.registries.createSerializationContext(JsonOps.INSTANCE), Recipe.CODEC, sortedmap); +@@ -108,7 +108,7 @@ public class RecipeManager extends SimplePreparableReloadListener imp + return RecipeMap.create(list); + } + +- protected void apply(RecipeMap prepared, ResourceManager manager, ProfilerFiller profiler) { ++ protected void apply(RecipeMap prepared, ResourceManager manager) { // Plazma - Completely remove Mojang's Profiler + this.recipes = prepared; + RecipeManager.LOGGER.info("Loaded {} recipes", prepared.values().size()); + } +diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java +index ad15fc9f329f5ea7fa0d0d88c937b2f36e0f2f3d..d03a89d264cafb752e6a2f07558c119a0ee23253 100644 +--- a/src/main/java/net/minecraft/world/level/Level.java ++++ b/src/main/java/net/minecraft/world/level/Level.java +@@ -35,8 +35,8 @@ import net.minecraft.util.AbortableIterationConsumer; + import net.minecraft.util.Mth; + import net.minecraft.util.RandomSource; + import net.minecraft.util.StringRepresentable; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.world.DifficultyInstance; + import net.minecraft.world.TickRateManager; + import net.minecraft.world.damagesource.DamageSource; +diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java +index 7f936a7ba994ccb51c17168c798b42dde0877a5d..49e255a7825d6c38e3851c121ecc4e6a6e0402f8 100644 +--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java ++++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java +@@ -24,8 +24,8 @@ import net.minecraft.tags.BlockTags; + import net.minecraft.util.Mth; + import net.minecraft.util.RandomSource; + import net.minecraft.util.VisibleForDebug; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.util.random.WeightedRandomList; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.EntitySpawnReason; +@@ -163,9 +163,9 @@ public final class NaturalSpawner { + } + + public static void spawnForChunk(ServerLevel world, LevelChunk chunk, NaturalSpawner.SpawnState info, List spawnableGroups) { +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Plazma - Completely remove Mojang's Profiler + +- gameprofilerfiller.push("spawner"); ++ //gameprofilerfiller.push("spawner"); // Plazma - Completely remove Mojang's Profiler + Iterator iterator = spawnableGroups.iterator(); + + while (iterator.hasNext()) { +diff --git a/src/main/java/net/minecraft/world/level/ServerExplosion.java b/src/main/java/net/minecraft/world/level/ServerExplosion.java +index 3c3d219c9339f64c23ec0b31783bf68a4423636c..ce3eb065081cfd7bc96ac95595f80bf5eb8bb263 100644 +--- a/src/main/java/net/minecraft/world/level/ServerExplosion.java ++++ b/src/main/java/net/minecraft/world/level/ServerExplosion.java +@@ -15,8 +15,8 @@ import net.minecraft.core.BlockPos; + import net.minecraft.core.Holder; + import net.minecraft.server.level.ServerLevel; + import net.minecraft.util.Mth; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.world.damagesource.DamageSource; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.EntityType; +@@ -700,11 +700,11 @@ public class ServerExplosion implements Explosion { + + this.hurtEntities(); + if (this.interactsWithBlocks()) { +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get(); // Plazma - Completely remove Mojang's Profiler + +- gameprofilerfiller.push("explosion_blocks"); ++ //gameprofilerfiller.push("explosion_blocks"); // Plazma - Completely remove Mojang's Profiler + this.interactWithBlocks(list); +- gameprofilerfiller.pop(); ++ //gameprofilerfiller.pop(); // Plazma - Completely remove Mojang's Profiler + } + + if (this.fire) { +diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +index 15c83c6f5f56d6a27911d3bbd326cef1c21b1e58..6656cc0c9041d954d6d318cdefaef86ebee4c2bc 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java ++++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +@@ -25,8 +25,8 @@ import net.minecraft.network.FriendlyByteBuf; + import net.minecraft.network.protocol.game.ClientboundLevelChunkPacketData; + import net.minecraft.server.level.FullChunkStatus; + import net.minecraft.server.level.ServerLevel; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.world.entity.Entity; + import net.minecraft.world.level.ChunkPos; + import net.minecraft.world.level.Level; +@@ -405,7 +405,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p + } + + if (LightEngine.hasDifferentLightProperties(iblockdata1, iblockdata)) { +- ProfilerFiller gameprofilerfiller = Profiler.get(); ++ //ProfilerFiller gameprofilerfiller = Profiler.get();// Plazma - Completely remove Mojang's Profiler + + //gameprofilerfiller.push("updateSkyLightSources"); // Purpur + // Paper - rewrite chunk system +diff --git a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java +index 91abbda59446d462979dddc4b380c6f24d0b4c92..f1aa182d7cc0ffac23ddb1f77335c61ca9f6f720 100644 +--- a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java ++++ b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java +@@ -12,9 +12,9 @@ import java.util.function.Function; + import java.util.stream.Collectors; + import javax.annotation.Nullable; + import net.minecraft.core.BlockPos; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; +-import net.minecraft.util.profiling.metrics.MetricCategory; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.metrics.MetricCategory; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.world.entity.Mob; + import net.minecraft.world.level.PathNavigationRegion; + +diff --git a/src/main/java/net/minecraft/world/ticks/LevelTicks.java b/src/main/java/net/minecraft/world/ticks/LevelTicks.java +index 452fb3442221fd66debfe1e1d6e85ee17951e556..eceb6110cd61c113d762e5c069108077421d03be 100644 +--- a/src/main/java/net/minecraft/world/ticks/LevelTicks.java ++++ b/src/main/java/net/minecraft/world/ticks/LevelTicks.java +@@ -23,8 +23,8 @@ import net.minecraft.Util; + import net.minecraft.core.BlockPos; + import net.minecraft.core.SectionPos; + import net.minecraft.core.Vec3i; +-import net.minecraft.util.profiling.Profiler; +-import net.minecraft.util.profiling.ProfilerFiller; ++//import net.minecraft.util.profiling.Profiler; // Plazma - Completely remove Mojang's Profiler ++//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove Mojang's Profiler + import net.minecraft.world.level.ChunkPos; + import net.minecraft.world.level.levelgen.structure.BoundingBox; + +@@ -81,7 +81,7 @@ public class LevelTicks implements LevelTickAccess { + public void tick(long time, int maxTicks, BiConsumer ticker) { + //ProfilerFiller profilerFiller = Profiler.get(); // Purpur + //profilerFiller.push("collect"); // Purpur +- this.collectTicks(time, maxTicks, null); // Purpur ++ this.collectTicks(time, maxTicks); // Purpur // Plazma - Completely remove Mojang's Profiler + //profilerFiller.popPush("run"); // Purpur + //profilerFiller.incrementCounter("ticksToRun", this.toRunThisTick.size()); // Purpur + this.runCollectedTicks(ticker); +@@ -90,7 +90,7 @@ public class LevelTicks implements LevelTickAccess { + //profilerFiller.pop(); // Purpur + } + +- private void collectTicks(long time, int maxTicks, ProfilerFiller profiler) { ++ private void collectTicks(long time, int maxTicks) { // Plazma - Completely remove Mojang's Profiler + this.sortContainersToTick(time); + //profiler.incrementCounter("containersToTick", this.containersToTick.size()); // Purpur + this.drainContainers(time, maxTicks); diff --git a/patches/unapplied/server/0001-Remove-remaining-timings-implementations.patch b/patches/unapplied/server/0001-Remove-remaining-timings-implementations.patch deleted file mode 100644 index f820be2ec..000000000 --- a/patches/unapplied/server/0001-Remove-remaining-timings-implementations.patch +++ /dev/null @@ -1,1264 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: AlphaKR93 -Date: Wed, 15 May 2024 14:12:50 +0900 -Subject: [PATCH] Remove remaining timings implementations - - -diff --git a/src/main/java/co/aikar/timings/MinecraftTimings.java b/src/main/java/co/aikar/timings/MinecraftTimings.java -index 4b467f1af93452d13829f756d55dee18b8889d40..0a35e272c913df99ac12e87383bb9c7351e9fdb7 100644 ---- a/src/main/java/co/aikar/timings/MinecraftTimings.java -+++ b/src/main/java/co/aikar/timings/MinecraftTimings.java -@@ -1,181 +1,4 @@ - package co.aikar.timings; - --import com.google.common.collect.MapMaker; --import io.papermc.paper.configuration.GlobalConfiguration; --import net.minecraft.commands.functions.CommandFunction; --import net.minecraft.network.protocol.Packet; --import net.minecraft.world.level.block.Block; --import net.minecraft.world.level.block.entity.BlockEntity; --import org.bukkit.plugin.Plugin; --import org.bukkit.scheduler.BukkitTask; -- --import org.bukkit.craftbukkit.scheduler.CraftTask; -- --import java.util.Map; -- --// TODO: Re-implement missing timers - @Deprecated(forRemoval = true) --public final class MinecraftTimings { -- -- public static final Timing serverOversleep = Timings.ofSafe("Server Oversleep"); -- public static final Timing playerListTimer = Timings.ofSafe("Player List"); -- public static final Timing commandFunctionsTimer = Timings.ofSafe("Command Functions"); -- public static final Timing connectionTimer = Timings.ofSafe("Connection Handler"); -- public static final Timing tickablesTimer = Timings.ofSafe("Tickables"); -- public static final Timing minecraftSchedulerTimer = Timings.ofSafe("Minecraft Scheduler"); -- public static final Timing bukkitSchedulerTimer = Timings.ofSafe("Bukkit Scheduler"); -- public static final Timing bukkitSchedulerPendingTimer = Timings.ofSafe("Bukkit Scheduler - Pending"); -- public static final Timing bukkitSchedulerFinishTimer = Timings.ofSafe("Bukkit Scheduler - Finishing"); -- public static final Timing chunkIOTickTimer = Timings.ofSafe("ChunkIOTick"); -- public static final Timing timeUpdateTimer = Timings.ofSafe("Time Update"); -- public static final Timing serverCommandTimer = Timings.ofSafe("Server Command"); -- public static final Timing savePlayers = Timings.ofSafe("Save Players"); -- -- public static final Timing tickEntityTimer = Timings.ofSafe("## tickEntity"); -- public static final Timing tickTileEntityTimer = Timings.ofSafe("## tickTileEntity"); -- public static final Timing packetProcessTimer = Timings.ofSafe("## Packet Processing"); -- public static final Timing scheduledBlocksTimer = Timings.ofSafe("## Scheduled Blocks"); -- public static final Timing structureGenerationTimer = Timings.ofSafe("Structure Generation"); -- -- public static final Timing processQueueTimer = Timings.ofSafe("processQueue"); -- public static final Timing processTasksTimer = Timings.ofSafe("processTasks"); -- -- public static final Timing playerCommandTimer = Timings.ofSafe("playerCommand"); -- -- public static final Timing entityActivationCheckTimer = Timings.ofSafe("entityActivationCheck"); -- -- public static final Timing antiXrayUpdateTimer = Timings.ofSafe("anti-xray - update"); -- public static final Timing antiXrayObfuscateTimer = Timings.ofSafe("anti-xray - obfuscate"); -- public static final Timing scoreboardScoreSearch = Timings.ofSafe("Scoreboard score search"); // Paper - add timings for scoreboard search -- public static final Timing distanceManagerTick = Timings.ofSafe("Distance Manager Tick"); // Paper - add timings for distance manager -- -- public static final Timing midTickChunkTasks = Timings.ofSafe("Mid Tick Chunk Tasks"); -- -- private static final Map, String> taskNameCache = new MapMaker().weakKeys().makeMap(); -- -- private MinecraftTimings() {} -- -- public static Timing getInternalTaskName(String taskName) { -- return Timings.ofSafe(taskName); -- } -- -- /** -- * Gets a timer associated with a plugins tasks. -- * @param bukkitTask -- * @param period -- * @return -- */ -- public static Timing getPluginTaskTimings(BukkitTask bukkitTask, long period) { -- if (!bukkitTask.isSync()) { -- return NullTimingHandler.NULL; -- } -- Plugin plugin; -- -- CraftTask craftTask = (CraftTask) bukkitTask; -- -- final Class taskClass = craftTask.getTaskClass(); -- if (bukkitTask.getOwner() != null) { -- plugin = bukkitTask.getOwner(); -- } else { -- plugin = TimingsManager.getPluginByClassloader(taskClass); -- } -- -- final String taskname = taskNameCache.computeIfAbsent(taskClass, clazz -> { -- try { -- String clsName = !clazz.isMemberClass() -- ? clazz.getName() -- : clazz.getCanonicalName(); -- if (clsName != null && clsName.contains("$Lambda$")) { -- clsName = clsName.replaceAll("(Lambda\\$.*?)/.*", "$1"); -- } -- return clsName != null ? clsName : "UnknownTask"; -- } catch (Throwable ex) { -- new Exception("Error occurred detecting class name", ex).printStackTrace(); -- return "MangledClassFile"; -- } -- }); -- -- StringBuilder name = new StringBuilder(64); -- name.append("Task: ").append(taskname); -- if (period > 0) { -- name.append(" (interval:").append(period).append(")"); -- } else { -- name.append(" (Single)"); -- } -- -- if (plugin == null) { -- return Timings.ofSafe(null, name.toString()); -- } -- -- return Timings.ofSafe(plugin, name.toString()); -- } -- -- /** -- * Get a named timer for the specified entity type to track type specific timings. -- * @param entityType -- * @return -- */ -- public static Timing getEntityTimings(String entityType, String type) { -- return Timings.ofSafe("Minecraft", "## tickEntity - " + entityType + " - " + type, tickEntityTimer); -- } -- -- public static Timing getBehaviorTimings(String type) { -- return Timings.ofSafe("## Behavior - " + type); -- } -- -- public static Timing getSensorTimings(String type, int rate) { -- return Timings.ofSafe("## Sensor - " + type + " (Default rate: " + rate + ")"); -- } -- -- /** -- * Get a named timer for the specified tile entity type to track type specific timings. -- * @param entity -- * @return -- */ -- public static Timing getTileEntityTimings(BlockEntity entity) { -- String entityType = entity.getClass().getName(); -- return Timings.ofSafe("Minecraft", "## tickTileEntity - " + entityType, tickTileEntityTimer); -- } -- public static Timing getCancelTasksTimer() { -- return Timings.ofSafe("Cancel Tasks"); -- } -- public static Timing getCancelTasksTimer(Plugin plugin) { -- return Timings.ofSafe(plugin, "Cancel Tasks"); -- } -- -- public static void stopServer() { -- TimingsManager.stopServer(); -- } -- -- public static Timing getBlockTiming(Block block) { -- return Timings.ofSafe("## Scheduled Block: " + block.toString(), scheduledBlocksTimer); -- } --/* -- public static Timing getStructureTiming(StructureGenerator structureGenerator) { -- return Timings.ofSafe("Structure Generator - " + structureGenerator.getName(), structureGenerationTimer); -- }*/ -- -- public static Timing getPacketTiming(Packet packet) { -- return Timings.ofSafe("## Packet - " + packet.getClass().getName(), packetProcessTimer); -- } -- -- public static Timing getCommandFunctionTiming(CommandFunction function) { -- return Timings.ofSafe("Command Function - " + function.id()); -- } -- -- public static void processConfig(GlobalConfiguration.Timings config) { -- TimingsManager.url = config.url; -- if (!TimingsManager.url.endsWith("/")) { -- TimingsManager.url += "/"; -- } -- TimingsManager.privacy = config.serverNamePrivacy; -- if (!config.hiddenConfigEntries.contains("proxies.velocity.secret")) { -- config.hiddenConfigEntries.add("proxies.velocity.secret"); -- } -- TimingsManager.hiddenConfigs.addAll(config.hiddenConfigEntries); -- co.aikar.timings.Timings.setVerboseTimingsEnabled(config.verbose); -- co.aikar.timings.Timings.setTimingsEnabled(config.enabled); -- co.aikar.timings.Timings.setHistoryInterval(config.historyInterval * 20); -- co.aikar.timings.Timings.setHistoryLength(config.historyLength * 20); -- } --} -+interface MinecraftTimings {} // Thunderbolt - Remove remaining timings implementations -diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java -index b35a9f4c5f8960864c402ede8a51fb5ab9c4fcc0..89c4d2cffb0bd3173070f8f241f45bdfe40fcfeb 100644 ---- a/src/main/java/co/aikar/timings/TimingsExport.java -+++ b/src/main/java/co/aikar/timings/TimingsExport.java -@@ -1,389 +1,4 @@ --/* -- * This file is licensed under the MIT License (MIT). -- * -- * Copyright (c) 2014 Daniel Ennis -- * -- * Permission is hereby granted, free of charge, to any person obtaining a copy -- * of this software and associated documentation files (the "Software"), to deal -- * in the Software without restriction, including without limitation the rights -- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -- * copies of the Software, and to permit persons to whom the Software is -- * furnished to do so, subject to the following conditions: -- * -- * The above copyright notice and this permission notice shall be included in -- * all copies or substantial portions of the Software. -- * -- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -- * THE SOFTWARE. -- */ - package co.aikar.timings; - --import com.google.common.collect.Sets; --import io.papermc.paper.adventure.PaperAdventure; --import net.kyori.adventure.text.event.ClickEvent; --import net.kyori.adventure.text.format.NamedTextColor; --import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer; --import net.minecraft.server.MinecraftServer; --import org.apache.commons.lang.StringUtils; --import org.bukkit.Bukkit; --import org.bukkit.Material; --import org.bukkit.configuration.ConfigurationSection; --import org.bukkit.configuration.MemorySection; --import org.bukkit.entity.EntityType; --import org.json.simple.JSONObject; --import org.json.simple.JSONValue; --import oshi.SystemInfo; --import oshi.hardware.HardwareAbstractionLayer; -- --import java.io.ByteArrayOutputStream; --import java.io.IOException; --import java.io.InputStream; --import java.io.OutputStream; --import java.lang.management.ManagementFactory; --import java.lang.management.OperatingSystemMXBean; --import java.lang.management.RuntimeMXBean; --import java.net.HttpURLConnection; --import java.net.InetAddress; --import java.net.URL; --import java.util.List; --import java.util.Map; --import java.util.Set; --import java.util.logging.Level; --import java.util.zip.GZIPOutputStream; -- --import static co.aikar.timings.TimingsManager.HISTORY; --import static co.aikar.util.JSONUtil.appendObjectData; --import static co.aikar.util.JSONUtil.createObject; --import static co.aikar.util.JSONUtil.pair; --import static co.aikar.util.JSONUtil.toArray; --import static co.aikar.util.JSONUtil.toArrayMapper; --import static co.aikar.util.JSONUtil.toObjectMapper; --import static net.kyori.adventure.text.Component.text; -- --@SuppressWarnings({"rawtypes", "SuppressionAnnotation"}) - @Deprecated(forRemoval = true) --public class TimingsExport extends Thread { -- -- private final TimingsReportListener listeners; -- private final Map out; -- private final TimingHistory[] history; -- private static long lastReport = 0; -- -- private TimingsExport(TimingsReportListener listeners, Map out, TimingHistory[] history) { -- super("Timings paste thread"); -- this.listeners = listeners; -- this.out = out; -- this.history = history; -- } -- -- /** -- * Checks if any pending reports are being requested, and builds one if needed. -- */ -- public static void reportTimings() { -- if (Timings.requestingReport.isEmpty()) { -- return; -- } -- TimingsReportListener listeners = new TimingsReportListener(Timings.requestingReport); -- listeners.addConsoleIfNeeded(); -- -- Timings.requestingReport.clear(); -- long now = System.currentTimeMillis(); -- final long lastReportDiff = now - lastReport; -- if (lastReportDiff < 60000) { -- listeners.sendMessage(text("Please wait at least 1 minute in between Timings reports. (" + (int)((60000 - lastReportDiff) / 1000) + " seconds)", NamedTextColor.RED)); -- listeners.done(); -- return; -- } -- final long lastStartDiff = now - TimingsManager.timingStart; -- if (lastStartDiff < 180000) { -- listeners.sendMessage(text("Please wait at least 3 minutes before generating a Timings report. Unlike Timings v1, v2 benefits from longer timings and is not as useful with short timings. (" + (int)((180000 - lastStartDiff) / 1000) + " seconds)", NamedTextColor.RED)); -- listeners.done(); -- return; -- } -- listeners.sendMessage(text("Preparing Timings Report...", NamedTextColor.GREEN)); -- lastReport = now; -- Map parent = createObject( -- // Get some basic system details about the server -- pair("version", Bukkit.getVersion()), -- pair("maxplayers", Bukkit.getMaxPlayers()), -- pair("start", TimingsManager.timingStart / 1000), -- pair("end", System.currentTimeMillis() / 1000), -- pair("online-mode", Bukkit.getServer().getOnlineMode()), -- pair("sampletime", (System.currentTimeMillis() - TimingsManager.timingStart) / 1000), -- pair("datapacks", toArrayMapper(MinecraftServer.getServer().getPackRepository().getSelectedPacks(), pack -> { -- return PlainTextComponentSerializer.plainText().serialize(PaperAdventure.asAdventure(pack.getChatLink(true))); -- })) -- ); -- if (!TimingsManager.privacy) { -- appendObjectData(parent, -- pair("server", Bukkit.getUnsafe().getTimingsServerName()), -- pair("motd", Bukkit.getServer().getMotd()), -- pair("icon", Bukkit.getServer().getServerIcon().getData()) -- ); -- } -- -- final Runtime runtime = Runtime.getRuntime(); -- RuntimeMXBean runtimeBean = ManagementFactory.getRuntimeMXBean(); -- -- OperatingSystemMXBean osInfo = ManagementFactory.getOperatingSystemMXBean(); -- -- HardwareAbstractionLayer hardwareInfo = new SystemInfo().getHardware(); -- -- parent.put("system", createObject( -- pair("timingcost", getCost()), -- pair("loadavg", osInfo.getSystemLoadAverage()), -- pair("name", System.getProperty("os.name")), -- pair("version", System.getProperty("os.version")), -- pair("jvmversion", System.getProperty("java.version")), -- pair("jvmvendor", System.getProperty("java.vendor")), -- pair("jvmvendorversion", System.getProperty("java.vendor.version")), -- pair("arch", System.getProperty("os.arch")), -- pair("maxmem", runtime.maxMemory()), -- pair("memory", createObject( -- pair("heap", ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().toString()), -- pair("nonheap", ManagementFactory.getMemoryMXBean().getNonHeapMemoryUsage().toString()), -- pair("finalizing", ManagementFactory.getMemoryMXBean().getObjectPendingFinalizationCount()) -- )), -- pair("cpu", runtime.availableProcessors()), -- pair("cpuname", hardwareInfo.getProcessor().getProcessorIdentifier().getName().trim()), -- pair("runtime", runtimeBean.getUptime()), -- pair("flags", StringUtils.join(runtimeBean.getInputArguments(), " ")), -- pair("gc", toObjectMapper(ManagementFactory.getGarbageCollectorMXBeans(), input -> pair(input.getName(), toArray(input.getCollectionCount(), input.getCollectionTime())))) -- ) -- ); -- -- parent.put("worlds", toObjectMapper(MinecraftServer.getServer().getAllLevels(), world -> { -- if (world.getWorld().getName().equals("worldeditregentempworld")) return null; -- return pair(world.getWorld().getName(), createObject( -- pair("gamerules", toObjectMapper(world.getWorld().getGameRules(), rule -> { -- return pair(rule, world.getWorld().getGameRuleValue(rule)); -- })), -- pair("ticking-distance", world.getWorld().getSimulationDistance()), -- pair("no-ticking-distance", world.getWorld().getViewDistance()), -- pair("sending-distance", world.getWorld().getSendViewDistance()) -- )); -- })); -- -- Set tileEntityTypeSet = Sets.newHashSet(); -- Set entityTypeSet = Sets.newHashSet(); -- -- int size = HISTORY.size(); -- TimingHistory[] history = new TimingHistory[size + 1]; -- int i = 0; -- for (TimingHistory timingHistory : HISTORY) { -- tileEntityTypeSet.addAll(timingHistory.tileEntityTypeSet); -- entityTypeSet.addAll(timingHistory.entityTypeSet); -- history[i++] = timingHistory; -- } -- -- history[i] = new TimingHistory(); // Current snapshot -- tileEntityTypeSet.addAll(history[i].tileEntityTypeSet); -- entityTypeSet.addAll(history[i].entityTypeSet); -- -- -- Map handlers = createObject(); -- Map groupData; -- synchronized (TimingIdentifier.GROUP_MAP) { -- for (TimingIdentifier.TimingGroup group : TimingIdentifier.GROUP_MAP.values()) { -- synchronized (group.handlers) { -- for (TimingHandler id : group.handlers) { -- -- if (!id.isTimed() && !id.isSpecial()) { -- continue; -- } -- -- String name = id.identifier.name; -- if (name.startsWith("##")) { -- name = name.substring(3); -- } -- handlers.put(id.id, toArray( -- group.id, -- name -- )); -- } -- } -- } -- -- groupData = toObjectMapper( -- TimingIdentifier.GROUP_MAP.values(), group -> pair(group.id, group.name)); -- } -- -- parent.put("idmap", createObject( -- pair("groups", groupData), -- pair("handlers", handlers), -- pair("worlds", toObjectMapper(TimingHistory.worldMap.entrySet(), input -> pair(input.getValue(), input.getKey()))), -- pair("tileentity", -- toObjectMapper(tileEntityTypeSet, input -> pair(input.ordinal(), input.name()))), -- pair("entity", -- toObjectMapper(entityTypeSet, input -> pair(input.ordinal(), input.name()))) -- )); -- -- // Information about loaded plugins -- -- parent.put("plugins", toObjectMapper(Bukkit.getPluginManager().getPlugins(), -- plugin -> pair(plugin.getName(), createObject( -- pair("version", plugin.getDescription().getVersion()), -- pair("description", String.valueOf(plugin.getDescription().getDescription()).trim()), -- pair("website", plugin.getDescription().getWebsite()), -- pair("authors", StringUtils.join(plugin.getDescription().getAuthors(), ", ")) -- )))); -- -- -- -- // Information on the users Config -- -- parent.put("config", createObject( -- pair("spigot", mapAsJSON(Bukkit.spigot().getSpigotConfig(), null)), -- pair("bukkit", mapAsJSON(Bukkit.spigot().getBukkitConfig(), null)), -- pair("paper", mapAsJSON(Bukkit.spigot().getPaperConfig(), null)), // Pufferfish -- pair("pufferfish", mapAsJSON(gg.pufferfish.pufferfish.PufferfishConfig.getConfigCopy(), null)) // Pufferfish -- )); -- -- new TimingsExport(listeners, parent, history).start(); -- } -- -- static long getCost() { -- // Benchmark the users System.nanotime() for cost basis -- int passes = 100; -- TimingHandler SAMPLER1 = Timings.ofSafe("Timings Sampler 1"); -- TimingHandler SAMPLER2 = Timings.ofSafe("Timings Sampler 2"); -- TimingHandler SAMPLER3 = Timings.ofSafe("Timings Sampler 3"); -- TimingHandler SAMPLER4 = Timings.ofSafe("Timings Sampler 4"); -- TimingHandler SAMPLER5 = Timings.ofSafe("Timings Sampler 5"); -- TimingHandler SAMPLER6 = Timings.ofSafe("Timings Sampler 6"); -- -- long start = System.nanoTime(); -- for (int i = 0; i < passes; i++) { -- SAMPLER1.startTiming(); -- SAMPLER2.startTiming(); -- SAMPLER3.startTiming(); -- SAMPLER3.stopTiming(); -- SAMPLER4.startTiming(); -- SAMPLER5.startTiming(); -- SAMPLER6.startTiming(); -- SAMPLER6.stopTiming(); -- SAMPLER5.stopTiming(); -- SAMPLER4.stopTiming(); -- SAMPLER2.stopTiming(); -- SAMPLER1.stopTiming(); -- } -- long timingsCost = (System.nanoTime() - start) / passes / 6; -- SAMPLER1.reset(true); -- SAMPLER2.reset(true); -- SAMPLER3.reset(true); -- SAMPLER4.reset(true); -- SAMPLER5.reset(true); -- SAMPLER6.reset(true); -- return timingsCost; -- } -- -- private static JSONObject mapAsJSON(ConfigurationSection config, String parentKey) { -- -- JSONObject object = new JSONObject(); -- for (String key : config.getKeys(false)) { -- String fullKey = (parentKey != null ? parentKey + "." + key : key); -- if (fullKey.equals("database") || fullKey.equals("settings.bungeecord-addresses") || TimingsManager.hiddenConfigs.contains(fullKey) || key.startsWith("seed-") || key.equals("worldeditregentempworld") || key.equals("feature-seeds")) { -- continue; -- } -- final Object val = config.get(key); -- -- object.put(key, valAsJSON(val, fullKey)); -- } -- return object; -- } -- -- private static Object valAsJSON(Object val, final String parentKey) { -- if (!(val instanceof MemorySection)) { -- if (val instanceof List) { -- Iterable v = (Iterable) val; -- return toArrayMapper(v, input -> valAsJSON(input, parentKey)); -- } else { -- return String.valueOf(val); -- } -- } else { -- return mapAsJSON((ConfigurationSection) val, parentKey); -- } -- } -- -- @Override -- public void run() { -- out.put("data", toArrayMapper(history, TimingHistory::export)); -- -- -- String response = null; -- String timingsURL = null; -- try { -- HttpURLConnection con = (HttpURLConnection) new URL(TimingsManager.url + "post").openConnection(); -- con.setDoOutput(true); -- String hostName = "BrokenHost"; -- try { -- hostName = InetAddress.getLocalHost().getHostName(); -- } catch (Exception ignored) {} -- con.setRequestProperty("User-Agent", "Paper/" + Bukkit.getUnsafe().getTimingsServerName() + "/" + hostName); -- con.setRequestMethod("POST"); -- con.setInstanceFollowRedirects(false); -- -- OutputStream request = new GZIPOutputStream(con.getOutputStream()) {{ -- this.def.setLevel(7); -- }}; -- -- request.write(JSONValue.toJSONString(out).getBytes("UTF-8")); -- request.close(); -- -- response = getResponse(con); -- -- if (con.getResponseCode() != 302) { -- listeners.sendMessage(text( "Upload Error: " + con.getResponseCode() + ": " + con.getResponseMessage(), NamedTextColor.RED)); -- listeners.sendMessage(text("Check your logs for more information", NamedTextColor.RED)); -- if (response != null) { -- Bukkit.getLogger().log(Level.SEVERE, response); -- } -- return; -- } -- -- timingsURL = con.getHeaderField("Location"); -- listeners.sendMessage(text("View Timings Report: ", NamedTextColor.GREEN).append(text(timingsURL).clickEvent(ClickEvent.clickEvent(ClickEvent.Action.OPEN_URL, timingsURL)))); -- -- if (response != null && !response.isEmpty()) { -- Bukkit.getLogger().log(Level.INFO, "Timing Response: " + response); -- } -- } catch (IOException ex) { -- listeners.sendMessage(text("Error uploading timings, check your logs for more information", NamedTextColor.RED)); -- if (response != null) { -- Bukkit.getLogger().log(Level.SEVERE, response); -- } -- Bukkit.getLogger().log(Level.SEVERE, "Could not paste timings", ex); -- } finally { -- this.listeners.done(timingsURL); -- } -- } -- -- private String getResponse(HttpURLConnection con) throws IOException { -- InputStream is = null; -- try { -- is = con.getInputStream(); -- ByteArrayOutputStream bos = new ByteArrayOutputStream(); -- -- byte[] b = new byte[1024]; -- int bytesRead; -- while ((bytesRead = is.read(b)) != -1) { -- bos.write(b, 0, bytesRead); -- } -- return bos.toString(); -- -- } catch (IOException ex) { -- listeners.sendMessage(text("Error uploading timings, check your logs for more information", NamedTextColor.RED)); -- Bukkit.getLogger().log(Level.WARNING, con.getResponseMessage(), ex); -- return null; -- } finally { -- if (is != null) { -- is.close(); -- } -- } -- } --} -+interface TimingsExport {} // Thunderbolt - Remove remaining timings implementations -diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java -index 22687667ec69a954261e55e59261286ac1b8b8cd..94efe27854d929e79480cee8a2075115b0c4a31c 100644 ---- a/src/main/java/co/aikar/timings/WorldTimingsHandler.java -+++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java -@@ -1,140 +1,4 @@ - package co.aikar.timings; - --import net.minecraft.server.level.ServerLevel; --import net.minecraft.world.level.Level; --import net.minecraft.world.level.storage.PrimaryLevelData; -- --/** -- * Set of timers per world, to track world specific timings. -- */ --// TODO: Re-implement missing timers - @Deprecated(forRemoval = true) --public class WorldTimingsHandler { -- public final Timing mobSpawn; -- public final Timing doChunkUnload; -- public final Timing doPortalForcer; -- public final Timing scheduledBlocks; -- public final Timing scheduledBlocksCleanup; -- public final Timing scheduledBlocksTicking; -- public final Timing chunkTicks; -- public final Timing lightChunk; -- public final Timing chunkTicksBlocks; -- public final Timing doVillages; -- public final Timing doChunkMap; -- public final Timing doChunkMapUpdate; -- public final Timing doChunkMapToUpdate; -- public final Timing doChunkMapSortMissing; -- public final Timing doChunkMapSortSendToPlayers; -- public final Timing doChunkMapPlayersNeedingChunks; -- public final Timing doChunkMapPendingSendToPlayers; -- public final Timing doChunkMapUnloadChunks; -- public final Timing doChunkGC; -- public final Timing doSounds; -- public final Timing entityRemoval; -- public final Timing entityTick; -- public final Timing tileEntityTick; -- public final Timing tileEntityPending; -- public final Timing tracker1; -- public final Timing tracker2; -- public final Timing doTick; -- public final Timing tickEntities; -- public final Timing chunks; -- public final Timing newEntities; -- public final Timing raids; -- public final Timing chunkProviderTick; -- public final Timing broadcastChunkUpdates; -- public final Timing countNaturalMobs; -- -- public final Timing chunkLoad; -- public final Timing chunkLoadPopulate; -- public final Timing syncChunkLoad; -- public final Timing chunkLoadLevelTimer; -- public final Timing chunkIO; -- public final Timing chunkPostLoad; -- public final Timing worldSave; -- public final Timing worldSaveChunks; -- public final Timing worldSaveLevel; -- public final Timing chunkSaveData; -- -- -- public final Timing miscMobSpawning; -- -- public final Timing poiUnload; -- public final Timing chunkUnload; -- public final Timing poiSaveDataSerialization; -- public final Timing chunkSave; -- public final Timing chunkSaveDataSerialization; -- public final Timing chunkSaveIOWait; -- public final Timing chunkUnloadPrepareSave; -- public final Timing chunkUnloadPOISerialization; -- public final Timing chunkUnloadDataSave; -- -- public WorldTimingsHandler(Level server) { -- String name = ((PrimaryLevelData) server.getLevelData()).getLevelName() + " - "; -- -- mobSpawn = Timings.ofSafe(name + "mobSpawn"); -- doChunkUnload = Timings.ofSafe(name + "doChunkUnload"); -- scheduledBlocks = Timings.ofSafe(name + "Scheduled Blocks"); -- scheduledBlocksCleanup = Timings.ofSafe(name + "Scheduled Blocks - Cleanup"); -- scheduledBlocksTicking = Timings.ofSafe(name + "Scheduled Blocks - Ticking"); -- chunkTicks = Timings.ofSafe(name + "Chunk Ticks"); -- lightChunk = Timings.ofSafe(name + "Light Chunk"); -- chunkTicksBlocks = Timings.ofSafe(name + "Chunk Ticks - Blocks"); -- doVillages = Timings.ofSafe(name + "doVillages"); -- doChunkMap = Timings.ofSafe(name + "doChunkMap"); -- doChunkMapUpdate = Timings.ofSafe(name + "doChunkMap - Update"); -- doChunkMapToUpdate = Timings.ofSafe(name + "doChunkMap - To Update"); -- doChunkMapSortMissing = Timings.ofSafe(name + "doChunkMap - Sort Missing"); -- doChunkMapSortSendToPlayers = Timings.ofSafe(name + "doChunkMap - Sort Send To Players"); -- doChunkMapPlayersNeedingChunks = Timings.ofSafe(name + "doChunkMap - Players Needing Chunks"); -- doChunkMapPendingSendToPlayers = Timings.ofSafe(name + "doChunkMap - Pending Send To Players"); -- doChunkMapUnloadChunks = Timings.ofSafe(name + "doChunkMap - Unload Chunks"); -- doSounds = Timings.ofSafe(name + "doSounds"); -- doChunkGC = Timings.ofSafe(name + "doChunkGC"); -- doPortalForcer = Timings.ofSafe(name + "doPortalForcer"); -- entityTick = Timings.ofSafe(name + "entityTick"); -- entityRemoval = Timings.ofSafe(name + "entityRemoval"); -- tileEntityTick = Timings.ofSafe(name + "tileEntityTick"); -- tileEntityPending = Timings.ofSafe(name + "tileEntityPending"); -- -- chunkLoad = Timings.ofSafe(name + "Chunk Load"); -- chunkLoadPopulate = Timings.ofSafe(name + "Chunk Load - Populate"); -- syncChunkLoad = Timings.ofSafe(name + "Sync Chunk Load"); -- chunkLoadLevelTimer = Timings.ofSafe(name + "Chunk Load - Load Level"); -- chunkIO = Timings.ofSafe(name + "Chunk Load - DiskIO"); -- chunkPostLoad = Timings.ofSafe(name + "Chunk Load - Post Load"); -- worldSave = Timings.ofSafe(name + "World Save"); -- worldSaveLevel = Timings.ofSafe(name + "World Save - Level"); -- worldSaveChunks = Timings.ofSafe(name + "World Save - Chunks"); -- chunkSaveData = Timings.ofSafe(name + "Chunk Save - Data"); -- -- tracker1 = Timings.ofSafe(name + "tracker stage 1"); -- tracker2 = Timings.ofSafe(name + "tracker stage 2"); -- doTick = Timings.ofSafe(name + "doTick"); -- tickEntities = Timings.ofSafe(name + "tickEntities"); -- -- chunks = Timings.ofSafe(name + "Chunks"); -- newEntities = Timings.ofSafe(name + "New entity registration"); -- raids = Timings.ofSafe(name + "Raids"); -- chunkProviderTick = Timings.ofSafe(name + "Chunk provider tick"); -- broadcastChunkUpdates = Timings.ofSafe(name + "Broadcast chunk updates"); -- countNaturalMobs = Timings.ofSafe(name + "Count natural mobs"); -- -- -- miscMobSpawning = Timings.ofSafe(name + "Mob spawning - Misc"); -- -- poiUnload = Timings.ofSafe(name + "Chunk unload - POI"); -- chunkUnload = Timings.ofSafe(name + "Chunk unload - Chunk"); -- poiSaveDataSerialization = Timings.ofSafe(name + "Chunk save - POI Data serialization"); -- chunkSave = Timings.ofSafe(name + "Chunk save - Chunk"); -- chunkSaveDataSerialization = Timings.ofSafe(name + "Chunk save - Chunk Data serialization"); -- chunkSaveIOWait = Timings.ofSafe(name + "Chunk save - Chunk IO Wait"); -- chunkUnloadPrepareSave = Timings.ofSafe(name + "Chunk unload - Async Save Prepare"); -- chunkUnloadPOISerialization = Timings.ofSafe(name + "Chunk unload - POI Data Serialization"); -- chunkUnloadDataSave = Timings.ofSafe(name + "Chunk unload - Data Serialization"); -- } -- -- public static Timing getTickList(ServerLevel worldserver, String timingsType) { -- return Timings.ofSafe(((PrimaryLevelData) worldserver.getLevelData()).getLevelName() + " - Scheduled " + timingsType); -- } --} -+interface WorldTimingsHandler {} // Thunderbolt - Remove remaining timings implementations -diff --git a/src/main/java/gg/pufferfish/pufferfish/compat/ServerConfigurations.java b/src/main/java/gg/pufferfish/pufferfish/compat/ServerConfigurations.java -index 4ad189d52b27560424ddb311d0817a334637dc95..f7e64bcd8810f7f5782d5314ec16290dc30cb518 100644 ---- a/src/main/java/gg/pufferfish/pufferfish/compat/ServerConfigurations.java -+++ b/src/main/java/gg/pufferfish/pufferfish/compat/ServerConfigurations.java -@@ -1,6 +1,6 @@ - package gg.pufferfish.pufferfish.compat; - --import co.aikar.timings.TimingsManager; -+// import co.aikar.timings.TimingsManager; // Thunderbolt - Remove remaining timings implementations - import com.google.common.io.Files; - import org.bukkit.configuration.InvalidConfigurationException; - import org.bukkit.configuration.file.YamlConfiguration; -@@ -37,7 +37,7 @@ public class ServerConfigurations { - - public static String getCleanCopy(String configName) throws IOException { - File file = new File(configName); -- List hiddenConfigs = TimingsManager.hiddenConfigs; -+ // List hiddenConfigs = TimingsManager.hiddenConfigs; // Thunderbolt - Remove remaining timings implementations - - switch (Files.getFileExtension(configName)) { - case "properties": { -@@ -45,9 +45,11 @@ public class ServerConfigurations { - try (FileInputStream inputStream = new FileInputStream(file)) { - properties.load(inputStream); - } -+ /* // Thunderbolt - Remove remaining timings implementations - for (String hiddenConfig : hiddenConfigs) { - properties.remove(hiddenConfig); - } -+ */ // Thunderbolt - Remove remaining timings implementations - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - properties.store(outputStream, ""); - return Arrays.stream(outputStream.toString() -@@ -63,11 +65,13 @@ public class ServerConfigurations { - throw new IOException(e); - } - configuration.options().header(null); -+ /* // Thunderbolt - Remove remaining timings implementations - for (String key : configuration.getKeys(true)) { - if (hiddenConfigs.contains(key)) { - configuration.set(key, null); - } - } -+ */ // Thunderbolt - Remove remaining timings implementations - return configuration.saveToString(); - } - default: -diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java -index 86822868e47b269891a71fdc04371b1e28a2752e..723444f9ac1a61ee08d0e2425e338c529a63dc27 100644 ---- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java -+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java -@@ -1,6 +1,6 @@ - package io.papermc.paper.configuration; - --import co.aikar.timings.MinecraftTimings; -+// import co.aikar.timings.MinecraftTimings; // Thunderbolt - Remove remaining timings implementations - import com.mojang.logging.LogUtils; - import io.papermc.paper.configuration.constraint.Constraints; - import io.papermc.paper.configuration.type.number.IntOr; -@@ -93,6 +93,7 @@ public class GlobalConfiguration extends ConfigurationPart { - public boolean useDisplayNameInQuitMessage = false; - } - -+ /* // Thunderbolt - Remove remaining timings implementations - @Deprecated(forRemoval = true) - public Timings timings; - -@@ -124,6 +125,7 @@ public class GlobalConfiguration extends ConfigurationPart { - MinecraftTimings.processConfig(this); - } - } -+ */ // Thunderbolt - Remove remaining timings implementations - - public Proxies proxies; - -diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java -index 23594fb7eb4b2f33146592866608c2858ef23937..db405389e7b3ec6136cb68161d437940d242ff13 100644 ---- a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java -+++ b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java -@@ -1,6 +1,6 @@ - package io.papermc.paper.plugin.manager; - --import co.aikar.timings.TimedEventExecutor; -+// import co.aikar.timings.TimedEventExecutor; // Thunderbolt - Remove remaining timings implementations - import com.destroystokyo.paper.event.server.ServerExceptionEvent; - import com.destroystokyo.paper.exception.ServerEventException; - import com.google.common.collect.Sets; -@@ -96,7 +96,7 @@ class PaperEventManager { - throw new IllegalPluginAccessException("Plugin attempted to register " + event + " while not enabled"); - } - -- executor = new TimedEventExecutor(executor, plugin, null, event); -+ // executor = new TimedEventExecutor(executor, plugin, null, event); // Thunderbolt - Remove remaining timings implementations - this.getEventListeners(event).register(new RegisteredListener(listener, executor, priority, plugin, ignoreCancelled)); - } - -@@ -183,7 +183,7 @@ class PaperEventManager { - } - } - -- EventExecutor executor = new TimedEventExecutor(EventExecutor.create(method, eventClass), plugin, method, eventClass); -+ EventExecutor executor = EventExecutor.create(method, eventClass); // Thunderbolt - Remove remaining timings implementations - eventSet.add(new RegisteredListener(listener, executor, eh.priority(), plugin, eh.ignoreCancelled())); - } - return ret; -diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperPluginManagerImpl.java b/src/main/java/io/papermc/paper/plugin/manager/PaperPluginManagerImpl.java -index 097500a59336db1bbfffcd1aa4cff7a8586e46ec..844e340c331c6dd12eaaac247f871b042ceb6c25 100644 ---- a/src/main/java/io/papermc/paper/plugin/manager/PaperPluginManagerImpl.java -+++ b/src/main/java/io/papermc/paper/plugin/manager/PaperPluginManagerImpl.java -@@ -232,7 +232,7 @@ public class PaperPluginManagerImpl implements PluginManager, DependencyContext - - @Override - public boolean useTimings() { -- return co.aikar.timings.Timings.isTimingsEnabled(); -+ return false; // Thunderbolt - Remove remaining timings implementations - } - - @Override -diff --git a/src/main/java/net/minecraft/network/protocol/PacketUtils.java b/src/main/java/net/minecraft/network/protocol/PacketUtils.java -index 8c134a642ccaf3530022f2e675a858d726e1dda4..2cc6668b64c5e8ae3c39a934efae95933e1c83db 100644 ---- a/src/main/java/net/minecraft/network/protocol/PacketUtils.java -+++ b/src/main/java/net/minecraft/network/protocol/PacketUtils.java -@@ -50,7 +50,7 @@ public class PacketUtils { - try { // Paper - detailed watchdog information - if (listener instanceof ServerCommonPacketListenerImpl serverCommonPacketListener && serverCommonPacketListener.processedDisconnect) return; // CraftBukkit - Don't handle sync packets for kicked players - if (listener.shouldHandleMessage(packet)) { -- co.aikar.timings.Timing timing = co.aikar.timings.MinecraftTimings.getPacketTiming(packet); // Paper - timings -+ // co.aikar.timings.Timing timing = co.aikar.timings.MinecraftTimings.getPacketTiming(packet); // Paper - timings // Thunderbolt - Remove remaining timings implementations - try { // Paper - timings // Purpur - packet.handle(listener); - } catch (Exception exception) { -diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index cffcbc5db9593f69748d1c2d5a5687fa31f9ada5..75171854b6f1d056262b78d9028e68f755254e10 100644 ---- a/src/main/java/net/minecraft/server/MinecraftServer.java -+++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -3,7 +3,7 @@ package net.minecraft.server; - import com.google.common.base.Preconditions; - import com.google.common.base.Splitter; - import com.google.common.collect.ImmutableList; --import co.aikar.timings.Timings; -+// import co.aikar.timings.Timings; // Thunderbolt - Remove remaining timings implementations - import com.destroystokyo.paper.event.server.PaperServerListPingEvent; - import com.google.common.base.Stopwatch; - import com.google.common.collect.Lists; -@@ -190,7 +190,7 @@ import org.bukkit.craftbukkit.CraftRegistry; - import org.bukkit.event.server.ServerLoadEvent; - // CraftBukkit end - --import co.aikar.timings.MinecraftTimings; // Paper -+// import co.aikar.timings.MinecraftTimings; // Paper // Thunderbolt - Remove remaining timings implementations - - public abstract class MinecraftServer extends ReentrantBlockableEventLoop implements ServerInfo, CommandSource, AutoCloseable { - -@@ -984,7 +984,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop waitable = new Waitable<>() { -@@ -858,9 +859,10 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface - co.aikar.timings.Timings.generateReport(new co.aikar.timings.TimingsReportListener(sender, waitable)); - } else { - // Paper end -+ */ // Thunderbolt - Remove remaining timings implementations - ConsoleInput serverCommand = new ConsoleInput(event.getCommand(), wrapper); - this.server.dispatchServerCommand(event.getSender(), serverCommand); -- } // Paper -+ // } // Paper // Thunderbolt - Remove remaining timings implementations - }); - // Paper start - if (waitableArray[0] != null) { -diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 873ef80c02b4c6494529a6327faf82902a0181da..9afadf28d33275d3e9f35fdcc6cf679d6b117457 100644 ---- a/src/main/java/net/minecraft/server/level/ServerLevel.java -+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1,7 +1,7 @@ - package net.minecraft.server.level; - - import com.google.common.annotations.VisibleForTesting; --import co.aikar.timings.TimingHistory; // Paper -+// import co.aikar.timings.TimingHistory; // Paper // Thunderbolt - Remove remaining timings implementations - import com.google.common.collect.Lists; - import com.mojang.datafixers.DataFixer; - import com.mojang.datafixers.util.Pair; -@@ -1497,9 +1497,9 @@ public class ServerLevel extends Level implements WorldGenLevel { - currentlyTickingEntity.lazySet(entity); - } - // Paper end - log detailed entity tick information -- ++TimingHistory.entityTicks; // Paper - timings -+ //++TimingHistory.entityTicks; // Paper - timings // Thunderbolt - Remove remaining timings implementations - // Spigot start -- co.aikar.timings.Timing timer; // Paper -+ //co.aikar.timings.Timing timer; // Paper // Thunderbolt - Remove remaining timings implementations - /*if (!org.spigotmc.ActivationRange.checkIfActive(entity)) { // Paper - comment out - EAR 2, reimplement below - entity.tickCount++; - timer = entity.getType().inactiveTickTimer.startTiming(); try { // Paper - timings -@@ -1522,7 +1522,7 @@ public class ServerLevel extends Level implements WorldGenLevel { - });*/ // Purpur - //gameprofilerfiller.incrementCounter("tickNonPassenger"); // Purpur - if (isActive) { // Paper - EAR 2 -- TimingHistory.activatedEntityTicks++; -+ // TimingHistory.activatedEntityTicks++; // Thunderbolt - Remove remaining timings implementations - entity.tick(); - entity.postTick(); // CraftBukkit - } else { entity.inactiveTick(); } // Paper - EAR 2 -diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index fdfe8f5bc5ad0e5f5ded41d87756a5866d041df1..9e519813080e76b43ad68f1a67b0dd0610062b68 100644 ---- a/src/main/java/net/minecraft/server/players/PlayerList.java -+++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -1,6 +1,6 @@ - package net.minecraft.server.players; - --import co.aikar.timings.MinecraftTimings; -+// import co.aikar.timings.MinecraftTimings; // Thunderbolt - Remove remaining timings implementations - import com.google.common.collect.Lists; - import com.google.common.collect.Maps; - import com.google.common.collect.Sets; -diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java -index 32a1b5a1d01fd4dc603a76fde259f3a0d4749fad..824855365586538ad78dfe379df53e89cd2c60f5 100644 ---- a/src/main/java/net/minecraft/world/entity/EntityType.java -+++ b/src/main/java/net/minecraft/world/entity/EntityType.java -@@ -356,10 +356,12 @@ public class EntityType implements FeatureElement, EntityTypeT - this(factory, spawnGroup, saveable, summonable, fireImmune, spawnableFarFromPlayer, canSpawnInside, dimensions, spawnBoxScale, maxTrackDistance, trackTickInterval, requiredFeatures, "custom"); - } - public EntityType(EntityType.EntityFactory factory, MobCategory spawnGroup, boolean saveable, boolean summonable, boolean fireImmune, boolean spawnableFarFromPlayer, ImmutableSet canSpawnInside, EntityDimensions dimensions, float spawnBoxScale, int maxTrackDistance, int trackTickInterval, FeatureFlagSet requiredFeatures, String id) { -+ /* // Thunderbolt - Remove remaining timings implementations - this.tickTimer = co.aikar.timings.MinecraftTimings.getEntityTimings(id, "tick"); - this.inactiveTickTimer = co.aikar.timings.MinecraftTimings.getEntityTimings(id, "inactiveTick"); - this.passengerTickTimer = co.aikar.timings.MinecraftTimings.getEntityTimings(id, "passengerTick"); - this.passengerInactiveTickTimer = co.aikar.timings.MinecraftTimings.getEntityTimings(id, "passengerInactiveTick"); -+ */ // Thunderbolt - Remove remaining timings implementations - // Paper end - this.builtInRegistryHolder = BuiltInRegistries.ENTITY_TYPE.createIntrusiveHolder(this); - this.factory = factory; -@@ -730,10 +732,12 @@ public class EntityType implements FeatureElement, EntityTypeT - } - - // Paper start - timings -+ /* // Thunderbolt - Remove remaining timings implementations - public final co.aikar.timings.Timing tickTimer; - public final co.aikar.timings.Timing inactiveTickTimer; - public final co.aikar.timings.Timing passengerTickTimer; - public final co.aikar.timings.Timing passengerInactiveTickTimer; -+ */ // Thunderbolt - Remove remaining timings implementations - // Paper end - public boolean trackDeltas() { - return this != EntityType.PLAYER && this != EntityType.LLAMA_SPIT && this != EntityType.WITHER && this != EntityType.BAT && this != EntityType.ITEM_FRAME && this != EntityType.GLOW_ITEM_FRAME && this != EntityType.LEASH_KNOT && this != EntityType.PAINTING && this != EntityType.END_CRYSTAL && this != EntityType.EVOKER_FANGS; -diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java b/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java -index 612a14806ec63b0dcf31814396282f4b7f4a527c..b72936610ae125d1d972608364c79c85703f987e 100644 ---- a/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java -+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java -@@ -16,7 +16,7 @@ public abstract class Behavior implements BehaviorContro - private final int maxDuration; - // Paper start - configurable behavior tick rate and timings - private final String configKey; -- private final co.aikar.timings.Timing timing; -+ // private final co.aikar.timings.Timing timing; // Thunderbolt - Remove remaining timings implementations - // Paper end - configurable behavior tick rate and timings - - public Behavior(Map, MemoryStatus> requiredMemoryState) { -@@ -38,7 +38,7 @@ public abstract class Behavior implements BehaviorContro - key = key.substring(lastSeparator + 1); - } - this.configKey = key.toLowerCase(java.util.Locale.ROOT); -- this.timing = co.aikar.timings.MinecraftTimings.getBehaviorTimings(configKey); -+ // this.timing = co.aikar.timings.MinecraftTimings.getBehaviorTimings(configKey); // Thunderbolt - Remove remaining timings implementations - // Paper end - configurable behavior tick rate and timings - } - -diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java b/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java -index 703006eb5df8099c4f51cdb4e41f95cacfbe43a6..a17f85cd0f52fba5d1ca64b20350310102377304 100644 ---- a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java -+++ b/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java -@@ -28,7 +28,7 @@ public abstract class Sensor { - private long timeToTick; - // Paper start - configurable sensor tick rate and timings - private final String configKey; -- private final co.aikar.timings.Timing timing; -+ // private final co.aikar.timings.Timing timing; // Thunderbolt - Remove remaining timings implementations - // Paper end - - public Sensor(int senseInterval) { -@@ -39,7 +39,7 @@ public abstract class Sensor { - key = key.substring(lastSeparator + 1); - } - this.configKey = key.toLowerCase(java.util.Locale.ROOT); -- this.timing = co.aikar.timings.MinecraftTimings.getSensorTimings(configKey, senseInterval); -+ // this.timing = co.aikar.timings.MinecraftTimings.getSensorTimings(configKey, senseInterval); // Thunderbolt - Remove remaining timings implementations - // Paper end - this.scanRate = senseInterval; - this.timeToTick = (long)RANDOM.nextInt(senseInterval); -diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 77ebd33eca98832e34866e7b522a263673fa25f8..37f80a6e2e0891464c99367700be70ed4618069b 100644 ---- a/src/main/java/net/minecraft/world/level/Level.java -+++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -183,7 +183,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { - - public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray - public final org.purpurmc.purpur.PurpurWorldConfig purpurConfig; // Purpur -- public final co.aikar.timings.WorldTimingsHandler timings; // Paper -+ // public final co.aikar.timings.WorldTimingsHandler timings; // Paper // Thunderbolt - Remove remaining timings implementations - public static BlockPos lastPhysicsProblem; // Spigot - private org.spigotmc.TickLimiter entityLimiter; - private org.spigotmc.TickLimiter tileLimiter; -@@ -364,7 +364,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { - public void onBorderSetDamageSafeZOne(WorldBorder border, double safeZoneRadius) {} - }); - // CraftBukkit end -- this.timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings -+ // this.timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings // Thunderbolt - Remove remaining timings implementations - this.entityLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.entityMaxTickTime); - this.tileLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.tileMaxTickTime); - this.chunkPacketBlockController = this.paperConfig().anticheat.antiXray.enabled ? new com.destroystokyo.paper.antixray.ChunkPacketBlockControllerAntiXray(this, executor) : com.destroystokyo.paper.antixray.ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray -@@ -1387,7 +1387,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { - - //this.timings.tileEntityTick.stopTiming(); // Spigot // Purpur - this.tickingBlockEntities = false; -- co.aikar.timings.TimingHistory.tileEntityTicks += this.blockEntityTickers.size(); // Paper -+ // co.aikar.timings.TimingHistory.tileEntityTicks += this.blockEntityTickers.size(); // Paper // Thunderbolt - Remove remaining timings implementations - //gameprofilerfiller.pop(); // Purpur - this.spigotConfig.currentPrimedTnt = 0; // Spigot - } -diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java -index 5ae3decf100d21f7d4a471c155eaf5e00e996580..5ed1cbeea5946888ef564a06b9a9d5a1379ca2da 100644 ---- a/src/main/java/net/minecraft/world/level/block/Block.java -+++ b/src/main/java/net/minecraft/world/level/block/Block.java -@@ -107,6 +107,7 @@ public class Block extends BlockBehaviour implements ItemLike { - this != Blocks.STRUCTURE_BLOCK && - this != Blocks.JIGSAW; - } -+ /* // Thunderbolt - Remove remaining timings implementations - public co.aikar.timings.Timing timing; - public co.aikar.timings.Timing getTiming() { - if (timing == null) { -@@ -114,6 +115,7 @@ public class Block extends BlockBehaviour implements ItemLike { - } - return timing; - } -+ */ // Thunderbolt - Remove remaining timings implementations - // Paper end - @Nullable - private String descriptionId; -diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java -index 8dc1436fe78759cee5247cc28e8a18999e738a1b..ace886913b43252c5216b716e1a6b42a652fd411 100644 ---- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java -+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java -@@ -33,14 +33,14 @@ import org.bukkit.craftbukkit.persistence.CraftPersistentDataTypeRegistry; - import org.bukkit.inventory.InventoryHolder; - // CraftBukkit end - --import org.spigotmc.CustomTimingsHandler; // Spigot --import co.aikar.timings.MinecraftTimings; // Paper --import co.aikar.timings.Timing; // Paper -+// import org.spigotmc.CustomTimingsHandler; // Spigot // Thunderbolt - Remove remaining timings implementations -+// import co.aikar.timings.MinecraftTimings; // Paper // Thunderbolt - Remove remaining timings implementations -+// import co.aikar.timings.Timing; // Paper // Thunderbolt - Remove remaining timings implementations - - public abstract class BlockEntity { - static boolean ignoreTileUpdates; // Paper - Perf: Optimize Hoppers - -- public Timing tickTimer = MinecraftTimings.getTileEntityTimings(this); // Paper -+ // public Timing tickTimer = MinecraftTimings.getTileEntityTimings(this); // Paper // Thunderbolt - Remove remaining timings implementations - // CraftBukkit start - data containers - private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry(); - public CraftPersistentDataContainer persistentDataContainer; -diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 58123df202b28de77a9e733e062ee4f201d4d305..709f49e83a3bd71de446f60a7b4f98ad3421c773 100644 ---- a/src/main/java/org/bukkit/craftbukkit/Main.java -+++ b/src/main/java/org/bukkit/craftbukkit/Main.java -@@ -376,8 +376,8 @@ public class Main { - tryPreloadClass("org.jline.terminal.impl.MouseSupport"); - tryPreloadClass("org.jline.terminal.impl.MouseSupport$1"); - tryPreloadClass("org.jline.terminal.Terminal$MouseTracking"); -- tryPreloadClass("co.aikar.timings.TimingHistory"); -- tryPreloadClass("co.aikar.timings.TimingHistory$MinuteReport"); -+ // tryPreloadClass("co.aikar.timings.TimingHistory"); // Thunderbolt - Remove remaining timings implementations -+ // tryPreloadClass("co.aikar.timings.TimingHistory$MinuteReport"); // Thunderbolt - Remove remaining timings implementations - tryPreloadClass("io.netty.channel.AbstractChannelHandlerContext"); - tryPreloadClass("io.netty.channel.AbstractChannelHandlerContext$11"); - tryPreloadClass("io.netty.channel.AbstractChannelHandlerContext$12"); -diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java -index e3af3ba8f34626e54cdd931601fd3ec40618a061..b08ef35521fd570a577b578f079587d11983229f 100644 ---- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java -+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java -@@ -1,6 +1,6 @@ - package org.bukkit.craftbukkit.scheduler; - --import co.aikar.timings.MinecraftTimings; // Paper -+// import co.aikar.timings.MinecraftTimings; // Paper // Thunderbolt - Remove remaining timings implementations - import com.google.common.base.Preconditions; - import com.google.common.util.concurrent.ThreadFactoryBuilder; - import java.util.ArrayList; -@@ -304,7 +304,7 @@ public class CraftScheduler implements BukkitScheduler { - } - return false; - } -- }){{this.timings=co.aikar.timings.MinecraftTimings.getCancelTasksTimer();}}; // Paper -+ })/*{{this.timings=co.aikar.timings.MinecraftTimings.getCancelTasksTimer();}}*/; // Paper // Thunderbolt - Remove remaining timings implementations - this.handle(task, 0L); - for (CraftTask taskPending = this.head.getNext(); taskPending != null; taskPending = taskPending.getNext()) { - if (taskPending == task) { -@@ -344,7 +344,7 @@ public class CraftScheduler implements BukkitScheduler { - } - } - } -- }){{this.timings=co.aikar.timings.MinecraftTimings.getCancelTasksTimer(plugin);}}; // Paper -+ })/*{{this.timings=co.aikar.timings.MinecraftTimings.getCancelTasksTimer(plugin);}}*/; // Paper // Thunderbolt - Remove remaining timings implementations - this.handle(task, 0L); - for (CraftTask taskPending = this.head.getNext(); taskPending != null; taskPending = taskPending.getNext()) { - if (taskPending == task) { -diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java -index 5835dc236b3f5291a804f7fb14a12eb466d4e0ba..878d8800f35c49a04a1632381e64137fbe619937 100644 ---- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java -+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java -@@ -2,14 +2,14 @@ package org.bukkit.craftbukkit.scheduler; - - import java.util.function.Consumer; - --import co.aikar.timings.NullTimingHandler; -+// import co.aikar.timings.NullTimingHandler; // Thunderbolt - Remove remaining timings implementations - import org.bukkit.Bukkit; - import org.bukkit.plugin.Plugin; - import org.bukkit.scheduler.BukkitTask; - --import org.spigotmc.CustomTimingsHandler; // Spigot --import co.aikar.timings.MinecraftTimings; // Paper --import co.aikar.timings.Timing; // Paper -+// import org.spigotmc.CustomTimingsHandler; // Spigot // Thunderbolt - Remove remaining timings implementations -+// import co.aikar.timings.MinecraftTimings; // Paper // Thunderbolt - Remove remaining timings implementations -+// import co.aikar.timings.Timing; // Paper // Thunderbolt - Remove remaining timings implementations - - public class CraftTask implements BukkitTask, Runnable { // Spigot - -@@ -31,7 +31,7 @@ public class CraftTask implements BukkitTask, Runnable { // Spigot - private long nextRun; - public final Runnable rTask; // Paper - public final Consumer cTask; // Paper -- public Timing timings; // Paper -+ // public Timing timings; // Paper // Thunderbolt - Remove remaining timings implementations - private final Plugin plugin; - private final int id; - private final long createdAt = System.nanoTime(); -@@ -55,7 +55,7 @@ public class CraftTask implements BukkitTask, Runnable { // Spigot - this.id = id; - this.period = CraftTask.NO_REPEATING; - this.taskName = taskName; -- this.timings = MinecraftTimings.getInternalTaskName(taskName); -+ // this.timings = MinecraftTimings.getInternalTaskName(taskName); // Thunderbolt - Remove remaining timings implementations - } - // Paper end - -@@ -76,7 +76,7 @@ public class CraftTask implements BukkitTask, Runnable { // Spigot - } - this.id = id; - this.period = period; -- timings = task != null ? MinecraftTimings.getPluginTaskTimings(this, period) : NullTimingHandler.NULL; // Paper -+ // timings = task != null ? MinecraftTimings.getPluginTaskTimings(this, period) : NullTimingHandler.NULL; // Paper // Thunderbolt - Remove remaining timings implementations - } - - @Override -diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 6f24422beb7d3db6dbed0efcba2935f542519827..f6f991d2018ffca3ca49c61a6cc942c6b00e150b 100644 ---- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -215,6 +215,7 @@ public final class CraftMagicNumbers implements UnsafeValues { - return ENTITY_TYPES_ENTITY_TYPE.get(entityTypes); - } - // Paper end -+ /* // Thunderbolt - Remove remaining timings implementations - // ======================================================================== - // Paper start - @Override -@@ -222,6 +223,7 @@ public final class CraftMagicNumbers implements UnsafeValues { - co.aikar.timings.TimingsExport.reportTimings(); - } - // Paper end -+ */ // Thunderbolt - Remove remaining timings implementations - - public static byte toLegacyData(BlockState data) { - return CraftLegacy.toLegacyData(data); -@@ -495,10 +497,12 @@ public final class CraftMagicNumbers implements UnsafeValues { - return new CraftDamageSourceBuilder(damageType); - } - // Paper start -+ /* // Thunderbolt - Remove remaining timings implementations - @Override - public String getTimingsServerName() { - return io.papermc.paper.configuration.GlobalConfiguration.get().timings.serverName; - } -+ */ // Thunderbolt - Remove remaining timings implementations - - @Override - public com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() { -diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index 583647f6c9ca0fb092f30c97693bd548f692dfd3..a46f90860b5d3565bae429b6d5a60edf90a4299f 100644 ---- a/src/main/java/org/spigotmc/ActivationRange.java -+++ b/src/main/java/org/spigotmc/ActivationRange.java -@@ -35,7 +35,7 @@ import net.minecraft.world.entity.projectile.FireworkRocketEntity; - import net.minecraft.world.entity.projectile.ThrowableProjectile; - import net.minecraft.world.entity.projectile.ThrownTrident; - import net.minecraft.world.entity.raid.Raider; --import co.aikar.timings.MinecraftTimings; -+// import co.aikar.timings.MinecraftTimings; // Thunderbolt - Remove remaining timings implementations - import net.minecraft.world.entity.schedule.Activity; - import net.minecraft.world.level.Level; - import net.minecraft.world.phys.AABB; diff --git a/patches/unapplied/server/1069-improve-random-block-selection-RNG.patch b/patches/unapplied/server/1069-improve-random-block-selection-RNG.patch new file mode 100644 index 000000000..fcaa8e470 --- /dev/null +++ b/patches/unapplied/server/1069-improve-random-block-selection-RNG.patch @@ -0,0 +1,66 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: scriptlinestudios +Date: Thu, 31 Oct 2024 12:00:37 +0200 +Subject: [PATCH] improve random block selection RNG + + +diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java +index 507671476c3d2d92a2fdb05be24443af27d26dcf..aa97b6a1c4dd1e23cd3a1657efd8a9109b053354 100644 +--- a/src/main/java/net/minecraft/world/level/Level.java ++++ b/src/main/java/net/minecraft/world/level/Level.java +@@ -123,16 +123,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl + public final Thread thread; + private final boolean isDebug; + private int skyDarken; +- protected int randValue = RandomSource.create().nextInt(); ++ protected long randValue = RandomSource.create().nextLong(); + protected final int addend = 1013904223; + protected float oRainLevel; + public float rainLevel; + protected float oThunderLevel; + public float thunderLevel; + public final RandomSource random = RandomSource.create(); +- /** @deprecated */ +- @Deprecated +- private final RandomSource threadSafeRandom = RandomSource.createThreadSafe(); + private final Holder dimensionTypeRegistration; + public final WritableLevelData levelData; + private final Supplier profiler; +@@ -1327,15 +1324,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl + } + + public void playSound(@Nullable Player source, double x, double y, double z, SoundEvent sound, SoundSource category, float volume, float pitch) { +- this.playSeededSound(source, x, y, z, sound, category, volume, pitch, this.threadSafeRandom.nextLong()); ++ this.randValue++; ++ this.playSeededSound(source, x, y, z, sound, category, volume, pitch, this.randValue); + } + + public void playSound(@Nullable Player source, double x, double y, double z, Holder sound, SoundSource category, float volume, float pitch) { +- this.playSeededSound(source, x, y, z, sound, category, volume, pitch, this.threadSafeRandom.nextLong()); ++ this.randValue++; ++ this.playSeededSound(source, x, y, z, sound, category, volume, pitch, this.randValue); + } + + public void playSound(@Nullable Player source, Entity entity, SoundEvent sound, SoundSource category, float volume, float pitch) { +- this.playSeededSound(source, entity, BuiltInRegistries.SOUND_EVENT.wrapAsHolder(sound), category, volume, pitch, this.threadSafeRandom.nextLong()); ++ this.randValue++; ++ this.playSeededSound(source, entity, BuiltInRegistries.SOUND_EVENT.wrapAsHolder(sound), category, volume, pitch, this.randValue); + } + + public void playLocalSound(BlockPos pos, SoundEvent sound, SoundSource category, float volume, float pitch, boolean useDistance) { +@@ -1950,10 +1950,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl + public abstract RecipeManager getRecipeManager(); + + public BlockPos getBlockRandomPos(int x, int y, int z, int l) { +- this.randValue = this.randValue * 3 + 1013904223; +- int i1 = this.randValue >> 2; ++ this.randValue = (((long)(x ^ 16691) << 32 | ((z ^ 19391) & 0xffffffffL)) << 8 | ((this.randValue + 2319389831L) * 11 & 0xFF)); ++ long i1 = Long.reverse(randValue*randValue<<39); ++ long i2 = Long.reverse(randValue*randValue<<41); ++ long i3 = Long.reverse(randValue*randValue<<23); + +- return new BlockPos(x + (i1 & 15), y + (i1 >> 16 & l), z + (i1 >> 8 & 15)); ++ return new BlockPos(x + ((int)i1 & 15), y + ((int)i2 & l), z + ((int)i3 & 15)); + } + + public boolean noSave() {