Make the parameter for equals methods consistent (#2361)

* Make the parameter for equals methods consistent

Fixes #2299

* Add conventions for the correct parameter for equals methods
This commit is contained in:
haykam821 2021-04-29 12:12:46 -04:00 committed by GitHub
parent 4da1f7c91e
commit 1317eb48c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 15 additions and 14 deletions

View File

@ -45,6 +45,7 @@ time to type thanks to IDE autocompletion. Common abbreviations you should use a
- "init" for "initialize"
- "min"/"max" for "minimum"/"maximum"
- Any abbreviations used by Java or libraries ("json", "html", etc.)
- "o" for the parameter of `equals(Ljava/lang/Object;)Z` methods
Treat acronyms as single words rather than capitalising every letter. This improves readability (compare `JsonObject` and
`JSONObject`) and it's consistent with Mojang naming (a known name is `NbtIo`).

View File

@ -19,7 +19,7 @@ CLASS net/minecraft/class_4877 net/minecraft/client/realms/dto/RealmsServer
FIELD field_22616 serverPing Lnet/minecraft/class_4880;
FIELD field_22617 LOGGER Lorg/apache/logging/log4j/Logger;
METHOD equals (Ljava/lang/Object;)Z
ARG 1 obj
ARG 1 o
METHOD method_25053 getDescription ()Ljava/lang/String;
METHOD method_25054 getWorldName (I)Ljava/lang/String;
ARG 1 slotId

View File

@ -5,6 +5,6 @@ CLASS net/minecraft/class_5601 net/minecraft/client/render/entity/model/EntityMo
ARG 1 id
ARG 2 name
METHOD equals (Ljava/lang/Object;)Z
ARG 1 other
ARG 1 o
METHOD method_35743 getId ()Lnet/minecraft/class_2960;
METHOD method_35744 getName ()Ljava/lang/String;

View File

@ -36,7 +36,7 @@ CLASS net/minecraft/class_3675 net/minecraft/client/util/InputUtil
ARG 2 type
ARG 3 code
METHOD equals (Ljava/lang/Object;)Z
ARG 1 other
ARG 1 o
METHOD method_1441 getTranslationKey ()Ljava/lang/String;
METHOD method_1442 getCategory ()Lnet/minecraft/class_3675$class_307;
METHOD method_1444 getCode ()I

View File

@ -3,7 +3,7 @@ CLASS net/minecraft/class_44 net/minecraft/loot/provider/number/ConstantLootNumb
METHOD <init> (F)V
ARG 1 value
METHOD equals (Ljava/lang/Object;)Z
ARG 1 object
ARG 1 o
METHOD method_32448 create (F)Lnet/minecraft/class_44;
ARG 0 value
CLASS class_5655 CustomSerializer

View File

@ -11,7 +11,7 @@ CLASS net/minecraft/class_3228 net/minecraft/server/world/ChunkTicket
METHOD compareTo (Ljava/lang/Object;)I
ARG 1 that
METHOD equals (Ljava/lang/Object;)Z
ARG 1 obj
ARG 1 o
METHOD method_14281 getType ()Lnet/minecraft/class_3230;
METHOD method_14283 getLevel ()I
METHOD method_20627 isExpired (J)Z

View File

@ -4,4 +4,4 @@ CLASS net/minecraft/class_2554 net/minecraft/text/BaseText
FIELD field_26623 orderedText Lnet/minecraft/class_5481;
FIELD field_26624 previousLanguage Lnet/minecraft/class_2477;
METHOD equals (Ljava/lang/Object;)Z
ARG 1 obj
ARG 1 o

View File

@ -5,7 +5,7 @@ CLASS net/minecraft/class_2558 net/minecraft/text/ClickEvent
ARG 1 action
ARG 2 value
METHOD equals (Ljava/lang/Object;)Z
ARG 1 obj
ARG 1 o
METHOD method_10844 getValue ()Ljava/lang/String;
METHOD method_10845 getAction ()Lnet/minecraft/class_2558$class_2559;
CLASS class_2559 Action

View File

@ -6,7 +6,7 @@ CLASS net/minecraft/class_2568 net/minecraft/text/HoverEvent
ARG 1 action
ARG 2 contents
METHOD equals (Ljava/lang/Object;)Z
ARG 1 obj
ARG 1 o
METHOD method_10891 getValue (Lnet/minecraft/class_2568$class_5247;)Ljava/lang/Object;
ARG 1 action
METHOD method_10892 getAction ()Lnet/minecraft/class_2568$class_5247;

View File

@ -31,7 +31,7 @@ CLASS net/minecraft/class_2583 net/minecraft/text/Style
ARG 9 insertion
ARG 10 font
METHOD equals (Ljava/lang/Object;)Z
ARG 1 obj
ARG 1 o
METHOD method_10949 withHoverEvent (Lnet/minecraft/class_2568;)Lnet/minecraft/class_2583;
COMMENT Returns a new style with the hover event provided and all other
COMMENT attributes of this style.

View File

@ -21,7 +21,7 @@ CLASS net/minecraft/class_2960 net/minecraft/util/Identifier
METHOD compareTo (Ljava/lang/Object;)I
ARG 1 other
METHOD equals (Ljava/lang/Object;)Z
ARG 1 other
ARG 1 o
METHOD method_12829 tryParse (Ljava/lang/String;)Lnet/minecraft/class_2960;
COMMENT <p>Parses a string into an {@code Identifier}.
COMMENT Takes a string of the form {@code <namespace>:<path>}, for example {@code minecraft:iron_ingot}.

View File

@ -21,7 +21,7 @@ CLASS net/minecraft/class_4581 net/minecraft/util/math/Matrix3f
METHOD <init> (Lnet/minecraft/class_4581;)V
ARG 1 source
METHOD equals (Ljava/lang/Object;)Z
ARG 1 object
ARG 1 o
METHOD method_22847 transpose ()V
METHOD method_22849 getSinAndCosOfRotation (FFF)Lcom/mojang/datafixers/util/Pair;
ARG 0 upperLeft

View File

@ -159,7 +159,7 @@ CLASS net/minecraft/class_1928 net/minecraft/world/GameRules
ARG 1 name
ARG 2 category
METHOD equals (Ljava/lang/Object;)Z
ARG 1 obj
ARG 1 o
METHOD method_20771 getName ()Ljava/lang/String;
METHOD method_27334 getTranslationKey ()Ljava/lang/String;
METHOD method_27335 getCategory ()Lnet/minecraft/class_1928$class_5198;

View File

@ -158,7 +158,7 @@ CLASS net/minecraft/class_1959 net/minecraft/world/biome/Biome
ARG 4 weirdness
ARG 5 weight
METHOD equals (Ljava/lang/Object;)Z
ARG 1 object
ARG 1 o
METHOD method_24381 calculateDistanceTo (Lnet/minecraft/class_1959$class_4762;)F
COMMENT Calculates the distance from this noise point to another one. The
COMMENT distance is a squared distance in a multi-dimensional cartesian plane

View File

@ -13,7 +13,7 @@ CLASS net/minecraft/class_4156 net/minecraft/world/poi/PointOfInterest
ARG 2 type
ARG 3 updateListener
METHOD equals (Ljava/lang/Object;)Z
ARG 1 obj
ARG 1 o
METHOD method_19137 reserveTicket ()Z
METHOD method_19138 releaseTicket ()Z
METHOD method_19139 hasSpace ()Z