teozfrank / DuelMe

DuelMe is a bukkit plugin to allow players to duel each other for fun
http://dev.bukkit.org/bukkit-plugins/duelme/
MIT License
9 stars 14 forks source link

CraftBukkit support #80

Closed DarkShimy00 closed 7 years ago

DarkShimy00 commented 7 years ago

Disclaimer: since I haven't followed the recent changes made to this plugin I may be totally wrong. Please correct me if that's the case.

Would it be feasible to support CraftBukkit and not only Spigot? The only thing I found that needs to be modified is the respawn method.

I don't know if you remember but I made some changes to the death system which had to be reverted because players died in one hit. Actually it could have been fixed by using getFinalDamage() (Gets the amount of damage caused by the event after all damage reduction is applied.) instead of getDamage() (Gets the raw amount of damage caused by the event).

If we bring back this system we should be able to drop the respawn method requirement.

teozfrank commented 7 years ago

Feel free to fork the repo and do that, the plugin works fine with spigot, I am not reverting back, sorry.

DarkShimy00 commented 7 years ago

I was just letting you know that it would be apparently easy to provide support for CraftBukkit and to potentially fix bugs caused by the plugin.

Letting the player die has some side effects with a lot of plugins, that was the reason I made the first PR. For example: a plugin that puts a grave where a player died will not work properly.

teozfrank commented 7 years ago

Letting the player die has some side effects with a lot of plugins, that was the reason I made the first PR. For example: a plugin that puts a grave where a player died will not work properly.

How does it not work properly?

Sorry but I wont be reverting back to craftbukkit support alone. As I said the code is there to create your own version if you so wish.

DarkShimy00 commented 7 years ago

Okay, let me explain it in a more detailed way.

Say we have a plugin that listens to the PlayerDeathEvent and place a grave where the player dies.

  1. the player dies;
  2. DuelMe forces the player to respawn using a listener and player.spigot().respawn();
  3. the event is still fired (not cancellable);
  4. the other plugin places a grave right inside the arena and this is not wanted as the player never really died.

There is plenty more situations like that,

Using a PlayerDeathEvent is not intended and is much more complicated. Of course every other plugin could check if the player is inside an arena but this is not a good solution.

Conclusion: the actual system is too complicated (clunky ?) and causes weird interactions/bugs with some specific plugins.

Actually, I wasn't planning to reimplement part of my changes but I was ultimately forced to for my server because we were randomly loosing items after duels (the result of a weird interaction between DuelMe and GameModeInventories apparently).

teozfrank commented 7 years ago

the other plugin places a grave right inside the arena and this is not wanted as the player never really died.

Then disable the grave plugin in the world where the arenas are..

teozfrank commented 7 years ago

Actually, I wasn't planning to reimplement part of my changes but I was ultimately forced to for my server because we were randomly loosing items after duels (the result of a weird interaction between DuelMe and GameModeInventories apparently).

Do you have a tested version with the changes for final damage that does not require a force respawn? If so I would gladly merge it to future versions of duelme.

DarkShimy00 commented 7 years ago

I have one but it needs some cleanup before merging. I'll make a PR when it's ready to be merged.

teozfrank commented 7 years ago

Any update on this?

teozfrank commented 7 years ago

Closed as no reply made, please reopen if there is an update.