GithubHelp home page GithubHelp logo

Comments (5)

Warriorrrr avatar Warriorrrr commented on August 16, 2024

Instead of a new event, why not just add the deleter to it so that the message can be sent?

from towny.

galacticwarrior9 avatar galacticwarrior9 commented on August 16, 2024

Sure, that would help. However, there is still the problem of the existing events being called by Towny when it deletes a town/nation internally. I would prefer not to interfere with these deletions as it isn't necessary for my use-case and can lead to odd issues.

from towny.

Warriorrrr avatar Warriorrrr commented on August 16, 2024

Having a deletion cause exposed would help with that

from towny.

galacticwarrior9 avatar galacticwarrior9 commented on August 16, 2024

I agree, that would be great

from towny.

LlmDl avatar LlmDl commented on August 16, 2024

I'm kinda thinking this one is going to have a fairly big refactor behind it. The issue I ran into before was that the removeTown and removeNation methods don't return anything for the other methods to work off of.

We could change those (and other things) over to booleans so some of the methods could deal with failures.

The other thing that's a bit of an issue is that towny can send a town/nation to be deleted for very good reasons (like having no residents or no towns,) and another plugin can currently stop that object being deleted.

We could also create removeTown(Town, new DeleteCause(Player, DeleteReason.TOWN_DELETE_COMMAND) and simply pass in a new DeleteCause object. DeleteCause would need to support a Player being nullable, and probably have a enum of actual reasons backing it. Then removeTown(Town, Boolean, DeleteCause) could send back an error message when the event is cancelled when DeleteCause.getPlayer() isn't null. It could also skip throwing the event entirely when the DeleteCause.getDeleteReason() is something critical where the TownyObject really shouldn't exist.

from towny.

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.