PlayPro / CoreProtect

CoreProtect is a blazing fast data logging and anti-griefing tool for Minecraft servers.
Artistic License 2.0
639 stars 315 forks source link

[Discussion] Custom Block Data Support #390

Open JustAHuman-xD opened 1 year ago

JustAHuman-xD commented 1 year ago

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.

Intelli commented 1 year ago

Can you provide a link to their implementation of custom block data?

JustAHuman-xD commented 1 year ago

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:

JustAHuman-xD commented 1 year ago

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

evilsaloon commented 1 year ago

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)

LoneDev6 commented 1 year ago

It's CustomBlock

lucian929 commented 1 year ago

This is something that would be extremely useful for thousands of server owners who are using resource packs to expand upon the game. 👍

JustAHuman-xD commented 1 year ago

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.

JustAHuman-xD commented 1 year ago

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.

JustAHuman-xD commented 1 year ago

any news? @Intelli

evilsaloon commented 1 year ago

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.

JustAHuman-xD commented 1 year ago

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.

Slarof commented 10 months ago

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 :(

updatepls commented 9 months ago

@all when will the feature with custom blocks appear? I need this urgently.

JustAHuman-xD commented 9 months ago

@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.

J3fftw1 commented 7 months ago

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.

JustAHuman-xD commented 7 months ago

^?

J3fftw1 commented 4 months ago

Any update on this?