Effectiveness 2 (#1272)

* isUsingEffectiveTool -> canHarvest, isEffectiveOn -> isSuitableFor

* Apply suggestions from code review

Co-authored-by: haykam821 <24855774+haykam821@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: YanisBft <doublecraft.official@gmail.com>

* Drop invalid mappings

* "this method doesn't exist" he said

Co-authored-by: haykam821 <24855774+haykam821@users.noreply.github.com>
Co-authored-by: YanisBft <doublecraft.official@gmail.com>
This commit is contained in:
­Sollace 2020-12-17 22:00:29 +02:00 committed by GitHub
parent b99cf7dda7
commit d4bd96020f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 4 deletions

View File

@ -156,8 +156,14 @@ CLASS net/minecraft/class_1657 net/minecraft/entity/player/PlayerEntity
ARG 1 structureBlock
METHOD method_7304 addEnchantedHitParticles (Lnet/minecraft/class_1297;)V
ARG 1 target
METHOD method_7305 isUsingEffectiveTool (Lnet/minecraft/class_2680;)Z
ARG 1 block
METHOD method_7305 canHarvest (Lnet/minecraft/class_2680;)Z
COMMENT Determines whether the player is able to harvest drops from the specified block state.
COMMENT If a block requires a special tool, it will check
COMMENT whether the held item is effective for that block, otherwise
COMMENT it returns {@code true}.
COMMENT
COMMENT @see Item#isSuitableFor
ARG 1 state
METHOD method_7308 getShoulderEntityRight ()Lnet/minecraft/class_2487;
METHOD method_7310 getOfflinePlayerUuid (Ljava/lang/String;)Ljava/util/UUID;
ARG 0 nickname

View File

@ -24,6 +24,8 @@ CLASS net/minecraft/class_1661 net/minecraft/entity/player/PlayerInventory
METHOD method_7368 getHotbarSize ()I
METHOD method_7370 getBlockBreakingSpeed (Lnet/minecraft/class_2680;)F
ARG 1 block
METHOD method_7371 indexOf (Lnet/minecraft/class_1799;)I
ARG 1 stack
METHOD method_7372 getArmorStack (I)Lnet/minecraft/class_1799;
ARG 1 slot
METHOD method_7373 scrollInHotbar (D)V

View File

@ -101,7 +101,15 @@ CLASS net/minecraft/class_1792 net/minecraft/item/Item
METHOD method_7853 getUseAction (Lnet/minecraft/class_1799;)Lnet/minecraft/class_1839;
ARG 1 stack
METHOD method_7854 getDefaultStack ()Lnet/minecraft/class_1799;
METHOD method_7856 isEffectiveOn (Lnet/minecraft/class_2680;)Z
METHOD method_7856 isSuitableFor (Lnet/minecraft/class_2680;)Z
COMMENT Determines whether this item can be used as a suitable tool for mining the specified block.
COMMENT Depending on block implementation, when combined together, the correct item and block may achieve a better mining speed and yield
COMMENT drops that would not be obtained when mining otherwise.
COMMENT <p>
COMMENT Note that this is not the <b>only</b> way to achieve "effectiveness" when mining.
COMMENT Other items, such as shears on string, may use their own logic
COMMENT and calls to this method might not return a value consistent to this rule for those items.
COMMENT </p>
ARG 1 state
METHOD method_7857 hasRecipeRemainder ()Z
COMMENT Checks if this item has a remainder item that is left behind when used as a crafting ingredient.

View File

@ -144,7 +144,14 @@ CLASS net/minecraft/class_1799 net/minecraft/item/ItemStack
METHOD method_7950 getTooltip (Lnet/minecraft/class_1657;Lnet/minecraft/class_1836;)Ljava/util/List;
ARG 1 player
ARG 2 context
METHOD method_7951 isEffectiveOn (Lnet/minecraft/class_2680;)Z
METHOD method_7951 isSuitableFor (Lnet/minecraft/class_2680;)Z
COMMENT Determines whether this item can be used as a suitable tool for mining the specified block.
COMMENT <p>
COMMENT Depending on block implementation, when combined together, the correct item and block may achieve a better mining speed and yield
COMMENT drops that would not be obtained when mining otherwise.
COMMENT </p>
COMMENT @return values consistent with calls to {@link Item#isSuitableFor}
COMMENT @see Item#isSuitableFor
ARG 1 state
METHOD method_7952 postMine (Lnet/minecraft/class_1937;Lnet/minecraft/class_2680;Lnet/minecraft/class_2338;Lnet/minecraft/class_1657;)V
ARG 1 world