From c096068118e2fd008d32ab1a9df773c819e03463 Mon Sep 17 00:00:00 2001 From: liach <7806504+liach@users.noreply.github.com> Date: Sat, 5 Jun 2021 04:32:32 -0500 Subject: [PATCH] Map perfcommand (incomplete) and fix zip compressor mappings (#2459) * Map perfcommand (incomplete) and fix zip compressor mappings Signed-off-by: liach * Fix perf command (after rebasing) Co-authored-by: liach --- .../dedicated/command/PerfCommand.mapping | 8 ++++ mappings/net/minecraft/util/Util.mapping | 2 +- .../util/profiler/ZipCompressor.mapping | 39 +++++++++++++++---- 3 files changed, 41 insertions(+), 8 deletions(-) diff --git a/mappings/net/minecraft/server/dedicated/command/PerfCommand.mapping b/mappings/net/minecraft/server/dedicated/command/PerfCommand.mapping index 3377e9522f..d064a6b392 100644 --- a/mappings/net/minecraft/server/dedicated/command/PerfCommand.mapping +++ b/mappings/net/minecraft/server/dedicated/command/PerfCommand.mapping @@ -4,6 +4,8 @@ CLASS net/minecraft/class_6413 net/minecraft/server/dedicated/command/PerfComman FIELD field_33987 ALREADY_RUNNING_EXCEPTION Lcom/mojang/brigadier/exceptions/SimpleCommandExceptionType; METHOD method_37331 register (Lcom/mojang/brigadier/CommandDispatcher;)V ARG 0 dispatcher + METHOD method_37332 (Lcom/mojang/brigadier/context/CommandContext;)I + ARG 0 context METHOD method_37333 executeStart (Lnet/minecraft/class_2168;)I ARG 0 source METHOD method_37334 sendProfilingStoppedMessage (Lnet/minecraft/class_2168;Lnet/minecraft/class_3696;)V @@ -13,5 +15,11 @@ CLASS net/minecraft/class_6413 net/minecraft/server/dedicated/command/PerfComman ARG 0 source ARG 1 tempProfilingFile ARG 2 server + METHOD method_37337 (Lcom/mojang/brigadier/context/CommandContext;)I + ARG 0 context METHOD method_37338 executeStop (Lnet/minecraft/class_2168;)I ARG 0 source + METHOD method_37339 (Lnet/minecraft/class_2168;Lnet/minecraft/class_3696;)V + ARG 1 result + METHOD method_37340 (Lnet/minecraft/class_2168;)Z + ARG 0 source diff --git a/mappings/net/minecraft/util/Util.mapping b/mappings/net/minecraft/util/Util.mapping index 9a343fded3..6086a51a00 100644 --- a/mappings/net/minecraft/util/Util.mapping +++ b/mappings/net/minecraft/util/Util.mapping @@ -6,7 +6,7 @@ CLASS net/minecraft/class_156 net/minecraft/util/Util FIELD field_24477 IO_WORKER_EXECUTOR Ljava/util/concurrent/ExecutorService; FIELD field_24622 BOOTSTRAP_EXECUTOR Ljava/util/concurrent/ExecutorService; FIELD field_25140 NIL_UUID Ljava/util/UUID; - FIELD field_33859 zipFileSystemProvider Ljava/nio/file/spi/FileSystemProvider; + FIELD field_33859 JAR_FILE_SYSTEM_PROVIDER Ljava/nio/file/spi/FileSystemProvider; METHOD method_17815 stream (Ljava/util/Optional;)Ljava/util/stream/Stream; ARG 0 optional METHOD method_17974 ifPresentOrElse (Ljava/util/Optional;Ljava/util/function/Consumer;Ljava/lang/Runnable;)Ljava/util/Optional; diff --git a/mappings/net/minecraft/util/profiler/ZipCompressor.mapping b/mappings/net/minecraft/util/profiler/ZipCompressor.mapping index 763f3dbaff..1e02162f1c 100644 --- a/mappings/net/minecraft/util/profiler/ZipCompressor.mapping +++ b/mappings/net/minecraft/util/profiler/ZipCompressor.mapping @@ -1,18 +1,43 @@ CLASS net/minecraft/class_6397 net/minecraft/util/profiler/ZipCompressor + COMMENT A ZIP compressor builds up a ZIP file. It completes the ZIP file when it is + COMMENT {@linkplain #close() closed}. All its methods and constructors throw + COMMENT {@link java.io.UncheckedIOException} when an I/O error occurs. + COMMENT + COMMENT @implSpec The compressor writes the contents of the ZIP to a {@link #temp} file + COMMENT first; then, it replaces the desired {@link #file} with the temp file when + COMMENT closed. FIELD field_33864 LOGGER Lorg/apache/logging/log4j/Logger; - FIELD field_33865 profilingDirectory Ljava/nio/file/Path; - FIELD field_33866 temporaryDirectory Ljava/nio/file/Path; + FIELD field_33865 file Ljava/nio/file/Path; + FIELD field_33866 temp Ljava/nio/file/Path; FIELD field_33867 zip Ljava/nio/file/FileSystem; METHOD (Ljava/nio/file/Path;)V - ARG 1 profilingDirectory + COMMENT Creates a ZIP compressor. + ARG 1 file + COMMENT the path of the ZIP file METHOD method_37161 copyAll (Ljava/nio/file/Path;)V - ARG 1 path + COMMENT Copies the {@code source} file or directory to the root of the ZIP. + ARG 1 source + COMMENT the source file or directory to copy METHOD method_37162 copy (Ljava/nio/file/Path;Ljava/io/File;)V - ARG 1 path - ARG 2 file + COMMENT Copies a {@code source} file to the {@code target} path within the ZIP. + COMMENT + COMMENT

If the {@code source} is a directory, then an empty directory would be + COMMENT copied. The {@code target} should be a relative path, as it will be resolved + COMMENT against the root of the ZIP. + ARG 1 target + COMMENT the target path in the ZIP + ARG 2 source + COMMENT the source file to copy METHOD method_37163 write (Ljava/nio/file/Path;Ljava/lang/String;)V - ARG 1 path + COMMENT Writes the {@code content}, in UTF-8 encoding, to the {@code target} path + COMMENT within the ZIP. + COMMENT + COMMENT

The {@code target} should be a relative path, as it will be resolved + COMMENT against the root of the ZIP. + ARG 1 target + COMMENT the target path in the ZIP ARG 2 content + COMMENT the file content to write in UTF-8 METHOD method_37164 (Ljava/nio/file/Path;Ljava/nio/file/attribute/BasicFileAttributes;)Z ARG 0 path ARG 1 attributes