Make handleBlock Methods that Bypass Island Recalculation #738
-
These are current methods within the Island API: void handleBlockPlace(Key key, int amount); void handleBlockBreak(Key key, int amount); It would be incredibly helpful if you created a version of these methods that functioned as is but were not recalculated during island recalculation. These methods are great for making sure the worth of custom (plugin-based) blocks are registered for worth. The only issue with using this method directly is that when island recalculation is run, any custom block that was sent to Superior using this method is dropped (worth for these blocks are reset to 0). Since anyone using these methods would handle the breaking of their custom blocks (and then call handleBlockBreak), it would be logical to skip these blocks so that their worth is still included after recalculation. The developer would then be able to remove the worth of the block if their block is destroyed using the provided API methods above. Alternatively (and probably a better solution), is to add a set Worth method within the IslandWorthCalculatedEvent event. There is currently a getWorth function but no ability to modify the new worth value after its calculated. This would be a great API feature and would help developers greatly.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Use the built-in system to handle custom values for your blocks. Register a custom block-key for your blocks and give them a worth in the worth-file using the custom block keys. An example can be found on our wiki page. |
Beta Was this translation helpful? Give feedback.
Use the built-in system to handle custom values for your blocks. Register a custom block-key for your blocks and give them a worth in the worth-file using the custom block keys. An example can be found on our wiki page.