Commit graph

30 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
Josh Roy f6cb9ff470
Improve command codestyle (#3337)
Co-authored-by: MD <1917406+md678685@users.noreply.github.com>

Fixes #3579 (async `/skull` command)
Fixes #3336 (improve codestyle of commands)
Partially addresses #3339 (`/spawn` and `/setspawn` are now hidden from tabcomplete)
Closes #3087 (`/paytoggle` is now a loop command)
2020-08-11 19:09:22 +01:00
pop4959 07e2fe3af1
Improve suicide and kill commands (#3388)
Fixes #3189 

This PR makes improvements to the suicide and kill commands, namely:
1) Call `EntityDamageEvent` with damage equal to `Float.MAX_VALUE`, which is the amount that is inflicted by `/minecraft:kill`.
2) Removes the calls to `Damageable::damage` which ends up damaging the player with `DamageSource.GENERIC`, and later causing another `EntityDamageEvent` where as a result the last damage cause gets set to `EntityDamageEvent.DamageCause.CUSTOM`. Thus, the `EntityDamageEvent` that Essentials calls gets rendered useless when someone tries to get the damage cause of the player in `PlayerDeathEvent`. Setting health to zero forcibly kills the player without causing damage.
3) Add `getTabCompleteOptions` to the suicide command, as it currently incorrectly suggests players.
2020-07-01 22:04:46 +01: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
ShadowRanger 7d6714f713 Properly apply damage causes 2015-09-28 11:45:25 +10: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
KHobbits 46691871ad Add permission: essentials.msg.multiple and essentials.pay.multiple
Message permission will allow rough nick matches and wildcards, while pay will only allow wildcards.
2013-12-28 22:37:36 +00:00
KHobbits 64e089e15b Cleanup 2013-10-18 00:07:35 +01:00
KHobbits 6f85761f7f Extract CommandSender to CommandSource, this should prevent Ess user object leaks. 2013-10-16 21:05:33 +01:00
KHobbits 03368e45df Extract user match looping 2013-09-28 21:33:22 +01:00
KHobbits b8cdd7d1f7 Fix NPE in /kill when used from console. Thanks Necrodoom 2013-08-18 21:04:19 +01:00
Iaccidentally 547e262061 [FEATURE] Add kill exempt :: new permission: essentials.kill.exempt
players with essentials.kill.force and console will still be able to override this
2013-04-19 14:40:10 -04:00
KHobbits 8f6c61fa99 Try to unify player matching for hidden users:
kill, lightning and ptime still need cleanup
2013-03-19 23:17:34 +00:00
KHobbits 99cefb2d74 Fix perm check in /kill 2012-10-20 19:24:33 +01:00
KHobbits 600f99eb6b If the player is still alive, make sure he dies. (/kill) 2012-10-20 19:18:04 +01:00
Iaccidentally bdf67db6ed fix name length check in /kill 2012-08-10 07:17:05 -04:00
KHobbits a92eb4dee6 Throw warning when using /kill without valid player. 2012-08-10 02:40:05 +01:00
KHobbits d3397279f6 Revert "We can't damage and kill, so we will just kill to make everyone happy, and the event pointless."
This reverts commit 705efc6002.

Also fix kill to do the same.
2012-05-06 16:09:47 +01:00
KHobbits a2418a68d9 Fixing Kill/suicide in creative mode. 2012-01-29 21:37:38 +00:00
KHobbits a31f5e219d Kill people the proper way.
Test #1410
2012-01-29 03:23:38 +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 a05f730e76 Little more command cleanup. 2011-11-18 13:48:31 +00:00
snowleo 5984cd5835 Fix pull request of damage request 2011-10-09 16:43:58 +02:00
feildmaster 7668af15b0 Fires an event before "killing."
Can be made cancel-able.
Could also be written to add "suicide" (if sender == player)
2011-10-03 03:40:42 -05:00
snowleo 6427a93d14 Correctly charge for the use of commands.
We now first test, if the user could pay it, do the stuff and then charge him. If the command throws an exception, the user will not be charged.
2011-08-27 23:14:49 +02:00
ementalo 07e49c3fbb [trunk] translations - halfway there
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1416 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-10 21:52:07 +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 a3ebd254f2 Moving all files to trunk.
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@969 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-03-19 22:39:51 +00:00