-
-
Notifications
You must be signed in to change notification settings - Fork 367
Allow florist to use shears on tall grass and ferns #10930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: version/main
Are you sure you want to change the base?
Conversation
src/main/java/com/minecolonies/core/colony/buildings/workerbuildings/BuildingFlorist.java
Show resolved
Hide resolved
return IDLE; | ||
} | ||
} | ||
|
||
worker.setItemInHand(InteractionHand.MAIN_HAND, ItemStack.EMPTY); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this have to switch to shears in hand if available then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just debugging this and found that while in development they did, on a new world they didn't, so I'm gonna have to debug this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's also fine to make it a fixed requirement. It makes sense thematically to use shears on flowers too and it's a mid-late game worker anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So after further testing the invocation of
if (!mineBlock(harvestPosition))
is responsible for automatically selecting the correct tool as well as breaking the block, as used in the EntityAIWorkLumberjack.java
and lots of other things, however the reason it wasn't working in further testing, is because it will correctly select shears only for 1 block tall tall grass and ferns, but not 2 block tall ferns and tall grass. I will work on fixing the tool selection for double tall grass and ferns.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interestingly the mineBlock
call always requests the right tool, but doesn't mark it as required for grass and ferns, so shears aren't requested. It also determines if shears are the right tool by checking if the block implements IForgeShearable
(but notably it doesn't call isShearable
, just checks if it's an instance of IForgeShearable
) in WorkerUtil
in the getBestToolForBlock
method (line 143), and while ferns and grass implement IForgeShearable
, double tall ferns and grass do not implement it, they are merely instances of DoublePlantBlock
which doesn't implement the interface. Instead they handle shearing with a custom loot table forge/data/minecraft/loot_tables/blocks/large_fern.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it's a good idea/ok to add a manual check there like (state.getBlock() instanceof IForgeShearable || state.getBlock() == Blocks.LARGE_FERN || state.getBlock() == Blocks.TALL_GRASS)
or if I need to delve into the loot table mechanic and check for custom rules on shearing (or if I should change the florist to not use mineBlock and instead do something custom) but I found that even when using shears, they still don't trigger the custom loot table for mining with shears, will have to debug further.
I'd say we add a custom tag for it
…-------- Original Message --------
On 6/9/25 06:53, pop1040 wrote:
@pop1040 commented on this pull request.
---------------------------------------------------------------
In [src/main/java/com/minecolonies/core/entity/ai/workers/production/agriculture/EntityAIWorkFlorist.java](#10930 (comment)):
> @@ -151,6 +153,14 @@ private IAIState decide()
return IDLE;
}
+ if(building.getSetting(AbstractBuilding.USE_SHEARS).getValue())
+ {
+ if(checkForToolOrWeapon(ModEquipmentTypes.shears.get()))
+ {
+ return IDLE;
+ }
+ }
+
worker.setItemInHand(InteractionHand.MAIN_HAND, ItemStack.EMPTY);
Not sure if it's a good idea/ok to add a manual check there like (state.getBlock() instanceof IForgeShearable || state.getBlock() == Blocks.LARGE_FERN || state.getBlock() == Blocks.TALL_GRASS) or if I need to delve into the loot table mechanic and check for custom rules on shearing (or if I should change the florist to not use mineBlock and instead do something custom) but I found that even when using shears, they still don't trigger the custom loot table for mining with shears, will have to debug further.
—
Reply to this email directly, [view it on GitHub](#10930 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/ABRD3S2RTIADVK7WQMRMBCT3CUHLHAVCNFSM6AAAAAB63MJFJSVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDSMBYHEYTCOJUGI).
You are receiving this because you commented.Message ID: ***@***.***>
|
I actually want the florist to use shears for everything, its his working tool and as such contributes to his working cost/requirements. Its a small cost to pay for flowers which you normally cannot grow at all in vanilla |
Several flowers (not all, true) can be bonemealed in vanilla fyi |
Closes #10019
Added as setting rather than hard requirement, in case the player doesn't need tall grass or ferns and would rather not waste iron on shears (or would explicitly like the byproducts of breaking grass without shearing)
Changes proposed in this pull request
Testing
Review please