pmdevita / CreeperHeal2

Spigot plugin to automatically patch creeper holes and more
GNU Affero General Public License v3.0
6 stars 2 forks source link

Addition of material whitelist/blacklist #16

Closed TylerS1066 closed 1 year ago

TylerS1066 commented 1 year ago

Another incompatibility I found is that when using the Movecraft plugin, this plugin will detect explosions on moving crafts and regenerate those blocks after the craft has moved or sunk. The easiest method to resolve this is to add support for a whitelist/blacklist system such that server owners can add the materials on their crafts to the blacklist, or setup a whitelist.

While I was at it, I also implemented tag support when loading the materials so that things like "#logs" can be used.

TylerS1066 commented 1 year ago

As a note, I put this as a draft until #15 is merged, since I wasn't smart and both features are built on top of each other.

pmdevita commented 1 year ago

Yeah, this would probably be a useful feature for a few different cases so thanks for adding it. There's a couple thoughts I have about the implementation so I'll add some comments there.

If you'd like, we can add some integration between the plugins, that would make for a more polished result. We could get the hitbox of the explosion, check if any of the crafts are involved with that, and remove those blocks from CH's handling. If you want to do it on your side, I can add a custom event that CH fires before it starts explosion processing for you to edit it's block list. That should work as long as the event isn't deferred until after the explosion event completes. Alternatively, you could open public access to CraftManager and then CH could iterate through the crafts to check them.