Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue running mvtp on Player_Leave #54

Closed
bc-hill opened this issue Feb 18, 2018 · 6 comments

Comments

@bc-hill
Copy link

commented Feb 18, 2018

I need players to teleport to another world after they leave the arena, ideally after their inventories are restored.
Other arena plugins have an exit point, where the player warps to after the game is completely over. Even if the other plugin cannot support mvtp, I can set the exit point to be right above a pressure plate, which then triggers mvtp. This works surprisingly well.

Anyway, in the arena file I set this:

Player_Leave:
Player: []
Console:
- "/mvtp {player} e:ServerSpawn:-1538,108,707:0:0"

But then I am returned to the arena world immediately, and console says:

[18:02:41] [Server thread/INFO]: player_name issued server command: /ma leave
[18:02:41] [Server thread/INFO]: Arena // CoreArena 1.5.3 encountered a IllegalArgumentException! Please check your error.log and report this issue with the information in that file.
[18:02:41] [Server thread/INFO]: java.lang.IllegalArgumentException: Cannot measure distance between ServerSpawn and corearena_small-rustic-pvp
[18:02:41] [Server thread/INFO]: at org.bukkit.Location.distanceSquared(Location.java:460)
[18:02:41] [Server thread/INFO]: at org.bukkit.Location.distance(Location.java:443)
[18:02:41] [Server thread/INFO]: at me.kangarko.corearena.nul. .cOm3.nul(SourceFile:597)
[18:02:41] [Server thread/INFO]: at me.kangarko.corearena.nul. .cOm3.nul(SourceFile:532)
[18:02:41] [Server thread/INFO]: at me.kangarko.corearena.nul. .cOm3.kickPlayer(SourceFile:490)
[18:02:41] [Server thread/INFO]: at me.kangarko.corearena.nul. .CoM3.handleSubCommand(SourceFile:26)
[18:02:41] [Server thread/INFO]: at me.kangarko.corearena.kautils.command.Lpt5.handleCommand(SourceFile:182)
[18:02:41] [Server thread/INFO]: at me.kangarko.corearena.kautils.command.BaseCommand.onCommand(SourceFile:53)
[18:02:41] [Server thread/INFO]: at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)
[18:02:41] [Server thread/INFO]: at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141)
[18:02:41] [Server thread/INFO]: Arena // -----------------------------------------------
[18:02:41] [Server thread/INFO]: Arena // Error while removing player player_name from small-rustic-pvp
[18:02:41] [Server thread/INFO]: Arena // Moving him to spawn.
[18:02:41] [Server thread/INFO]: Arena // IllegalArgumentException: Cannot measure distance between ServerSpawn and corearena_small-rustic-pvp
[18:02:41] [Server thread/INFO]: Arena // -----------------------------------------------
[18:02:41] [Server thread/INFO]: Arena // GG! The game in small-rustic-pvp has finished!

Edit: The issue appears to be that Player_Leave triggers before CoreArena is completely finished ending the game.
Maybe you could just add commands that run after the plugin finishes?

@bc-hill

This comment has been minimized.

Copy link
Author

commented Feb 18, 2018

------------------------------------[ 17.02.2018 18:44:52 ]-----------------------------------
CoreArena 1.5.3 encountered a IllegalArgumentException
Running CraftBukkit 1.12.2-R0.1-SNAPSHOT and Java 1.8.0_144
Plugins: CoreProtect v2.14.2, LuckPerms v4.0.80, WorldEdit v6.1.8-SNAPSHOT;cd4729f, CityWorld v3.02, PlaceholderAPI v2.8.2, Vehicles v9.2.1, Craftconomy3 v3.3.1-d99cf63-trv200, Boss v1.5.10, WorldBorder v1.8.7, DecoHeads v1.4, RelaJumpPads v1.0, WorldGuard v6.2.1;84bc322, The Multiverse-Core Plugin, AdvancedPortals v0.0.38, GameAPI v1.1.1, VoidGenerator v1.2.0, CraftDisplay v5.0.2, SimpleAPI v3.8, Vault v1.5.6-b49, statuecreator v1.5, Sit v1.0, Essentials v2.0.1-b594, ArmorStandTools v2.4.3, ChatControl v7.6.34, PerWorldInventory v1.11.5, HolographicDisplays v2.2.6, LWC v1.9.4, CommandSigns v1.6.4, SimplePets v3.9, Citizens v2.0.22-SNAPSHOT (build 1497), BlockBall v4.1.1, MythicMobs v4.3.2-SNAPSHOT, HeavySpleef v2.4.1-b341, MCPainter v2.0.0-dev, WanderingNPC v1.7, CraftBook v3.9-SNAPSHOT-jenkins-CraftBook-203, CoreArena v1.5.3, Sentinel v1.4.5 (build 157)


More Information:
Error while removing player player_name from small-rustic-pvp
Moving him to spawn.
%error
IllegalArgumentException Cannot measure distance between ServerSpawn and corearena_small-rustic-pvp
at org.bukkit.Location.distanceSquared(Location.java:460)
at org.bukkit.Location.distance(Location.java:443)
at me.kangarko.corearena.nul. .cOm3.nul(SourceFile:597)
at me.kangarko.corearena.nul. .cOm3.nul(SourceFile:532)
at me.kangarko.corearena.nul. .cOm3.kickPlayer(SourceFile:490)
at me.kangarko.corearena.nul. .CoM3.handleSubCommand(SourceFile:26)
at me.kangarko.corearena.kautils.command.Lpt5.handleCommand(SourceFile:182)
at me.kangarko.corearena.kautils.command.BaseCommand.onCommand(SourceFile:53)
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141)
at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchCommand(CraftServer.java:648)


@kangarko

This comment has been minimized.

Copy link
Owner

commented Feb 22, 2018

ArenaTeleport.zip

Hey, I am sorry this turned out to be real pain to fix, so I made a small plugin for that (feel free to decompile). You configure that location in that plugin's config.yml.

I am leaving this open for a fix inside CA.

@bc-hill

This comment has been minimized.

Copy link
Author

commented Feb 22, 2018

Hey, this is a pretty full-featured temp fix plugin!
Seems to work well, using my mvtp command. So far, no conflicts with PerWorldInventories, like I was worried about.
What impact does the delay-ticks setting have? Is the plugin triggered by corearena on player_leave, and the delay is to let corearena finish up?
Thank you!

@kangarko

This comment has been minimized.

Copy link
Owner

commented Feb 25, 2018

It's actually really small 49 lined plugin (see below). Yes, the delay only postpones the commands that are run after a player left an arena (see line 46).
a

The ArenaLeaveEvent is called at the very last when a player leaves.
b

That leave method is again called at the very last when an arena stops. We also include security kick-out in case of a failure. I don't understand how CA won't finish clean-up since those methods are at the bottom but at present I am working on a more important project.
c

@kangarko

This comment has been minimized.

Copy link
Owner

commented Mar 5, 2018

I referenced this issue to Wiki and added ArenaTeleport as the official workaround. This turned to be a really hard to fix and that plugin handles it extremely cleanly and well so it will stay that way for the time being.

@kangarko kangarko closed this Mar 5, 2018
@kangarko

This comment has been minimized.

Copy link
Owner

commented Jun 3, 2019

Here's a new version of ArenaTeleport made for the recent recode.

ArenaTeleport.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.