Skip to content
This repository has been archived by the owner on Oct 1, 2019. It is now read-only.

API to support "custom blocks" in level calculation #180

Closed
Poslovitch opened this issue May 3, 2017 · 2 comments
Closed

API to support "custom blocks" in level calculation #180

Poslovitch opened this issue May 3, 2017 · 2 comments
Assignees
Milestone

Comments

@Poslovitch
Copy link
Collaborator

Idea taken from : https://forum.rinaorc.com/index.php?threads/skyblock.9667/ (french server forum)

Consists in giving to developpers a programming interface to register their "custom blocks", ideally an abstract Object.

When calculating the island level, ASB would go through every registered custom block and ask if a block is "special". Then if true, ASB will use the "custom" block value instead of the vanilla one.

I.e : Slimefun (https://github.com/TheBusyBiscuit/Slimefun4) adds a 24-Carat Gold Block, which is extremely valuable, as it is hard to obtain. But, when placed on an island, this block doesn't give much levels as a regular gold block.
Hopefully, Poslovitch worked hard on a new feature in ASB API ( :D ), which allows Slimefun to register this custom block !
And now, when ASB calculates island level, it checks if the block is "custom" (by an abstract method "isCustom" which returns a boolean). If true, it uses the value of the custom block (Slimefun gives a default value, but it can be overriden by adding a line with the "id" of the custom block in blockvalues.yml), otherwise it uses the vanilla value.

And it would work the same for /is value.


This is an idea that may slow the level calculation, but I think it would be something very interesting. It's now possible with plugins (and even with resource packs!) to "add" blocks. Providing a way to make them more or less valuable than "normal" blocks would be an "added value" to the overall plugin as well as promoting incredible plugins like Slimefun.

@Poslovitch Poslovitch added this to the 4.0 milestone May 3, 2017
@Poslovitch Poslovitch self-assigned this May 3, 2017
@tastybento
Copy link
Owner

It should be possible to just add another list of special blocks for the calculation. It's done async anyway. The challenge may be in identifying the special blocks during the calculation because the system uses chunk snapshot to grab the chunk data. When I was trying to code up something to spot spawners of a special type that was going to cause issues. So, it may be better to have a list of special block locations as well. It needs some thought.

@tastybento
Copy link
Owner

This issue was moved to tastybento/bskyblock#21

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants