Mods / ShearLib
Authors: Tels, Phiwa
Side: Both
Created: Sep 21st 2024 at 11:36 AM
Last modified: Oct 23rd at 7:11 PM
Downloads: 78222
Follow Unfollow 726
Recommended download (for Vintage Story 1.21.0, 1.21.1 and 1.21.2 - 1.21.5):
shearlib-1.2.0.zip
1-click install
Do not install this mod unless another mod requires it, or you are a mod developer wanting to use it.
This is otherwise useless for playing VS!
This library adds a new behaviour called "shearable" that can be attached to entities (animals).
The behaviour allows to define one or two drops, the min and max quantity of items/blocks to drop, and weather using shears instead of a knife gives a bonus. Only live entities can be sheared.
Does not modify existing animals, for this please use Wool & More.
Many thanks go to Catasteroid for donating his code for shearing animals from Hide & Fabric to us!
We hope you like our work,
Tels s & Phiwa 🧡
Title card image based on a photo by CSIRO
| Mod Version | Mod Identifier | For Game version | Downloads | Released | Changelog | Download | 1-click mod install* |
|---|---|---|---|---|---|---|---|
| 1.2.0 | shearlib | 24851 | Aug 25th at 7:23 PM | shearlib-1.2.0.zip | 1-click install | ||
v1.2.0 - 2025-08-25 - More Translations
New Features
Bug Fixes
Tweaks and Balancing
Translations
We hope you enjoy our work, Tels & Phiwa 🤍
| |||||||
| 1.1.2 | shearlib | 39778 | Jan 26th at 11:57 AM | shearlib-1.1.2.zip | 1-click install | ||
v1.1.2 - 2025-01-25 - Even Better ShearInfoTweaks and Balancing
Translations
We hope you enjoy our work, Tels & Phiwa 🤍 -----BEGIN PGP SIGNATURE----- | |||||||
| 1.1.1 | shearlib | 4793 | Jan 19th at 1:25 PM | shearlib-1.1.1.zip | 1-click install | ||
v1.1.1 - 2025-01-19 - ShearInfoBug Fixes
Tweaks and Balancing
Translations
We hope you enjoy our work, Tels & Phiwa 💛 -----BEGIN PGP SIGNATURE----- | |||||||
| 1.1.0 | shearlib | 608 | Jan 18th at 3:12 PM | shearlib-1.1.0.zip | 1-click install | ||
v1.1.0 - 2025-01-18 - VS 1.20Compatibility
We hope you enjoy our work, Tels & Phiwa 💛 -----BEGIN PGP SIGNATURE----- | |||||||
| 1.0.3 | shearlib | 2894 | Nov 17th 2024 at 4:21 PM | shearlib-1.0.3.zip | 1-click install | ||
v1.0.3 - 2024-11-17 - Fixed DropsBug Fixes
Tweaks and Balancing
-----BEGIN PGP SIGNATURE----- | |||||||
| 1.0.2 | shearlib | 738 | Nov 5th 2024 at 7:57 AM | shearlib-1.0.2.zip | 1-click install | ||
v1.0.2 - 2024-11-05 - Fixed ErrorsBug Fixes
We hope you enjoy our work, Tels & Phiwa 💛 -----BEGIN PGP SIGNATURE----- | |||||||
| 1.0.1 | shearlib | 873 | Oct 22nd 2024 at 5:22 PM | shearlib-1.0.1.zip | 1-click install | ||
v1.0.1 - 2024-10-21 - TranslationsTranslations
We hope you enjoy our work, Tels & Phiwa 💛 -----BEGIN PGP SIGNATURE----- | |||||||
| 1.0.0 | shearlib | 1752 | Sep 22nd 2024 at 10:43 PM | shearlib-1.0.0.zip | 1-click install | ||
v1.0.0 - 2024-09-22 - First ReleaseNew FeaturesTranslations
We hope you like our work. Special thanx go to Catasteroid for donating his code to us! -----BEGIN PGP SIGNATURE----- | |||||||
Battlemints Yes, it should. It works with 1.21.5 as well.
Does this work with 1.21.4?
При обновлении 1.21.0 требуется изменить текст в wool-1.6.4.zip\assets\wool\patches\Survival-blocktypes-wood-pan.json
22 строки: "path": "/attributes/panningDrops/@(sand|gravel)-.*/-",
заменить на "path": "/attributes/panningDrops/@(sand|gravel|sandwavy)-.*/-",
тогда drop будет работать
Ok, so, there is a null check in initialize that adds the tree if it is missing, but that only happens server side due to line 266
if (entity.World.Side == EnumAppSide.Client) return; shearTree = entity.WatchedAttributes.GetTreeAttribute("shearable"); if (shearTree == null) { entity.WatchedAttributes.SetAttribute("shearable", shearTree = new TreeAttribute()); }So if the entity is sent to the client _without_ the shearable attribute, then attempting to later shear the entity results in the exception I included.
I was suggesting adding a check of
if (shearTree == null) return;
at some point in the callpath from OnInteract down or adding a check and reasonable default everywhere that shearTree is accessed (like in LastShearTime)
The first option is likely the safest, adding the check and return to canshear after the alive check but before the first attempt to access DropQuantity
GitLab isn't letting me give you are pull request. I have added an issue to shearlib gitlab
Lantalia I'm not really familiar with the code and it looks to me like the check is aleady there? Could you please send me a diff (on discord, preferable, or make an isseu on the shearlib gitlab?
https://gitlab.com/codesmiths/vs_shearlib/
-/blob/main/src/vs_shearlibModSystem.cs#L323
Can you add the null check for shearTree being null to the clientSide (or at least try not to access it without a check)? Not checking that turns minor desyncs into client crashes
shearTree = entity.WatchedAttributes.GetTreeAttribute("shearable");
if (shearTree == null) return;
If you need a pull request, I can set one up
System.NullReferenceException: Object reference not set to an instance of an object.
at ShearLib.EntityBehaviorShearable.get_LastShearTime()
at ShearLib.EntityBehaviorShearable.get_Growth()
at ShearLib.EntityBehaviorShearable.get_DropQuantity()
at ShearLib.EntityBehaviorShearable.CanShear(ItemSlot itemslot, Boolean& bonus)
at ShearLib.EntityBehaviorShearable.TryShear(EntityAgent byEntity, ItemSlot itemslot)
at ShearLib.EntityBehaviorShearable.OnInteract(EntityAgent byEntity, ItemSlot itemslot, Vec3d hitPosition, EnumInteractMode mode, EnumHandling& handled)
at Vintagestory.API.Common.EntityAgent.OnInteract(EntityAgent byEntity, ItemSlot slot, Vec3d hitPosition, EnumInteractMode mode) in VintagestoryApi\Common\Entity\EntityAgent.cs:line 306
There will be new release for 1.21.0 but so far Sherlib 1.1.2 works in 1.21.0-pre.1 just fine.
Hi Tels, here is the french translation for ShearLib. Have a good day !
Sihg It works on all 1.20.x versions just fine, I've updated the file entry. I'd recommend to updated to 1.20.7 for security and stability reasons, tho, and also I generally only can test with the latest versions so results for older versions might vary for you.
Need a 1.20.4 version
bonenaut7 Done, it was indeed a mistake in the error messag code. Thanx for the report!
bonenaut7 Thanx for the report, I'll look into it!
There's probably a minor bug with text display. I'm tried to shear wild gazelle and found out that on the tooltip in the top part of the screen everything is ok, and text tells me that animal should be at least from 3rd generation to be sheared, but the problem is red text shown near hotbar when you're trying to click RMB with knife while looking at the animal, text says animal should be at least from 0 generation.
Also i'm used my translation to the mod, but i kept all placeholders in the text, so i don't think it's the problem (For testing you can download translation theme from my profile here on moddb and take translation file from there)
(It's happening on 1.19.8)
Tels
Czech translate - code (cs)
MiaIsis This is only the shearing behaviour of Hide & Fabric, nothing else. It will not do anything unless you install the newest Wool & Hide mod (or are a mod developer and use this mod in your own mod). There have been 8 downloads since I made this mod public (because my development pipeline needed a release) so it seems I need to improve the description. :)
Is it like Hide&Fabric, but just the shearing?