Commit graph

65 commits

Author SHA1 Message Date
Josh Roy
8f86849aec
Fix 65f8883 breaking offline home listing (#3446) 2020-07-02 18:59:40 -07:00
Josh Roy
65f88834ba
Fix further AME(s) in /home (#3444) 2020-07-02 22:58:40 +01:00
Josh Roy
b7f38517ef
Fix some reported bugs regarding teleportation. (#3433)
Fixes #3420
Fixes #3430
2020-06-30 17:00:20 +01: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
pop4959
d5ffed09b4
Fix home tab completions (#3206)
Fixes #1337 😎 

This PR fixes tab completions for all of the home commands in Essentials. Prior to this PR, the behavior is approximately as follows:

- `/sethome` has no implementation for completions, and so it provides player names, which isn't very useful, and in my opinion can cause more harm than good by confusing users.
- `/home` and `/delhome` fail to provide valid completions when a user has the `essentials.home.others` permission. The argument syntax is `[player:]<name>` but it tries to complete it as `<player> <name>`. Not only does it not show you suggestions for your own homes, but it proceeds to show you invalid suggestions!

This PR provides completions that accurately reflect the syntax and real behavior of the command, including suggesting homes for player names that are partially matched. It will provide suggestions for all of your own homes, as well as providing suggestions based on how far along you are in the command (players if you haven't specified `:` yet, otherwise a specific player's homes).
2020-04-30 20:26:27 +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
Glare
882699919e Reimplement spawn-if-no-home config option (#2757)
This reimplements the `spawn-if-no-home` config option from the original Essentials plugin. If set to true, running `/home` without having set a home will send the player to spawn (previous behaviour). If set to false, running `/home` will instead show an error message and not teleport the player anywhere.

Closes #1452.
2019-10-20 09:12:53 +01:00
Glare Masters
26d63da7aa [Feature] Implemented a message to say teleporting to home. (#2489)
[Feature] Implemented a message to say teleporting to home.
2019-04-17 19:14:44 -04: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
drtshock
dde0b20775 Reformat 2015-04-14 23:06:16 -05:00
KHobbits
36e580474f Converted emulated player class calls to use base class. 2014-04-13 01:01:49 +01:00
FearFree
5724c0c8df Future Java versions may not support _ as identifier. 2014-03-22 16:08:11 +11:00
KHobbits
8fecd44786 Fix some /home errors with invalid data. 2014-03-09 17:59:07 +00:00
KHobbits
bcd5350a4d Add extra /home message TL params
{1} = current home count
{2} = max home count
2013-12-21 17:42:55 +00:00
KHobbits
1ac5b4230e Teleport cleanup 2013-08-13 18:06:24 +01:00
KHobbits
09f67c9723 Split util classes. 2013-06-08 22:31:19 +01:00
KHobbits
353423efec Use correct getPlayer method to not match offline users. 2013-03-20 01:29:54 +00:00
KHobbits
3ddf883d5d Import cleanup 2013-03-16 09:19:30 +00:00
KHobbits
fa8b8bec5a fix typo in messages
add new messages to messages.properties

add new messages to messages_en.properties

add new messages to messages_cs.properties

add new messages to messages_da.properties

add new messages to messages_de.properties

add new messages to messages_es.properties

add new messages to messages_fi.properties

add new messages to messages_fr.properties

add new messages to messages_it.properties

add new messages to messages_nl.properties

add new messages to messages_pl.properties

add new messages to messages_pt.properties

add new messages to messages_se.properties

remove color from bedNull

remove color from bedNull

remove color from bedNull

remove color from bedNull

remove color from bedNull

remove color from bedNull

remove color from bedNull

remove color from bedNull

remove color from bedNull

remove color from bedNull

remove color from bedNull

remove color from bedNull
2013-02-12 22:45:54 +00:00
Necrodoom
2a816cef7b try improve bed spawn handle
dont act as if bed doesnt exist if its missing
2013-02-12 22:43:06 +00:00
KHobbits
24c93c11c0 Stylize 'bed' in /home list 2013-02-03 17:30:14 +00:00
KHobbits
ef01332114 Fix missing 'bed' from home list. 2013-02-01 05:26:17 +00:00
KHobbits
705b193450 Let Bukkit decide if a bedspawn is valid or not.
Bukkit's bed fix forces minimum bukkit change.
2013-02-01 02:59:40 +00:00
KHobbits
03445e5b9b Fix home functionality bugs:
/home not using bed when enabled
/home not giving teleport warning
2012-12-29 06:43:26 +00:00
KHobbits
4f21490ec8 Move null bed check to teleport code 2012-12-09 17:10:12 +00:00
KHobbits
8c9b755671 Extra perm check in /home 2012-11-08 11:53:26 +00:00
KHobbits
8ba7a24fd2 Block explicit /home bed, unless user has "essentials.home.bed" permission.
This does not effect the '/home' command when used with no arguments.
In this case, a player will still be sent to the bed home, if they have no Ess home set.
2012-10-20 16:15:43 +01:00
KHobbits
ef608c7595 Remove extra home check. 2012-10-20 16:09:54 +01:00
KHobbits
f9659dae68 Move the per world permissions:
essentials.world.worldname is moved to essentials.worlds.worldname
2012-09-08 22:50:20 +01:00
KHobbits
74f0babc7d Separate toggle for world teleports using homes. 2012-05-22 17:54:19 +01:00
KHobbits
fa58503c9f Code tidy. 2012-05-22 00:41:03 +01:00
KHobbits
56fccb9645 Patch null error in /home after recent update. 2012-05-22 00:39:23 +01:00
KHobbits
faa3a5e027 Make /home and /back obey the world perm system.
This will prevent players from moving between words using virtually all essentials commands.
ATM /warp is excepted, because we already have per warp permissions.
Ess3 may see warp permissions altered to: essentials.warp.<world>.<warpname>
2012-05-20 23:58:03 +01:00
KHobbits
2f1d9ad82c Prevent /home bed, if the bed was later destroyed. 2012-01-29 21:44:15 +00:00
KHobbits
2f96c9763f Only list bed home if it is set. 2012-01-28 01:39:51 +00:00
KHobbits
f7c6759433 Check bed still exist, for bed homes. 2012-01-28 00:49:22 +00:00
KHobbits
3f6b9586b4 Fixing double charges on /home
Test #1426
2012-01-14 16:42:53 +00:00
snowleo
46c99e5c6f /home sends the player to bed again before it tries to respawn. 2011-12-07 15:18:50 +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
snowleo
019b49ef11 Updated EssentialsSpawn to use the new config code
/spawn and /home now call the PlayerRespawnEvent to make it more compatible with other plugins.
2011-12-06 13:41:29 +01:00
snowleo
1f1b6aff54 Allows to be teleported to bed location of offline players.
Also adds missing return in /home command
2011-12-02 08:19:55 +01:00
snowleo
f250a107e4 CB#1518 B#1042
Support for Enchantments & Removed broken BedFix (in cb now)
2011-11-27 06:01:41 +01:00
snowleo
65776d6ed2 BedLocationFix for CraftBukkit 2011-11-27 04:46:33 +01:00
snowleo
b21b7b7e15 New behavior of the /home command and beds
- The behavior has been altered to match the vanilla server.
 - Using a bed will no longer create a home in the users file, if config option bed-sethome is set
 - The config option bed-sethome has been removed
 - It's now possible to go to /home bed or /home playername:bed
 - Bed locations stored before installing Essentials will be used
 - Players respawn at their bed location (if set) instead of the spawn, if respawn-at-home is set to false
 - The default value of spawn-if-no-home is set to true
 - If spawn-if-no-home is set and the player has not set a home, he will be either teleported to his bed location (if set) or the spawn, when he uses the /home command
2011-11-26 22:30:40 +01:00
snowleo
4ad19b6fad Cleanup 2011-11-26 00:34:36 +01:00
snowleo
220d68f375 Switch to the new I18n class and format cleanup of all classes 2011-11-21 02:55:26 +01:00
KHobbits
e5a8cd88f0 Code cleanup continued. 2011-11-18 17:48:49 +00:00
KHobbits
e54d73704e Command cleanup 2011-11-18 12:06:59 +00:00
KHobbits
bd8fe521cd Adjusting behavior of 'spawn-if-no-home'. 2011-09-24 03:31:20 +01:00
KHobbits
0b057d8e29 Move 'spawnifnospawn' check to home decision tree. 2011-09-09 14:23:42 +01:00