TF-EssentialsX/Essentials/src/com/earth2me/essentials/signs
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
..
EssentialsSign.java Fix invalid charge error when using suffix currency on signs (#3253) 2020-05-11 15:20:00 +01:00
SignBalance.java Reformat 2015-04-14 23:06:16 -05:00
SignBlockListener.java Cleanup code (#3067) 2020-04-25 13:08:57 +01:00
SignBuy.java Cleanup code (#3067) 2020-04-25 13:08:57 +01:00
SignDisposal.java Add option to change disposal title via sign (#3269) 2020-06-05 16:16:47 +01:00
SignEnchant.java Add default enchantment level for enchant sign (#3070) 2020-05-04 11:10:16 +01:00
SignEntityListener.java Cleanup code (#3067) 2020-04-25 13:08:57 +01:00
SignException.java Reformat 2015-04-14 23:06:16 -05:00
SignFree.java Reformat 2015-04-14 23:06:16 -05:00
SignGameMode.java Add the ability to make spectator gamemode signs (#2386) @darbyjack 2019-01-20 10:14:20 +00:00
SignHeal.java Reformat 2015-04-14 23:06:16 -05:00
SignInfo.java Reformat 2015-04-14 23:06:16 -05:00
SignKit.java Move kits to kits.yml (#1774) 2018-01-18 00:25:00 -08:00
SignMail.java Reformat 2015-04-14 23:06:16 -05:00
SignPlayerListener.java Cleanup code (#3067) 2020-04-25 13:08:57 +01:00
SignProtection.java Cleanup code (#3067) 2020-04-25 13:08:57 +01:00
SignRepair.java Reformat 2015-04-14 23:06:16 -05:00
Signs.java Run IntelliJ IDEA inspections 2015-06-03 14:11:56 -06:00
SignSell.java Cleanup code (#3067) 2020-04-25 13:08:57 +01:00
SignSpawnmob.java Reformat 2015-04-14 23:06:16 -05:00
SignTime.java Reformat 2015-04-14 23:06:16 -05:00
SignTrade.java Fix invalid charge error when using suffix currency on signs (#3253) 2020-05-11 15:20:00 +01:00
SignWarp.java Reduce sync loads for teleporting (#3102) 2020-06-24 09:52:25 +01:00
SignWeather.java Reformat 2015-04-14 23:06:16 -05:00