TF-EssentialsX/Essentials/src/com/earth2me/essentials
Josh Roy d9bf099c3d
Reduce sync loads for teleporting (#3102)
This PR reduces the number of sync loads occurring on any teleport caused by essentials.

Fixes #2861
Fixes #2287
Fixes #3274
Fixes #3201
Fixes #2120

Before this PR, essentials would get a block multiple times causing sync loads to check if it was safe to teleport to. Now, the target block's chunk if fetched async with PaperLib and passed along to `LocationUtil#isBlockUnsafeForUser` (which internally calls other LocationUtil methods what that chunk object) resulting in the chunk only loading once, off the main thread. The only operations remaining on the main thread is `LocationUtil#getSafeDestination`. This is due to the method's recursion which would be a pain to move async. **However:** since the chunk was already loaded async, `LocationUtil#getSafeDestination` most of the time won't cause sync chunk loads. The only time it would cause sync chunk loads is with an unsafe location near a chunk border.

-----------------------------------------

* Reduce sync teleporting loads

* Avoid argument re-assigning

* Remove async teleports when unnecessary

* Make exceptions cleaner

* Async all the things

Made an async version of every method with fallbacks for deprecated methods.

* Remove old now fallback method

* Migrate everything to the new async teleport API

* Update ITeleport javadocs

* Fix invoking via async context

* Fix /jail using deprecated method

* Fix jail join handler using deprecated method

* Rename all teleport classes to indicate async

* Remove deprecated methods

* Add (and deprecate) old teleport api

* Revert TimedTeleport.java

* Reduce Diff

* Add legacy sendToJail method

* Reduce Diff Further

* Use getNewExceptionFuture in Commandtpo

* Use getNewExceptionFuture everywhere

* Fix even more usages

* Revert LocationUtil.java

* Fix issue causing unsafe locations to not work properly

* Add deprecated notice in IUser implementation

* Use CompletableFuture#completeExceptionally for exceptions

* Use Essentials' logger in EssentialsCommand#showError

* Return implementation rather than interface

* Avoid possible deadlocks with entity ejections

* Nuke some sync loads with homes

Took 7 hours and 2 PRs to paper but it's here!

* Fix ABI and make the codestyle worse

* Make the codestyle worse because muh diff

* Further ruin the codestyle

* Fix error messages not showing in TimedTeleports

* Improve messages around beds for /home

* Fix #3274

Allow unsafe locations for different worlds + spectator mode

* Fix fly safety operators
2020-06-24 09:52:25 +01:00
..
api Reduce sync loads for teleporting (#3102) 2020-06-24 09:52:25 +01:00
commands Reduce sync loads for teleporting (#3102) 2020-06-24 09:52:25 +01:00
craftbukkit Fix isStopping MethodHandle invocation on Spigot (#3267) 2020-05-12 20:14:01 +01:00
items Add serialize method to ItemResolvers for custom serialization (#3307) 2020-06-15 13:46:44 +01:00
messaging implement PrivateMessagePreSendEvent (#3260) 2020-05-13 08:03:28 +01:00
metrics Fix Metrics plugin name reporting 2019-05-13 19:15:33 +01:00
perm Add support for permission contexts (#3320) 2020-06-03 21:36:27 +01:00
register/payment Cleanup code (#3067) 2020-04-25 13:08:57 +01:00
settings Remove unnecessary types 2019-03-08 11:24:42 +00:00
signs Reduce sync loads for teleporting (#3102) 2020-06-24 09:52:25 +01:00
storage Cleanup code (#3067) 2020-04-25 13:08:57 +01:00
textreader Cleanup code (#3067) 2020-04-25 13:08:57 +01:00
utils Reduce sync loads for teleporting (#3102) 2020-06-24 09:52:25 +01:00
AlternativeCommandsHandler.java Cleanup code (#3067) 2020-04-25 13:08:57 +01:00
AsyncTeleport.java Reduce sync loads for teleporting (#3102) 2020-06-24 09:52:25 +01:00
AsyncTimedTeleport.java Reduce sync loads for teleporting (#3102) 2020-06-24 09:52:25 +01:00
Backup.java Fix age old bug with active status in Backup manager (#3262) 2020-05-11 18:09:29 -07:00
ChargeException.java Reformat 2015-04-14 23:06:16 -05:00
CommandSource.java Rewrote messaging structure for more abstractness. 2015-10-27 20:46:58 -06:00
Console.java Add isReachable API to IMessageRecipient. 2015-10-30 19:58:30 +00:00
Enchantments.java Cleanup code (#3067) 2020-04-25 13:08:57 +01:00
Essentials.java Add support for translating command description and usage (#3284) 2020-06-16 13:39:48 -07:00
EssentialsBlockListener.java Cleanup code (#3067) 2020-04-25 13:08:57 +01:00
EssentialsConf.java Cleanup code (#3067) 2020-04-25 13:08:57 +01:00
EssentialsEntityListener.java Add option to remove vanishing items from keepinv users (#3328) 2020-06-15 16:22:00 -07:00
EssentialsPlayerListener.java Add permission for storing user's last location on teleportation (#3272) 2020-05-13 15:53:36 -07:00
EssentialsPluginListener.java Add support for permission contexts (#3320) 2020-06-03 21:36:27 +01:00
EssentialsServerListener.java Ignore CloudNet v3 SLPE (#3288) 2020-05-17 15:35:31 +01:00
EssentialsTimer.java Nullcheck user iteration in EssentialsTimer (fixes #675) 2016-06-25 09:47:06 -06:00
EssentialsUpgrade.java Cleanup after UUID Ignore List PR (#3227) 2020-05-04 14:32:49 +01:00
EssentialsUserConf.java Reformat 2015-04-14 23:06:16 -05:00
ExecuteTimer.java Cleanup code (#3067) 2020-04-25 13:08:57 +01:00
I18n.java Add UTF8 support for .properties files (#3358) 2020-06-07 12:06:33 +01:00
IConf.java Run IntelliJ IDEA inspections 2015-06-03 14:11:56 -06:00
IEssentials.java Allow toggling public broadcast of AFK messages (#2780) 2020-04-13 14:33:37 +01:00
IEssentialsModule.java Reformat 2015-04-14 23:06:16 -05:00
ISettings.java Add option to remove vanishing items from keepinv users (#3328) 2020-06-15 16:22:00 -07:00
ITarget.java Run IntelliJ IDEA inspections 2015-06-03 14:11:56 -06:00
IUser.java Reduce sync loads for teleporting (#3102) 2020-06-24 09:52:25 +01:00
Jails.java Reduce sync loads for teleporting (#3102) 2020-06-24 09:52:25 +01:00
Kit.java Fix invalid charge error when using suffix currency on signs (#3253) 2020-05-11 15:20:00 +01:00
Kits.java Cleanup code (#3067) 2020-04-25 13:08:57 +01:00
LocationTarget.java Reformat 2015-04-14 23:06:16 -05:00
ManagedFile.java Cleanup code (#3067) 2020-04-25 13:08:57 +01:00
MetaItemStack.java Cleanup code (#3067) 2020-04-25 13:08:57 +01:00
Mob.java Update to 1.15 (#2873) 2019-12-11 07:47:56 +00:00
MobCompat.java Cleanup code (#3067) 2020-04-25 13:08:57 +01:00
MobData.java Cleanup code (#3067) 2020-04-25 13:08:57 +01:00
OfflinePlayer.java Cleanup code (#3067) 2020-04-25 13:08:57 +01:00
PlayerExtension.java Reformat 2015-04-14 23:06:16 -05:00
PlayerList.java Cleanup code (#3067) 2020-04-25 13:08:57 +01:00
PlayerTarget.java Reformat 2015-04-14 23:06:16 -05:00
Potions.java Compile against 1.13 preview. 2018-01-18 17:52:44 -08:00
Settings.java Add option to remove vanishing items from keepinv users (#3328) 2020-06-15 16:22:00 -07:00
SpawnMob.java Cleanup code (#3067) 2020-04-25 13:08:57 +01:00
Teleport.java Reduce sync loads for teleporting (#3102) 2020-06-24 09:52:25 +01:00
TimedTeleport.java Reduce sync loads for teleporting (#3102) 2020-06-24 09:52:25 +01:00
TNTExplodeListener.java Reformat 2015-04-14 23:06:16 -05:00
Trade.java Reduce sync loads for teleporting (#3102) 2020-06-24 09:52:25 +01:00
User.java Reduce sync loads for teleporting (#3102) 2020-06-24 09:52:25 +01:00
UserData.java Convert ignore list storage to UUID-based (#3209) 2020-05-04 11:06:09 +01:00
UserMap.java Cleanup code (#3067) 2020-04-25 13:08:57 +01:00
UUIDMap.java Cleanup code (#3067) 2020-04-25 13:08:57 +01:00
Warps.java Cleanup code (#3067) 2020-04-25 13:08:57 +01:00
Worth.java Fix Worth.setPrice on 1.13+; add Javadocs to Worth 2018-12-08 16:32:09 +00:00