Skip to content

Commit

Permalink
22w42a util stuff (#3337)
Browse files Browse the repository at this point in the history
* 22w42a util stuff

* Update mappings/net/minecraft/util/PathUtil.mapping

Co-authored-by: Juuz <[email protected]>

Co-authored-by: Juuz <[email protected]>
  • Loading branch information
apple502j and Juuxel authored Oct 21, 2022
1 parent 3362890 commit 34865fd
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CLASS net/minecraft/class_4239 net/minecraft/util/FileNameUtil
COMMENT A class holding file name-related utility methods.
CLASS net/minecraft/class_4239 net/minecraft/util/PathUtil
COMMENT A class holding path-related utility methods.
FIELD field_18955 RESERVED_WINDOWS_NAMES Ljava/util/regex/Pattern;
FIELD field_18956 FILE_NAME_WITH_COUNT Ljava/util/regex/Pattern;
FIELD field_33384 MAX_NAME_LENGTH I
Expand Down Expand Up @@ -41,11 +41,26 @@ CLASS net/minecraft/class_4239 net/minecraft/util/FileNameUtil
COMMENT to {@code /}}
ARG 0 path
METHOD method_46344 getPath (Ljava/nio/file/Path;Ljava/util/List;)Ljava/nio/file/Path;
COMMENT {@return {@code paths} resolved as a path from {@code root}}
COMMENT
COMMENT <p>If {@code paths} is empty, this returns {@code root}.
ARG 0 root
ARG 1 paths
METHOD method_46345 isPathValid ([Ljava/lang/String;)V
METHOD method_46345 validatePath ([Ljava/lang/String;)V
COMMENT Validates that {@code paths} is not empty and does not contain invalid segments
COMMENT (such as {@code .}, {@code ..}, or otherwise {@linkplain #isFileNameValid invalid names}).
COMMENT
COMMENT @throws IllegalArgumentException when the {@code paths} are invalid
ARG 0 paths
METHOD method_46346 split (Ljava/lang/String;)Lcom/mojang/serialization/DataResult;
COMMENT {@return {@code path} split by {@code /}, or an error result if the path is invalid}
COMMENT
COMMENT <p>All path segments must be a {@linkplain #isFileNameValid valid file name}. Additionally,
COMMENT {@code .} and {@code ..} are forbidden.
ARG 0 path
METHOD method_46347 isFileNameValid (Ljava/lang/String;)Z
COMMENT {@return whether {@code name} is a valid file name}
COMMENT
COMMENT @apiNote A valid file name contains only ASCII lowercase alphabets, ASCII digits,
COMMENT a dot, or an underscore. Unlike {@link Identifier} paths, hyphens are not allowed.
ARG 0 name
2 changes: 2 additions & 0 deletions mappings/net/minecraft/util/collection/WeightedList.mapping
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ CLASS net/minecraft/class_6032 net/minecraft/util/collection/WeightedList
ARG 3 data
METHOD method_35105 (Lcom/mojang/serialization/Dynamic;Ljava/lang/Object;)Lnet/minecraft/class_6032$class_6033;
ARG 1 data
METHOD method_35106 (Lcom/mojang/serialization/DynamicOps;Lnet/minecraft/class_6032$class_6033;)Lcom/mojang/datafixers/util/Pair;
ARG 1 entry
2 changes: 2 additions & 0 deletions mappings/net/minecraft/util/profiler/ProfilerTiming.mapping
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ CLASS net/minecraft/class_3534 net/minecraft/util/profiler/ProfilerTiming
ARG 2 parentUsagePercentage
ARG 4 totalUsagePercentage
ARG 6 visitCount
METHOD compareTo (Ljava/lang/Object;)I
ARG 1 other
METHOD method_15409 getColor ()I

0 comments on commit 34865fd

Please sign in to comment.