Closed christiaanbruijnes closed 7 years ago
This is a configuration option now: https://github.com/MinelinkNetwork/CombatTagPlus/blob/master/CombatTagPlus/src/main/java/net/minelink/ctplus/Settings.java#L418
Simply add untag-on-plugin-teleport: true
to your config.
They added that option because of my previous issue, however this didn't fixed it. That is why I openend this issue.
That config option doesn't work and that is the exact problem.
So, initially it was added and wasn't behind a config option. This broke my plugin teleports (World Border, etc. :D ) and created PVP exploits (easy way to untag self).
I mention just in case -- always worth doublechecking the config first as you might not have caught that it's now behind a config option instead of default on.
Back to the issue -- none of the plugins you use can teleport a player while in Combat? Is there a stack trace on your console or any other indication of failure? Or simply -- nothing -- no action, no error?
Does any plugin work at all, or is it only certain comands? Does vanilla work?
I tested this on an empty server with newest Spigot and CTP.
I tried to teleport the player away in combat with Essentials and with Skript, but simply nothing. No action, no error!
Everything works and everything is good expect that I can't teleport a player away while in combat which is needed for some cases (example, in a duel.. I want to teleport them to spawn).
Does it work with vanilla commands?
Which vanilla command?
Try any
I tried /minecraft:tp
So only the vanilla commands work, but not plugin ones? Could you please gist your config file?
Correct.
https://gist.github.com/chrisbruijnes/187d23da6c7fe86ac4bf93d7a2bbc4cf
I already tried the untag-on-plugin-teleport
option.
I have found the issue on file listener > PlayerListener on line 286.
https://gyazo.com/3c74b56294b24ca26f6753387fc652e2
The CASE: PLUGIN is empty and should be filled with the same code below.
However, that won't fix the MAIN issue though, the server itself should be able to teleport players away while in combat.
@SpiroMarshes CASE are fall-through -- since there is no break;
on the PLUGIN case, it also executes the same code as in UNKNOWN. Your patch is unnecessary as it doesn't change anything, the code is already getting run.
@chrisbruijnes This is the code I pointed you to several months back, as it's tied to the untag-on-plugin-teleport option.
If different behavior is needed between UNKNOWN and PLUGIN, then perhaps another configuration option needs adding. I'm still not clear why the existing code doesn't behave the way you're wanting.
That config option doesn't work, it is simple: You can't teleport people away while they are in combat. This is a really urgent requirement for most servers.
I've tried everything you told me to do, nothing works. Please find a proper solution for this.
@ProgrammerDan @chrisbruijnes brought up a good point by bringing up the "Case" issue but touched on the wrong part of it, he's using essentials to run the teleport however when essentials teleports the player it runs them with the enum cause "Command" which was not added so you should add in the "Command" as another fallthrough cause along with "Plugin" https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/player/PlayerTeleportEvent.TeleportCause.html#COMMAND
I've tested the response from running the tp command with Essentials and it responded with "COMMAND", which is how I know how to fix this, just by the way.
It's a super simple 1 line fix, I have no idea how to commit to fixes but here's the code which would fix it: http://hastebin.com/ozegexinow.java
Awesome! @ProgrammerDan Can you add "case COMMAND:" into the newest version and push it to the newest dev build?
Someone else will probably beat me to it, but sure, that's something easily contributed in a PR -- thanks @ExoticCoding for pointing out the issue, wasn't aware a CASE was missing, good catch; it'd be bound by default
behavior.
Will this be added/fixed in a new dev build? If so, when?
Waiting for this for months now :D
@ProgrammerDan I'm not really sure how to make PRs, I also don't think I can due to my internet limitations but if I could do it, I would.
@chrisbruijnes http://ci.minelink.net/job/CombatTagPlus/ -- Build is live!
The bug hasn't been fixed, however we are getting closer!
What I am trying to do is: /spawn
If the config value "untag-on-plugin-teleport" just untags the player first before teleporting, it will be fixed I guess.
Maybe because of the "setCancelled(true)": https://gyazo.com/8830408501f5e6d8e3ac486490e00323
If the config value "untag-on-plugin-teleport" just untags the player first before teleporting, it will be fixed I guess.
Indeed that is what it does. Assuming untag-on-plugin-teleport is set to true, the setCancelled(true)
you point to will not execute, when using /spawn or other essentials teleport commands.
How come that it doesn't work then?
Oh by the way, is another restart needed for that config value to take affect? Because I used /ctreload for that one.
It sounds like something else is reversing the teleport -- not cancelling it. A cancelled teleport never happens, whereas what you are describing is a reversal -- you arrive, only to be sent back -- and that implies some other plugin at work.
/ctreload
I am not certain, if doubt remains concerning its activation, restart to be sure.
Okay, I did some research and tested some couple things and came to the following conclusion:
I deleted all of my plugins except Worldguard and the bug was still here, removing WorldGuard did fix the bug. The cause of the bug is the flag "pvp: deny", that stops you from teleporting because there is a PvP zone there.
Hope this makes things more clear and it can be fixed.
(The restarting didn't fixed it by the way).
Based on your investigation, I think we've "fixed" the issue as much as possible within CTP; if worldguard is preventing behavior that CTP now supports, you will probably need to open a companion issue with WorldGuard to see if they can help you out.
Isn't there a way to just force the teleport? There must be a solid way of fixing this issue, since a lot of people will be teleporting a player away into a No-PvP zone.
Let's be honest, Worldguard is not going to spend their time to fix small issues like this, when this is a major problem for CTP.
Aren't there other way-arounds to fix this issue?
Well, regardless, we are at a limit of my knowledge. I am entirely unfamiliar with WorldGuard -- perhaps someone else knows it better and could propose a solution.
Good luck :)
To anyone with actual familiarity with WorldGuard, perhaps the hook needs updating: https://github.com/MinelinkNetwork/CombatTagPlus/tree/master/CombatTagPlusWG-v6
Is there anyone who might have a proper solution? I am waiting for this for months now.
The issue right now: I can't teleport players away in combat to a Non-PvP zone.
Re-opn this please @Techcable
Will this be ever fixed?
UPDATE:
I've finally found a way to fix this by enabling disable-teleportation
, and it works now!
However, because of this we have another issue that people get untagged because of plugins teleporting them (https://github.com/MinelinkNetwork/CombatTagPlus/commit/b7ceaf9579a4a4f8ea90489418fadda27297133a)
Can you only add the case for Essentials and remove the others? A proper and solid way of fixing this issue is by adding an untag or teleport command.
@Techcable @ProgrammerDan @ExoticCoding
@chrisbruijnes Thank you so much for that :p
But why does it block teleportation when it's disabled? That's the real issue.
Using the function to untag on teleport is not smart to use right now, there are appearing many new bugs.. I just prefer a new command to untag or teleport to solve all issues. How hard could it be?
Any update on this??
Still nothing, I guess the smartest solution to this is an untag command: /untag
@Techcable @Byteflux @ProgrammerDan @ExoticCoding
Why does the plugin stop teleporting, even with the option disabled in the config anyways?
It doesn't. I personally use it on 2 different servers with the option disabled.
Whenever you teleport someone to a non-pvp zone, it won't work.
(if you have teleportion disabled and the untag value).
That's why a /untag command will be a fix to all issues.
@ProgrammerDan @Techcable @Byteflux @ExoticCoding
Can you commit the following code? It is an untag command, can you also register it in the config.yml file?
@Techcable Thanks a ton, maybe add a second delay after this, so they can't get tagged after the command got executed for 1 second?
This because of I will first untag them with a command and then teleport them away, but what if someone hits them on the exact same time?
I tried to commit a fix, however I do not have enough permissions.
All what is needed is the following: https://gyazo.com/bb7a625d5e9f5bf829a04a2ef31fcf98
Can one of you PLEASE commit that? @ProgrammerDan @Byteflux @Techcable
@chrisbruijnes just fork the repo and do it yourself
Okay, I've made the fix: https://github.com/MinelinkNetwork/CombatTagPlus/pull/100
This will fix bug #99 and the bugs from above, maybe a second delay should be added aswell (see 2 comments above).
@Byteflux @Techcable
The operator requested to reopen an issue if the previous issue hasn't been fixed which is the case now.
I am using the latest dev build and the issue is the following:
While a player is in combat you can't teleport them away with any plugin (Skript, Essentials etc..).