Mods / Attribute Rendering Library

Tags: #Library
Authors: DanaCraluminum, Moby_, nanotect, Maltiez, jayu, SaltyWater, BowlSoldier
Side: Both
Created: Jul 26th at 2:33 PM
Last modified: Nov 4th at 4:39 PM
Downloads: 104342
Follow Unfollow 959

Recommended download (for Vintage Story 1.21.0 - 1.21.5):
AttributeRenderingLibrary-v2.4.0.zip  1-click install


I live in Ukraine and there is a war going on right now.

If you are enjoying my mods, you can support me on Patreon. Any help is appreciated!

Patreon

[Discord] Discord


 

Implements attribute-based variant system for rendering things, which is very optimized and efficient way to add thousands of variants for any item or block.

Usually vanilla and mods add new item or block variants by using VariantGroups, but this mod doesn't require VariantGroups at all.

 

Documentation is being worked on.

 

Mods using this library:

 

To reference the library in the code mod, add the following to your csproj file (use higher version if needed):

<ItemGroup>
	<PackageReference Include="CraluminumMods.VintageStory.AttributeRenderingLibrary" Version="2.4.0" PrivateAssets="all" />
</ItemGroup>

 

Roadmap
  • Implement attribute-based variant system for following things
    • Entity
    • EntityBehavior
    • ItemWearable
      • textures and shape only

Mod Version For Game version Downloads Released Changelog Download 1-click mod install*
2.4.0
1.21.0 - 1.21.5
15406 Nov 4th at 4:39 PM AttributeRenderingLibrary-v2.4.0.zip 1-click install
  • Feature: Implemented more things:
    • collision and selection boxes (for BlockBehavior)
    • drops (for BlockBehavior)
    • shapeInventory (for BlockBehavior)
    • durability (for Item)
    • attackPower (for Item)
    • attackRange (for Item)
    • storageFlags (for both Item and CollectibleBehavior)
    • heldLeftReadyAnimation (for both Item and CollectibleBehavior)
    • heldRightReadyAnimation (for both Item and CollectibleBehavior)
    • heldLeftTpIdleAnimation (for both Item and CollectibleBehavior)
    • heldRightTpIdleAnimation (for both Item and CollectibleBehavior)
    • heldTpUseAnimation (for both Item and CollectibleBehavior)
    • heldTpHitAnimation (for both Item and CollectibleBehavior)
  • Feature: Implemented ignoreElements for shapes
  • Fixed: Block mesh not redrawing on changing variants
  • Fixed: Blocks with attributes that don't set canChisel attribute were possible to chisel, even if it irreversibly broke them (canChisel is now forcefully set to false for such blocks)
  • Fixed: Blocks not displaying handbook drops properly
  • API Tweak: Added profiler for FindByVariant
2.3.0
1.21.2 - 1.21.5
52721 Sep 14th at 4:26 PM AttributeRenderingLibrary-v2.3.0.zip 1-click install

Feature: Added NWOrientable behavior that supports attribute-based variants system

2.2.0 1700 Sep 13th at 8:03 PM AttributeRenderingLibrary-v2.2.0.zip 1-click install

Feature: Blocks can now use attribute-based variants system (technical: implemented block behavior and block entity behavior)

Feature: Implemented own versions of HorizontalOrientable and HorizontalAttachable behaviors that support attribute-based variants system (technical: only for GetDrops and OnPickBlock)

2.1.2 2753 Sep 11th at 7:14 PM AttributeRenderingLibrary-v2.1.2.zip 1-click install

Added Variants.ContainsKey and Variants.MergeVariants

2.1.1 15950 Aug 30th at 2:14 PM AttributeRenderingLibrary-v2.1.1.zip 1-click install

Fixed: Added null check to Variants.RemoveKeys to prevent possible crashes

2.1.0 5652 Aug 25th at 7:21 PM AttributeRenderingLibrary-v2.1.0.zip 1-click install

Feature: Can now override contained description for items with attributes
Removed: AttachableToEntityTyped behavior (it is now built-in into ShapeTexturesFromAttributes behavior and ItemShapeTexturesFromAttributes class). It can now be configured only it through STFA_attachableToEntity attribute

2.0.1 631 Aug 8th at 11:13 AM AttributeRenderingLibrary-v2.0.1.zip 1-click install

Fixed: Suppress missing texture errors in logs

2.0.0 88 Aug 7th at 7:53 PM AttributeRenderingLibrary-v2.0.0.zip 1-click install

Update to 1.21

1.0.4 2213 Aug 26th at 7:44 PM AttributeRenderingLibrary-v1.0.4.zip 1-click install

Backport of 1.21 version for 1.20

1.0.3
1.20.0 - 1.20.3 1.20.5 - 1.20.7 1.20.8 - 1.20.10 1.20.11 - 1.20.12
5834 Aug 3rd at 3:12 PM AttributeRenderingLibrary-v1.0.3.zip 1-click install

API Tweak: Ignore empty and null dictionaries (slight performance improvement)

1.0.2
1.20.0 - 1.20.3 1.20.5 - 1.20.7 1.20.8 - 1.20.10 1.20.11 - 1.20.12
545 Jul 29th at 10:43 PM AttributeRenderingLibrary-v1.0.2.zip 1-click install

Fixed: Crash when shape overlays are null in AttachableToEntity behavior

1.0.1
1.20.0 - 1.20.3 1.20.5 - 1.20.7 1.20.8 - 1.20.10 1.20.11 - 1.20.12
61 Jul 29th at 10:42 AM AttributeRenderingLibrary-v1.0.1.zip 1-click install

API Tweak: Attribute-based variant system:

  • Use full domain and path placeholders

 

API Tweak: Suppress log warnings when overlays don't exist

1.0.0
1.20.0 - 1.20.3 1.20.5 - 1.20.7 1.20.8 - 1.20.10 1.20.11 - 1.20.12
788 Jul 26th at 2:37 PM Empty AttributeRenderingLibrary-v1.0.0.zip 1-click install

10 Comments (oldest first | newest first)

💬 CKitt, Sep 11th at 10:29 PM

Thanks very much for the quick response on which version! Always appreciated.

💬 Skaface443, Sep 11th at 10:12 PM

ahh good point. Forgot to do that after updating.

Works like a charm after clearing cache.

 

Great work you and your team do

💬 DanaCraluminum , Sep 11th at 9:55 PM

Skaface443 Clear cache

💬 Skaface443, Sep 11th at 9:42 PM

CTD with newest version:

Just wanted to let you know. Dont have mods that need newest version so ill downgrade again.

 

Crash Report
System.Exception: Don't know how to instantiate collectible behavior of class 'AttributeRenderingLibrary.ShapeTexturesFromAttributes' did you forget to register a mapping?   at Vintagestory.Common.ClassRegistry.CreateCollectibleBehavior(CollectibleObject collectible, String code) in VintagestoryLib\Common\ClassRegistry.cs:line 257   at Vintagestory.Common.ItemTypeNet.ReadItemTypePacket(Packet_ItemType packet, IWorldAccessor world, ClassRegistry registry) in VintagestoryLib\Common\Network\ItemTypeNet.cs:line 57   at Vintagestory.Client.NoObf.ClientSystemStartup.PopulateItems(List`1 items, Int32 listSize) in VintagestoryLib\Client\Systems\Startup.cs:line 639   at Vintagestory.Client.NoObf.ClientSystemStartup.LoadItemTypes() in VintagestoryLib\Client\Systems\Startup.cs:line 440   at Vintagestory.Client.NoObf.ClientSystemStartup.HandleServerAssets_Step1() in VintagestoryLib\Client\Systems\Startup.cs:line 382   at System.Threading.QueueUserWorkItemCallback.Execute()   at System.Threading.ThreadPoolWorkQueue.Dispatch()   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
💬 DanaCraluminum , Sep 11th at 9:19 PM

CKitt You don't need to update to new version of the library unless some mod requires 2.1.2+ version

💬 CKitt, Sep 11th at 9:13 PM (modified Sep 11th at 9:13 PM)

With 2.1.2's additions, is it safe to leave a modpack otherwise as-is? Nothing seems to specify needing this version of your library, and the server is currently running 2.1.1.

💬 DanaCraluminum , Aug 26th at 5:36 PM
💬 JokoJose, Aug 25th at 7:05 PM

does it works for 1.20.12?

💬 DanaCraluminum , Jul 30th at 8:28 AM (modified Jul 30th at 8:28 AM)

AidasLit The library is very optimized

💬 AidasLit, Jul 29th at 11:00 PM

I'm not experienced in VS modding, but I am curious if this impact's RAM usage. When I add mods with lots of items, a large part of them are variants, and my game sometimes maxes out RAM usage. Would mods using this library help with that?

 (edit comment delete)
Основной веб-сайт | Почтовый сервер | FTP сервер | Административная панель | API интерфейс | Content Delivery Network | Статические файлы | Ресурсы сайта | Изображения | Файловое хранилище | Блог | Интернет-магазин | Техническая поддержка | Справочная система | Документация | Форум | Новости | Загрузки | Демонстрация | Тестовая среда | Приложение | Медиа контент | Разработка | Промежуточная среда | Бета версия | Безопасная зона | Вход в систему | Панель управления | Портал | Система управления контентом