Commit Graph

52 Commits

Author SHA1 Message Date
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
Josh Roy
23f0f98af3
Cleanup code (#3067)
Co-Authored-By: md678685 <1917406+md678685@users.noreply.github.com>

Basically cleans up a bunch of warnings that are easily suppressed.
2020-04-25 13:08:57 +01:00
JRoy
ebf60c1e70
Implement better AfkStatusChangeEvent 2020-03-12 22:08:11 -04:00
Pokechu22
7a73301a37 Add permissions for individual colors (#1441)
* Add tests for existing format behavior

* Replace formatting implementation

* Add permissions for individual color codes

Resolves #415

* Use format code names

* Fix escaping

* Mockito: test scope only

* Explicitly check the .magic permission

Once I switch to checking if a perm's set in the loop, the explicit check is needed for an * perm.

* Add support for removing individual colors

* Use `obfuscated` as the name for §k

`magic` is still accepted as the group name, so this is not a breaking change.
2019-06-09 15:56:58 +01:00
AgentTroll
f68fb52af1 Add command to toggle reply player functionality 2019-03-09 15:39:45 -08:00
Trent Hensler
1a820ad9b7 Initial removal of item IDs.
We do not rely on Bukkit's item ids anymore, though we still support them in commands via a mapping built off of the items.csv.
2017-12-12 22:06:25 -08:00
Ali 'SupaHam' M
be076509f2
Implement clear confirmation (#1623)
Introduces:
- `clearinventoryconfirmtoggle` command with shorter aliases
- `confirmClear` boolean in UserData
2017-11-12 16:44:53 +00:00
Ali Moghnieh
5f83766dc1
Implement player based toggle for pay confirmation prompts. Fixes #1032
This commit adds a new `/payconfirmtoggle` command with `/payconfirmon` and `/payconfirmoff` as well.
2016-12-25 18:08:16 +00:00
Ali 'SupaHam' M
dadc6b2d3a Implement confirmation dialogue for /pay. (#1002) 2016-12-18 15:03:03 +00:00
Ali Moghnieh
ad94cca95b
Check for timeout in /tpa and /tpaccept. Fixes #818.
This commit adds a method called hasOutstandingTeleportRequest() in IUser - implemented fully in User.
2016-11-22 20:39:31 +00:00
Ali Moghnieh
2493c655f8
Create /paytoggle command. Resolves #413 2016-07-26 16:23:34 +01:00
Ali Moghnieh
a76b20f1b5
Display time since AFK in /whois. Resolves #761.
This commit adds a getAfkSince() method to IUser.

This commit adds a whoisAFKSince message which is sent when a player is AFK, it follows the same format as whoisAFK which is still used. whoisAFK remains unchanged but is sent only when the player is not AFK.
2016-07-26 01:36:29 +01:00
Ali Moghnieh
3a439bcdb5
Merge branch '2.x' into create-afk-message 2016-07-10 19:56:23 +01:00
Ali Moghnieh
09acbcdb05 Implement Command Cooldowns. Resolves #110 2016-06-30 12:52:28 -07:00
Ali Moghnieh
795ffec8b8 Remove trailing space. 2016-06-18 21:38:20 +01:00
Ali Moghnieh
5842b5f51d Implement AFK messages.
This commit makes it possible for players to set an afk message to detail their reasoning for being away to other players. This can be especially useful for the /msg command; instead of replying the user is afk, it will specify why they are afk so the sender can act further on that information.

Two methods have been added to IUser: getAfkMessage() and setAFKMessage(String).

All locale files have two new messages: userAFKWithReason and userIsAwayWithReason. They all use the messages that do not have the suffix WithReason, i.e. userAFK and userIsAway. Furthermore, the userIsAwayWithReason will not utilise the second parameter, the reason, to prevent spam and unnecessary text in global chat. However, the second parameter ({1}) is available for use in userIsAwayWithReason. userAFKWithReason, which is sent to /msg senders, does use the {1} as it controllable spam by the command sender themselves.

/afk usage is now: /afk [player/message...]
2016-06-18 17:44:17 +01:00
vemacs
c592a9d361 Add IgnoreMsg API 2015-07-28 19:45:33 -06:00
vemacs
73ac6488ce Run IntelliJ IDEA inspections 2015-06-03 14:11:56 -06:00
drtshock
dde0b20775 Reformat 2015-04-14 23:06:16 -05:00
KHobbits
10de6ac929 Cleanup 2014-04-06 15:44:37 +01:00
KHobbits
882ebae257 [Breaking] Add exception when players have exceeded their account limit.
This might effect some plugins which hook Essentials for economy without using the API
2014-02-02 16:07:32 +00:00
KHobbits
92a9673652 Restore original give/take Money API 2013-10-19 12:26:28 +01:00
KHobbits
6f85761f7f Extract CommandSender to CommandSource, this should prevent Ess user object leaks. 2013-10-16 21:05:33 +01:00
KHobbits
11f87eccb0 Tidy and slightly expand user API 2013-07-14 12:41:27 +01:00
Iaccidentally
cd51d718ba [API] flip! (╯°□°)╯︵ ┻━┻ 2013-07-13 13:40:46 -04:00
Iaccidentally
dad348d3d0 [API] Move 2.x API to new package, create dummy classes for compatibility 2013-07-13 11:14:39 -04:00
KHobbits
1abacf00df More cleanup 2013-07-07 13:02:40 +01:00
KHobbits
3d29248ace Misc cleanup 2013-07-07 12:38:01 +01:00
KHobbits
f48ed6988d Essentials API cleanup and teleport possession fixing. (UNSTABLE) 2013-06-08 19:34:14 +01:00
KHobbits
5d5fee4612 Attempt to fix /seen times on vanish. 2013-06-02 17:45:56 +01:00
KHobbits
2d70bb19f7 Economy Madness 2013-05-05 05:12:17 +01:00
kukelekuuk00
f16907412d Add a method to write to the userdata to UserData.java and IUser.java. 2013-02-13 08:24:25 -06:00
snowleo
3f31dc179b Fix /seen command 2013-02-08 22:26:21 +01:00
snowleo
5b975672e8 Don't overwrite last location on logout
Logout position is saved as logoutlocation now in users yml
2013-02-08 21:22:35 +01:00
Chris Ward
bb64fa468a Fixing IUser 2012-12-23 21:29:26 +11:00
Chris Ward
66db3c6cfb Adding isAfk and setAfk to IUser API 2012-12-23 21:25:29 +11:00
KHobbits
889f60e58e Userdata cleanup 2012-11-27 17:47:08 +00:00
KHobbits
8a9353fd09 Remove 3.x api migration code.
3.x development was moved to different code branch.
Removing deprecated warnings, since it would be silly to deprecate ALL classes.
2012-08-18 15:48:29 +01:00
md_5
9ca820d45e Small cleanup of things 2012-04-24 20:31:19 +10:00
KHobbits
a5b38ce1a4 Add Minimum Balance, to allow people to manage overdrafts. 2012-02-26 04:15:14 +00:00
snowleo
15ce04b539 Better exp fix and allow exp on buy and sell signs. 2011-12-13 08:38:15 +01:00
KHobbits
d3dd8208ef Fixing Sell/Buy Signs which use EXP as a currency. 2011-12-13 04:29:16 +00:00
snowleo
fdd8fffbb3 Support for experience as trading goods on signs. This will not work until experience is fixed in Bukkit. 2011-12-07 10:31:18 +01:00
snowleo
72e187cd5c Updated Jails to use the new config classes 2011-12-06 17:28:48 +01:00
snowleo
58237a796a New Interfaces in api package (WIP) 2011-12-06 16:32:06 +01:00
snowleo
fb211d722c Prevent that hidden players broadcast afk messages
Prevent that moving players triggers unafk too early, they can now move within a radius of 3 blocks from the position where they went afk.
2011-09-02 16:16:15 +02:00
KHobbits
3d913f9fcc Make home throw an exception if the world doesn't exist.
Add multiverse/missing world support to home upgrade.
2011-08-24 05:18:35 +01:00
KHobbits
6ee7017603 Adding Home upgrade script.
Tidying up home code.
2011-08-23 06:09:34 +01:00
KHobbits
0592c1fe11 Added multiple homes.
Permissions currently: essentials.sethome.multiple and essentials.sethome.multiple.unlimited
New config setting: multiple-homes (default value 5)
2011-08-23 03:42:32 +01:00
snowleo
88ded926f4 Corrected all commands of PermCommands
onCommand now supports the change of the permissions prefix
2011-06-26 15:47:28 +02:00