Giter Club home page Giter Club logo

Comments (6)

Amperial avatar Amperial commented on August 12, 2024

@EnderEli 👍

from spongeapi.

asofold avatar asofold commented on August 12, 2024

The given approach in this ticket would equal adding more levels of Order (and organizing them slightly differently)?
....
A slightly different approach has been discussed by some pe ople on the first commit:
5a96c64#commitcomment-7695983

It boiled down to have the Order more or less as is and add a way to relate to other listeners for the level of Order you registered for. Specifically a listener (method) has three additional properties for the event handler annotation:

  1. tags which describe the listener (e.g. net.abc.PluginXY, net.abc.PluginXY.Feature123, WORLD_PROTECTION)
      1. "before" and "after", which both describe a set of regex or just tags to be registered before or after, also allowing to register before or after all others (e.g. before = {"*"}.

This way you can relate to other plugin on the same level of Order. This approach focuses on the aspect of cross-plugin compatibility, usually knowing the plugins you relate to, though establishing generic tags (like WORLD_PROTECTION, SECURITY) could help for some cases too.

Not sure this should be discussed here, though.

from spongeapi.

spaceemotion avatar spaceemotion commented on August 12, 2024

@EnderEli 👍 I really do like that idea, but I am not sure if others do ;)

from spongeapi.

 avatar commented on August 12, 2024

@asofold But I think it is the easiest general system. I will link it to the commit so everyone can says what he thinks.

I can create a global API commit so we can look at it.

from spongeapi.

asofold avatar asofold commented on August 12, 2024

@EnderEli Actually i don't know if the Sponge team wants to have stuff discussed independently, in that case i would have to start a competing ticket :p. I think it needs be considered to weigh out these approaches, not because the do the same thing, but because they are slightly opposing in nature, not impossible to both exist alongside, but it would then mean using 3 things of order/priority, which seems... a lot.

So if i understand this right, your approach simplifies the top level, while increasing the total number of levels, roughly staying equivalent to the original commit (splitting levels by a finite number is the same as adding more levels, except for the usability/appearance). On a side note, you will certainly need the sub-priorities on pre/post levels, they still are crucial to some cross-plugin compatibility scenarios.

It's hard to tell ad hoc, what the typical situation will be with many plugins registred, but this could also do the trick for most things, though it changes the easy to overlook Order vs. a two-layered system that does not allow relating to specific other plugins, for the case of cross-plugin compatibility being the objective.

from spongeapi.

 avatar commented on August 12, 2024

@asofold

Yes and no. The basic idea, going to the roots, is splitting the listener orders in two parts. The access level, so read only, cancelable, read only end....
And then the priority, where we can use a basic system OR dependencies like "after WorldGuard"...

So the developer can set the acces level and then a priority or an order related to 3rd party plugins...

from spongeapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.