Comments (5)
Instead of a new event, why not just add the deleter to it so that the message can be sent?
from towny.
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.
Having a deletion cause exposed would help with that
from towny.
I agree, that would be great
from towny.
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)
- Event War: World War Conquered Towns Being Left Behind HOT 1
- Suggestion: [Event War] Block Town/Nation Deletion
- Suggestion: Bonus outposts for nation capitals
- TOwny can outsiderr attack the towny and break HOT 13
- Suggestion: Set outpost names HOT 6
- Dynmap: outpost markers overlay their towns' HOT 1
- Towny fails to update to version `0.100.2.0` or higher. HOT 4
- Suggestion: add a NationPreInviteTownEvent
- Suggestion: option to enable build until next battle session HOT 2
- Outdated deixis in config comment HOT 1
- Suggestion: alphabetize `plotManagementIgnoreIds` and `PlotManagementWildRegenBlocks` HOT 2
- Dynmap-Towny: Regressions in plot type rendering
- Suggestion: avoid suffocation at homeblocks HOT 2
- Suggestion: King of the Hill alternate to Capture Sites
- Integrate TownyProvinces with TownyCamps HOT 1
- Restarted during World War HOT 2
- World War Conquered Towns Not Transfering HOT 3
- LoadedMetadataEvent does not fire off on Folia
- Suggestion: Cancellable event thrown when a plot is added to a plot group
- Suggestion: Create new District TownyObject. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from towny.