Rename and document HoeItem tilling names (#2635)

* Rename and document HoeItem tilling names

- TILLED_BLOCKS -> TILLING_ACTIONS (it's not a pure block->block map
  anymore)
- getTillingConsumer -> getTillingAction: more descriptive this way
- usagePredicate -> canUse: more conventional and descriptive name for a
  boolean-returning method

* HoeItem.canUse -> canTill

* Address code review

* Code review part II

* Update mappings/net/minecraft/item/HoeItem.mapping

Co-authored-by: liach <7806504+liach@users.noreply.github.com>

Co-authored-by: liach <7806504+liach@users.noreply.github.com>
This commit is contained in:
Juuxel 2021-08-23 00:15:46 +03:00 committed by GitHub
parent b1b2179711
commit 55c122e987
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 7 deletions

View File

@ -1,5 +1,9 @@
CLASS net/minecraft/class_1794 net/minecraft/item/HoeItem CLASS net/minecraft/class_1794 net/minecraft/item/HoeItem
FIELD field_8023 TILLED_BLOCKS Ljava/util/Map; FIELD field_8023 TILLING_ACTIONS Ljava/util/Map;
COMMENT A map of input blocks to predicate-consumer action pairs.
COMMENT
COMMENT <p>Tilling works so that if the predicate succeeds, the consumer (the real action)
COMMENT is executed, and the hoe is damaged.
METHOD <init> (Lnet/minecraft/class_1832;IFLnet/minecraft/class_1792$class_1793;)V METHOD <init> (Lnet/minecraft/class_1832;IFLnet/minecraft/class_1792$class_1793;)V
ARG 1 material ARG 1 material
ARG 2 attackDamage ARG 2 attackDamage
@ -9,12 +13,19 @@ CLASS net/minecraft/class_1794 net/minecraft/item/HoeItem
ARG 1 p ARG 1 p
METHOD method_36984 (Lnet/minecraft/class_2680;Lnet/minecraft/class_1838;)V METHOD method_36984 (Lnet/minecraft/class_2680;Lnet/minecraft/class_1838;)V
ARG 1 context ARG 1 context
METHOD method_36985 getTillingConsumer (Lnet/minecraft/class_2680;Lnet/minecraft/class_1935;)Ljava/util/function/Consumer; METHOD method_36985 createTillAndDropAction (Lnet/minecraft/class_2680;Lnet/minecraft/class_1935;)Ljava/util/function/Consumer;
ARG 0 state COMMENT {@return a tilling action that sets a block state and drops an item}
ARG 1 dropItem ARG 0 result
COMMENT the tilled block state
ARG 1 droppedItem
COMMENT the item to drop
METHOD method_36986 (Lnet/minecraft/class_2680;Lnet/minecraft/class_1935;Lnet/minecraft/class_1838;)V METHOD method_36986 (Lnet/minecraft/class_2680;Lnet/minecraft/class_1935;Lnet/minecraft/class_1838;)V
ARG 2 context ARG 2 context
METHOD method_36987 usagePredicate (Lnet/minecraft/class_1838;)Z METHOD method_36987 canTillFarmland (Lnet/minecraft/class_1838;)Z
COMMENT {@return whether the used block can be tilled into farmland}
COMMENT This method is used as the tilling predicate for most vanilla blocks except rooted dirt.
ARG 0 context ARG 0 context
METHOD method_36988 getTillingConsumer (Lnet/minecraft/class_2680;)Ljava/util/function/Consumer; METHOD method_36988 createTillAction (Lnet/minecraft/class_2680;)Ljava/util/function/Consumer;
ARG 0 state COMMENT {@return a tilling action that sets a block state}
ARG 0 result
COMMENT the tilled block state