[Discussion] Custom Block Data Support
JustAHuman-xD opened this issue ยท 17 comments
Core Protect's APIs do not currently support any ways for plugins such as Slimefun, Nova, ItemsAdder and more to log any additional information that could be important to a block. See #365 where the developer states that they can't add support because of that very reason.
This Issue is just to discuss what changes / additions could be made to allow that to happen.
Personally I work with Slimefun so I know how they handle their custom block data. Recently, a PR was merged that added 2 events for the placement and breakage of Custom Blocks which makes handling logging it to a plugin such as Core Protect much easier. That's why I'm creating this discussion, just to see if and how something like this could be facilitated.
Can you provide a link to their implementation of custom block data?
For the main class: https://github.com/Slimefun/Slimefun4/blob/master/src/main/java/me/mrCookieSlime/Slimefun/api/BlockStorage.java
For the events I was talking about:
Another relevant class if you want to look is: https://github.com/Slimefun/Slimefun4/blob/master/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BlockListener.java
Similarly, here's ItemsAdder's custom block data API: https://itemsadder.devs.beer/developers/java-api/examples
https://github.com/LoneDev6/API-ItemsAdder/blob/master/src/main/java/dev/lone/itemsadder/api/CustomStack.java
(although I could be wrong, cc @LoneDev6)
It's CustomBlock
This is something that would be extremely useful for thousands of server owners who are using resource packs to expand upon the game. ๐
Do you think it'd be better to have api methods in CP that other plugins utilize to add their own custom data. Or would you want to have api methods that are used internally, so those plugins would have to PR to CP to add support.
Better in a very broad sense, could be better for maintainability or better for modularity, just whatever you value in the project and consistency for how CP currently is.
any news? @Intelli
Bumping this issue again since #365 has been marked as stale.
Currently, blocks with extra data are affected the most by griefing, because any rollbacks have to be done either via WorldEdit (which is buggy and sometimes writes garbage block data) or via whole world rollbacks (which is extremely annoying to players and loses valuable data). If you try to rollback any custom blocks via CoreProtect, they simply get replaced with their vanilla states, and plugins that utilize custom data are simply unable to detect when such blocks are being placed.
Rolling back custom blocks is currently impossible via CoreProtect, and doing rollbacks without it requires an extremely manual and intricate process prone to user error. I haven't seen any players exploit this in the wild just yet, but this has forced me to implement extremely restrictive WorldGuard+Towny rules on my server just because I happen to have custom blocks, which can still be bypassed by bad actors with enough effort.
Given how thousands of servers are reliant on ItemsAdder and other custom blocks plugins (there are 5k servers using ItemsAdder alone), I wholeheartedly support this suggestion and hope it gets added to CoreProtect eventually.
Is there anything any other devs can do to help with this? I know a number of Slimefun devs/Slimefun addon devs who would be interested in doing so.
Wouldn't be surprised if any ItemsAdder devs felt the same.
That would really be great
I used ItemsAdder, StorageMechanic and Nova in order to add new storages. As soon as I realized that the items that are added/removed there are not recorded - I abandoned this idea :(
@ALL when will the feature with custom blocks appear? I need this urgently.
@ALL when will the feature with custom blocks appear? I need this urgently.
Firstly, you mentioned a stranger, secondly none of us know. It's up to the dev, if you read up we have tried to talk about helping etc but it appears they want to do is themselves. So no ETA, just gotta wait.
Is there any update on this.
I would love to help out from the Slimefun side for any events or anything else thats needed?
I see its been accepted for a while now.