Can you sneak into the API a way for us to get the total elements in a bp as an integer?
Blueprints and total elements
-
- English
- yahwho
- Thread is marked as Resolved.
A new update is now available, introducing seasons and more!
Latest hotfix: 0.8.0.1 (2024-12-20)
Latest hotfix: 0.8.0.1 (2024-12-20)
-
-
I know that blueprints costing resources will be some time off, but in the meantime if I can create something via the API then I can allow players to use BPs on MR.
I'm thinking something like...
sudocode:
-
It just so happens that the next update will provide a proper Item API in general This means it will distinguish between different item types (unlike the old API, which used different "Attribute" types for an item - that term was a bit confusing). So with the next update, it would look like this:
Java: This will work after the next updateThese item subclasses will also provide specific access (e.g. to get the definition file etc). In case of blueprint items, you will be able to access various information about the blueprint (like number of construction elements it contains, creator name etc)
-----
However, if you're working with the PlayerPlaceBlueprintEvent, you can already check the amount of elements the blueprint contains: It provides the methods "getConstructionCount()" (to get the number of construction elements in the blueprint), "getObjectCount()" (to get the number of objects like furniture) and "getPlantCount()" (the number of vegetation). If these values exceed your threshold, you can cancel the event
Participate now!
Don’t have an account yet? Create a new account now and be part of our community!