Commit graph

39 commits

Author SHA1 Message Date
Josh Roy 9a23f806fe
Refactor Project to Gradle (#3720)
Gradle is better than Maven, don't @ me. okay but actually it's [faster](https://www.youtube.com/watch?v=atuFSv2bLa8&feature=youtu.be&t=77), compiles and tests in parallel more efficiently, and more epic stuff).
2020-11-25 20:24:24 +00:00
md678685 9b3c8a9df2 Reformat and fix Checkstyle violations 2020-10-04 19:59:42 +01:00
triagonal 73d2457fea
Fix regression with teleportation commands where command cost gets charged twice (#3601) 2020-08-16 14:40:58 -07:00
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
Drkmaster83 9dc58948b2 Implements PR#1516 - TPPos World-Teleport Permissions
https://github.com/EssentialsX/Essentials/issues/1516
Considerations:
• TPPos on a target doesn't consider the target's world access permissions, reminiscent of the TP A to B command.
2017-12-25 01:08:08 -06:00
Ali 'SupaHam' M bbe0ca9302 Implement tab completion for all commands. (#1282)
List of supported commands:
```
/afk
/balance
/balancetop
/ban
/banip
/bigtree
/book
/broadcastworld
/burn
/clearinventory
/condense
/delhome
/deljail
/delwarp
/eco
/enchant
/enderchest
/essentials
/exp
/ext
/feed
/fireball
/firework
/gamemode
/getpos
/give
/hat
/heal
/help
/helpop
/home
/ignore
/invsee
/item
/itemdb
/jump
/kick
/kill
/kit
/lightning
/list
/mail
/me
/msg
/mute
/near
/nick
/nuke
/pay
/potion
/powertool
/ptime
/pweather
/recipe
/remove
/repair
/sell
/showkit
/skull
/speed
/tempban
/thunder
/time
/togglejail
/tp
/tpa
/tpaall
/tpahere
/tpall
/tphere
/tpo
/tpohere
/tppos
/tree
/warp
/weather
/world
/worth```
2017-06-11 01:17:43 +01:00
Ali Moghnieh 0eb5063332 Duplicated code is so boring, ugh. Fixes #280. 2015-11-25 17:25:34 +00:00
Ali Moghnieh 7b60552ec1 /tppos shouldn't add 180 to yaw. Fixes #225 2015-10-31 20:47:04 +00:00
CoolV1994 06e24b3bc2 [Fix]: tppos for Console
Use the correct arguments when using from Console
2015-07-18 18:02:21 -04:00
CoolV1994 3283b8c0a3 [Feature]: Add world argument to /tppos 2015-07-16 19:09:19 -04:00
CoolV1994 f43501e828 [Fix]: Relative Coordinates
Fixes the error when trying to do something like:
/tp ~ ~10 ~
2015-07-16 18:36:10 -04:00
vemacs b6957db352 Apply patch "Fix float parsing issues" from Spigot-Essentials 2015-06-04 20:32:36 -06:00
drtshock dde0b20775 Reformat 2015-04-14 23:06:16 -05:00
FearFree 5724c0c8df Future Java versions may not support _ as identifier. 2014-03-22 16:08:11 +11:00
Luke Anderson (stuntguy3000) 077074c855 Add missing language pointers 2014-03-09 17:14:09 +00:00
KHobbits eee18f40be Pass optional location parameters to teleport TL keys. 2014-01-12 01:23:12 +00:00
KHobbits 6f85761f7f Extract CommandSender to CommandSource, this should prevent Ess user object leaks. 2013-10-16 21:05:33 +01:00
KHobbits 353423efec Use correct getPlayer method to not match offline users. 2013-03-20 01:29:54 +00:00
Necrodoom ea9bf854cc [Fix] offline player matching for online only commands.
/kick,/warp, /burn & /tppos should only match online players
2013-03-19 14:07:42 +00:00
GunfighterJ b83a8eccee [Fix] Persist yaw and pitch on teleport
Vanilla bukkit/MC persists yaw on teleport
2013-02-22 10:56:39 -06:00
KHobbits 5225fb22f8 Minor comment updates. 2013-02-03 04:14:23 +00:00
snowleo e706614a3b Align /tp syntax with Minecraft /tp command 2012-12-15 14:12:34 +01:00
Iaccidentally 5e476f4d61 Update Essentials/src/com/earth2me/essentials/commands/Commandtppos.java
2.9 too
2012-10-28 15:01:54 -03:00
Iaccidentally 6f213c23e2 update tppos to not accept coords over 30000000 2012-10-28 11:09:49 -04:00
KHobbits bf1e073ef4 Allow tppos to be used in console. 2012-04-02 02:47:44 +01:00
ementalo 10597cec2f Catch TeleportClause.COMMAND in the teleport listener.
Changed Teleport methods to pass a TeleportClause param
2011-12-07 01:12:36 +00:00
KHobbits ae4c10ced6 Fixing optional argument on tppos to use the correct yaw value. 2011-11-27 01:15:14 +00:00
snowleo 220d68f375 Switch to the new I18n class and format cleanup of all classes 2011-11-21 02:55:26 +01:00
KHobbits cd9ea163e4 Continuing code cleanup 2011-11-18 22:09:26 +00:00
KHobbits e5a8cd88f0 Code cleanup continued. 2011-11-18 17:48:49 +00:00
snowleo b2394048fa Allow yaw & pitch in /tppos 2011-09-18 03:34:05 +02:00
KHobbits afb951461c Adding throw to prevent double charge. 2011-08-30 03:42:31 +01:00
snowleo fd2d2456b9 Renamed the Charge class to Trade 2011-06-13 15:05:11 +02:00
snowleo 117d938ac5 Several bug fixes and cleanup.
Found using PMD and FindBugs.

git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1553 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-06-01 10:40:12 +00:00
snowleo 5ae48481bd Refactoring: New Charge class
user.canAfford(String), user.canAfford(EssentialsCommand), user.charge(String), user.charge(EssentialsCommand) have been removed.
Teleport class has been changed to use the Charge class.
This also fixes some bugs, like the one with warp signs.

git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1512 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-22 18:53:23 +00:00
snowleo 5eeb020f01 Finally all commands translated.
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1471 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-15 01:30:54 +00:00
snowleo 224c18348a This is a big refactoring of the user class and more.
Many commands have been cleaned.

File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.

Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax

New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added

Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
-  time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m

git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
snowleo 08041599ff Revert to 1013
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1021 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-03-30 12:56:34 +00:00
Zenexer cb21bc4d7a 2.1 prerelease, part 2 of 3
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk2.1@1015 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-03-30 04:03:21 +00:00