1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-09-06 12:40:45 +02:00

Compare commits

...

2892 Commits

Author SHA1 Message Date
ElgarL
02c6780476 Release the Player object reference on quit. 2014-10-15 09:39:23 +01:00
ElgarL
2526f559ff Merge pull request #766 from necrodoom/patch-133
Fix error message typo
2014-10-03 08:42:46 +01:00
Necrodoom
9818df3039 Fix error message typo 2014-10-03 10:30:53 +03:00
ElgarL
c843a329bd Update WorldDataHolder.java
Set Primary group before sub group on loading else the subgroup tests default.
2014-10-03 08:25:04 +01:00
ElgarL
4fb96aa586 Merge pull request #740 from necrodoom/patch-119
Remove null check
2014-07-24 13:38:00 +01:00
Necrodoom
a11daafb0d Remove null check
Match can never be null
2014-07-24 12:58:23 +03:00
ElgarL
c6dfa741c1 Case sensitive works, so make all Users names case insensitive as no duplicate names will be allowed. 2014-07-20 13:46:59 +01:00
ElgarL
e36f26e185 All User lookups should be case sensitive. 2014-07-19 04:10:35 +01:00
ElgarL
4b20b6a93a Perform case sensitive name checks on plugin requests. 2014-07-19 04:04:20 +01:00
ElgarL
cdd5df0c0a Debug logging on Name to UUID lookup. 2014-07-19 02:21:34 +01:00
ElgarL
d3be04c81a Merge branch 'groupmanager' of https://github.com/essentials/Essentials into groupmanager 2014-07-19 00:08:00 +01:00
ElgarL
e6049b0818 Add FINE debug on user login. 2014-07-19 00:05:50 +01:00
ElgarL
2e04dbf7be Merge pull request #736 from necrodoom/patch-117
Remove unneeded negation
2014-07-17 11:25:04 +01:00
Necrodoom
bd210309b2 Add exception node example
Readd toggle effect options
2014-07-17 12:49:40 +03:00
Necrodoom
d7c9a8742d Change vanish negation in groups.yml
Instead of negating all vanish perms, negate forced effects
2014-07-17 12:48:08 +03:00
Necrodoom
7b63aab562 Remove unneeded negation
No vanish perms are default given
2014-07-17 12:45:32 +03:00
ElgarL
2c9feadf1d Fix 'manudel' so it correctly deletes the user. 2014-07-17 10:40:28 +01:00
ElgarL
bd72eee559 Prevent inherited group permission negations overriding higher level group perms. 2014-07-17 10:37:58 +01:00
ElgarL
d32c692b66 Fix Overloaded and non-overloaded users to report correctly for group tests. 2014-07-08 18:03:21 +01:00
ElgarL
4097ef4939 Remove debug spam.
Stop using WeakHashMap in BukkitPermissions as using it with string keys results in unreliable removal.
2014-06-21 09:09:20 +01:00
ElgarL
3137c9ae10 Ensure GM reports the same permissions as Bukkit. 2014-06-20 22:33:25 +01:00
ElgarL
194de920cf Fix attachments not being reset between worlds. 2014-06-20 21:48:44 +01:00
ElgarL
9a55d32b75 Convert all User lookups and commands to use UUIDs where possible. 2014-06-20 10:56:52 +01:00
ElgarL
d86d72eeb7 Prevent NPEs on new user creation. 2014-06-20 08:51:41 +01:00
ElgarL
f336e54b67 Prevent plugins which run their PlayerJoinEvent too early from breaking the name to UUID lookups.
No plugin bar permission plugins shoud be running on Lowest for the PlayerJoinEvent
2014-06-19 21:40:01 +01:00
ElgarL
2e0a1dde85 Fix NPE when adding name to UUID key before the name has been set. 2014-06-19 17:29:20 +01:00
ElgarL
e862e3c87b Add internal name to UUID resolution to speed data lookups. 2014-06-19 07:59:20 +01:00
ElgarL
d9fdf3bdf6 Merge pull request #708 from necrodoom/patch-105
[REPULL] Fix successful message color
2014-05-28 11:56:11 +01:00
ElgarL
34a323125f Prevent GM's own permission tests from allowing inherited permissions to override inherited negations (caused when we added the exception override for sub groups). 2014-05-28 02:03:51 +01:00
ElgarL
f03e41536b Added metrics. 2014-05-15 19:07:04 +01:00
ElgarL
9c3d965371 Error in logic 2014-05-04 17:10:37 +01:00
ElgarL
578aec35eb Prevent players who have never logged in before from taking over existing accounts. 2014-05-04 16:17:31 +01:00
ElgarL
a8ad83fb0b Merge branch 'groupmanager' of https://github.com/essentials/Essentials into groupmanager 2014-05-04 16:13:02 +01:00
Necrodoom
6779c9f0d3 [REPULL] Fix successful message color 2014-05-04 16:33:20 +03:00
ElgarL
86b57804c6 Fix clones forgetting sub groups. 2014-05-04 12:50:22 +01:00
ElgarL
211dc220d8 Set a default mirror map if none is found in the config. 2014-05-04 12:50:21 +01:00
ElgarL
aae586f79a Fix overloadedWorldHolder so it correctly calls the new WorldHolder code when the user is not overloaded. 2014-05-04 12:50:20 +01:00
ElgarL
32f49350cf Fixup javadocs 2014-05-04 12:50:18 +01:00
ElgarL
9739784e75 v2.1: - Update for CraftBukkit 1.7.8-R0.1(3050). - Add UUID support. Plugins can still query by player name but a UUID is faster and preferable. 2014-05-04 12:50:17 +01:00
ElgarL
a0e93af758 Do not override higher level permissions with negations. 2014-05-04 12:50:16 +01:00
Necrodoom
81c6291338 Fix a /mangcheckp message 2014-05-04 12:50:15 +01:00
ElgarL
24509d60be Update mangcheckp to understand Exception nodes. 2014-05-04 12:50:14 +01:00
ElgarL
f0947e9a7c Fix manucheckp to understand and report correctly on Exception nodes. 2014-05-04 12:50:13 +01:00
ElgarL
92bb4e0e66 Allow Exceptions in any inherited group to override negation of permissions. 2014-05-04 12:50:12 +01:00
Necrodoom
8f810ad447 Cleanup plugin description 2014-05-04 12:50:11 +01:00
ElgarL
3f35a6b59c Prevent adding sub groups for ranks the granting player doesn't have access to. 2014-05-04 12:50:09 +01:00
ElgarL
427dd714c9 Allow Exception permission to override negations when in the same group. 2014-05-04 12:50:08 +01:00
ElgarL
9d7a2043f7 Change to use LinkedHashSets to preserve ordering. Fixes an issue with populating bukkit perms in the wrong order. Fix wildcard negation in parent groups. 2014-05-04 12:50:07 +01:00
ElgarL
ff3ec84b0d Fix Cyclic mirroring test (silly me) 2014-05-04 12:50:06 +01:00
ElgarL
1f9e72c5e2 Tidy imports 2014-05-04 12:50:05 +01:00
Necrodoom
67be18566c Improve Javadocs, clean ' strip checks, update changelog. 2014-05-04 12:50:04 +01:00
Necrodoom
862e71bc85 add recursive permission adding/removing
also other minor fixes
2014-05-04 12:50:03 +01:00
ElgarL
395655ba19 Check subgroup permissions with an equal priority so no one subgroup is higher ranked than another. 2014-05-04 12:50:02 +01:00
KHobbits
1bb569fff2 Fix attempting to spawn invalid items. 2014-04-30 05:41:42 +01:00
KHobbits
e66ad88451 Skip npc's when doing cleanup. 2014-04-29 04:42:55 +01:00
KHobbits
3bf3093177 Better handle a write locked usermap.csv 2014-04-29 01:44:28 +01:00
ElgarL
69faf87866 Fix clones forgetting sub groups. 2014-04-29 00:22:51 +01:00
KHobbits
5eb82add06 Run user dispose on another thread. 2014-04-28 23:12:35 +01:00
Corin Simpson-Bryars
8bd1a9f3bc Updating pom for vault
When deploying with Jenkins the build will fail due to there being no http://repo.ess3.net:8071/content/groups/public/net/milkbowl/vault/1.2.27 however there's a valid jar/dir for vault at http://repo.ess3.net:8071/content/groups/public/net/milkbowl/vault/Vault/1.2.32/
This will keep maven happy and the build not to error.
2014-04-28 00:52:06 +01:00
ElgarL
e1631b2af8 Set a default mirror map if none is found in the config. 2014-04-27 23:55:20 +01:00
KHobbits
145d24c34c Fix /home for offline players. 2014-04-27 17:09:44 +01:00
KHobbits
229ff9f0e4 Update UUID mapping, if uuid for a username changes. 2014-04-27 01:35:52 +01:00
KHobbits
0557aa58b0 Switch AFK check to use UUID. 2014-04-27 01:10:44 +01:00
KHobbits
b40aa43872 Delay uuidconversion for 10s and show warning.
UUID conversion should now better handle offline conversion.
2014-04-26 23:50:12 +01:00
KHobbits
a1cdfa19b0 Fix time command exit statuses. 2014-04-24 10:24:35 +01:00
KHobbits
d62b401db8 Skip empty user names on uuid conversion. 2014-04-22 18:07:02 +01:00
KHobbits
887957756e [Breaking] Fix ECO NPC's. This is a work around of CB's recent changes blocking invalid uuid lookups.
NPC's converted with the previous version will need manual changes.
2014-04-19 02:03:39 +01:00
KHobbits
b6d6b24796 Only write to UUIDMap if the entry doesn't exist. 2014-04-18 06:48:14 +01:00
KHobbits
b6c0871daa Format /seen account history list, optimize map loading. 2014-04-18 05:57:47 +01:00
KHobbits
b080187808 Add previous account tracking to /seen 2014-04-18 04:48:34 +01:00
KHobbits
3c613fd59b Force CB 3050+ 2014-04-18 03:58:27 +01:00
KHobbits
547c6e4073 Fix offlineplayers with null names. 2014-04-17 06:09:08 +01:00
KHobbits
6098086a99 Optimize uuidmap writing, and use userConf write buffering. 2014-04-17 05:34:34 +01:00
KHobbits
87f90e9bdd Add progress status and /ess uuidconvert command for manual conversion. 2014-04-17 02:18:28 +01:00
KHobbits
65b1821196 Update Bukkit to 1.7.8-R0.1
Bukkit: 1922 CraftBukkit: 3050
2014-04-15 00:24:12 +01:00
KHobbits
756321d280 Add UUID mocking support, and fix tests. 2014-04-15 00:08:02 +01:00
KHobbits
3dbf69f163 Allow usermap to support legacy users, and restore ability to create user on first access, as well as server join. 2014-04-15 00:07:35 +01:00
KHobbits
e8ace54036 Make eco npc methods use proper user config creation and resets. 2014-04-15 00:06:29 +01:00
KHobbits
22e1c14e7e Stop delayed writes from reversing user reset. 2014-04-15 00:05:56 +01:00
ElgarL
50d3486d35 Fix overloadedWorldHolder so it correctly calls the new WorldHolder code when the user is not overloaded. 2014-04-14 23:40:04 +01:00
ElgarL
4f2ed6fe11 Fixup javadocs 2014-04-14 22:23:47 +01:00
ElgarL
6cc0edb89a v2.1:
- Update for CraftBukkit 1.7.8-R0.1(3050).
	- Add UUID support.
	  Plugins can still query by player name but a UUID is faster and preferable.
2014-04-14 22:19:14 +01:00
KHobbits
cd38aeb544 Remove Ess object from FakeServer. 2014-04-14 00:03:07 +01:00
KHobbits
9e9409da1e Essentials UUID conversion. 2014-04-13 21:40:15 +01:00
KHobbits
36e580474f Converted emulated player class calls to use base class. 2014-04-13 01:01:49 +01:00
clou44
e007331581 Update items.csv
Added additional aliases for various flowers.
2014-04-10 23:31:05 +01:00
clou44
8d435ec86e Update items.csv
Added additional aliases for coal blocks.
2014-04-10 23:30:58 +01:00
KHobbits
214d64e4ad Update config.yml to reflect vanilla fallback no longer works. 2014-04-07 14:09:09 +01:00
KHobbits
737fadc390 Update Bukkit 1.7.5-R0.1
Bukkit 1919 CB: 3039
No UUID update yet.
2014-04-06 15:57:37 +01:00
KHobbits
10de6ac929 Cleanup 2014-04-06 15:44:37 +01:00
KHobbits
fe9fbf585f Correctly handle line overflow in book pager
Fixes a bug with the last book pager tweak.
2014-04-05 15:33:38 +01:00
KHobbits
af3f3fb4c7 Fix fly logic check (creative doesn't mean fly is enabled) 2014-03-31 03:26:48 +01:00
KHobbits
0e6a5240db Add chat configurables. 2014-03-30 15:50:32 +01:00
KHobbits
f272a7ecd6 See if we can better handle book paging to fit more context on a line, without causing text loss after reaching character limit. 2014-03-29 16:07:32 +00:00
ElgarL
e00ee62f75 Do not override higher level permissions with negations. 2014-03-27 12:55:01 +00:00
ElgarL
22ff49a0b8 Merge pull request #689 from necrodoom/patch-102
Fix a /mangcheckp message
2014-03-27 12:35:38 +00:00
Necrodoom
14c764e049 Fix a /mangcheckp message 2014-03-27 13:02:34 +02:00
ElgarL
ec5496ad18 Update mangcheckp to understand Exception nodes. 2014-03-27 03:55:58 +00:00
ElgarL
020f0b2ad6 Fix manucheckp to understand and report correctly on Exception nodes. 2014-03-27 03:48:20 +00:00
ElgarL
8e59c47200 Allow Exceptions in any inherited group to override negation of permissions. 2014-03-27 01:50:00 +00:00
evonuts
104caea3c9 Minor phrasing fixes. 2014-03-26 22:08:37 +00:00
Matt Anthony
44fbd05df7 Add colors to a few TL keys. 2014-03-26 21:58:36 +00:00
KHobbits
6cfb5084e1 Add local echo to tempban command. 2014-03-26 20:08:38 +00:00
KHobbits
ae1804758a Helpop should use broadcast method
Add local echo's to helpop and mute commands.
2014-03-26 20:06:01 +00:00
Necrodoom
4b470b32c5 Add socialspy wildcard support 2014-03-26 19:09:00 +00:00
Necrodoom
cfe89dde17 Match /clearinventory multiple permission to /msg 2014-03-26 19:07:48 +00:00
Necrodoom
30dae51ddf Some messages fixes, and information addition. 2014-03-26 19:07:41 +00:00
KHobbits
0b11abf8f4 Revert "Do not allow a block with an Essentials Sign attached to it to be pulled with a sticky piston"
This reverts commit b673882b2f.
2014-03-26 15:14:40 +00:00
Chris Ward
b673882b2f Do not allow a block with an Essentials Sign attached to it to be pulled with a sticky piston 2014-03-26 22:00:57 +11:00
KHobbits
200dbda6d3 Merge branch '2.x' of github.com:essentials/Essentials into 2.x 2014-03-23 18:14:21 +00:00
KHobbits
3538728733 Fix null teleport costs. 2014-03-23 18:12:33 +00:00
FearFree
5724c0c8df Future Java versions may not support _ as identifier. 2014-03-22 16:08:11 +11:00
KHobbits
0b5718f7ff Cleanup warp charging, to properly handle warp sign costs. 2014-03-19 00:01:47 +00:00
ElgarL
c6b0dfaa4c Merge pull request #668 from necrodoom/patch-91
Fix messages
2014-03-12 15:41:53 +00:00
KHobbits
8fecd44786 Fix some /home errors with invalid data. 2014-03-09 17:59:07 +00:00
Dabo Ross
2ee590d85c Add IEssentialsSpawn class for API for Essentials Spawn with two methods, getSpawn(String) and setSpawn(String, Location).
Implement IEssentialsSpawn in EssentialsSpawn.
2014-03-09 17:31:36 +00:00
KHobbits
b469439f7b Update translations from Crowdin
http://translate2.ess3.net/
2014-03-09 17:23:38 +00:00
Necrodoom
a7d6e5440b Fix messages 2014-03-09 19:17:26 +02:00
Luke Anderson (stuntguy3000)
077074c855 Add missing language pointers 2014-03-09 17:14:09 +00:00
FearFree
c59a204827 Remove op and replace with permission 2014-03-09 17:01:31 +00:00
KHobbits
1be30e4a0a Only enable teleport protection on plugin/command caused teleport events. 2014-03-09 01:13:41 +00:00
Dykam
28ec7c2d80 You can now access the old balance during the UserBalanceUpdateEvent Event 2014-03-04 19:44:55 +00:00
Kryptic Dot
ee986768ce Cleaning up readme markdown 2014-03-04 19:29:47 +00:00
SkyBirdSoar
de485b8d48 Fixed some grammatic errors, changed some sentences. 2014-03-04 19:26:16 +00:00
Zed Spencer-Milnes
e443776dc1 Finish Sentence
# Setting to false means EssentialsAntiBuild will never prevent you from using.
->
# Setting to false means EssentialsAntiBuild will never prevent you from using items.

Am I glad to make such a profoud change to the source code.
2014-03-04 19:22:05 +00:00
Luke Anderson
859ffeaa0b Remove generated comments 2014-03-04 19:20:56 +00:00
KHobbits
545d706a70 Fix login death caused by built up fall damage using /fly. 2014-03-03 21:24:00 +00:00
KHobbits
9ec0ca25a5 User loading cleanup 2014-03-03 09:01:07 +00:00
KHobbits
b0e165546e Round to gc output to 2 dp. 2014-03-03 08:34:43 +00:00
KHobbits
470f4c1b3e Constant user file casing. 2014-02-27 01:55:04 +00:00
KHobbits
3b35763fef Fix warp sign costs. 2014-02-25 07:09:32 +00:00
KHobbits
2d5c1fd51c Fix safety tp check above world height
Performance tweak to fly check
2014-02-23 17:41:25 +00:00
KHobbits
088c54e386 Fix customtext copy 2014-02-19 03:28:28 +00:00
KHobbits
e409363426 Alternative implementation of unsafe enchant blocking for signs.
Permission: essentials.signs.enchant.allowunsafe - required to add unsafe enchants using enchant signs.
This reverts commit 3f2c2aadbb.
2014-02-19 01:18:40 +00:00
KHobbits
34599b7428 Fix projectiles compiling. 2014-02-19 00:58:20 +00:00
KHobbits
53c1c8a8b7 Update Bukkit to 1.7.3-R0.3 - Bukkit: 1903 CB: 3020
This also disables vanilla fallback, use new aliases file.
2014-02-19 00:36:54 +00:00
snowleo
3f2c2aadbb Split unsafe enchantments in kits to a new config option 2014-02-18 23:47:18 +01:00
KHobbits
a1a190bb02 Merge branch '2.x' of github.com:essentials/Essentials into 2.x 2014-02-16 01:15:25 +00:00
KHobbits
6744b652e6 Use the absolute radius value. 2014-02-16 01:15:01 +00:00
Chris Ward
11b308cc8c Update repository URLs 2014-02-15 14:23:30 +11:00
KHobbits
c50f559512 Allow sending customtext chapters as a parameter instead of reading commandLabel 2014-02-13 22:52:14 +00:00
KHobbits
98bee40bf7 Fix Stripping/blocking of urls containing caps. 2014-02-12 01:20:54 +00:00
Iaccidentally
970d342a60 Merge pull request #657 from evonuts/2.x
Fix spelling error (atleast) in translation files.
2014-02-11 02:27:10 -05:00
evonuts
2500c9af90 Fix spelling error (atleast) in translation files. 2014-02-11 20:15:14 +13:00
KHobbits
fa765d3077 Fix world argument to ignore radius, and allow for skipping radius param in syntax. 2014-02-09 22:26:54 +00:00
KHobbits
9bc8f287a4 Fix ghost items with /recipe 2014-02-09 21:54:04 +00:00
Necrodoom
5e6ce8aecb Reorder ID 376 2014-02-09 21:37:03 +00:00
KHobbits
6174e4a98b Code cleanup and remove remote skull edit. 2014-02-08 01:23:54 +00:00
Luke Anderson (stuntguy3000)
5c74af42a3 Add /skull command 2014-02-08 00:25:34 +00:00
coegho
ce48f2f326 [Fix] fireball-fire=true now prevents fire spread from fireballs 2014-02-08 00:22:56 +00:00
Necrodoom
2affce875c Restore 2 aliases 2014-02-08 00:16:11 +00:00
Necrodoom
52c8ebc61f Fix duplicates, a few more aliases addition/remove 2014-02-08 00:16:11 +00:00
KHobbits
a9249deea7 Reformat pom 2014-02-08 00:13:46 +00:00
KHobbits
d99c35cc35 Add bow as a skeleton keyword 2014-02-06 02:35:27 +00:00
Iaccidentally
518650e842 Modifier order consistency 2014-02-04 11:11:43 -05:00
KHobbits
20ff61909f Readme tweak. 2014-02-04 01:17:06 +00:00
KHobbits
f0e4e8c5ba Add support for vanilla item names from api. 2014-02-02 19:04:09 +00:00
KHobbits
63300866f9 Fixed argument count for meta parsing. 2014-02-02 18:56:45 +00:00
KHobbits
c8212371ff Allow the Essentials module to compile again. 2014-02-02 18:19:29 +00:00
KHobbits
0a6a79115a Raise minimum CB version to 2922 or 1.7.2-R0.1
This should prevent issued caused by UUID mismatch.
2014-02-02 17:13:44 +00:00
KHobbits
6798615507 Track UUID for future use. 2014-02-02 17:05:41 +00:00
KHobbits
016b39726c Restore teleporting to middle of block, when flying and unsafe is enabled. 2014-02-02 16:43:31 +00: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
161862bc53 Make sure we leave any vehicles before teleporting. 2014-02-02 15:04:07 +00:00
Iaccidentally
18b31a7e50 [FIX] Print a proper error when using tpaccept with no requester 2014-02-01 16:49:54 -05:00
Chris Ward
5b5be164b6 Allow the use of non-development Bukkit builds at runtime
Unsafe code is surrounded by sufficient handling
2014-01-30 10:43:26 +11:00
Chris Ward
466b4ae7c5 Restore Bukkit dependency to parent pom 2014-01-30 10:34:16 +11:00
KHobbits
e7c468b20d Attempt to fix client issue with speed reset on world change. 2014-01-26 22:33:56 +00:00
KHobbits
b9d09dd7b0 Make /speed persist on world change if permissions exist. 2014-01-26 20:00:41 +00:00
KHobbits
1c035457bb Force Bukkit version to match deps. 2014-01-25 23:29:48 +00:00
KHobbits
5070f15810 Use OSX character split on internal sign interface 2014-01-25 22:55:28 +00:00
Necrodoom
c8faf03f5b Fix cauldron ID 2014-01-25 22:46:26 +00:00
Necrodoom
915cb51d1a Trim items.csv based on feedback 2014-01-25 22:46:25 +00:00
snowleo
52c3169a3c Read backup output async 2014-01-25 15:33:33 +01:00
Chris Ward
32b118d3c0 Add fullstops for @Necrodoom 2014-01-21 12:20:24 +11:00
Chris Ward
9ce1158aeb Add support for vanilla JSON metadata syntax (/give, /i, /kit, etc.) 2014-01-21 00:54:48 +11:00
Chris Ward
839bfe0c2e Update to Bukkit Development Builds
Change things so unit testing can run after Bukkit's breaking commit with classloader stuff
2014-01-20 21:20:13 +11:00
KHobbits
f39ef36115 Fix hidden groups in /list 2014-01-14 21:55:30 +00:00
KHobbits
eee18f40be Pass optional location parameters to teleport TL keys. 2014-01-12 01:23:12 +00:00
KHobbits
4084445b5b Config description cleanup. 2014-01-11 17:34:35 +00:00
Adam
8c882a5268 Reset Exhaustion on /feed 2014-01-08 01:07:38 +00:00
ElgarL
3440a22d6d Merge pull request #626 from necrodoom/patch-76
Update plugin.yml
2014-01-07 07:18:25 -08:00
Chris Ward
3b0e86ae67 Add an upload-only pom file for GroupManager 2014-01-06 10:03:22 +11:00
KHobbits
3fecd3138d Check command cost, before running kit delay check, prevent accidentally delaying unran commands. 2014-01-03 08:16:17 +00:00
KHobbits
d48c02021d Add and implement sign break/create/interact events to EssAPI
Implement AfkStatusChangeEvent
2013-12-31 17:47:52 +00:00
KHobbits
0b71b6e93d Remove redundant permission check. 2013-12-31 04:44:28 +00:00
KHobbits
99d25bfaea Fix NB parent compiling 2013-12-28 23:09:56 +00: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
Chris Ward
58440dd594 Add deploy plugin 2013-12-29 03:04:36 +11:00
Chris Ward
12c96e21b9 Use the Essentials Maven repository 2013-12-29 00:21:26 +11:00
Chris Ward
1d791fb110 Remove Ant, migrate Netbeans code style to pom.xml 2013-12-27 03:47:13 +11:00
Necrodoom
bca9bf5099 Update plugin.yml 2013-12-25 20:25:10 +02:00
Chris Ward
0384ac5d42 Travis - use Maven to build 2013-12-26 01:19:51 +11:00
SkyBirdSoar
def1569fcc Add aliases to stationary water & stationary lava
New changes:
stillwater is an alias to 9:0 (Stationary water)
stilllava is an alias to 11:0 (Stationary lava)
2013-12-26 01:17:42 +11:00
Chris Ward
7d7e87e63a Pull geoip library from Maven 2013-12-26 01:12:04 +11:00
Chris Ward
8b26c7fc84 Use Ant to replace GroupManager's plugin.yml version 2013-12-22 19:21:19 +11:00
KHobbits
3017d2a7f4 Better matching of zombie and skeleton mobdata to avoid confusion. 2013-12-22 00:12:22 +00:00
KHobbits
23d2ffb134 Add {4} to homeSet TL key, this contains the name of the home being set. 2013-12-21 23:30:12 +00:00
KHobbits
ad2f446602 Check command cost permissions prior to teleporting. Fixes ESS-4918 2013-12-21 23:19:58 +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
b6b2ee61a4 Don't check for default worth durability if more than one durability price is defined.
This also adds support for '*' durability matching 'other'.
2013-12-21 03:33:27 +00:00
KHobbits
6362dbd5b3 Restore CB to lib folder 2013-12-21 02:39:26 +00:00
Chris Ward
ee55584117 Use Bukkit beta build 2013-12-18 17:26:01 +11:00
KHobbits
e5b522ed14 Try changing the config file home language up a little bit. 2013-12-17 19:23:28 +00:00
Necrodoom
df219db1a4 fix gcWorld in de locale 2013-12-15 12:49:06 -06:00
Necrodoom
f8e273767e Add cobweb aliases 2013-12-13 09:23:29 -06:00
Chris Ward
1bfab68932 Change teleport safety checks to use less expensive methods. 2013-12-13 19:41:57 +11:00
KHobbits
901b835ae0 Alter teleport cancel message to reflect config option. 2013-12-13 08:15:28 +00:00
Joshua Popoff
7d8d9d8959 Add the ability to disable teleport safety. Requested by a few people - teleport safety isn't always a good thing for some servers. Request is cancelled if not safe. 2013-12-13 17:07:26 +11:00
Chris Ward
b70b58660f Remove Javadocs from the default compile, use the javadoc:javadoc goal to generate them. 2013-12-11 21:50:06 +11:00
Chris Ward
18a6d1761a Merge pull request #609 from Skylexia/patch-1
Fixed all the salmon.
2013-12-10 18:46:51 -08:00
Skylexia
9a197d65a3 Fixed all the salmon. 2013-12-10 20:42:56 -05:00
Iaccidentally
b68e451c13 Merge pull request #607 from necrodoom/patch-67
Add new baked potato aliases - thanks clou44
2013-12-08 09:45:16 -08:00
Necrodoom
11949a4315 Add new baked potato aliases - thanks clou44 2013-12-08 19:44:14 +02:00
ElgarL
69e1583bac Merge pull request #606 from necrodoom/patch-66
fix typo in node
2013-12-08 06:32:47 -08:00
Necrodoom
752cec8f13 fix typo in node 2013-12-08 15:02:48 +02:00
Chris Ward
f52858d058 Strip all Mac OSX characters
Temporary workaround awaiting PR from Bukkit
2013-12-08 20:40:10 +11:00
md-5
90fc19cc7b Fix formatting from last commit 2013-12-08 17:00:53 +11:00
md_5
ddb1f76a26 Strip weird sign chars sent by OSX due to client bug 2013-12-08 16:57:44 +11:00
KHobbits
2584e0ab06 Update config.yml to reflect recent custom message settings. 2013-12-08 04:46:33 +00:00
KHobbits
5dbf4f5a00 Make it so both {world} and {worldname} work for both keyword parsers. 2013-12-07 23:58:47 +00:00
KHobbits
af02a28ce5 Update Bukkit
Bukkit: #1859 CB: #2943
2013-12-07 22:26:41 +00:00
Necrodoom
5e9f5904fd Ignore empty chat events generated by plugins 2013-12-07 22:15:01 +00:00
KHobbits
946051de71 Add support for adding item meta to [free] signs.
Fix NPE on [sign] creation.
2013-12-07 20:25:23 +00:00
KHobbits
427b97433e Logger cleanup pt 1. 2013-12-07 20:03:05 +00:00
KHobbits
f3b005e331 Cleanup /remove ingame syntax 2013-12-07 19:17:36 +00:00
KHobbits
5b64c31e86 Show warning when invalid mob type is specified for /remove 2013-12-07 19:03:29 +00:00
KHobbits
723e458a81 Remove requires at least one argument. 2013-12-07 18:46:25 +00:00
Chris Ward
309273dc6b Fix issue in login messages
Message wouldn't be displayed if silent join is enabled and custom is disabled. Probably.
2013-12-07 14:24:39 +11:00
Chris Ward
d40e331c8a Disable the login message hooks automatically 2013-12-07 14:20:51 +11:00
Chris Ward
c57e902173 Fix login messages 2013-12-07 13:44:41 +11:00
Chris Ward
e864696b00 Revert "Fixed bug when logging in silently"
This reverts commit 5fe19dbd83.
2013-12-07 13:24:48 +11:00
Iaccidentally
fed250fd74 Merge pull request #605 from Phryxiil/2.x
Fixed bug when logging in silently
2013-12-06 18:17:06 -08:00
Zarubinator
5fe19dbd83 Fixed bug when logging in silently 2013-12-06 21:15:27 -05:00
Chris Ward
b836b3c041 Who doesn't love a good ol' NPE 2013-12-06 19:01:37 +11:00
Necrodoom
9550ef2a0d Fix glass pane IDs
remove duplicates in items.csv (thanks .itemdbparse)
2013-12-05 23:09:35 +00:00
Chris Ward
bac26f966c Cleanup join/quit messages. 2013-12-05 23:08:29 +00:00
Chris Ward
278bb98649 Fix custom join messages Removes double message, adds colour codes and placeholders for the user's name. 2013-12-05 23:08:28 +00:00
TheReverend403
3839b6f1f5 Code cleanup 2013-12-05 23:06:04 +00:00
Necrodoom
c0a58a5316 Update items.csv to 1.7.2 (beta file version) 2013-12-05 23:03:34 +00:00
KHobbits
de7c2be960 Updated translations from crowdin 2013-12-05 23:03:34 +00:00
KHobbits
c57c791e69 Cache join/quit messages. 2013-12-05 23:03:33 +00:00
Iaccidentally
1ae2b094f3 Add options to disable join/quit messages and custom join/quit messages 2013-12-05 23:03:33 +00:00
KHobbits
dde8cd8f72 Merge remove and killall command, thanks to @Evonuts and @Iaccidentally. 2013-12-05 23:03:33 +00:00
Adam
b3bad6a35a Add a title to [Disposal] and [Free] sign inventory 2013-12-05 23:03:33 +00:00
Chris Ward
25e4096a12 Update FakeServer - fixes compilation 2013-12-05 23:03:33 +00:00
KHobbits
e411f61296 Update to first build of 1.7.2 - CraftBukkit is still buggy so expect issues
Bukkit: #1856 CB: #2922
2013-12-05 23:03:32 +00:00
iBo3oF
caa3ac88aa Add Balance Update Event. 2013-12-05 23:03:31 +00:00
KHobbits
f677d6a411 Tidy up string manipulation in trade signs. 2013-12-05 23:03:31 +00:00
KHobbits
4232216f76 Try to be a little less confusing with non-command debug errors. 2013-12-05 23:03:31 +00:00
KHobbits
beef371ae6 Adding saddles to horses should properly tame horses. 2013-12-05 23:03:31 +00:00
Necrodoom
872df26e9d Do not block user damaging self (ender eye) 2013-11-17 19:19:42 +02:00
Joseph Jenniges
8146858ee0 Fix logic error with /kickall in console 2013-11-17 10:04:36 -06:00
snowleo
9b4e6e5dc6 Fix fromIndex = -20 2013-11-15 20:06:16 +01:00
KHobbits
53b1526906 Throw meaningful warnings when wrong Essentials version is used with unsupported mod packs. 2013-11-15 00:22:10 +00:00
Iaccidentally
82be7546d5 Tidy up Commandremove a bit, thanks to Evonuts 2013-11-10 23:25:42 +00:00
Iaccidentally
f400f81e4d Add more functionality to the remove command. This now overlaps some functionality of the killall command, which should eventually be merged into this command and removed. new options: hostile, monsters, passive, animals, ambient, mobs, entities 2013-11-10 23:25:34 +00:00
KHobbits
5d1ea4aa88 Allow ignore to block tpahere requests. 2013-11-09 04:08:25 +00:00
KHobbits
7f8d62be02 Add a couple more enchant aliases for blast protection 2013-11-09 03:40:51 +00:00
Iaccidentally
3e725ef060 Cleanup various aspects of code, fix some formatting, more netbeans 7.4 stuff 2013-11-06 21:22:32 -05:00
Iaccidentally
d5196e31b2 Add ability to supress join/leave messages :: new permissions: essentials.silentjoin & essentials.silentquit 2013-11-06 18:05:02 -05:00
Iaccidentally
235f134514 netbeans 7.4 stuff 2013-11-06 18:03:46 -05:00
ElgarL
a66b9a3ee4 Prevent adding sub groups for ranks the granting player doesn't have access to. 2013-10-31 11:40:12 +00:00
KHobbits
6af1b923cc Update Bukkit and Craftbukkit jar files for stable 1.6.4
Bukkit: 1848 Craftbukkit: 2912
2013-10-28 00:29:01 +00:00
KHobbits
365888a8f9 Update Translation files from Crowdin:
http://translate2.ess3.net/
2013-10-28 00:21:41 +00:00
FearFree
b8f5c9a8e4 Update for consistency.
Signed-off-by: KHobbits <rob@khobbits.co.uk>
2013-10-28 00:10:35 +00:00
FearFree
ae89c80d4e Clarify no perm msgs for missing .offline perms
Signed-off-by: KHobbits <rob@khobbits.co.uk>
2013-10-28 00:10:33 +00:00
KHobbits
7436009ea4 Clarify message when ignoring exempt players. 2013-10-27 23:53:24 +00:00
Chris Ward
84ce3d39d8 Fix automatic versioning when compiling with Maven 2013-10-21 13:50:17 +11:00
KHobbits
9aa88bdf8d Add a little more group based debugging. 2013-10-21 01:20:09 +01:00
KHobbits
f36f5ec0ce Add debug log entry when checking permission groups. 2013-10-20 17:45:37 +01:00
KHobbits
b1d422ba8f Round up Y position when standing on half blocks. This should address some safelogin bugs. 2013-10-20 02:25:11 +01:00
KHobbits
049577c97e Restore deleted craftbukkit jar 2013-10-20 01:36:22 +01:00
KHobbits
92a9673652 Restore original give/take Money API 2013-10-19 12:26:28 +01:00
Chris Ward
1164bbd90d [Fix] Allow someone to change their nick to different case of the same thing 2013-10-19 12:19:40 +01:00
Chris Ward
4ea629628d Use a player's real name in /balance if they are vanished 2013-10-19 12:19:40 +01:00
Chris Ward
3e9a2377a8 Call Ant from Maven (for GM) 2013-10-19 12:19:40 +01:00
Chris Ward
48261daf89 Fix null pointer exception on kits with meta 2013-10-19 12:19:39 +01:00
Chris Ward
97d176ea27 Make looping commands see vanished players properly
Make /r check player existence in the correct order
2013-10-19 12:19:39 +01:00
Chris Ward
e25e02d154 Add Maven Support 2013-10-19 12:19:39 +01:00
Chris Ward
50a9b5718c Fix double messages in targeted commands 2013-10-19 12:19:37 +01:00
Chris Ward
2615468a08 Remove .idea and *.iml from git 2013-10-18 17:32:47 +11:00
Chris Ward
298e677373 Fix /r 2013-10-18 17:23:27 +11:00
KHobbits
64e089e15b Cleanup 2013-10-18 00:07:35 +01:00
KHobbits
be31b1695d Restore getUser API 2013-10-18 00:07:34 +01:00
KHobbits
6f85761f7f Extract CommandSender to CommandSource, this should prevent Ess user object leaks. 2013-10-16 21:05:33 +01:00
KHobbits
cf9d79d24c Strip nickname prefix when doing displayname comparison. 2013-10-16 20:54:23 +01:00
Iaccidentally
f53240191f Cleanup XMPP PR 2013-10-16 20:53:30 +01:00
patjense
27ee587887 add delayed task for XMPP presence update 2013-10-16 20:52:50 +01:00
patjense
601bdbff46 add XMPP presence management stack 2013-10-16 20:52:50 +01:00
patjense
12bf4e9dcf add update for global presence handler 2013-10-16 20:52:50 +01:00
KHobbits
59b501b2b1 Clean Imports 2013-10-11 03:44:41 +01:00
KHobbits
9e20f556e1 Allow for event based test cases. 2013-10-11 03:34:41 +01:00
Iaccidentally
375caa6f9e implement GodStatusChangeEvent 2013-10-11 03:14:51 +01:00
KHobbits
cc34c02623 Update README.markdown 2013-10-07 01:34:42 +01:00
KHobbits
cfa367dfc3 Allow recolouring own name. 2013-10-05 05:34:33 +01:00
KHobbits
e1ff3542ae Cleanup 2013-10-05 03:27:40 +01:00
KHobbits
4951c204d2 Improve nick validation
Now matches nicks against userdata for conflicts
Now checks for empty string nicknames
2013-10-05 02:31:19 +01:00
KHobbits
122232a0e7 Add more API template and implement nick change event. 2013-10-05 02:11:39 +01:00
KHobbits
03368e45df Extract user match looping 2013-09-28 21:33:22 +01:00
Luke GB
e6b76cadbc Adds even more clarification to metrics opt-out 2013-09-25 00:22:11 +01:00
TheReverend403
06e3d33845 Adds clarification to metrics opt-out 2013-09-25 00:18:43 +01:00
drtshock
e853199d90 Format to the format with the formatter. 2013-09-24 09:38:30 +01:00
drtshock
f7f7c2a68b Ignore list and no tpa to self. Fixes ESS-4456 ESS-4711
List users that you ignore when no arguments are given. Otherwise state
that no players are ignored.

Don't allow users to tpa or tpahere themself. This is a problem with
people "glitching" with how essentials finds a safe location to get
inside of places they shouldn't.
2013-09-24 09:38:29 +01:00
Iaccidentally
99c73f3d67 Update to 1.6.4 2013-09-19 21:38:15 -04:00
Chris Ward
6094485992 Cleanup 2013-09-18 22:22:56 +10:00
GunfighterJ
503d39ee55 Update ItemStack reference to getTypeId() 2013-09-17 23:23:45 +10:00
Chris Ward
bd5fd2980f Require latest Bukkit RB 2013-09-17 21:08:20 +10:00
GunfighterJ
a49895278b Push latest Bukkit RB 2013-09-17 06:06:34 -05:00
GunfighterJ
8d739d6a76 Fix translation typo 2013-09-15 16:43:16 -05:00
KHobbits
3963a528b3 Fix handling max warp pages. 2013-09-10 01:42:11 +01:00
KHobbits
7c686b4b58 Fix case sensitivity on {PLAYERLIST:group} 2013-09-06 23:54:37 +01:00
KHobbits
0a17489c9c Clarify kit errors 2013-09-05 15:40:43 +01:00
KHobbits
0926da3782 Expose other plugins ban masks. 2013-09-04 07:19:30 +01:00
KHobbits
c056ba0059 Properly handle negative /clear amounts. 2013-09-04 06:35:53 +01:00
KHobbits
df5d9a4db8 Reimplement 'private' keywords. 2013-09-01 00:24:11 +01:00
KHobbits
36c61eaa06 New enum cached, lazy generated KeywordReplacer
This runs before the pager, so keywords on other pages will still be parsed.
2013-08-31 23:11:08 +01:00
Pocketkid2
9908eb0619 Use Tamed instead of horse/ocelot/wolf 2013-08-31 19:36:41 +01:00
KHobbits
64743ef428 Add support for coloured authors on books
Fixes ESS-4690
2013-08-31 13:20:36 +01:00
KHobbits
2973b1335c Add debug output to keyword replacer 2013-08-30 13:37:49 +01:00
KHobbits
52e9cc6ba1 This tp req cancel isn't needed anymore. 2013-08-30 11:05:27 +01:00
KHobbits
62b4348842 Don't waste cpu on /baltop if eco is disabled. 2013-08-28 18:00:27 +01:00
KHobbits
eca3be5cf3 Extend eco disable option to block eco lookups. This can be required to combat slow SQL economies.
This option is not recommended under normal circumstances.
2013-08-28 17:50:28 +01:00
KHobbits
3fb4d1f3bf Don't allow buying partial item sets via trade signs. 2013-08-28 13:42:08 +01:00
KHobbits
f96359e31c Add another customtext example (including one with multiple aliases) 2013-08-20 23:43:40 +01:00
KHobbits
cf79daddde Add support for {PLAYERLIST:GROUP} AND {PLAYERLIST:GROUP:<none>}
Replace <none> with what you want to show if there are no players from that group online.
2013-08-20 23:39:34 +01:00
Chris Ward
ed007589f3 Add COORDS, UPTIME and TPS keywords 2013-08-20 22:14:29 +10:00
KHobbits
b85aaea039 More colour. 2013-08-20 01:51:32 +01:00
KHobbits
3a4e4c59e4 Refresh default motd. 2013-08-19 22:00:30 +01:00
KHobbits
7f27de4bb7 Fix text file color code escaping (&&6 -> &6) Add support for color escaping in ingame chat Other formatting class cleanup 2013-08-19 21:37:44 +01:00
KHobbits
a06a81c15d New command /customtext - This command is intended to be used with bukkit.yml aliases to make custom commands. 2013-08-19 21:37:33 +01:00
KHobbits
a29e1bfe51 Add support for multiple bookmarks/chapter names
Clean up info file handling
2013-08-19 00:13:49 +01:00
KHobbits
3ccefb49c0 Fix tests 2013-08-18 22:48:13 +01:00
KHobbits
543672a2a8 Reset fall distance when toggling fly so fall damage is not accidentally applied. 2013-08-18 22:43:43 +01:00
KHobbits
8cba8da516 Fix a few issues with /list and group formatting. 2013-08-18 22:08:57 +01:00
KHobbits
3b8df2d18e Fix feed cooldown bypass permission:
Permission: essentials.feed.cooldown.bypass
2013-08-18 21:05:45 +01:00
KHobbits
b8cdd7d1f7 Fix NPE in /kill when used from console. Thanks Necrodoom 2013-08-18 21:04:19 +01:00
KHobbits
92a2244650 Add muting offline players
Permission: essentials.mute.offline
2013-08-18 21:02:47 +01:00
KHobbits
75fe543579 Allow alternative command handler to also pass tab complete. 2013-08-15 21:58:23 +01:00
Necrodoom
7bc84d6cad items.csv - try move the most common item alias to top of aliases stack
without ore aliases remove
2013-08-15 21:37:55 +01:00
KHobbits
2928e8a99f Use essentials itemdb for charge messages. 2013-08-15 05:47:23 +01:00
KHobbits
ffae86dd42 Use user object to send messages when possible. 2013-08-15 01:53:22 +01:00
KHobbits
ff41588c3b Gracefully handle botched plugin starts 2013-08-13 23:41:54 +01:00
KHobbits
66eb9202ce Fix mail sendall from console skipping first param 2013-08-13 22:01:13 +01:00
Necrodoom
f17ad2c4e7 fix config comment at heal-cooldown 2013-08-13 18:16:40 +01:00
Pocketkid2
794dd788a3 Update Commandremove.java
Fix class checking in /remove
2013-08-13 18:14:40 +01:00
Necrodoom
b3cae17cab trim and replace spaces in chapter names to always work in commands 2013-08-13 18:07:27 +01:00
KHobbits
1ac5b4230e Teleport cleanup 2013-08-13 18:06:24 +01:00
GunfighterJ
a3cae43f9f Fix NPE in /back when no previous location exists 2013-08-13 11:46:52 -05:00
KHobbits
d329d27a4f Restore safe location for /top 2013-08-13 00:55:31 +01:00
KHobbits
e9c0bd3bab Prevent inf loop when adding air to kits.
Should fix #4555
2013-08-12 00:26:51 +01:00
KHobbits
c43574eab9 Fully support numerical worth yml data. 2013-08-11 23:43:45 +01:00
KHobbits
09e8b87650 When in fly+god mode or when in creative mode, don't use safe teleport location when teleporting to other players.
Enable fly in unsafe circumstances.
This only works when teleporting within worlds for permission reasons.
2013-08-11 22:42:29 +01:00
KHobbits
ee05bf371d Update plugin.yml and add some aliases (Evonuts is going to hate me) 2013-08-11 22:10:56 +01:00
KHobbits
fb9fc579d0 Allow toggling vanish for other players
Permission: essentials.vanish.others
2013-08-11 21:48:30 +01:00
KHobbits
8b11b870b1 General cleanup.
Add optional TL param for tempban/mute time in notify message
2013-08-11 21:34:26 +01:00
KHobbits
7401608cc5 The /tpahere command now stores the location of 'here' rather than using the current players location.
Cleanup teleport logic - This also fixes exploiting /tpahere to get accesses to restricted areas.
2013-08-11 16:37:21 +01:00
KHobbits
4cfa3fc3a2 Update Mob.java 2013-08-09 04:38:57 +01:00
Necrodoom
0d9db22d81 display syntax if more than one argument to avoid confusion with command purpose
more clearly, show syntax when people try to do /money give playername amount
2013-08-05 16:04:28 +01:00
KHobbits
cc1ae2c243 Update Bukkit for 1.6.2R0.1 beta
CB: 2838 Bukkit: 2252
2013-08-05 04:15:26 +01:00
KHobbits
53faf70d10 Update Translations from crowdin 2013-08-05 00:19:44 +01:00
KHobbits
4d87033771 Force space after group in /list 2013-08-04 23:39:56 +01:00
GunfighterJ
b08aaec6c0 Remove duplicate key 2013-08-04 12:53:46 -05:00
Pocketkid2
152cf98a9d Update Potions.java
Add extra alias
2013-08-04 11:38:48 -05:00
KHobbits
12cd467277 More missing syntax. 2013-08-03 02:48:50 +01:00
KHobbits
bb7c8c308d Add missing command syntax for /spawnmob 2013-08-03 02:25:42 +01:00
Pocketkid2
c15540862d Update Commandkillall.java
Add support for horses
2013-07-29 21:40:52 +10:00
ElgarL
ea824b26f4 Fix Typo. 2013-07-28 09:10:23 +01:00
KHobbits
ddc8c07cd7 Restore vault compat 2013-07-26 00:11:37 +01:00
Iaccidentally
0ef4dfd453 Merge pull request #524 from necrodoom/patch-40
fix mobdata typo
2013-07-25 10:51:08 -07:00
Necrodoom
f50feedabb fix mobdata typo 2013-07-25 16:44:48 +02:00
GunfighterJ
eb22254564 Close inventories before opening any others 2013-07-24 16:01:17 -05:00
KHobbits
3cfde70ec6 Use the correct name in /sethome if you don't have sethome.others permission. 2013-07-23 23:39:44 +01:00
KHobbits
f251c9e694 Restore deprecated trade api
Fixes #4500
2013-07-23 22:48:32 +01:00
ElgarL
7b0d3d49f1 Allow Exception permission to override negations when in the same group. 2013-07-22 13:29:06 +01:00
ElgarL
00cc13ce1a Change to use LinkedHashSets to preserve ordering.
Fixes an issue with populating bukkit perms in the wrong order.
Fix wildcard negation in parent groups.
2013-07-22 13:02:24 +01:00
KHobbits
298da19334 Fix max radius. 2013-07-21 00:04:04 +01:00
okamosy
e3c83be37e Refactored and cleaned up SpawnMob. Added context-aware help /spawnmob <mob>: 2013-07-20 21:29:13 +01:00
KHobbits
c1e39c7007 Show if a IP is ip-banned on /seen <ip> 2013-07-19 02:25:50 +01:00
KHobbits
59515aed94 Cleanup worth and sell messages 2013-07-19 00:55:21 +01:00
snowleo
4eef8b5e84 Can't sell negative amount of items. 2013-07-19 01:01:52 +02:00
okamosy
8aac502ab6 Added horse armor /spawnmob horse:armor<iron|gold|diamond> 2013-07-17 23:32:25 +01:00
okamosy
3aca9f793b Added saddles to pigs and horses /spawnmob pig:saddle /spawnmob horse:saddle 2013-07-17 23:31:37 +01:00
KHobbits
4483ff40b4 Log notice when chat ignore is blocked by another plugin. 2013-07-17 23:26:26 +01:00
KHobbits
e8d9951ee8 Add scaling object cap for usermap, prevent huge memory usage, also config file configurable. 2013-07-17 01:56:27 +01:00
okamosy
bf675b230e Added horses to SpawnMob /spawnmob horse:<color><variant><style><chest> 2013-07-16 23:36:11 +01:00
KHobbits
ba6fd95247 Fix radius logic 2013-07-15 23:15:35 +01:00
Necrodoom
419f51636a Max near radius 2013-07-15 23:10:55 +01:00
KHobbits
f6f71126a1 Add missing param in /remove 2013-07-15 02:43:23 +01:00
KHobbits
1f3e52a4b9 Better handle esschat/GM reloading during async events. 2013-07-15 00:47:17 +01:00
KHobbits
0bfe1ec1de Update Craftbukkit
CB: 2814 Bukkit: 1792
2013-07-14 22:27:57 +01:00
KHobbits
00463a7899 Try to restore basic api functionality 2013-07-14 13:00:03 +01:00
KHobbits
11f87eccb0 Tidy and slightly expand user API 2013-07-14 12:41:27 +01:00
KHobbits
0d2dea41e3 Fix worth display bug 2013-07-14 12:09:49 +01:00
KHobbits
8009c1539a Fix local chat spy tag order. 2013-07-14 01:20:36 +01:00
KHobbits
29ea24f715 Throw syntax error instead of "For input string" 2013-07-14 01:07:59 +01:00
KHobbits
a14104c529 Add support for /worth all and /worth hand 2013-07-14 01:03:08 +01:00
KHobbits
d044ba2fb9 Whoops, wrong event. 2013-07-13 18:56:18 +01:00
KHobbits
5eb3d9fa42 Wrap ItemDb accessors and move Item string matching to itemdb class. 2013-07-13 18:52:53 +01:00
KHobbits
fc63f63de6 Fix local message when no players are in the area
Allow any translation key to be silenced by blanking it in locale file
2013-07-13 18:46:26 +01:00
Iaccidentally
cd51d718ba [API] flip! (╯°□°)╯︵ ┻━┻ 2013-07-13 13:40:46 -04:00
Iaccidentally
200ad81862 [API] fix implementation? 2013-07-13 12:52:08 -04:00
Iaccidentally
c05ad0458f Merge branch 'API' of https://github.com/essentials/Essentials into API 2013-07-13 12:41:31 -04:00
Iaccidentally
ecd2484cb9 [API] fix other modules to use new packages 2013-07-13 12:40:50 -04:00
KHobbits
43c2c02336 Fix failing XMPP build. 2013-07-13 17:36:35 +01:00
KHobbits
adb5189d42 Add 'No one listening' message stub, will be empty by default and thus not sent. 2013-07-13 17:31:14 +01:00
KHobbits
ef3b052c64 Remove old chat hook
Use Bukkit API for local chat handling
Implement localChatSpy event
2013-07-13 17:25:58 +01:00
Iaccidentally
f5624d4cb6 [API] remove setters 2013-07-13 11:53:52 -04:00
Iaccidentally
624f7ab9f6 [API] Event framework 2013-07-13 11:48:05 -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
Iaccidentally
3d0f0062a9 Merge branch '2.x' of https://github.com/essentials/Essentials into API 2013-07-13 10:38:28 -04:00
Necrodoom
ab359f678a fix mute message when chatting
deny /mail if muted
2013-07-12 15:22:48 +01:00
GunfighterJ
406c9e807e Add horse to entity spawn protection blacklist 2013-07-11 12:37:09 -05:00
KHobbits
d858555263 Don't cast sender to User. 2013-07-11 09:20:52 +01:00
KHobbits
72fd893733 Prevent speed from hitting absolute zero. 2013-07-11 08:58:22 +01:00
KHobbits
9f015c1bda Update TL files from Crowdin, this commit resets untranslated English to new colour scheme. 2013-07-10 22:36:27 +01:00
KHobbits
61ed77b60c Remove unused TL Keys 2013-07-10 22:14:23 +01:00
Iaccidentally
e57aa0e088 tweak default setting for max nick length 2013-07-10 11:01:49 -04:00
Iaccidentally
2ad346e84c [FEATURE] Add configurable max nick length 2013-07-10 10:48:14 -04:00
KHobbits
aa65a2b349 Update CB to 2808 2013-07-10 00:09:48 +01:00
KHobbits
499a1aee7f Fix TL handling with escaped ' marks. 2013-07-10 00:03:14 +01:00
KHobbits
3377e3483d Fix user comparison. 2013-07-09 09:08:26 +01:00
GunfighterJ
427d8cc4e0 Implement abstract methods 2013-07-08 19:28:24 -05:00
GunfighterJ
4e9a42671f Update to 1.6.2, adds new potion effect types 2013-07-08 19:22:38 -05:00
ElgarL
132d56760b Fix Cyclic mirroring test (silly me) 2013-07-08 16:01:34 +01:00
KHobbits
a369f9aabb Standardize translation formatting. 2013-07-07 15:01:00 +01:00
KHobbits
2f4a19a5b8 Update Polish and Swedish translations from crowdin 2013-07-07 14:54:38 +01:00
KHobbits
6d360421f8 Translation cleanup
Allow '' in non format keys
Update French translation from crowdin
2013-07-07 14:52:31 +01:00
Gabriel D
03a10e80b9 Update some new text 2013-07-07 14:13:43 +01: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
3f5e2ad85a Whoops, we shouldn't be leaking the user object. 2013-07-07 11:51:12 +01:00
mrarroyo
817174e18f Fix punctuation 2013-07-07 02:17:25 +01:00
Chris Ward
df2ab974bc Merge pull request #509 from necrodoom/patch-31
add horse egg
2013-07-02 02:25:49 -07:00
Necrodoom
423a722152 add horse egg 2013-07-02 12:20:20 +03:00
KHobbits
34f6487ba2 Add carpet to safe teleport materials. 2013-07-02 08:02:01 +01:00
KHobbits
522c3e85b2 Add command logging for CommandBlocks and other console types. 2013-07-02 07:16:42 +01:00
Iaccidentally
188a214de9 Merge pull request #503 from necrodoom/patch-26
update items.csv to Minecraft 1.6
2013-07-01 19:48:11 -07:00
GunfighterJ
d0795fc3e7 Update Essentials for Bukkit 1.6.1-R0.1-SNAPSHOT 2013-07-01 21:38:27 -05:00
Necrodoom
95a2fce9a6 update items.csv to Minecraft 1.6 2013-07-01 13:03:24 -05:00
GunfighterJ
d6ef0e1e50 Close the reader 2013-06-30 07:47:33 -05:00
GunfighterJ
f6fd0bdb32 Force reading in UTF-8 from .txt files 2013-06-30 07:40:24 -05:00
Tyler Blair
cb052e690c Update Plugin Metrics to R7 2013-06-29 18:05:42 +01:00
Iaccidentally
6af622b6b1 [API] Fix package naming 2013-06-28 15:30:47 -04:00
Iaccidentally
dded3cae14 [API] fix references 2013-06-28 15:26:23 -04:00
Iaccidentally
6a3c5694ac [API] Cleanup 2013-06-28 15:21:49 -04:00
Iaccidentally
90c1df7cc7 [API] Remove some unneeded dependencies 2013-06-28 14:58:45 -04:00
Iaccidentally
ff8c7b3315 [API] A basic example of a custom event, more to come. 2013-06-28 14:22:18 -04:00
KHobbits
0e43233e46 Add {TEAMPREFIX} {TEAMSUFFIX} and {TEAMNAME} to chat formatting. 2013-06-28 17:12:01 +01:00
KHobbits
db234b9837 Force repair inventory refresh. 2013-06-28 14:14:43 +01:00
KHobbits
42b77864cd Minor colour tweak 2013-06-28 13:05:56 +01:00
KHobbits
f485cbc48b Make the paging logic even more complicated. 2013-06-28 01:05:56 +01:00
KHobbits
0292cb59cd Drop messageFormat for simple string replace, remove duped ' marks. 2013-06-27 09:33:35 +01:00
KHobbits
3e519f95d5 Don't drop oversized stacks on the ground if player doesn't have oversized permission. 2013-06-26 21:44:34 +01:00
KHobbits
18d0183364 [Fix] Fix toggle syntax in plugin.yml 2013-06-26 08:57:26 +01:00
KHobbits
96cf363567 Merge pull request #504 from necrodoom/patch-30
[Fix] Fix socialspy toggle with no on/off param.
2013-06-26 00:51:51 -07:00
Necrodoom
cfc6ed9364 fix socialspy toggles 2013-06-26 09:56:56 +03:00
KHobbits
3de3f00b11 Let's make the default group colour orange. 2013-06-26 01:22:18 +01:00
KHobbits
c69c78f15c Don't automatically convert {chatparms} to [chatparams] 2013-06-25 18:04:31 +01:00
Necrodoom
0fdd367098 update items.csv to Minecraft 1.6 2013-06-25 19:04:29 +03:00
KHobbits
1a49cdd140 Fix null values. 2013-06-25 16:34:17 +01:00
ZerothAngel
cd4bdb83d4 Add group/prefix/suffix support for zPermissions. 2013-06-25 16:24:23 +01:00
Luuk Jacobs
f6fc9777b5 Reword some things, minor fixes and add punctuation.
more tiny fixes
minor unicode fix
2013-06-25 16:20:21 +01:00
KHobbits
9edc68bb2b Merge branch '2.x' of github.com:essentials/Essentials into 2.9 2013-06-25 16:00:32 +01:00
KHobbits
8f1f68f2be Merge pull request #502 from afistofirony/patch-1
Changing a spawner should update its BlockState.
2013-06-25 07:58:46 -07:00
KHobbits
c0ed8649d0 Add missing variable. 2013-06-25 15:09:50 +01:00
Sahir
f26466831a Changing a spawner should update its BlockState. 2013-06-25 17:07:43 +04:00
KHobbits
c92ae00f9f Update KeywordReplacer.java 2013-06-24 13:31:07 +02:00
KHobbits
66355f0ead Update info.txt 2013-06-24 13:29:28 +02:00
KHobbits
eeb9c13276 Merge pull request #499 from mozoa/patch-1
Update messages_nl.properties
2013-06-23 15:41:51 -07:00
KHobbits
9300529113 Merge pull request #501 from theudis/patch-6
Update messages_fr.properties
2013-06-23 15:41:30 -07:00
theudis
19e4acfc97 Update messages_fr.properties 2013-06-24 00:18:58 +03:00
KHobbits
1cb9ddf9fe [Feature] Allow the placing of spawners with predefined network id's (/i spawner:50)
[Permission] essentials.spawnerconvert.<mobname> - Allow the placing of specific mobspawners with premade network id's.
2013-06-23 16:11:24 +01:00
mozoa
c801bc0173 Update messages_nl.properties
Reworded some strings
and changed the order of words
2013-06-23 16:49:08 +02:00
KHobbits
88d025cd0f Merge pull request #498 from mozoa/patch-1
Added /ci lines
2013-06-22 16:49:48 -07:00
mozoa
dc1469105b Update messages_nl.properties 2013-06-22 22:51:38 +03:00
mozoa
d3e0966b3f Update messages_nl.properties
Added new CI lines
bit indifferent about line 543 and 544
2013-06-22 22:49:26 +03:00
KHobbits
a15e0b3875 [Feature] Expand /ci to allow removing certain amounts, and breakdown on the items removed. 2013-06-22 17:36:35 +01:00
KHobbits
52ba151b81 Clean up exception types. 2013-06-22 16:33:22 +01:00
KHobbits
aa6c6b4d48 Fix missing Unicode in NL TL 2013-06-21 11:23:01 +01:00
KHobbits
7648e38ec2 Reduce restrictions on same item trading, so only identical items are blocked. 2013-06-20 21:14:28 +01:00
mozoa
a67520477b Update NL locale 2013-06-20 21:07:58 +01:00
KHobbits
f8fb8935d7 [Fix] Don't throw the wrong error message when using group limited kit signs. 2013-06-19 21:20:58 +01:00
GunfighterJ
8ae0ea98a3 Merge pull request #489 from necrodoom/patch-23
fix permission check typo (thanks to #4365)
2013-06-18 11:01:17 -07:00
Necrodoom
5338f6b706 fix permission check typo (thanks to #4365) 2013-06-18 20:57:30 +03:00
KHobbits
fdb5d85ba5 Merge pull request #488 from necrodoom/patch-21
fix typo in eco warning
2013-06-17 08:19:59 -07:00
Necrodoom
2b4b1520d3 fix typo in eco warning 2013-06-17 16:05:45 +03:00
KHobbits
07bcd17e0f Block external access to unsupported saveConfig() method. 2013-06-17 01:08:42 +01:00
KHobbits
8fb91c5a61 Allow new lines and add secure broadcast keywords. 2013-06-16 01:18:35 +01:00
KHobbits
aa6d85eacc Cleanup broadcast, allow limited keywords in. 2013-06-16 01:07:16 +01:00
KHobbits
f5986194aa Clarify 'permission-based-item-spawn' config setting. 2013-06-16 00:05:27 +01:00
KHobbits
b646bda9d2 Update to 1.5.2 RB:
Bukkit #1776 CraftBukkit #2788
2013-06-15 11:53:47 +01:00
ElgarL
32b466bb3b Tidy imports 2013-06-14 08:47:10 +01:00
ElgarL
0041492f42 Merge pull request #487 from necrodoom/patch-20
add recursive permission adding/removing
2013-06-14 00:39:58 -07:00
Necrodoom
27d88a6c56 remove excess return false lines since elgarl doesnt like them 2013-06-14 10:38:54 +03:00
Necrodoom
981d620349 fix javadoc 2013-06-14 10:34:55 +03:00
Necrodoom
c902155d6e change checkPermissionExists to how Elgarl wants it 2013-06-14 10:30:03 +03:00
Necrodoom
6ea835e96f change ' strip checks 2013-06-14 10:25:41 +03:00
Necrodoom
5fdac7588e Update Changelog.txt 2013-06-14 10:01:39 +03:00
Necrodoom
9e7320ad16 Update plugin.yml 2013-06-14 10:00:43 +03:00
Necrodoom
8dc79c2d37 add recursive permission adding/removing
also other minor fixes
2013-06-14 10:00:11 +03:00
KHobbits
fe86f3a01d Reset suffix on /nick even if op and prefix/suffix are disabled. 2013-06-13 09:18:47 +01:00
KHobbits
ae2a03d80c Merge pull request #485 from necrodoom/patch-29
no permissions is not an error, so dont output it as a warning
2013-06-12 02:59:55 -07:00
Necrodoom
e4d7aacc5d no permissions is not an error, so dont output it as a warning 2013-06-12 12:41:15 +03:00
KHobbits
129fd53d5a Merge branch 'temp1' into 2.9 2013-06-11 20:50:24 +01:00
KHobbits
6bf57de64d Merge branch 'release' of github.com:essentials/Essentials into 2.9 2013-06-11 20:46:28 +01:00
Iaccidentally
f1eae9be6f Cleanup imports 2013-06-11 20:45:12 +01:00
KHobbits
a77c2d6d95 Restore support for replacing CAPITAL colour codes. 2013-06-11 16:38:24 +01:00
KHobbits
c476471978 Don't look up valid looking IP's in the player database. 2013-06-09 23:10:02 +01:00
Iaccidentally
8755935fcb Remove old permissions handlers that are no longer used. This fixes an issue where new versions of Bpermissions would be detected as old. 2013-06-09 14:38:27 -04:00
KHobbits
9976cc847f Allow use of deprecated teleport function through interface. 2013-06-09 13:38:09 +01:00
theudis
56f86c9ae4 Update messages_fr.properties
Small changes in what I had done previously.
2013-06-09 03:09:20 +01:00
Necrodoom
bdb5d095ca Fix arg length checks on /exp 2013-06-09 03:07:35 +01:00
cexikitin
f38ed576c5 Alert give sender that the user was unable to receive all the items. 2013-06-09 03:05:40 +01:00
KHobbits
09f67c9723 Split util classes. 2013-06-08 22:31:19 +01:00
KHobbits
98e427e831 Cleanup ITarget 2013-06-08 21:43:42 +01:00
KHobbits
ac6b74887f Turn Target into a real class. 2013-06-08 21:40:02 +01:00
KHobbits
7276bcccab Trapdoors should be treated as half blocks, not transparent blocks. 2013-06-08 21:26:11 +01:00
KHobbits
a7b62c65b8 Teleport invulnerability should trigger on respawn as well as normal teleport. 2013-06-08 21:06:33 +01:00
KHobbits
f48ed6988d Essentials API cleanup and teleport possession fixing. (UNSTABLE) 2013-06-08 19:34:14 +01:00
KHobbits
b8300cc35a Throw a little testing on toggle logic. 2013-06-08 16:33:30 +01:00
KHobbits
a3e6996ef9 Try and make toggles DRYer without loosing command flow.
Allow socialspy to match multiple players.
2013-06-08 15:13:51 +01:00
KHobbits
34daa5691c Allow spawning zombies without the trademark gold boots.
Also limit armor to zombies and skeletons.
2013-06-05 03:15:12 +01:00
KHobbits
0457705850 Fix unit tests. 2013-06-02 17:56:48 +01:00
KHobbits
5d5fee4612 Attempt to fix /seen times on vanish. 2013-06-02 17:45:56 +01:00
KHobbits
43f4a69760 Mute and sudo should check for essentials.vanish.interact permission. 2013-06-02 16:09:56 +01:00
KHobbits
55cee73a48 Allow spawning zombies with swords too. 2013-06-02 00:09:12 +01:00
KHobbits
51f554827c [Feature]Extend spawning mob meta to allow more customized spawning:
/spawnmob (skeleton|zombie|pigzombie):(diamond|iron|gold)armor
2013-06-02 00:02:40 +01:00
KHobbits
d6756a2605 [Fix] Set some default mob data.
Fixes skeletons spawning without bows.
2013-06-01 23:33:31 +01:00
KHobbits
b065f4a05a Update Essentials spawn to use new kit params. 2013-05-27 02:29:28 +01:00
KHobbits
867bfbf1b8 Better handle kit item casting. 2013-05-27 02:25:30 +01:00
KHobbits
7fe83dbd91 Ignore extra spaces in kit config. 2013-05-26 23:53:39 +01:00
KHobbits
1a4c2e8484 Exempt [repair] signs from 'essentials.repair.all' permissions check. 2013-05-26 22:00:35 +01:00
KHobbits
84874c9855 Update inventory when closing ghost-dupe-able inventory, to remove ghost items. 2013-05-26 18:21:19 +01:00
KHobbits
6512a53a3f Reduce duplicated broadcast code. 2013-05-26 17:58:04 +01:00
KHobbits
423c8c54dc Simplify player matching. 2013-05-26 17:37:11 +01:00
KHobbits
160a1a04eb Standardize /getpos and /whois to use essentials.vanish.interact like all other commands. 2013-05-26 17:20:03 +01:00
KHobbits
88c5b64694 GeoIP already has a perm, doesn't need hidden behind essentials.seen.extra as well. 2013-05-26 16:52:25 +01:00
KHobbits
19451c151e Show teleport cancel messages to tpa user. 2013-05-26 16:49:11 +01:00
KHobbits
e4d041b9b0 Fix /helpop for console use. 2013-05-26 16:23:36 +01:00
KHobbits
3bcd3390fe [Fix] Fix vanished player matching in: /seen /give /burn /nuke /tpall /tpaall 2013-05-26 16:02:40 +01:00
KHobbits
35783ee429 Forgot to push Essentials spawn changes. 2013-05-24 00:10:39 +01:00
KHobbits
66911bb0a9 Improve hidden player matching.
Replace essentials.teleport.hidden with essentials.vanish.interact
Fix perm checks in tpall and tpaall
2013-05-23 22:59:09 +01:00
KHobbits
d48c342e37 Fixing feed messages. 2013-05-23 22:12:54 +01:00
ElgarL
4da70254ff Check subgroup permissions with an equal priority so no one subgroup is higher ranked than another. 2013-05-22 10:37:24 +01:00
KHobbits
5c05870490 Improve user matching 2013-05-20 18:50:14 +01:00
KHobbits
d76fe946b7 Don't throw NPE on broken sign state, just allow block to break. 2013-05-19 01:21:21 +01:00
KHobbits
a738e49e3c Default chat formatting should strip all format codes, not just colours. 2013-05-19 01:03:54 +01:00
KHobbits
9dc6e7ad1e Add indication of when kit's cannot be used yet, in the /kit output. 2013-05-18 23:27:41 +01:00
KHobbits
293406a603 Tidy up /gc's TPS output. 2013-05-18 21:42:02 +01:00
KHobbits
727c53eb2b [Feature] Add hunger level to /whois 2013-05-18 18:20:06 +01:00
KHobbits
274ad06665 Fix null when trying to tempban players in console for times longer than max ban. 2013-05-18 17:57:05 +01:00
KHobbits
5e6f6b2482 Tweak /baltop to not show displaynames on vanished players. 2013-05-12 21:19:54 +01:00
KHobbits
29c9a46c2f Tiny listener optimizations. 2013-05-12 20:59:07 +01:00
KHobbits
6d317fd26d Small tweak to warning display and make config variable 'economy-lag-warning' set in ms not ns. 2013-05-12 16:31:40 +01:00
KHobbits
8ebe55a294 Make the lag warning configurable, useful to debug economy lag on larger servers. 2013-05-12 16:10:41 +01:00
KHobbits
af2c514f2a Throw console warning on slow economy api call. 2013-05-12 04:12:34 +01:00
GunfighterJ
3042151fee [Fix] Check initial direction when looking for a safe teleport spot 2013-05-10 11:21:39 -05:00
KHobbits
59f67acfd0 Don't treat AFK players as god mode when dealing with food regen. 2013-05-09 17:44:10 +01:00
snowleo
7051801a85 Update ItemDb.java 2013-05-08 00:53:37 +03:00
snowleo
0d02b91506 Doesn't need this 2013-05-08 00:52:39 +03:00
KHobbits
5f6cca83ce [Feature] Withdraw from trade signs without dropping items as overflow. [EXPERIMENTAL] 2013-05-06 23:09:31 +01:00
KHobbits
ed5743147b Add some sign debugging to /ess debug to help track down charging issues. 2013-05-05 22:37:28 +01:00
KHobbits
1bb7946e13 Couple more bits of Eco cleanup 2013-05-05 20:05:28 +01:00
KHobbits
9ec1a6b78f Fix /sell to handle zero priced items again. 2013-05-05 19:59:35 +01:00
snowleo
76a96d1004 Make it compatible with Factions again. 2013-05-05 19:00:21 +03:00
snowleo
b49aaee66d Catch both exceptions in EssentialsConf and valueOf instead of new 2013-05-05 11:55:39 +02:00
snowleo
0d34b9ae9f Cleanup 2013-05-05 11:42:53 +02:00
snowleo
6044cca54f ECONOMY MADNESS? THIS IS … FIXED 2013-05-05 11:41:19 +02:00
snowleo
aaebb6143e fix NPE in teleport code 2013-05-05 11:08:49 +03:00
KHobbits
c4ac744d35 Further economy cleanup 2013-05-05 08:03:06 +01:00
KHobbits
162b67aaa6 Cleanup player argument matching in loops
Cleanup ess cleanup timestamp matching
2013-05-05 07:15:33 +01:00
KHobbits
2d70bb19f7 Economy Madness 2013-05-05 05:12:17 +01:00
KHobbits
801acbb004 Trim stored precision to below that of a double, to prevent rounding issues. 2013-05-05 01:23:07 +01:00
theudis
aeb1b4601c Update messages_fr.properties 2013-05-04 21:56:32 +01:00
KHobbits
f5b32f51aa Update CS translation with some extra TL keys from tommymortago 2013-05-04 19:34:55 +01:00
KHobbits
0b20055f60 Sorted TL files 2013-05-04 19:22:44 +01:00
pa001024
2f30064ab4 update zh-locate 2013-05-04 18:32:44 +01:00
Necrodoom
a65d0db57d Throw invalid kit message on invalid delay 2013-05-04 18:26:34 +01:00
KHobbits
479dad9966 cleanup 2013-05-04 18:22:55 +01:00
KHobbits
b7acccfc8b [Feature] Make /kit list kit costs if any are set. 2013-05-04 18:11:35 +01:00
KHobbits
fbcfd4948b Merge pull request #465 from skmedix/patch-1
Update Polish translation
2013-05-04 08:55:18 -07:00
KHobbits
cdbdb5e8e9 [Permission] Add essentials.repair.all permission, which is required to unlock /repair all
Also make it to /repair defaults to hand.
2013-05-04 16:06:06 +01:00
KHobbits
6e20275cc7 [Fix] Allow Feed to be used via console
Throw events when modifying heath or food levels.
2013-05-04 16:04:59 +01:00
snowleo
aac9e4884d Remove User instance from Teleport class 2013-05-03 01:53:54 +02:00
snowleo
ddb3b13931 Don't trust File.length() 2013-05-03 01:26:51 +02:00
snowleo
c62f762724 Do not keep hard references to User objects 2013-05-03 01:15:02 +02:00
snowleo
4bdeb1324d *angry eyes* 2013-05-03 00:25:07 +02:00
snowleo
555a300378 Fix cleanup to not hold Users in memory. 2013-05-03 00:12:40 +02:00
Iaccidentally
ebc6b14284 Update libs for 1.5.2 :: Minimum CB version now 2763 2013-05-02 11:54:05 -04:00
SKmedix
041fa8537d Update messages_pl.properties
Changelog:
---
* Added:
kitError2 (216)
kitNotFound (536)
socialSpy (537)
setBal (538)
insufficientFunds (540)

* Fixed:
backUsageMsg (21)
banFormat (28)
bedMissing (30)
connectedPlayers (58)
downloadingGeoIp (91)
fullStack (125)
geoIpUrlEmpty (131)
geoIpUrlInvalid (132)
healOther (148)
itemSpawn (200)
jailReleased (206)
jailSentenceExtended (208)
jailSet (209)
kickedAll (213)
kitInvFull (221)
kitOnce (222)
markMailAsRead (239)
matchingIPAddress (242)
messageTruncated (246)
nickChanged (272)
removed (376)
repairNone (381)
teleportAll (419)
tempBanned (434)
thunderDuration (437)
timeSet (442)
totalWorthAll (446)
totalWorthBlocks (447)
tradeSignEmpty (450)
youAreHealed (520)
youHaveNewMail (521)
balanceOther (527)
2013-04-30 20:34:33 +03:00
Iaccidentally
7bbceed491 Minor cleanup 2013-04-30 12:57:38 -04:00
Iaccidentally
7a46de6b02 Fix some tl keys :: update Portuguese translation 2013-04-30 12:26:09 -04:00
Iaccidentally
1ab2a51550 API & misc cleanup 2013-04-30 12:25:25 -04:00
Iaccidentally
42dc6a2e07 Merge pull request #460 from main--/2.9
Made the "throws" declaration of getWarps() more specific
2013-04-30 08:30:41 -07:00
KHobbits
9ba9223632 Support /me in console 2013-04-30 02:24:30 +01:00
KHobbits
c4173c0486 Allow powertool to be set from console. 2013-04-30 02:18:22 +01:00
KHobbits
049886797b Fix tests. 2013-04-30 01:50:02 +01:00
KHobbits
a43cbe061a Move spawnmob.stack perm check to the right place. 2013-04-30 01:37:39 +01:00
KHobbits
9d2358ed4d [Fix] Stacked mobs count towards spawnmob-limit count. 2013-04-30 01:04:40 +01:00
KHobbits
7913cfdb3c Fix currency rounding up. 2013-04-30 00:35:39 +01:00
KHobbits
137d0df9dc Fix TL messages. 2013-04-30 00:18:53 +01:00
KHobbits
d425ab5f93 Fix Eco take bug and fix NPE 2013-04-30 00:07:28 +01:00
KHobbits
012741fea6 Merge branch '2.9' of github.com:essentials/Essentials into 2.9 2013-04-29 23:50:49 +01:00
GunfighterJ
006f996283 Remove ArrayListInput
Formatting
2013-04-29 14:04:59 -05:00
main()
538a2425c5 Made the "throws" declaration of getWarps() more specific
It is very difficult to handle an Exception thrown by an API method when you don't have any way to **programatically** (without dirty stuff like string comparisons, so the message is not enough) distinguish errors and find out what's going on.
2013-04-29 20:29:42 +02:00
GunfighterJ
79bdd8a212 Add keyword replacements in kits
Add SimpleTextInput constructor for lists
Variable refactoring for clarity.
2013-04-29 06:31:08 -05:00
Iaccidentally
28cbac6610 cleanup last commit a bit 2013-04-28 17:22:11 -04:00
Iaccidentally
0a03696983 [API] Add a warp api, with future 3.x support :: minor cleanup 2013-04-28 16:23:45 -04:00
KHobbits
f0ab66c4c6 Fix ZH TL messages 2013-04-28 14:18:19 +01:00
pa001024
57184f01e9 Add China/Hong Kong/Taiwan Translations 2013-04-28 14:12:21 +01:00
Iaccidentally
02df03a4b1 [CHANGE] Rewrite eco command with better logic :: the command will now attempt to do exactly what it is told, with respect to the minimum balance :: fix missing messages 2013-04-27 23:44:23 -04:00
KHobbits
3396cf6e02 [Fix] Try singular and plural entity names in /remove. 2013-04-28 04:26:39 +01:00
Necrodoom
e60f17bb53 Fix radius in /remove and add world.
Fix SocialSpy
Fix /killall world argument.
2013-04-28 04:20:28 +01:00
Necrodoom
eb0c71984c [Feature] Add /socialspy other 2013-04-28 03:44:24 +01:00
KHobbits
865b581d06 Update Polish translation by skmedix 2013-04-28 03:31:18 +01:00
Necrodoom
b093111920 [Fix] Output proper message if typo'd kit 2013-04-28 03:22:31 +01:00
snowleo
c55e52539e Update Commandgc.java 2013-04-23 08:57:22 +03:00
snowleo
1dfad57c6f Derp, still need currentTime 2013-04-23 08:55:02 +03:00
snowleo
6148583fb2 Fix tps after Timer changes 2013-04-23 08:51:25 +03:00
snowleo
9160410a50 Allow to forceSave conf files 2013-04-23 00:47:45 +02:00
snowleo
2588e20140 Delayed write to file (experimental) 2013-04-22 23:31:11 +02:00
U-SFX\wardcg
e291633ac8 Merge remote-tracking branch 'origin/groupmanager' into 2.9 2013-04-23 01:02:31 +10:00
KHobbits
dfc62bca76 Minor TP and timer tweaks. 2013-04-22 00:11:13 +01:00
KHobbits
f48871ff29 Attempt to smooth out timer usage.
Add extra sign metrics.
2013-04-21 23:39:50 +01:00
snowleo
c2eb7b05b3 Restrict EssentialsTimer to 10ms execution time 2013-04-22 01:23:21 +03: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
Iaccidentally
62942bdb3d Merge pull request #453 from necrodoom/patch-20
[FIX] ID 18, 29, 33 invalid damage values and more
2013-04-19 10:32:47 -07:00
ElgarL
e8c2a9792f Merge pull request #452 from evonuts/groupmanager
Minor grammatical changes to config.yml
2013-04-19 09:57:16 -07:00
Necrodoom
f1bc7a305a [FIX] ID 18, 29, 33 invalid damage values and more
expand IDs 98:1, 98:2, 98:3
2013-04-19 19:43:22 +03:00
GunfighterJ
fd0134227c Fix NPE on invalid enchant 2013-04-19 10:06:43 -05:00
evonuts
59c833aa9e Minor grammatical changes to config.yml 2013-04-19 12:13:09 +12:00
Iaccidentally
f6e2db1eda [Feature] Add a blacklist for what dispensers can dispense to antibuild 2013-04-16 17:01:01 -04:00
Iaccidentally
eeb31e054f [UPDATE] Update to 1.5.1-r0.2 beta build 2013-04-16 16:59:36 -04:00
Iaccidentally
4629cad99b Clean up last commit 2013-04-16 16:16:07 -04:00
Iaccidentally
5e360995eb [FIX] Update user activity when shooting a bow 2013-04-16 15:58:13 -04:00
GunfighterJ
a72777d043 Allow permission control of stacked mobs
Adds essentials.spawnmob.stack to allow stacking of more than one mob using the /spawnmob command

Adds https://www.assembla.com/spaces/essentials/tickets/4050
2013-04-14 15:01:25 -05:00
snowleo
39d66b1c43 Changing that name too, thanks jomp16 2013-04-14 12:30:30 +03:00
snowleo
9a3295439b Threading Fix 2013-04-14 04:44:16 +03:00
KHobbits
656a40abb2 Remove duplicate perm. 2013-04-13 23:50:17 +01:00
KHobbits
7e80f440ca Check threading on backup init. 2013-04-13 23:10:09 +01:00
GunfighterJ
e353ec7f66 Merge pull request #438 from GunfighterJ/2.9
Add Romanian translation
2013-04-08 17:27:16 -07:00
GunfighterJ
bacb84a943 Add Romanian translation 2013-04-06 17:13:59 -05:00
GunfighterJ
bac2b3f878 [Feature] pweather command 2013-04-06 16:20:12 -05:00
snowleo
8f41cc07e3 Still need that check 2013-04-06 18:40:42 +03:00
snowleo
4f033d8073 Math fail 2013-04-06 18:38:49 +03:00
snowleo
284d7a23ca Fix § at end of line 2013-04-06 18:37:13 +03:00
KHobbits
8777410d30 Balance others message. 2013-04-06 05:54:44 +01:00
KHobbits
3356db080a Fix group name when using wildcard group definitions. 2013-04-06 05:05:28 +01:00
ementalo
55e8aa765b Remove GB from main build.xml 2013-04-04 20:49:55 +01:00
ementalo
d2ee2e3646 [update] Remove GroupBridge 2013-04-04 20:45:09 +01:00
KHobbits
d9a6974ae2 Missing file update. 2013-04-04 08:45:08 +01:00
KHobbits
641fbca40c Update Bukkit for 1.5.1-R0.1 Beta.
CB: 2735 Bukkit: 1741
2013-04-04 08:39:57 +01:00
Paul A.
11fafb5339 Merge pull request #435 from GunfighterJ/2.9
[Fix] NPE on ptime from console
2013-04-02 08:31:42 -07:00
GunfighterJ
e4b04db412 [Fix] NPE on ptime from console 2013-04-02 10:21:20 -05:00
Iaccidentally
93b76446f5 Merge pull request #431 from GunfighterJ/2.9
Show Geolocation in /seen
2013-04-01 14:20:42 -07:00
GunfighterJ
e3183e66df Show Geolocation in /seen
Refactor argument for clarity
2013-04-01 16:00:09 -05:00
KHobbits
9d1f25c455 Block sign interact if player is dead. 2013-04-01 05:23:04 +01:00
KHobbits
9fe226b79a Merge pull request #428 from necrodoom/patch-15
readd "forest" and "jungle"
2013-03-31 08:27:26 -07:00
Necrodoom
228ecd2a5c readd "forest" and "jungle" 2013-03-31 18:26:38 +03:00
KHobbits
4eb6c9b54f For group overflow, add a little colour. 2013-03-30 02:40:20 +00:00
KHobbits
c093b6e7c2 Use original casing in config file group name. 2013-03-30 02:36:09 +00:00
Iaccidentally
757a41f890 [FIX] add itemframe support to remove 2013-03-29 22:20:54 -04:00
KHobbits
8427b41e30 Prevent sign healing when the player is recently dead. 2013-03-29 14:37:30 +00:00
SKmedix
159cbba809 Update messages_pl.properties
Update Polish translation.
2013-03-29 03:19:43 +00:00
Necrodoom
8604debc4e [Fix] Allow console to afk others 2013-03-29 03:16:18 +00:00
Necrodoom
22efa3e000 wipe too general log name aliases 2013-03-29 03:13:03 +00:00
Necrodoom
578576e317 [Fix] Sudo allowed on vanished players. 2013-03-29 03:10:45 +00:00
Necrodoom
98aa303ff5 prevent confusion at /ci code 2013-03-29 03:04:54 +00:00
KHobbits
c857832759 Spacing. 2013-03-29 03:01:53 +00:00
KHobbits
aab6af768d Fixing casing and formatting issues in /list 2013-03-29 02:59:55 +00:00
KHobbits
879560092f Merge pull request #423 from kukelekuuk00/patch-1
[Fix] Strip colourcodes from groups in /list (internal only)
2013-03-28 19:50:50 -07:00
ElgarL
411b4e2b8f another string fix. 2013-03-28 16:08:59 +00:00
ElgarL
519785d09f More Necrodoom fixes. 2013-03-28 15:38:18 +00:00
ElgarL
231f9d49c1 Fix loops. 2013-03-28 13:10:17 +00:00
ElgarL
e15a8c50d6 Merge pull request #371 from necrodoom/patch-72
add new commands and others
2013-03-28 05:59:35 -07:00
Luuk Jacobs
386b73dbdb [Fix] Strip colourcodes from groups
This way groups with colourcodes in the middle of the name work with /who <groupname> ie. §4S§cerveradmin
2013-03-26 11:43:45 +01:00
Iaccidentally
c7f62700d5 Merge pull request #409 from GunfighterJ/2.9
[Feature] Stack more mobs with /spawnmob
2013-03-22 14:39:55 -07:00
GunfighterJ
85741288ce [Feature] Stack more mobs with /spawnmob
Uses same syntax, now supports more than 2 mobs
2013-03-22 16:35:01 -05:00
KHobbits
566a826cf1 Abort user login code, if user disconnects before it runs. 2013-03-21 22:30:02 +00:00
KHobbits
28e069eb6b Don't allow an empty list value. 2013-03-21 21:41:30 +00:00
KHobbits
44584b11c5 Tweak ess version 2013-03-21 21:12:58 +00:00
KHobbits
b8e079ddcb Add the max-walk-speed config variable back to the default config file. 2013-03-20 23:24:45 +00:00
SKmedix
35792f9728 Update messages_pl.properties
Update Polish translation.
2013-03-20 08:53:00 +00:00
KHobbits
353423efec Use correct getPlayer method to not match offline users. 2013-03-20 01:29:54 +00:00
KHobbits
889157371c [Permission] essentials.vanish.interact - Players with this permission will be able to interact with hidden players. 2013-03-20 01:00:50 +00:00
KHobbits
896e14670f Add some missing hidden checks 2013-03-19 23:24:06 +00: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
1d6ac42311 [Fix] Reset walk/fly speed on login.
[Permission] essentials.speed.<fly|walk> - If a player only has one of these, they will only be able to toggle the given state.
2013-03-19 22:55:00 +00:00
KHobbits
61b115ceac Don't close inventories every plugin disable, just our own. 2013-03-19 21:05:12 +00:00
Necrodoom
a5ec8b9cbb [Fix] Print correct sender name on /spawn player from console. 2013-03-19 20:59:02 +00:00
Necrodoom
5af1f50b65 Fix exception in /heal, "playernotfound" should be exception. 2013-03-19 20:56:50 +00:00
KHobbits
093611fb2a Use original case for default /list groups. 2013-03-19 18:34:28 +00:00
KHobbits
709ddae508 readmeupdate 2013-03-19 14:32:23 +00:00
Necrodoom
cac53ab12e kittycannon should actually fire kittens 2013-03-19 14:31:34 +00:00
Necrodoom
df55e162d4 console should be able to mute admins 2013-03-19 14:09:30 +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
KHobbits
f5c17fc7c7 Pull the default list behavior from the old 'sort-list-by-groups' variable if it exists. 2013-03-19 09:00:50 +00:00
KHobbits
2dda15d47f Add Travis notifications 2013-03-18 23:48:01 +00:00
KHobbits
d9485cea8d Try different ant command 2013-03-18 23:35:00 +00:00
KHobbits
e728236dd3 Travis 2013-03-18 23:27:15 +00:00
KHobbits
fe28faf79d Merge pull request #396 from GunfighterJ/2.9
Allow potion clear/apply commands to work
2013-03-18 16:20:45 -07:00
KHobbits
66e87bdd1c Minor code cleanup 2013-03-18 23:15:18 +00:00
KHobbits
4b5cc8cfd8 Cleanup: Run Kukes code through a dryer, add more comments. 2013-03-18 22:43:05 +00:00
GunfighterJ
8b97a84652 Allow potion clear/apply commands to work 2013-03-18 11:21:28 -05:00
KHobbits
16ca842929 Edit default config to not cause confusion. 2013-03-18 08:59:40 +00:00
KHobbits
984eca9723 Cleanup: Comment and simplify /list code - More to do. 2013-03-18 08:53:12 +00:00
KHobbits
5b55fd97e6 Cleanup - Split /list into methods 2013-03-18 08:16:34 +00:00
kukelekuuk00
0c82c61574 fixes and addition of '*' to match all unmatched users. 2013-03-18 06:16:02 +00:00
kukelekuuk00
32099a4109 Added /list [group] and some more detailed configuration regarding /list 2013-03-18 06:16:02 +00:00
GunfighterJ
ce51a07bf1 Potion erroring and duration/power fix 2013-03-18 06:14:44 +00:00
Necrodoom
5e4659e6ae update IDs 27, 28, 66, 157
update rails aliases to match bukkit item names
2013-03-18 06:14:00 +00:00
GunfighterJ
2f96ef1e97 [Fix] Potion erroring and duration/power fix 2013-03-17 13:34:10 -05:00
KHobbits
5ea1bdec56 [Fix] Restore /speed command's ability to control walk speed. 2013-03-17 06:38:24 +00:00
KHobbits
f338d3c135 Fixing TL edit error. 2013-03-16 12:17:13 +00:00
Necrodoom
20d019383f Update messages.properties
fix typos in new messages
2013-03-16 12:15:57 +00:00
KHobbits
ee080e56c2 Fix raw bukkit itemdb lookup 2013-03-16 12:11:03 +00:00
KHobbits
d9a238fb80 Cleanup open inventories 2013-03-16 11:01:56 +00:00
KHobbits
3ddf883d5d Import cleanup 2013-03-16 09:19:30 +00:00
KHobbits
1111254e46 Fix potion effect errors 2013-03-16 09:13:21 +00:00
KHobbits
6185581962 Fix Minecart class rename
Lets use consistent versions in the code base
Bukkit: 1700 CB: 2648
2013-03-16 08:55:39 +00:00
KHobbits
24a9a74fd5 We use tabs not spaces for indenting. 2013-03-16 08:43:52 +00:00
KHobbits
208d673c2b Check health is 0 after /suicide 2013-03-16 08:42:24 +00:00
KHobbits
2b0506de77 Fix missing /ci syntax update. 2013-03-16 08:32:21 +00:00
Alexander Schepp
d63e259461 Merge pull request #388 from GunfighterJ/2.9
[Feature] Additional spawnable mob types
2013-03-15 13:44:43 -07:00
GunfighterJ
c8a867be38 [Feature] Additional spawnable mob types 2013-03-15 15:41:23 -05:00
Alexander Schepp
734286e8d3 Merge pull request #387 from GunfighterJ/2.9
Initial 1.5 update
2013-03-15 12:59:50 -07:00
GunfighterJ
96c5bebdf2 Initial 1.5 update 2013-03-15 14:54:51 -05:00
Alexander Schepp
fc96d7e0e9 Merge pull request #342 from necrodoom/patch-60
[feature] update items.csv to minecraft 1.5
2013-03-15 12:25:09 -07:00
KHobbits
fa445790e7 Merge pull request #383 from necrodoom/patch-73
[fix] trying to AFK others should work now
2013-03-15 06:28:56 -07:00
KHobbits
20b61a6147 Merge branch 'groupmanager' of github.com:essentials/Essentials into 2.9 2013-03-14 18:01:50 +00:00
Iaccidentally
c61abadd91 Merge pull request #385 from Skylexia/patch-1
[Fix] Fixing message (Tl key).
2013-03-13 17:41:10 -07:00
Skylexia
89c1cc5503 Fixing message. 2013-03-13 20:23:01 -03:00
KHobbits
db86648b84 Fix missing console notifications on /unban and /unbanip 2013-03-12 22:26:24 +00:00
Necrodoom
e68035cc7a [fix] trying to AFK others should work now 2013-03-11 15:36:12 +02:00
KHobbits
895c14430a Fixing ban ip broadcast notification. 2013-03-11 10:33:59 +00:00
KHobbits
664fe18bbe Fix Essentials version display 2013-03-11 02:01:57 +00:00
KHobbits
e60c65cfc5 Fixed lost TL. 2013-03-10 23:43:13 +00:00
Skylexia-PC
6b70899484 Shows IP unbans to online staff. 2013-03-10 23:41:17 +00:00
Necrodoom
973e918d3a readd some checks 2013-03-10 14:42:03 +02:00
KHobbits
5cfb9326f6 Merge pull request #380 from Skylexia/2.9
[Feature] Broadcast unbans to online staff.
2013-03-10 00:38:09 -08:00
Skylexia-PC
16857da2b4 Update tl properties to remove unused properties. 2013-03-10 04:37:04 -04:00
Skylexia-PC
ee7b50a014 [Feature] Broadcast unbans to online staff. 2013-03-10 03:22:35 -04:00
KHobbits
56bd973e94 Use lower locale. 2013-03-10 02:04:11 +00:00
KHobbits
9ff0571cea Protect us from npe. 2013-03-10 02:01:59 +00:00
Iaccidentally
fc019af9f6 Merge pull request #379 from GunfighterJ/2.9
Allow potion meta to work
2013-03-09 16:46:59 -08:00
GunfighterJ
937ef0bb85 Allow potion meta to work
Instead of denying if they have perms
2013-03-09 18:38:59 -06:00
KHobbits
45fe5f2c02 Fix TL key casing. 2013-03-09 21:41:30 +00:00
KHobbits
b1f427d52e [Fix] Allow /nick to change nickname case, without adding prefix character. 2013-03-09 14:24:19 +00:00
KHobbits
46e9471a63 [Fix] Move allowunsafe enchant perm to: essentials.enchantments.allowunsafe 2013-03-09 14:02:34 +00:00
KHobbits
4d9685e10d [Fix] Move all enchant type perms to: essentials.enchantments.<enchant>
[Fix] Move all potion effect perms to: essentials.potions.<effect>
[Fix] Move multiple potion perm to: essentials.potions.multiple
Other perms: essentials.itemspawn.meta-(firework|firework-multiple|firework-power|name|lore|head|book|chapter|chapter-<chapter>|author|title)
2013-03-09 13:56:38 +00:00
Necrodoom
fd3cdde354 fix alias 2013-03-09 15:12:15 +02:00
KHobbits
d93719ebcf Merge pull request #378 from Skylexia/2.9
Fixing exp trading type.
2013-03-08 14:08:08 -08:00
Skylexia-PC
63b2766e2b Fixing exp trading type. 2013-03-08 17:04:54 -05:00
KHobbits
6d552281d4 Allow item/item trades still. 2013-03-08 12:34:11 +00:00
KHobbits
6436baf7a4 Merge pull request #370 from necrodoom/patch-71
[fix] EssentialsAntiBuild shouldn't run without Essentials
2013-03-08 04:01:08 -08:00
KHobbits
896298a9e8 Clean up meta error messages.
Add enchant perm checks back.
2013-03-07 03:17:58 +00:00
KHobbits
7d0fafd084 Don't check people for meta perms when using kits. 2013-03-07 02:57:25 +00:00
KHobbits
32d44eb13d Merge pull request #375 from GunfighterJ/patch-15
[Feature] Adds meta permissions
2013-03-06 18:46:55 -08:00
KHobbits
c275626bee [Fix] Prevent same item type trades on signs, prevents amount confusion scams. 2013-03-07 02:42:47 +00:00
KHobbits
861b04b680 Fix cleanup comparison number base 2013-03-06 23:39:11 +00:00
KHobbits
d8e4862e82 Add cleanup logging to debug mode. 2013-03-06 22:36:36 +00:00
GunfighterJ
4aaf0eda79 [Feature] Adds meta permissions
TL MetaItemStack.java
Some meta cleanup
Parameter refactor for clarity
Full list of added perms http://goo.gl/do1XL
2013-03-06 15:09:51 -06:00
KHobbits
2f9dcfee16 Fix a color code mistake. 2013-03-06 20:46:19 +00:00
KHobbits
292f8a8799 Sort TL files. 2013-03-06 17:44:05 +00:00
Necrodoom
ec87104c57 add armor aliases since new leather names 2013-03-05 18:56:40 +02:00
KHobbits
d7588e61bc [Fix] Unify item spawning permissions in /give 2013-03-03 20:33:23 +00:00
Necrodoom
061794e86d add mising isopoverride check 2013-03-03 18:35:05 +02:00
KHobbits
b9285b2aeb Merge pull request #372 from skmedix/patch-21
Update messages_pl.properties
2013-03-02 09:43:35 -08:00
SKmedix
2187b7536e Update messages_pl.properties
Update Polish translations.
---
Date: 2.03.13

---
Added "playerBanIpAddress" (27)
2013-03-02 18:41:04 +01:00
KHobbits
86c0767833 Fix /banip so it compiles, also throw it through a DRYer. 2013-03-02 17:08:22 +00:00
Necrodoom
090c1f6f83 Include IP address when banning IP 2013-03-02 17:08:16 +00:00
Necrodoom
69c40a2f1a add new commands, add alias to listgroups 2013-03-02 10:03:45 +02:00
Necrodoom
42edd14939 Update GroupManagerPermissions.java 2013-03-02 09:56:38 +02:00
Necrodoom
dba47cb44c fix clear commands change mandemote and manpromote
dont make manpromote and mandemote act like manuadd when OP, 3 manuadd commands arent needed.
2013-03-02 09:50:31 +02:00
Necrodoom
b020983471 messages fix, add /manuclearp and /mangclearp 2013-03-01 20:48:12 +02:00
ementalo
13efbb666d Remove reference to c3p0 from build.xml 2013-02-28 21:23:33 +00:00
ementalo
8d77a3f941 [Breaking] Remove protect database functionality for protecting signs and rails.
- Removed config entries
- Removed c3p0 lib
2013-02-28 21:02:37 +00:00
Necrodoom
8f785598b0 [fix] essantibuild shouldnt run without essentials 2013-02-28 19:04:05 +02:00
KHobbits
58b1b34e44 Merge pull request #369 from TheReverend403/2.9
Fix geoip messages
2013-02-28 05:32:42 -08:00
Lee Watson
ffbc05144c Updated ALL local files 2013-02-28 13:23:28 +00:00
KHobbits
207a8d1b4f Merge pull request #364 from necrodoom/patch-69
deny empty warp name
2013-02-28 04:55:40 -08:00
KHobbits
919f3abe6d Merge pull request #357 from skmedix/patch-20
Update Essentials/src/messages_pl.properties
2013-02-28 04:53:58 -08:00
KHobbits
c1f66fc817 [Fix] Charging players at wrong point in /spawn 2013-02-28 12:52:22 +00:00
KHobbits
8d2b10d783 Add extra trade log messages for sign charges. 2013-02-28 03:15:21 +00:00
Necrodoom
38b7fa64fa deny empty warp name 2013-02-26 19:07:10 +02:00
ElgarL
f5ed4dd6cd Merge pull request #361 from necrodoom/patch-66
add catches for the last 2 config settings
2013-02-26 08:49:40 -08:00
ElgarL
17dab04094 Merge pull request #362 from necrodoom/patch-67
fix a few groupmanager.java errors
2013-02-26 06:43:31 -08:00
Necrodoom
308f05b8bf change commandblock message 2013-02-26 13:05:45 +02:00
Necrodoom
48db088fb4 fix a few groupmanager.java errors 2013-02-26 12:27:05 +02:00
Necrodoom
9965e41567 add catches for the last 2 config settings 2013-02-26 12:17:26 +02:00
Iaccidentally
0ddcfafbc0 This is still needed. 2013-02-25 22:44:52 -05:00
KHobbits
6f55e4b316 Revert "[Spawn] Please join me in welcoming EssentialsSpawn to Java 1.6 and modern bukkit.
This reverts commit a11e8d4236.
If you don't understand the code, don't touch it.
2013-02-26 03:30:11 +00:00
Iaccidentally
de91073dda Merge branch '2.9' of https://github.com/essentials/Essentials into 2.9 2013-02-25 22:01:49 -05:00
Iaccidentally
a11e8d4236 [Spawn] Please join me in welcoming EssentialsSpawn to Java 1.6 and modern bukkit. :: http://i.imgur.com/79Izo.jpg 2013-02-25 22:01:06 -05:00
Iaccidentally
bf8f0365d9 Merge pull request #360 from GunfighterJ/patch-15
[Protect] Prevent creepers from breaking paintings if their explosions a...
2013-02-25 18:46:44 -08:00
GunfighterJ
d5f702f2cb [Protect] Prevent creepers from breaking paintings if their explosions are disabled.
Backport from 3.0
2013-02-25 17:15:20 -06:00
ElgarL
c1b4ed5920 Show the world a group change is made in when using notify. 2013-02-25 14:11:42 +00:00
ElgarL
cc83553d72 Store worldSelection indexed on the senders name rather than the object
(fixes commandblocks using manselect).
2013-02-25 13:49:18 +00:00
ElgarL
643a9be985 Only prevent adding nodes with '/manuaddp' and '/mangaddp' if they are
exact matches (not wildcards).
2013-02-25 12:47:23 +00:00
ElgarL
9f13653be6 Warn when adding a node where an exception already exist. 2013-02-25 10:46:16 +00:00
ElgarL
5f5a9adf31 Don't allow adding a node with '/manuaddp' and '/mangaddp' which is
already negated.
2013-02-25 10:27:01 +00:00
ElgarL
29746df914 Fix setting of accessLevel on User level permission tests. 2013-02-25 10:11:44 +00:00
SKmedix
c3b42993de Update Essentials/src/messages_pl.properties
Update Polish translations.
---
Date: 24.02.13

---
+ Added "noMatchingPlayers" (509)
+ Added "matchingIPAddress" (510)
+ Added "runningPlayerMatch" (511)
* Fixed "adventure" (8)
* Fixed "antiBuildInteract" (14)
2013-02-24 11:45:56 +01:00
KHobbits
964bdc6d30 [Feature] Allow IP lookup in /seen command.
[Permission] essentials.seen.ipsearch - allows /seen <ip address>
2013-02-24 03:55:20 +00:00
KHobbits
3d5aa40965 Clarify vanish status a little. 2013-02-23 23:34:31 +00:00
Iaccidentally
26352ac6b6 Merge pull request #352 from GunfighterJ/patch-15
[Fix] Persist yaw and pitch on teleport
2013-02-23 11:57:15 -08:00
KHobbits
00ec717e7d Merge pull request #356 from skmedix/patch-19
Update Essentials/src/messages_pl.properties
2013-02-23 05:26:21 -08:00
skmedix
f70015e8c5 Update Essentials/src/messages_pl.properties
Update Polish translations.
---
Date: 23.02.13
---
* Fixed "fireworkSyntax" (502)
* Fixed colors.
2013-02-23 11:08:47 +01:00
ElgarL
399be38680 Merge pull request #355 from necrodoom/patch-63
add "all_unnamed_worlds" info
2013-02-22 12:47:12 -08:00
Necrodoom
3bceecdfb6 fix typo 2013-02-22 20:49:57 +02:00
Necrodoom
68b95c668d add "all_unnamed_worlds" info 2013-02-22 20:48:09 +02:00
ElgarL
a7648c7c12 Only one error this time Necrodoom :) 2013-02-22 17:21:14 +00:00
ElgarL
bda3c32370 Merge pull request #353 from necrodoom/patch-61
various messages fixes - This better work!!!!!!
2013-02-22 09:19:56 -08:00
ElgarL
9ce067a7fd Fix global mirroring of non main worlds. 2013-02-22 17:07:55 +00:00
Necrodoom
ef7d323902 various messages fixes 2013-02-22 19:07:01 +02: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
ElgarL
51ddcdcf87 Merge pull request #351 from GunfighterJ/gm-patch-1
Receive was spelt wrong
2013-02-22 05:56:53 -08:00
GunfighterJ
8ca738a436 I before E except after C 2013-02-22 07:50:54 -06:00
ElgarL
f9b5d74f6d Do not list "all_unnamed_worlds" as a selectable world. 2013-02-22 13:17:58 +00:00
ElgarL
8960417d56 Don't try to use the worldHolder before it's initialised. 2013-02-22 12:59:50 +00:00
ElgarL
90730f63d5 Added a new mirroring option in the config of 'all_unnamed_worlds'. This
will cause all new or unnamed worlds to use this mirroring.
2013-02-22 12:39:41 +00:00
ElgarL
13e07f64ec '/manselect' will no longer list duplicate worlds. 2013-02-22 11:46:59 +00:00
KHobbits
6308b1ecf3 Merge pull request #350 from skmedix/patch-18
Update Polish TL - Thanks to andrewkm for proofing.
2013-02-22 02:44:03 -08:00
skmedix
dff7e81b7f Update Essentials/src/messages_pl.properties
Update Polish translations.
---
Date: 21.02.13
---
+ Added "cleaned" (42)
+ Added "cleaned" (43)
2013-02-21 11:03:06 +01:00
GunfighterJ
bf0a11e4fe Cache teleport invulnerability time 2013-02-20 13:46:28 +00:00
Chris Ward
c9efe14ad3 Final! 2013-02-20 12:46:47 +11:00
KHobbits
64ee6b7914 Readme cleanup. 2013-02-20 01:39:04 +00:00
KHobbits
6ae6c51dc0 Code cleanup 2013-02-19 23:06:04 +00:00
kukelekuuk00
8710a133ce Added /essentials cleanup <days> [money] [homes] [bans]
Delete userdata of players offline for over <days> and with less money than [money], less homes than [homes] and less bans than [bans].
2013-02-19 22:43:23 +00:00
Necrodoom
32b1ce9e39 add 1.5 new slab blocks 2013-02-19 19:47:49 +02:00
Necrodoom
c982592674 update items.csv to minecraft 1.5
dont pull till 1.5 bukkit devbuild
2013-02-19 13:35:29 +02:00
Chris Ward
ff02f0e270 Merge pull request #341 from necrodoom/patch-59
fix rest of "posion" aliases
2013-02-19 02:26:44 -08:00
Necrodoom
8f52908eed fix rest of "posion" aliases 2013-02-19 11:46:26 +02:00
GunfighterJ
8f8fc4a08d Fixes Necrodoom's code Needs more exception 2013-02-18 15:25:09 +00:00
Necrodoom
e63276242c make sure player isnt dead before healing 2013-02-18 15:08:55 +00:00
KHobbits
3ddbeea45a Fix socialspy command list. 2013-02-17 18:05:07 +00:00
ElgarL
7f972801bf Fix Necrodooms code...again! 2013-02-17 17:24:52 +00:00
ElgarL
36e354388c Merge pull request #338 from necrodoom/patch-57
if variable is inside ' ', strip them
2013-02-17 09:22:36 -08:00
ElgarL
bbd0021a8b Merge pull request #328 from necrodoom/patch-53
delete player command messages, bukkit does it
2013-02-17 09:21:12 -08:00
Necrodoom
880fb29b44 if variable is inside ' ', strip them 2013-02-17 19:09:04 +02:00
KHobbits
31f3662101 Clarify command disabling. 2013-02-17 16:30:05 +00:00
Necrodoom
5f2c759a8f fix auto afk description 2013-02-17 16:26:18 +00:00
KHobbits
a91cfbf43a Merge pull request #334 from necrodoom/patch-54
add skull alias to head item
2013-02-17 08:17:10 -08:00
Necrodoom
33fa32cbff add skull alias to head item 2013-02-17 18:15:48 +02:00
snowleo
69e941670f why do we even remove the items?
derp
2013-02-17 15:34:49 +01:00
snowleo
af10a2050a Revert the last 2 commits and actually fix the right one. 2013-02-17 15:17:47 +01:00
snowleo
ce9e630072 Fix all removeItem()
This could fix some broken logging of selling items
2013-02-17 15:10:41 +01:00
snowleo
ef063c255e Items can't be reused after the have been used in removeItem 2013-02-17 15:07:32 +01:00
KHobbits
0e7d64f9e7 Fix a couple of cosmetic errors in /seen 2013-02-17 01:18:50 +00:00
Skylexia
2a91f593de Fixed colour coding.
Fixed colour coding.

Fixed colour coding.

Fixed colour coding.

Fixed colour coding.

Fixed colour coding.

Fixed colour coding.

Fixed colour coding.

Fixed colour coding.

Fixed colour coding.

Fixed colour coding.

Fixed colour coding.

Fixed colour coding.

totalWorthAll
totalWorthBlocks
2013-02-16 18:22:25 +00:00
KHobbits
9186ca2c9a Merge pull request #333 from GunfighterJ/patch-12
Adds optional argument to clear both inventory and armor with /clear
2013-02-16 08:40:44 -08:00
GunfighterJ
f1e4e49779 Adds optional argument to clear inventory and armor with /clear 2013-02-15 12:38:41 -06:00
ElgarL
3740f200f8 Catch the error when using an out of date config for
'allow_commandblocks' So it doesn't kill the whole config.
2013-02-15 17:39:34 +00:00
KHobbits
5840c02efc Merge pull request #331 from kukelekuuk00/2.9
Add methods to UserData and IUser for accessing and writing of data from other plugins.
2013-02-14 03:05:41 -08: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
Iaccidentally
44a6f4d562 Merge branch '2.9' of https://github.com/essentials/Essentials.git into 2.9 2013-02-12 18:38:35 -05:00
Iaccidentally
ec8c778f68 Clean up protect :: transient is not needed :: remove unnecessary returns :: @Override all the things! 2013-02-12 18:37:40 -05:00
KHobbits
56df6b36a5 Fix /give|/item descriptions for itemmeta. 2013-02-12 22:56:17 +00:00
KHobbits
30b65a0bc7 Merge branch '2.9' of github.com:essentials/Essentials into patch-41 2013-02-12 22:46:35 +00:00
Necrodoom
0dc8980d32 remove color from bedNull 2013-02-12 22:45:54 +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
63c7d4519a change bed spawn set message 2013-02-12 22:43:07 +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
Iaccidentally
c2d904ac7d Fix build :: This is what happens when you don't use an IDE 2013-02-12 17:42:04 -05:00
Necrodoom
911224dc64 fix typo 2013-02-12 22:26:02 +00:00
KHobbits
0ad765e1c8 add inventoryclearall message
update messages.properties

update messages_en.properties

update messages_da.properties

update messages_de.properties

update messages_en.properties

update messages_es.properties

update messages_fi.properties

update messages_fr.properties

update messages_it.properties

update messages_nl.properties

update messages_pl.properties

update messages_pt.properties

update messages_se.properties
2013-02-12 22:26:02 +00:00
Skylexia
9db040edd4 Update Essentials/src/config.yml 2013-02-12 17:17:48 -05:00
Skylexia
c0f3e9073d Update Essentials/src/plugin.yml 2013-02-12 17:13:08 -05:00
Necrodoom
e4565de717 delete player command messages, bukkit does it 2013-02-12 16:56:54 +02:00
ElgarL
33382f9940 Merge pull request #327 from necrodoom/patch-52
add missing return false in manudelp
2013-02-12 06:49:27 -08:00
Necrodoom
1d0c2f75dc add missing return false; 2013-02-12 16:47:39 +02:00
KHobbits
c3f0d34293 Minor entity optimization. 2013-02-11 23:33:30 +00:00
KHobbits
c298fb9332 Attempt to optimize Essentials login event. 2013-02-11 23:11:37 +00:00
KHobbits
a1f1319990 Merge pull request #325 from Skylexia/patch-2
Fixed all "poison" typos; add ppotato alias.
2013-02-11 15:00:14 -08:00
Skylexia
2316bfbd28 Update Essentials/src/items.csv 2013-02-11 17:57:20 -05:00
KHobbits
96348a5e92 Merge pull request #324 from Skylexia/patch-1
Update Essentials/src/items.csv
2013-02-11 10:41:09 -08:00
Skylexia
d9903efcf4 Update Essentials/src/items.csv 2013-02-11 13:38:11 -05:00
KHobbits
bc90deb87d Merge pull request #322 from necrodoom/patch-50
add dye aliases to match bukkit
2013-02-11 09:22:56 -08:00
Necrodoom
c35e5bf53a add dye aliases to match bukkit 2013-02-11 18:56:23 +02:00
KHobbits
8ea0a152d4 Merge pull request #321 from GunfighterJ/patch-10
Fix array index out of bounds on /firework fire
2013-02-11 08:41:47 -08:00
GunfighterJ
8e205768b3 Fix array index out of bounds on /firework fire 2013-02-11 10:35:55 -06:00
ElgarL
fcfa3ce31d Merge pull request #298 from necrodoom/patch-37
Fix typo at groupmanager config.yml
2013-02-10 02:12:42 -08:00
Chris Ward
05aeba521f Merge pull request #317 from necrodoom/patch-47
update AFK documation
2013-02-10 01:54:37 -08:00
Necrodoom
8dff1155bf update AFK documation 2013-02-10 11:46:59 +02:00
Chris Ward
b6648ad9bd Fix compilation, unreachable code. 2013-02-10 20:37:46 +11:00
Chris Ward
40f03295a1 Merge pull request #316 from necrodoom/patch-46
throw exception on banexempt
2013-02-10 01:34:53 -08:00
Necrodoom
5fdb10a5bf throw exception on banexempt
match rest of moderator commands
2013-02-10 11:04:55 +02:00
KHobbits
e9bb2df87d Fix kit messages when giving kit to another player. 2013-02-10 00:07:40 +00:00
KHobbits
be29e4da59 missing alias 2013-02-09 23:39:21 +00:00
GunfighterJ
b2a0166c46 Proper TL 2013-02-09 16:27:54 -06:00
GunfighterJ
03b115d4c3 Merge branch '2.9' of https://github.com/essentials/Essentials into 2.9 2013-02-09 16:27:19 -06:00
KHobbits
d522a4230f Make /god and /god <player> behave the same. 2013-02-09 19:31:31 +00:00
Chris Ward
f17485b112 Merge remote-tracking branch 'origin/groupmanager' into 2.9 2013-02-09 21:55:20 +11:00
ElgarL
1f932434c2 Fix bad Git Merge 2013-02-09 10:51:16 +00:00
Chris Ward
92b0178ca7 Merge pull request #312 from necrodoom/patch-44
update kit link to the new one
2013-02-09 02:48:48 -08:00
Necrodoom
d30c3ca2a6 update kit link to the new one 2013-02-09 12:47:36 +02:00
Chris Ward
fb60272439 Merge pull request #311 from necrodoom/patch-43
fix itemmeta link on kit section
2013-02-09 02:41:01 -08:00
Necrodoom
80ad075f02 fix itemmeta link on kit section 2013-02-09 11:57:32 +02:00
GunfighterJ
37029e6b5d Un-deletes deleted things. 2013-02-08 17:14:46 -06:00
GunfighterJ
631e0bbd0a Merge branch '2.9' of https://github.com/essentials/Essentials into 2.9 2013-02-08 16:05:48 -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
snowleo
335d8b7f20 Check if player is still online 2013-02-08 21:18:00 +01:00
snowleo
379e75f3e6 Fix async access to bukkit code 2013-02-08 21:16:21 +01:00
Chris Ward
2ca171a3f4 Merge pull request #304 from necrodoom/patch-40
pull messages.properties changes to messages_en
2013-02-06 22:54:27 -08:00
Necrodoom
8036cc9924 pull messages.properties changes to messages_en 2013-02-06 16:15:18 +02:00
Chris Ward
6442e793a9 Merge pull request #300 from necrodoom/patch-39
add missing puncuation
2013-02-06 02:49:04 -08:00
KHobbits
d745b866c0 Don't block food recovery in god mode. 2013-02-05 23:34:08 +00:00
KHobbits
4493d7d00c Merge pull request #302 from GunfighterJ/patch-9
Prevents flying from being disabled on world teleport if player has esse...
2013-02-05 12:07:36 -08:00
GunfighterJ
631692d763 Prevents flying from being disabled on world teleport if player has essentials.fly 2013-02-05 13:16:27 -06:00
GunfighterJ
ef341ae539 Adds potion meta
Some cleanup as well
2013-02-05 13:13:19 -06:00
Necrodoom
d0e3c1d946 fix a few errors 2013-02-05 16:45:30 +02:00
Necrodoom
82137e0703 add missing puncuation
probably needs extra reading though before pulling.
2013-02-05 13:57:27 +02:00
KHobbits
a3b2ffdeef Merge pull request #297 from necrodoom/patch-36
fix typo at ID 22
2013-02-05 03:26:19 -08:00
Necrodoom
dd095e15cb Fix typo at groupmanager config.yml 2013-02-05 13:13:00 +02:00
Necrodoom
46fc6c192c fix typo at ID 22 2013-02-05 13:11:36 +02:00
ElgarL
6506c290c8 Revert Necro's change to mancheckw 2013-02-04 13:44:58 +00:00
ElgarL
b1bc73f938 Fix Necrodooms errors for not using an IDE!!!!! 2013-02-04 13:33:06 +00:00
ElgarL
09851acd1b Merge pull request #291 from necrodoom/patch-32
display name instead of path for /mancheckw
2013-02-04 05:29:10 -08:00
ElgarL
df42c9051b Merge pull request #290 from necrodoom/patch-30
Derp - revert incorrect modified line
2013-02-04 05:25:10 -08:00
KHobbits
24c93c11c0 Stylize 'bed' in /home list 2013-02-03 17:30:14 +00:00
Chris Ward
5a13e9bbe5 Merge pull request #294 from necrodoom/patch-35
add common cat type name aliases
2013-02-03 05:16:17 -08:00
Necrodoom
05f337c63c add common cat type name aliases 2013-02-03 15:13:36 +02:00
KHobbits
eea0c9682c We don't need move events if afk interact is disabled. 2013-02-03 05:15:25 +00:00
KHobbits
2f567812d2 Merge pull request #292 from GunfighterJ/2.9
Adds toggle to disable AFK cancel on interactions
2013-02-02 21:11:43 -08:00
GunfighterJ
88c1b785af Adds toggle to disable AFK cancel on interactions 2013-02-02 23:06:09 -06:00
KHobbits
5225fb22f8 Minor comment updates. 2013-02-03 04:14:23 +00:00
Necrodoom
fae5780e09 Update EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java 2013-02-01 16:39:18 +02:00
Necrodoom
7ec65bf213 Update EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/UsersDataHolder.java 2013-02-01 16:33:55 +02:00
Necrodoom
d40484d016 Update EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/GroupsDataHolder.java 2013-02-01 16:33:37 +02:00
Necrodoom
971902ae38 Update EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/UsersDataHolder.java 2013-02-01 16:31:58 +02:00
Necrodoom
844be04d75 Derp - revert incorrect modified line 2013-02-01 14:14:46 +02: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
20b9111495 [GM] Catch all of the null. 2013-02-01 02:52:41 +00:00
KHobbits
1661eddc02 Make gm API lookup respect offlineperms toggle properly. 2013-02-01 00:01:57 +00:00
KHobbits
15be319d3e Updating groups example 2013-01-31 21:02:38 +00:00
KHobbits
fddbd7a52a Merge branch 'groupmanager' of github.com:essentials/Essentials into 2.9
Conflicts:
	EssentialsGroupManager/src/Changelog.txt
2013-01-31 20:38:36 +00:00
Iaccidentally
360e3e8801 cleanup :: fix build 2013-01-31 14:40:33 -05:00
Iaccidentally
4edc39360a Refactor name of ScheduleAsyncDelayedTask to RunTaskAsynchronously 2013-01-31 14:16:09 -05:00
Iaccidentally
cd126264e0 Update to 1.4.7 R1 :: remove calls to ScheduleAsyncDelayedTask, as it is deprecated :: cleanup :: WARNING: This commit may or may not be stable 2013-01-31 14:03:27 -05:00
ElgarL
df0ccb5832 Fix Necrodooms broken code. 2013-01-30 19:55:38 +00:00
ElgarL
8afcd41ab2 Merge pull request #288 from necrodoom/patch-29
config option to allow GM commands in commandblocks
2013-01-30 11:45:27 -08:00
Necrodoom
b8a71761ec update changelog 2013-01-30 19:26:46 +02:00
Necrodoom
738ded7ae5 update commandblock usage deny message 2013-01-30 19:25:35 +02:00
Necrodoom
5535435215 update config description of allow_commmandblocks 2013-01-30 19:14:57 +02:00
Necrodoom
4167dd2590 add allow commandblock check 2013-01-30 18:53:40 +02:00
Necrodoom
623ff0f629 register new config setting 2013-01-30 18:47:19 +02:00
Necrodoom
6e4ba4302f update config.yml to include commandblock change 2013-01-30 18:15:58 +02:00
KHobbits
3d4d616414 What is less than less than one. 2013-01-29 23:59:31 +00:00
KHobbits
d6c91d2d04 Might as well make it all safe. 2013-01-29 23:51:42 +00:00
snowleo
cef8cf7b75 Don't run calls against bucket api in async login thread 2013-01-30 00:26:50 +01:00
snowleo
12786a260e Update /sell command to newer bukkit api 2013-01-29 20:29:03 +01:00
ElgarL
6ea956b11c Doh, actually find what world we want to check properly with mancheckw. 2013-01-29 16:56:03 +00:00
ElgarL
132aa0cc1d Update plugin.yml with the new command 2013-01-29 16:45:23 +00:00
ElgarL
b5733d6597 grammaaahhhh!!! 2013-01-29 16:35:15 +00:00
ElgarL
7fc4a75d4d Added '/mancheckw <world>' to inspect what permission files a world is
referencing.
2013-01-29 16:33:20 +00:00
ElgarL
e9e9efd2d7 Missed an S 2013-01-29 16:15:45 +00:00
ElgarL
9e4493fbb4 Prevent '*' permissions granting the 'groupmanager.noofflineperm'
permission.
2013-01-29 16:14:24 +00:00
ementalo
a64cb31211 Revert "Merge pull request #286 from GunfighterJ/2.9"
This reverts commit 57de3f3ed2, reversing
changes made to 76d1ea5cab.
2013-01-29 10:25:01 +00:00
Iaccidentally
57de3f3ed2 Merge pull request #286 from GunfighterJ/2.9
Ignore itemmeta on selling
2013-01-28 21:13:41 -08:00
GunfighterJ
74b63a6f2d Ignore itemmeta on sell 2013-01-28 23:11:43 -06:00
ElgarL
faad91849d Add support for BukkitForge using 'overworld' as the main world name. 2013-01-28 04:13:16 +00:00
GunfighterJ
ce7d83adb6 Merge branch '2.9' of https://github.com/essentials/Essentials into 2.9 2013-01-27 14:20:59 -06:00
KHobbits
76d1ea5cab Minor /ci tweak. 2013-01-27 17:22:43 +00:00
KHobbits
9fb42375b8 Cleanup /ci addition. 2013-01-27 17:10:07 +00:00
GunfighterJ
2a7f3c6525 Merge branch '2.9' of https://github.com/essentials/Essentials into 2.9 2013-01-27 10:44:13 -06:00
KHobbits
c65353350f Merge pull request #278 from GunfighterJ/2.9
Adds vanilla syntax for /clearinventory
2013-01-27 08:40:39 -08:00
KHobbits
1ae58d05b4 Fix vanish status when switching worlds.
This fixes the potion effect being cleared on world change.
2013-01-27 16:39:50 +00:00
KHobbits
4f35a72174 Add command syntax comment, for clarification.
Merge branch '2.9' of github.com:essentials/Essentials into 2.9
2013-01-27 15:26:46 +00:00
KHobbits
addd55228b Don't try and charge a user if we don't have the chat data stored. 2013-01-27 15:26:42 +00:00
Iaccidentally
bb29d48268 Make heal remove fire from players. 2013-01-26 17:16:48 -05:00
Iaccidentally
d9ee9b036c Update heal to account for the fact that 20 is not always the max health 2013-01-26 17:12:17 -05:00
GunfighterJ
95e630de92 Merge branch '2.9' of https://github.com/essentials/Essentials into 2.9 2013-01-24 21:16:13 -06:00
KHobbits
2836c0862d Revert "Prevent replacement of { and } characters in chat.format"
This reverts commit 8fde5102b9.
2013-01-25 03:12:13 +00:00
KHobbits
286091cd32 Try command fallback 2013-01-25 03:06:53 +00:00
KHobbits
20786654a4 Merge pull request #284 from phrstbrn/chat-braces-fix
Prevent replacement of { and } characters in chat.format
2013-01-24 08:53:32 -08:00
Zak Ford
8fde5102b9 Prevent replacement of { and } characters in chat.format 2013-01-24 11:43:10 -05:00
GunfighterJ
133fdac343 Update /ci to support vanilla syntax 2013-01-23 16:47:21 -06:00
Chris Ward
2361b9e724 Add debug option to XMPP 2013-01-23 19:41:36 +11:00
Chris Ward
972d831d0d Remove references to earth2me in plugin.ymls 2013-01-23 02:56:18 +11:00
Chris Ward
bfa34130a0 Merge pull request #280 from necrodoom/patch-28
update documation reference in config.yml
2013-01-22 00:13:07 -08:00
Necrodoom
befe1fb39e Update Essentials/src/config.yml 2013-01-22 09:54:48 +02:00
KHobbits
378eaaaf1f Small patch to allow multiple firework effects to be defined in kits. 2013-01-21 23:38:03 +00:00
KHobbits
51a55318d0 Revert /gc change.
Simplify firework syntax, and add help
Merge branch 'patch-26' of git://github.com/necrodoom/Essentials into 2.9
2013-01-21 20:07:02 +00:00
KHobbits
4663c89dd6 Merge pull request #276 from necrodoom/patch-26
Update Essentials/src/plugin.yml
2013-01-21 06:41:32 -08:00
Necrodoom
2a1c3fb8e0 Update Essentials/src/plugin.yml 2013-01-21 16:40:45 +02:00
Necrodoom
0ac1a90b93 Update Essentials/src/messages_en.properties 2013-01-21 16:37:12 +02:00
Necrodoom
ab6b3bff90 fix message 2013-01-21 16:35:40 +02:00
Necrodoom
2d00fd0c1e try make error message more informative 2013-01-21 16:32:49 +02:00
Necrodoom
e5f4cb9a4d Update Essentials/src/plugin.yml 2013-01-21 16:29:26 +02:00
KHobbits
91701e8c2f Allow negative exp to be given 2013-01-21 14:15:53 +00:00
KHobbits
9cef107bc3 Fix a couple of param issues. 2013-01-21 13:40:45 +00:00
KHobbits
76fd829e8c Merge pull request #275 from DMarby/patch-1
Update Essentials/src/messages_se.properties
2013-01-20 15:31:34 -08:00
David Marby
6ea422015c Update Essentials/src/messages_se.properties 2013-01-21 00:26:38 +01:00
KHobbits
443a317184 Show afk warning when pm'ing afk players.
Fix vanished leak on player matching.
2013-01-20 22:05:44 +00:00
KHobbits
50dca9abf5 Add optional 2nd arg to broadcast format. 2013-01-20 20:58:05 +00:00
KHobbits
f1e3d48248 Fix book meta error message. 2013-01-20 20:41:15 +00:00
KHobbits
63ce4a99b9 Trim long /gc output, add /gc all 2013-01-20 20:35:41 +00:00
KHobbits
1ccda52e9f Fix minor /book bug (Null author) 2013-01-20 20:06:27 +00:00
KHobbits
1679790157 Fix eco take derp. 2013-01-20 19:43:59 +00:00
KHobbits
6170540a24 Fix colour syntax message on coloured leather. 2013-01-20 01:44:03 +00:00
KHobbits
987b2ff4d5 Minor cleanup on /eco command. 2013-01-20 01:24:09 +00:00
KHobbits
23a15cb11a Merge pull request #274 from GunfighterJ/2.9
Cleanup /eco, fix reset broadcast
2013-01-19 17:12:07 -08:00
KHobbits
41547e3243 Cleanup /exp command, and fix vanilla syntax issues.
Needs double checking with commandblocks with vanilla syntax.
2013-01-20 01:10:41 +00:00
GunfighterJ
a586edfd0b Cleanup /eco, fix reset broadcast 2013-01-19 17:58:12 -06:00
KHobbits
762bb65677 Add example firework kit, and cleanup debug messages. 2013-01-19 23:43:40 +00:00
KHobbits
73c92bf742 Move firework meta handling into MetaItemStack
Allow firework meta to be applied to item spawning and kit commands.
2013-01-19 23:35:59 +00:00
ElgarL
2b8435342d Negate 'groupmanager.noofflineperms' by default in the owner group. 2013-01-19 22:22:42 +00:00
KHobbits
9566499a2f Merge pull request #272 from GunfighterJ/2.9
/eco overhaul, adds /eco set
2013-01-19 10:54:11 -08:00
GunfighterJ
343c3a1bdd /eco overhaul, adds /eco set 2013-01-19 12:50:35 -06:00
KHobbits
9aeb49f6c3 Reduce chance of self repeating powertool actions. 2013-01-19 15:19:39 +00:00
Chris Ward
7dae04759f Merge pull request #271 from necrodoom/patch-25
update /book description
2013-01-19 06:21:47 -08:00
Necrodoom
e2f6e5a7fd update /book description 2013-01-19 16:16:35 +02:00
ElgarL
d26fa6c5b8 Negate 'groupmanager.noofflineperms' by default in the owner group. 2013-01-19 12:40:40 +00:00
Chris Ward
82f9505a2e Touch of cleanup to Gunfighter's addition to exp 2013-01-19 18:22:22 +11:00
GunfighterJ
f8ce80c18a Adds vanilla syntax to /exp command 2013-01-18 18:20:05 -06:00
Alexander Schepp
313fd30ce9 Fix bug with empty motd 2013-01-18 23:36:59 +01:00
Iaccidentally
da216b05d9 Merge pull request #266 from GunfighterJ/2.9
Duplicate alias removed
2013-01-17 17:30:04 -08:00
GunfighterJ
d8132548f6 Duplicate alias removed 2013-01-17 19:27:21 -06:00
snowleo
6fdeddd96b Merge remote-tracking branch 'origin/groupmanager' into 2.9 2013-01-18 01:01:23 +01:00
Iaccidentally
8082508db9 Merge pull request #265 from GunfighterJ/2.9
Adds essentials.mute.notify
2013-01-17 15:53:37 -08:00
GunfighterJ
78e6da9504 Adds essentials.mute.notify 2013-01-17 17:42:32 -06:00
Iaccidentally
0014d5cfcb Merge pull request #263 from GunfighterJ/2.9
Added /firework command
2013-01-17 14:59:01 -08:00
Iaccidentally
6aeba173b9 Update libs 2013-01-17 14:36:03 -05:00
Iaccidentally
a2813358af Update Bukkit to 1.4.7-R0.1 2013-01-17 14:25:19 -05:00
GunfighterJ
8e663b53ce Now it adds the right firework command 2013-01-16 20:40:29 -06:00
GunfighterJ
214d9414da Adds the actual /firework command 2013-01-16 20:39:09 -06:00
GunfighterJ
6d7881f876 Added /firework command 2013-01-16 20:36:33 -06:00
Iaccidentally
19ccdf2193 Merge branch '2.9' of https://github.com/essentials/Essentials into 2.9 2013-01-16 21:23:17 -05:00
KHobbits
35036ecc18 Fix null args on /book 2013-01-16 16:56:27 +00:00
KHobbits
b3cc4dbe09 Remove logger. 2013-01-16 16:30:30 +00:00
KHobbits
04bd9e8baf Remove broken firework meta. 2013-01-15 00:37:08 +00:00
KHobbits
fdc262a205 Start work on firework effect - syntax in flux 2013-01-14 23:11:19 +00:00
Iaccidentally
32ea86bfd3 Merge branch '2.9' of https://github.com/essentials/Essentials into 2.9 2013-01-14 17:25:32 -05:00
KHobbits
4807fb39e5 Couple of extra /helpop aliases. 2013-01-14 21:40:25 +00:00
KHobbits
4ffe61a505 Add colour support to item meta. 2013-01-14 21:34:35 +00:00
KHobbits
d74952927a Only show ban reason in the in-game display, not full banFormat. 2013-01-14 11:59:31 +00:00
KHobbits
f8cf3be87f Better handle initial book.txt creation. 2013-01-14 08:21:03 +00:00
KHobbits
ada266a0f9 Switch book meta, to use 'book.txt', and 'book:<section>'.
Should make things clearer and easier to understand.
2013-01-14 08:14:42 +00:00
KHobbits
115c4fa1d0 Merge remote-tracking branch 'remotes/origin/groupmanager' into 2.9 2013-01-14 07:37:11 +00:00
KHobbits
0c19b2feed All the better to kick you with
(Pipe format for linebreak)
2013-01-14 07:36:45 +00:00
ElgarL
04c833f648 Fix recursive loop when used on offline servers. 2013-01-14 06:47:50 +00:00
ElgarL
4533d09fc9 Update GlobalGroups (removing old permissions) as Towny handles it's own
perms now.
2013-01-14 05:48:48 +00:00
KHobbits
7337b86a16 Cleanup /book command. 2013-01-13 23:11:15 +00:00
Iaccidentally
3db015b1c1 Merge pull request #260 from GunfighterJ/patch-3
Fixes /top command not carrying pitch and yaw
2013-01-13 15:09:05 -08:00
GunfighterJ
659d602b57 Fixes /top command not carrying pitch and yaw 2013-01-13 17:02:46 -06:00
KHobbits
f82d7e806f Merge pull request #259 from GunfighterJ/patch-2
Added more book commands for editing author and title
2013-01-13 14:57:35 -08:00
GunfighterJ
a8088fb8c8 Merge branch 'patch-2' of https://github.com/GunfighterJ/Essentials into patch-2
Conflicts:
	Essentials/src/com/earth2me/essentials/commands/Commandbook.java
2013-01-13 16:31:29 -06:00
GunfighterJ
84c06fb746 Added more book arguments for editing author and title amend 2013-01-13 16:19:37 -06:00
KHobbits
ffe2a283d2 Cleanup of book meta. 2013-01-13 22:18:08 +00:00
GunfighterJ
7e3fd48956 Added more book commands for editing author and title 2013-01-13 15:54:11 -06:00
KHobbits
bd22aec38a Adding support for books made from /einfo 2013-01-13 21:08:24 +00:00
ElgarL
675c4b7897 typo in changelog. 2013-01-13 16:40:53 +00:00
ElgarL
ad7009c77e Do not grant any permissions (nort update Bukkit) if the server is in
offline mode and the player has the permission node
'groupmanager.noofflineperms'.
2013-01-13 16:39:53 +00:00
KHobbits
3f783bb43b Merge branch '2.9' of github.com:essentials/Essentials into 2.9 2013-01-13 16:30:43 +00:00
KHobbits
9fe7712bd6 Clean up TextPager 2013-01-13 16:30:22 +00:00
ElgarL
24f56892ad Fix the logger so errors are reported again. 2013-01-13 16:20:38 +00:00
ElgarL
b860e943f6 Synchronize pushing to Bukkit perms to prevent any
ConcurrentModificationException.
2013-01-13 16:20:09 +00:00
Chris Ward
5dc2665377 Merge pull request #258 from necrodoom/patch-22
update ID 397:3
2013-01-13 05:03:05 -08:00
Necrodoom
dd9b7e0d3c update ID 397:3 2013-01-13 15:01:10 +02:00
KHobbits
18a15ca63c Add provisional support for basic item Meta
Adds /book command to allow reediting of signed books.
2013-01-13 04:44:28 +00:00
KHobbits
ef1492a2a2 Clean up userdata saving, to prevent CMI
Also update config section code to use newer bukkit methods
2013-01-12 19:30:06 +00:00
KHobbits
298ab846c1 Don't extend ItemStack 2013-01-12 17:05:05 +00:00
KHobbits
7fdb2ad7d3 Pull item meta from itemdb class 2013-01-12 14:12:12 +00:00
Iaccidentally
3afe8d18f4 Merge branch '2.9' of https://github.com/essentials/Essentials into 2.9 2013-01-11 12:56:18 -05:00
Iaccidentally
0b581580c7 Merge pull request #251 from necrodoom/patch-19
/me shakes fist at Khobbits
2013-01-11 09:17:44 -08:00
Necrodoom
01e78cd666 /me shakes fist at Khobbits
fixes e6aeefb12d whitespace
2013-01-11 19:10:32 +02:00
Chris Ward
29d28456aa Merge remote-tracking branch 'origin/groupmanager' into 2.9 2013-01-11 21:59:39 +11:00
Chris Ward
f3812786d0 Fixes Item Frames being linked to Paintings when breaking 2013-01-11 21:54:52 +11:00
ElgarL
999d922fb9 Store a plugin and server reference. 2013-01-11 00:53:48 +00:00
KHobbits
2d4a07b95b New permission: essentials.sethome.bed
Players with this permission will force a bed home updating if daytime beds are enabled.
2013-01-10 22:36:38 +00:00
Chris Ward
5c99eee0c0 Implement abstract methods 2013-01-10 22:57:08 +11:00
Chris Ward
1fc502a4ff Update bukkit/craftbukkit libs. Force latest beta version 2013-01-10 22:51:48 +11:00
KHobbits
e73983649f Ban cleanup 2013-01-09 21:31:56 +00:00
KHobbits
465cdae989 Util commenting 2013-01-09 21:18:46 +00:00
KHobbits
341cb89bb7 Multiline kick messages and tempban countdown. 2013-01-09 21:04:58 +00:00
Chris Ward
79004c7098 Merge branch 'groupmanager' into 2.9 2013-01-10 04:57:10 +11:00
Joseph
2988db08ca Formatting 2013-01-10 03:25:58 +11:00
GunfighterJ
b04fa82be2 Add more items to Fireball command. Add delay option to /spawner 2013-01-10 03:25:57 +11:00
Chris Ward
5d210d81dc Merge pull request #247 from necrodoom/patch-18
rewrite ID 43:6, 44:6, 113, 114
2013-01-09 06:50:31 -08:00
Necrodoom
c14b32123f rewrite ID 43:6, 44:6, 113, 114 2013-01-09 16:46:37 +02:00
ElgarL
f256930269 Synchronize the raising of GroupManager events to Bukkit.getServer()
(should prevent deadlocks).
2013-01-09 14:38:00 +00:00
ElgarL
cde95d832e Merge pull request #241 from necrodoom/patch-15
fix typo
2013-01-09 02:50:30 -08:00
ElgarL
b9af4fb35c Remove attachments BEFORE we clear them. 2013-01-09 04:27:10 +00:00
ElgarL
5056210a38 code tidy. 2013-01-09 04:13:40 +00:00
ElgarL
eacb847305 Remove attachments before clearing 2013-01-09 04:04:59 +00:00
ElgarL
27ff43c0ac Clear our attachment map upon a manload so we correctly reconfigure a
players new permissions.
2013-01-09 03:55:26 +00:00
KHobbits
368c33a843 Expand plugin.yml fireball aliases. 2013-01-09 01:00:13 +00:00
KHobbits
c210e8730b Fire a few extra entities from /fireball 2013-01-09 00:58:29 +00:00
KHobbits
6c48e02c14 Add a couple of extra entities to spawnmob 2013-01-09 00:41:24 +00:00
KHobbits
c54d68a660 Cleanup 2013-01-08 23:59:31 +00:00
KHobbits
33d3123104 Pull and clean up book enchant pullreq.
Removed 1 enchant per book limit, anvils seem to handle multiple enchants fine, even if the result can only be one enchant.
2013-01-08 23:51:46 +00:00
Chasing Code
df0b1cedd8 Add missing import for EnchantmentStorageMeta 2013-01-08 11:46:08 -08:00
Chasing Code
2b57381fb8 Store enchanments in Enchanted Books
Change enchant command to store the enchantment instead of applying it when used on an Enchanted Book.  If an enchantment is already present, replace it (only one allowed on Enchanted Books).
2013-01-08 11:37:46 -08:00
oggehej
67b9a82e51 Update Swedish translation with new messages. 2013-01-08 19:45:51 +11:00
Chris Ward
c4e10da646 Store regex, use util method instead of another regex. Store variable 2013-01-08 02:26:09 +11:00
Chris Ward
fbb1c1278c Fix multiple enchantments in kits 2013-01-08 02:25:35 +11:00
Chris Ward
9b49c5e0f4 Merge pull request #242 from necrodoom/patch-17
update ID 127
2013-01-07 07:00:41 -08:00
Necrodoom
186d4e2fd1 update ID 127 2013-01-07 16:52:51 +02:00
Chris Ward
437b01e371 Unnecessary RegEx is unnecessary. 2013-01-08 00:08:11 +11:00
KHobbits
3bf36fecf9 Enchantment and item spawning cleanup
Should make it a little easier to add itemmeta.
2013-01-06 18:28:24 +00:00
KHobbits
c57332be63 Tell user that /mail sendall succeeded when used in console. 2013-01-06 16:27:20 +00:00
Necrodoom
292fb0cea1 fix typo 2013-01-05 19:05:02 +02:00
Necrodoom
3c4388f8be update IDs 368, 381, 399, 402 2013-01-05 19:27:56 +11:00
KHobbits
f930ff48a2 Throw an error if user doesn't have permission to use kit sign. 2013-01-05 07:39:32 +00:00
KHobbits
ef7b940e96 More user feedback on enchant sign. 2013-01-05 07:24:02 +00:00
KHobbits
6497db837d Allow unsafe enchants to be placed by [enchant] signs if enabled in the config file. 2013-01-05 07:05:25 +00:00
KHobbits
87cb6190eb Couple of extra enchant aliases 2013-01-05 06:59:37 +00:00
KHobbits
74c4c604da Merge branch 'release' into 2.9 2013-01-04 21:40:02 +00:00
KHobbits
0937a35470 Fix sign break bug 2013-01-04 13:05:57 +00:00
md_5
121f09caf0 Might be worth catching other occurances of the event too. 2013-01-04 13:53:01 +11:00
md_5
ef8bd3422a ArrayList, I choose you! (Fixes CraftBook erroring when the killall command is used and custom drops are enabled in that plugin) 2013-01-04 13:49:45 +11:00
Alexander Schepp
2232d859fd Fix nl translation 2013-01-03 11:50:19 +01:00
Iaccidentally
0258abee29 Update AntiBuild to use HangingBreakByEntityEvent instead of deprecated PaintingBreakByEntityEvent 2013-01-02 18:25:40 -05:00
Iaccidentally
9b8991788b Merge branch '2.9' of https://github.com/essentials/Essentials into 2.9 2013-01-02 18:24:34 -05:00
KHobbits
9a91c99391 Merge pull request #236 from gravypod/patch-1
Store ingredient map and recipe shape
2013-01-01 15:20:26 -08:00
KHobbits
c6dd921f0c New permission: essentials.fly.safelogin - Players with this command will automatically switch to fly mode if they login whilst floating in the air. 2013-01-01 22:00:53 +00:00
KHobbits
63e622374d New perm: essentials.vanish.effect - People with this effect will get the potion effect applied while vanished. 2013-01-01 21:12:26 +00:00
KHobbits
ca25c71010 Cleanup cleanup. 2013-01-01 19:48:08 +00:00
KHobbits
b5e559ff66 More cleanup 2013-01-01 19:34:32 +00:00
KHobbits
555bb76428 Cleanup 2013-01-01 18:39:23 +00:00
ElgarL
f210f8e20b Merge pull request #235 from necrodoom/patch-10
fix isOpOverride checks
2012-12-31 07:59:27 -08:00
gravypod
e572e7c94c Store ingredient map and recipe shape 2012-12-31 10:44:28 -05:00
Chris Ward
5c9d3c6b1a Fix recipe NPE/failed display in game 2013-01-01 02:26:04 +11:00
Necrodoom
ccfc23d629 fix isOpOverride checks 2012-12-31 15:35:58 +02:00
KHobbits
b5dd0fc671 Don't unregister all listeners. 2012-12-31 12:15:51 +00:00
KHobbits
8e3ee8576e Unregister unused events. 2012-12-31 05:44:20 +00:00
KHobbits
4cec7fe5c1 Use bukkit api for chat user list 2012-12-31 05:43:05 +00:00
KHobbits
6c3b2076ff Allow unbanning players who do not have valid userdata 2012-12-31 01:08:39 +00:00
KHobbits
cbc1aeacbe Implement event toggle. 2012-12-30 04:32:43 +00:00
KHobbits
a1b2773bf5 Reorganize entity listener 2012-12-30 03:32:32 +00:00
Alexander Schepp
9ecb501e00 Use the right formatter in XMPP 2012-12-30 00:23:04 +01:00
KHobbits
3dcdad2233 Hide a few more duplicate enchantments from /enchant 2012-12-29 09:00:42 +00:00
KHobbits
3725a5e6d4 Set default tpa timeout to 2 minutes. 2012-12-29 08:40:03 +00:00
KHobbits
ed88f8aa06 Allow unsafe enchantments in /item /give /kit and /enchant
Needs enabled in config file manually.
2012-12-29 08:36:24 +00:00
KHobbits
d551e8c6d2 Make /enchant only show valid enchantments for the item. 2012-12-29 07:58:28 +00:00
KHobbits
69ad186839 Add aliases for new thorns enchantment. 2012-12-29 07:47:07 +00:00
KHobbits
fc89867e4a Ignore self damage in teleport entity protection. 2012-12-29 07:35:26 +00:00
KHobbits
bbb478c51f Lets clean up the recipe window on player quit, just in case. 2012-12-29 06:55:48 +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
0755fbf089 Update bukkit to 1.4.6-R0.1
bukkit: 1652 cb: 2561
2012-12-29 06:37:52 +00:00
KHobbits
3a789bdcfe Fix string match error on none existing user (/ban). 2012-12-29 02:00:48 +00:00
Chris Ward
93db8bc7c1 Add SimplyPerms to classpath 2012-12-29 11:26:44 +11:00
Xefir
62832ad43a Added SimplyPerms Handler 2012-12-29 10:41:15 +11:00
Alexander Schepp
52b104aca5 Merge pull request #229 from necrodoom/patch-9
fix tempban permission check
2012-12-28 09:37:40 -08:00
Necrodoom
1f98fe710f derp - fix tempban permission check 2012-12-28 19:05:54 +02:00
ElgarL
a73986a358 Fix missing + from Necrodoom's pull request. 2012-12-28 13:46:22 +00:00
ElgarL
257165584e Merge pull request #228 from necrodoom/patch-8
Update EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManage...
2012-12-28 05:43:54 -08:00
Iaccidentally
8e92150cb7 Merge branch '2.9' of https://github.com/essentials/Essentials into 2.9 2012-12-26 09:48:38 -05:00
Chris Ward
4bb275e1b7 Revert 6b18259af6 - Adding permission node to speak, with config option to enable the node 2012-12-27 01:41:32 +11:00
Chris Ward
e5fc579071 Add tpdeny message to /tpahere 2012-12-27 01:10:57 +11:00
Iaccidentally
26306f6fa3 Merge branch '2.9' of https://github.com/essentials/Essentials into 2.9 2012-12-25 18:12:42 -05:00
Necrodoom
0bfb079cbb Update EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java 2012-12-25 18:11:10 +02:00
Chris Ward
6b18259af6 Adding permission node to speak, with config option to enable the node 2012-12-24 01:55:53 +11:00
Chris Ward
99c750d18b Move max-tempban-time in config 2012-12-24 01:04:02 +11: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
c97763c3c8 Make seen status's only show when true. 2012-12-22 03:36:56 +00:00
Chris Ward
ad3e8a3aba Merge pull request #215 from necrodoom/patch-5
update items.csv to minecraft 1.4.6
2012-12-21 04:33:14 -08:00
KHobbits
617959a11b Log target plugin in debug mode for altcmd 2012-12-21 06:38:51 +00:00
KHobbits
a480091617 Final all the things - Recipe 2012-12-21 03:48:54 +00:00
KHobbits
13a847e0ab Fix recipe layout for small shapes 2012-12-21 03:35:48 +00:00
KHobbits
a8a8b52977 Swap method order on recipe 2012-12-21 03:21:35 +00:00
KHobbits
226a75472c Adjust section matching. 2012-12-20 23:37:37 +00:00
KHobbits
a1c88a140e Merge pull request #227 from Elvaron/2.9
FallBack for missing config property
2012-12-20 15:36:01 -08:00
Elvaron
2c3218b056 FallBack for missing config property 2012-12-21 00:16:18 +01:00
KHobbits
27db9e8c3b Merge branch '2.9' of github.com:essentials/Essentials into 2.9 2012-12-20 22:58:00 +00:00
KHobbits
cf0e36c973 Add support for whitelisting commands in /help by permission: essentials.help.<plugin>.<command> 2012-12-20 22:57:38 +00:00
KHobbits
1218a0b217 Reduce permissions checking when generating /help 2012-12-20 22:54:36 +00:00
KHobbits
adb75b69c2 Allow certain commands while in jail, but only if the user normally has access to that command. 2012-12-20 22:53:52 +00:00
KHobbits
010df964a1 Merge pull request #226 from Elvaron/2.9
Made socialspy commands list configurable
2012-12-20 14:16:45 -08:00
Elvaron
0e2e8e16af Made socialspy commands list configurable 2012-12-20 23:07:22 +01:00
KHobbits
6f28540d59 Merge branch 'release' of github.com:essentials/Essentials into 2.9 2012-12-20 20:37:42 +00:00
KHobbits
ce78125028 Add a little bit of extra information to /seen, this will show when user is online. 2012-12-20 20:37:04 +00:00
KHobbits
10b972bd07 Warn other party when teleport fails after tpaccept. 2012-12-20 20:24:07 +00:00
KHobbits
371a6437ae Redundant tpaccept cost check. 2012-12-20 20:23:51 +00:00
KHobbits
78666ade2b Fix max tempban length option. 2012-12-20 20:11:45 +00:00
KHobbits
8f00aa5542 Warn other party when teleport fails after tpaccept. 2012-12-20 20:01:43 +00:00
KHobbits
b2d68fe213 Redundant tpaccept cost check. 2012-12-20 19:50:59 +00:00
KHobbits
a6c13974c4 Merge branch 'release' of github.com:essentials/Essentials into 2.9 2012-12-20 17:03:48 +00:00
KHobbits
fb0cd8fbf0 Remove command cost warnings from plugin matching. 2012-12-20 15:51:49 +00:00
Chris Ward
01d1ae442e Fix currency display in MOTD - display currency character, trim decimal places 2012-12-20 15:45:32 +00:00
snowleo
dc13f46ff1 Don't use broken CB methods ... 2012-12-20 15:45:22 +00:00
snowleo
f125ac3b4a Don't use broken CB methods ... 2012-12-20 16:07:40 +01:00
Chris Ward
be29a373ab Useless import 2012-12-20 23:10:38 +11:00
Chris Ward
b28db7e435 Fix currency display in MOTD - display currency character, trim decimal places 2012-12-20 23:07:49 +11:00
md_5
3ac6cc11e3 Fix nagging for overriden commands. 2012-12-20 09:56:30 +01:00
snowleo
9097bef728 Merge branch 'refs/heads/groupmanager' into 2.9 2012-12-20 09:55:26 +01:00
snowleo
68e401821f Fix gm builds
Change craftbukkit.jar -> bukkit,jar
2012-12-20 09:36:35 +01:00
md_5
7f9a52c3f7 Lets leave numeric homes as is for now, looping through all files on server startup is not the place to do this (reverse-merged from commit 79a44b919c) 2012-12-20 17:24:14 +11:00
md_5
79671d08e4 Fix nagging for overriden commands. 2012-12-20 17:11:05 +11:00
Chris Ward
d01d6bcd1b Fix NPE in update (sorry again :P) 2012-12-20 15:45:09 +11:00
Chris Ward
79a44b919c Update home names to prepend "home" to numeric home names 2012-12-20 13:11:05 +11:00
snowleo
477e1a4f58 Force people to use latest CB version 2012-12-20 00:46:03 +01:00
snowleo
c028c385b6 Fix Spawns / Jail loading 2012-12-20 00:46:03 +01:00
snowleo
f9bcc3100c Update Inventory Workaround to the latest version
Still bugged in CB: maxAmount of items
2012-12-20 00:46:03 +01:00
snowleo
3ea3d18922 Force people to use latest CB version 2012-12-19 23:28:18 +01:00
snowleo
3faedec602 Fix Spawns / Jail loading 2012-12-19 23:26:29 +01:00
snowleo
2a88a314ce Update Inventory Workaround to the latest version
Still bugged in CB: maxAmount of items
2012-12-19 22:07:03 +01:00
ElgarL
38293560d7 Update Bukkit to version #2543 (1.4.5-R1.0) To ensure we are all
compatible with current recommended build.
2012-12-19 15:10:37 +00:00
Chris Ward
f57b3595ed Fix recipe command 2012-12-20 01:35:55 +11:00
md_5
e2e6bb3876 Simply using the SnakeYaml default (which in turn defaults to Class.forName) appears to be enough to get the classes for our custom configuration. This avoid Bukkit depreciation. 2012-12-19 12:57:05 +00:00
KHobbits
4e399778b4 Merge branch '2.9' of github.com:essentials/Essentials into 2.9 2012-12-19 12:54:00 +00:00
KHobbits
9ba5f43315 Updating Bukkit to 1.4.5 RB
Bukkit: 1643 CB: 2543
2012-12-19 12:52:05 +00:00
Chris Ward
0bde364125 Merge pull request #223 from chrisgward/patch-1
Add /recipe command
2012-12-19 00:28:27 -08:00
md_5
87f5ec491e Simply using the SnakeYaml default (which in turn defaults to Class.forName) appears to be enough to get the classes for our custom configuration. This avoid Bukkit depreciation. 2012-12-19 19:10:02 +11:00
Chris Ward
1f8a0a811f Add /recipe command 2012-12-19 14:57:12 +11:00
KHobbits
74d5590d3b Remove CB from EssCore libs. 2012-12-18 22:58:55 +00:00
KHobbits
258fbdb0e8 Merge pull request #216 from chrisgward/patch-1
Add tempban limit (with override node)
2012-12-18 02:24:45 -08:00
KHobbits
bd4a48c441 Fix command costs warnings. 2012-12-17 18:32:42 +00:00
KHobbits
00bd6a3e02 Support new skeleton and zombie types.
Also fix baby sheep colours.
2012-12-16 21:39:31 +00:00
KHobbits
28ad7b96d2 Log a few extra metrics. 2012-12-16 21:02:02 +00:00
KHobbits
97204c0e8c Merge pull request #217 from necrodoom/patch-7
add "w" alias
2012-12-16 11:07:10 -08:00
Necrodoom
46645cb39f Update Essentials/src/plugin.yml 2012-12-16 18:05:07 +02:00
Necrodoom
dfd6fc78f0 add "w" alias 2012-12-16 18:03:04 +02:00
Chris Ward
ecf5d47e97 Add tempban limit (with override node) and console override to exempt node. 2012-12-17 02:12:38 +11:00
Alexander Schepp
77df82eaff derp
That's why switch statements are bad.
2012-12-16 13:59:25 +01:00
Alexander Schepp
020f2c3ea5 Fix order of messages 2012-12-16 13:48:02 +01:00
KHobbits
5a855eede5 Update bukkit
Bukkit 1608 CraftBukkit 2488
2012-12-16 12:28:49 +00:00
KHobbits
8b4273cbd1 Merge branch 'groupmanager' of github.com:essentials/Essentials into 2.9 2012-12-16 12:12:23 +00:00
Necrodoom
30bc597851 update items.csv to minecraft 1.4.6 2012-12-16 12:52:16 +02:00
Alexander Schepp
13efadbb65 Merge pull request #214 from necrodoom/patch-4
change add-prefix-suffix description
2012-12-15 06:17:22 -08:00
snowleo
6bc3d7f0f4 Fix the gap 2012-12-15 14:22:52 +01:00
snowleo
e706614a3b Align /tp syntax with Minecraft /tp command 2012-12-15 14:12:34 +01:00
Necrodoom
cf68031110 change add-prefix-suffic description
hopefully will keep newbies from changing it for no reason
2012-12-15 12:58:57 +02:00
Iaccidentally
5741cea3f5 Merge pull request #210 from Echo4190/patch-1
Update Essentials/src/config.yml
2012-12-11 04:06:10 -08:00
Echo419
7b879331db Update Essentials/src/config.yml
trillions => trillion
english => English
2012-12-11 12:03:21 +00:00
KHobbits
0a27a631e3 Merge pull request #209 from necrodoom/patch-2
update config.yml to reference wiki more
2012-12-10 09:46:31 -08:00
KHobbits
d8c6587532 Add missing import. 2012-12-10 17:45:32 +00:00
KHobbits
d600f160fe Update metrics to r6 2012-12-10 17:43:06 +00:00
KHobbits
d23c324035 Metrics Diff 2012-12-10 17:40:15 +00:00
Necrodoom
52bfeff5b4 update config.yml to reference wiki more
also changed locale setting to be less confusing
2012-12-10 09:39:22 +02:00
KHobbits
3dcb2a828e Delay sending respawn event until we actually try to respawn user. 2012-12-09 17:32:02 +00:00
KHobbits
0b95a691a6 Revert "Bukkit should have fixed this issue, so we can now get a better first join player experience by teleporting them at once with no delay."
This reverts commit f7daa20be8.

This breaks compatibility with multiverse, and Essentials core.
2012-12-09 17:14:57 +00:00
KHobbits
eba2bad113 Merge branch '2.9' of github.com:essentials/Essentials into 2.9 2012-12-09 17:10:31 +00:00
KHobbits
4f21490ec8 Move null bed check to teleport code 2012-12-09 17:10:12 +00:00
md_5
f7daa20be8 Bukkit should have fixed this issue, so we can now get a better first join player experience by teleporting them at once with no delay. 2012-12-09 16:03:00 +11:00
KHobbits
a9ace1163f Shorten local chat format. 2012-12-08 18:51:18 +00:00
KHobbits
ba380e61ee Some nice friendly messages to help debugging command costs. 2012-12-08 15:51:33 +00:00
KHobbits
bbc306970f Throw error when using /more on full stack 2012-12-07 00:46:13 +00:00
KHobbits
7b997634ef Remove unused variable 2012-12-06 23:27:43 +00:00
KHobbits
1efbc3856c Make BPerms sign group checking behave similarly to same as GM and PEX 2012-12-06 23:26:48 +00:00
KHobbits
f769f96f74 Merge pull request #208 from kukelekuuk00/2.9
Added a total profit message for /sell all|blocks
2012-12-05 09:14:07 -08:00
kukelekuuk00
3f69473072 Added a total profit message for /sell all|blocks 2012-12-05 15:40:17 +01:00
KHobbits
d7bcf6508d Merge branch '2.9' of github.com:essentials/Essentials into 2.9 2012-12-03 09:09:17 +00:00
KHobbits
61c4d8cb5e Update afk status on block interact 2012-12-03 09:08:56 +00:00
Iaccidentally
f7361eed98 Merge pull request #205 from evonuts/patch-1
Spelling/Grammar fixes.
2012-12-01 02:43:20 -08:00
evonuts
deaa72b05d Spelling/Grammar fixes. 2012-12-01 21:51:24 +13:00
Iaccidentally
92bdd51cd4 Merge branch '2.9' of https://github.com/essentials/Essentials into 2.9 2012-11-27 14:54:18 -05:00
snowleo
0ed29c029d Add log color removal.
(This could already be done with the bukkit setting "log-strip-color")
2012-11-27 19:54:32 +01:00
KHobbits
61903355cd Fix kit timers, kit times more than 25 years will be treated as single use. 2012-11-27 18:27:23 +00:00
KHobbits
889f60e58e Userdata cleanup 2012-11-27 17:47:08 +00:00
KHobbits
c4f292f4ef Merge branch 'release' of github.com:essentials/Essentials into 2.9 2012-11-27 15:24:34 +00:00
Iaccidentally
36687e2659 Merge pull request #204 from necrodoom/patch-23
fix typo at config.yml
2012-11-25 09:30:13 -08:00
Necrodoom
948647926d fix typo at config.yml 2012-11-25 15:07:25 +02:00
Iaccidentally
4a4f443fee Merge branch '2.9' of https://github.com/essentials/Essentials into 2.9 2012-11-24 14:55:54 -05:00
KHobbits
18d52821b7 Merge pull request #201 from necrodoom/patch-22
fix spacing at disabled-commands
2012-11-20 11:16:00 -08:00
Necrodoom
ad7d751856 fix spacing at disabled-commands 2012-11-20 19:38:21 +02:00
ElgarL
1151f1a29c Fix recursive error detection when partial mirroring the main world 2012-11-20 14:55:06 +00:00
snowleo
0b1625f4c1 Better fix for last commit 2012-11-19 22:03:25 +01:00
snowleo
1363406b84 Fix for the plugin conflict with any plugin that contains a log4j library 2012-11-19 20:28:12 +01:00
KHobbits
4b875ed4d9 Merge branch 'release' of github.com:essentials/Essentials into 2.9 2012-11-19 14:28:28 +00:00
KHobbits
42872650d2 Add tptoggle others Essentials style. 2012-11-16 01:37:47 +00:00
Iaccidentally
fd87933aa9 Merge remote-tracking branch 'remotes/origin/release' into 2.9 2012-11-13 22:57:14 -05:00
ElgarL
269cf85457 Update bukkit.jar to #1593 in lib so we can reference the new
interfaces.
2012-11-13 10:17:15 +00:00
Iaccidentally
5728f964a5 Merge pull request #195 from evonuts/2.9
Update fly command to allow for /fly on|*ena*|1 and inversely, /fly off|...
2012-11-11 14:21:18 -08:00
ElgarL
a7aa8be37a Prevent GM commands from being used on CommandBlocks. 2012-11-11 20:56:07 +00:00
ElgarL
237c896fff Add support for Rcon. 2012-11-11 20:39:03 +00:00
Iaccidentally
fbb3d7344f update tptoggle to allow toggling other players :: new permission: essentials.tptoggle.others 2012-11-11 14:34:56 -05:00
KHobbits
8b660d32ac Cleanup spawnmob classes
Spawnmob sign nolonger calls Command
Spawnmob other, now spawns at targets feet, rather than where the target is looking
Console can now spawnmob other
2012-11-11 18:55:02 +00:00
Iaccidentally
98bccf6cec Merge pull request #197 from necrodoom/patch-21
Update Essentials/src/com/earth2me/essentials/Mob.java
2012-11-11 09:10:33 -08:00
KHobbits
936606ce7c Mob comment. 2012-11-11 17:04:16 +00:00
Necrodoom
a63748ca3a Update Essentials/src/com/earth2me/essentials/Mob.java 2012-11-11 18:58:05 +02:00
Iaccidentally
a1ce340ce0 Make playerFishEvent cancel AFK :: fixes #3192 2012-11-11 11:43:10 -05:00
KHobbits
a8df79661a Merge branch '2.9' of github.com:essentials/Essentials into release 2012-11-11 14:55:00 +00:00
KHobbits
f52e0ae7a8 Merge branch 'groupmanager' of github.com:essentials/Essentials into 2.9 2012-11-11 14:54:19 +00:00
KHobbits
648a5ef8dd Merge branch '2.9' of github.com:essentials/Essentials into release 2012-11-11 14:53:42 +00:00
Iaccidentally
0d610f761b Merge pull request #196 from necrodoom/patch-20
update ID 101, by andrewkm request
2012-11-10 09:53:16 -08:00
Necrodoom
e7afe4109e update ID 101, by andrewkm request 2012-11-10 19:12:25 +02:00
evonuts
b11a1a7cf2 Fix fly specific settings for other players (eg. /fly evonuts on) 2012-11-10 22:17:39 +13:00
evonuts
6a8a2dd28b Update fly command to allow for /fly on|*ena*|1 and inversely, /fly off|*dis*|0. 2012-11-10 13:40:48 +13:00
ElgarL
a370a8e01c Merge pull request #194 from necrodoom/patch-19
correct spaces at plugin.yml
2012-11-09 05:51:52 -08:00
ElgarL
5e38a2180c Merge pull request #193 from necrodoom/patch-18
GroupManager typo fix
2012-11-09 05:51:15 -08:00
ElgarL
f3bc94a547 Merge pull request #190 from necrodoom/patch-16
fix typos and update ingame error message
2012-11-09 05:50:39 -08:00
Necrodoom
ba0db53c44 correct spaces at plugin.yml 2012-11-08 16:35:57 +02:00
Necrodoom
ef98a6b54c GroupManager typo fix 2012-11-08 16:31:49 +02:00
KHobbits
8c9b755671 Extra perm check in /home 2012-11-08 11:53:26 +00:00
md_5
6c1da1d552 Set a players sleeping ignored status synchronously, just in case! Thanks for the hint mbaxter & Wolvereness. Closes ticket 3179. 2012-11-08 18:57:44 +11:00
Iaccidentally
0df0be5762 Merge pull request #192 from evonuts/2.9
Allow for console based gamemode shortcuts. Fixes ticket #3173
2012-11-07 18:39:39 -08:00
evonuts
83120f707f Allow for console based gamemode shortcuts. Fixes ticket #3173 2012-11-08 15:19:07 +13:00
Iaccidentally
9d98edb4ee fix build 2012-11-04 19:04:10 -05:00
Iaccidentally
a50b0ac71d CB 2455 :: Bukkit 1593 2012-11-04 17:52:35 -05:00
KHobbits
d674e65c11 Allow the 'userIsNotAway' and 'userIsAway' translation messages to be empty. 2012-11-04 22:41:35 +00:00
Alexander Schepp
4967279b8c Allow the noNewMail translation to be empty 2012-11-04 22:34:47 +01:00
KHobbits
4722e687fa Code comments. 2012-11-04 21:31:23 +00:00
Iaccidentally
332a59f3fc allow money to be put in kits using the currency symbol before the amount 2012-11-04 16:25:09 -05:00
KHobbits
587f532991 Use durability instead of itemdata for antibuild checks.
Fixes potion blocking using antibuild.
2012-11-04 18:02:36 +00:00
KHobbits
10244d5f90 Fix godmode pvp protection not blocking thrown pots and arrows. 2012-11-04 17:31:57 +00:00
KHobbits
6f1a70dc8b Fix missing mob target block 2012-11-04 16:45:02 +00:00
KHobbits
7369155166 Fix a few more errors in plugin.yml 2012-11-04 13:29:39 +00:00
KHobbits
28d4609c8c Fix plugin.yml typo. 2012-11-04 13:16:05 +00:00
KHobbits
d2966b64eb Code comments 2012-11-04 02:24:54 +00:00
KHobbits
c8f8680ce9 Limit tnt disable on /nuke to 10s 2012-11-04 02:18:51 +00:00
md_5
9fcb412774 Update Spanish translations thanks to nikooo14. 2012-11-03 11:47:39 +11:00
Necrodoom
296af1069e Update EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java 2012-11-02 18:21:26 +02:00
Alexander Schepp
b22e97b3cf remove all L 2012-10-31 21:30:57 +01:00
Iaccidentally
dcf90cbf5a Make /exp accept L before or after the amount, add extra checks 2012-10-31 16:25:13 -04:00
Alexander Schepp
4dc2e2e3fd Handle int overflow in SetExpFix 2012-10-31 21:06:30 +01:00
Alexander Schepp
4d4779ecdc Use the class, not the interface
This code will be changed later, once Elgarl updates the gm branch to 1.4
2012-10-31 20:06:32 +01:00
Alexander Schepp
1c25d317dd Quickfix to prevent GM commands from being called by BlockCommandSender. 2012-10-31 19:44:13 +01:00
Iaccidentally
651a62890a fix minimum required bukkit version. 2012-10-29 14:26:51 -03:00
Iaccidentally
39b38f0619 CB 2420 :: Bukkit 1570 :: Update FakeServer and OfflinePlayer 2012-10-29 13:17:56 -04:00
KHobbits
4a194e8758 Merge pull request #185 from evonuts/patch-5
Update Essentials/src/config.yml
2012-10-29 02:21:24 -07:00
evonuts
5a35da53a0 Update Essentials/src/config.yml
'flase' typo in wither-spawnexplosion
2012-10-29 22:06:23 +13:00
ementalo
8d64c7c81b Fix mail 2012-10-28 20:09:25 +00:00
ementalo
bea3583192 Fix mail 2012-10-28 20:00:15 +00:00
Iaccidentally
618d115233 typo fix 2012-10-28 15:03:45 -03:00
Iaccidentally
5e476f4d61 Update Essentials/src/com/earth2me/essentials/commands/Commandtppos.java
2.9 too
2012-10-28 15:01:54 -03:00
Iaccidentally
5bc1b8df70 nothing to see here, move along (typo fix) 2012-10-28 13:09:19 -04:00
Iaccidentally
72e0ab2cb2 NOW with complete wither protection! 2012-10-28 13:05:08 -04:00
Iaccidentally
e0d189a5e0 oops! :: fix wither spawn explosion blocking 2012-10-28 12:58:01 -04:00
Iaccidentally
91c193b773 Fully support wither blocking in protect 2012-10-28 12:53:12 -04:00
Iaccidentally
4a18130354 CB #2415 2012-10-28 12:23:47 -04:00
Iaccidentally
7c6268fe20 Merge branch '2.9' of https://github.com/essentials/Essentials into 2.9 2012-10-28 11:10:17 -04:00
Iaccidentally
6f213c23e2 update tppos to not accept coords over 30000000 2012-10-28 11:09:49 -04:00
Iaccidentally
cc606fe1aa Merge pull request #184 from necrodoom/patch-15
add bat egg and witch egg
2012-10-28 07:40:52 -07:00
Necrodoom
ee8638841d add bat egg and witch egg
enderdragon and wither have no useable eggs, so not added
2012-10-28 16:37:23 +02:00
Iaccidentally
9864a75c32 Protect updates :: ability to prevent wither damage :: block spawning of new mobs 2012-10-28 09:39:54 -04:00
Iaccidentally
520427239f CB #2406 Bukkit #1568 2012-10-28 09:11:50 -04:00
md-5
614a229ea7 Merge pull request #183 from evonuts/patch-4
Update Essentials/src/config.yml
2012-10-28 03:22:55 -07:00
evonuts
2a4d40020e Update Essentials/src/config.yml 2012-10-28 22:37:00 +13:00
md_5
d6efae202a Why the f*** do we depend on Bukkit too? 2012-10-28 20:09:26 +11:00
md-5
7b9c711486 Merge pull request #182 from evonuts/patch-3
Update Essentials/src/config.yml
2012-10-28 02:02:24 -07:00
md_5
e2bd22d984 No idea why this still refuses to compile locally. Stupid ant. 2012-10-28 20:01:27 +11:00
evonuts
2310b41b21 Update Essentials/src/config.yml 2012-10-28 21:55:20 +13:00
md-5
2ae9c577db Merge pull request #180 from Glyca/2.9
Added, fixed and improved French translations
2012-10-28 01:38:51 -07:00
md-5
7c9375ce2e Merge pull request #176 from necrodoom/patch-14
update files to minecraft 1.4
2012-10-28 01:37:22 -07:00
Glyca
9addc2ccd5 Added, fixed and improved French translations 2012-10-27 21:47:55 +02:00
Necrodoom
e180f6e6b3 update ID 137 2012-10-27 10:41:50 +03:00
KHobbits
f0e29552bc Merge branch '2.9' of github.com:essentials/Essentials into release 2012-10-26 21:41:49 +01:00
KHobbits
48d04216a7 Reduce calls to bukkit getPlayer(); 2012-10-26 21:34:36 +01:00
ementalo
ff6221f1a8 2.9 Release 2012-10-26 09:48:45 +01:00
KHobbits
0bc33554f3 Fix tp delay message 2012-10-23 00:00:55 +01:00
KHobbits
7c480e88d6 Update EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java 2012-10-22 14:55:52 +02:00
KHobbits
c357d19c56 Update listener comment 2012-10-22 12:27:01 +02:00
Alexander Schepp
86124b2705 Fix NPE in UserData on login
if no address is available
2012-10-21 23:17:08 +03: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
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
Necrodoom
2ea453110a update mob.java to 1.4 2012-10-20 12:24:18 +03:00
Necrodoom
a86efb5ebe update items.csv to 1.4
items.csv version 2.2_01
2012-10-20 12:11:27 +03:00
ementalo
e61fa58d2b Fix test 2012-10-17 13:14:59 +01:00
ementalo
ec5edf7bd2 CB #2396 B #1566 2012-10-17 13:09:03 +01:00
snowleo
8dbcebda53 Don't call plugin manager in Settings. 2012-10-15 20:30:52 +02:00
KHobbits
28d2a9ed2e Merge pull request #174 from necrodoom/patch-13
fix sandstone slab aliases
2012-10-14 09:44:26 -07:00
Necrodoom
d47e9145f3 fix sandstone slab aliases 2012-10-14 19:40:57 +03:00
KHobbits
ae7c64619c Allow kicking of hidden players 2012-10-14 13:04:00 +01:00
KHobbits
bdef1780ac Warn when banning a player who has never connected to the server. 2012-10-14 13:03:54 +01:00
Iaccidentally
ced192e8fd Update Essentials/src/items.csv
quick items.csv fix
2012-10-09 05:19:27 -03:00
KHobbits
0a9e9ca41d Merge branch '2.9' of github.com:essentials/Essentials into 2.9 2012-10-07 22:40:18 +01:00
KHobbits
4982cc950e Add alt warp perm for others 2012-10-07 22:40:04 +01:00
snowleo
140a9100b7 Update AntiBuild for NB7.2 2012-10-07 23:00:09 +02:00
snowleo
0097f961b4 Prevent massive amount of mails being send.
Added new config: mails-per-minute, default 1000
2012-10-07 22:46:15 +02:00
KHobbits
98d657ec4b New permission: essentials.vanish.pvp
If you don't have this permission you cannot PVP while vanished.
2012-10-07 18:10:50 +01:00
KHobbits
63149d0b50 Change default action colour to be different to /say 2012-10-06 22:26:51 +01:00
KHobbits
7a410919a0 Code comments 2012-10-06 03:49:36 +01:00
KHobbits
aa7a39d0b0 Comment for future sanity. 2012-10-05 02:06:23 +01:00
KHobbits
9b88107897 Fix gamemode other perm check 2012-10-02 21:06:28 +01:00
KHobbits
147a2fc227 Better handle invalid warp names 2012-10-02 00:19:42 +01:00
KHobbits
732dc3bf34 Cleanup sethome 2012-10-01 20:32:10 +01:00
Alexander Schepp
227cde75a7 Merge pull request #171 from chrisgward/patch-5
Adding console override to sudo chat
2012-10-01 10:31:48 -07:00
Chris Ward
e670d0af45 Adding console override to sudo chat, changing say to c: 2012-10-02 03:30:13 +10:00
ElgarL
cd0fde05b7 Merge remote-tracking branch 'remotes/origin/2.9' into groupmanager 2012-10-01 17:51:56 +01:00
ElgarL
8cf2ce7b73 Merge branch '2.9' of https://ElgarL@github.com/essentials/Essentials.git into 2.9 2012-10-01 17:50:08 +01:00
ElgarL
1ecf592893 Move Event to LOW so permissions get updated before this event is
triggered.

With LOWEST it would only randomly work with most perm systems,
depending on the loading order.
2012-10-01 17:49:42 +01:00
Alexander Schepp
0dd0dba338 Merge pull request #165 from chrisgward/patch-2
Adding say command to sudo to fake chat
2012-10-01 09:34:49 -07:00
Alexander Schepp
678ae78767 Merge pull request #166 from chrisgward/patch-3
Blocking numeric home names, changing invalid home message
2012-10-01 09:34:09 -07:00
Chris Ward
d8b6742543 Blocking numeric home names, changing invalid home message 2012-10-02 02:32:52 +10:00
Chris Ward
2671f39951 Adding -c switch to sudo to fake chat 2012-10-02 02:31:15 +10:00
Alexander Schepp
d7ddf3c828 Merge pull request #169 from chrisgward/patch-5
Adding console only overrides to exempts
2012-10-01 09:15:18 -07:00
Alexander Schepp
2b7cba936d Merge pull request #170 from chrisgward/2.9
Fixing storage of compiled regex
2012-10-01 09:12:35 -07:00
Chris Ward
2757c707bb Fixing storage of compiled regex 2012-10-02 02:11:05 +10:00
Chris Ward
f50c5276e4 Adding console overrides to exempts 2012-10-02 01:57:29 +10:00
Iaccidentally
a7e692fe37 Merge pull request #164 from chrisgward/patch-1
Fixing bad file names in Windows (Fixes #2924)
2012-10-01 07:16:22 -07:00
Chris Ward
02d273f15e Fixing bad file names in Windows (Fixes #2924) 2012-10-01 21:20:17 +10:00
ElgarL
778f5649c8 allWorldsDataList now returns fully mirrored worlds whihc are not
identical mirrors (fixes the /manselect list).
2012-10-01 12:05:49 +01:00
KHobbits
d7829bef28 Merge pull request #163 from chrisgward/patch-1
Fixes #2933
2012-10-01 03:27:37 -07:00
Chris Ward
d436d10b00 Typo (Ticket 2933) 2012-10-01 20:12:13 +10:00
KHobbits
2d9254eb28 Merge pull request #158 from necrodoom/patch-10
update potion aliases- add all unused potions
2012-09-30 13:55:20 -07:00
KHobbits
23393aea5f Merge pull request #162 from necrodoom/patch-12
small fixes to items.csv
2012-09-30 13:55:09 -07:00
KHobbits
e1562e38bf Restore removed tp method, it is used in other plugins. 2012-09-30 18:15:46 +01:00
KHobbits
4dcce2544e Update Bukkit/CB to 1.3.2 R1
Bukkit: 1546 CB: 2377
2012-09-30 17:33:49 +01:00
Necrodoom
29fa2f0f19 small fixes to items.csv 2012-09-30 19:22:14 +03:00
KHobbits
b850ae93e9 Merge branch 'release' of github.com:essentials/Essentials into 2.9 2012-09-30 17:21:09 +01:00
Necrodoom
21cb8efb90 update kit sign permission check 2012-09-30 17:16:03 +01:00
Necrodoom
cd7be1bb86 update warp sign permission check 2012-09-30 17:15:57 +01:00
KHobbits
69cd17a1b1 Should fix tpaccept charge bug - needs testing 2012-09-30 17:15:40 +01:00
KHobbits
872bc4df4c New permission: essentials.teleport.timer.move - allow players to move during tp delay 2012-09-29 23:48:59 +01:00
KHobbits
3083ba2627 Little bit DRYer 2012-09-29 23:41:12 +01:00
KHobbits
35259892b8 Merge branch '2.9' of github.com:essentials/Essentials into 2.9 2012-09-29 23:35:09 +01:00
KHobbits
fbc0f13b2b Properly handle tphere requests so the right user is in control/charged. 2012-09-29 23:34:46 +01:00
KHobbits
aa7f49cb85 Tidy Teleport file 2012-09-29 23:33:32 +01:00
KHobbits
720676542e Merge pull request #161 from necrodoom/patch-11
update signs permission check
2012-09-29 13:52:07 -07:00
Necrodoom
1d7eb77f27 update kit sign permission check 2012-09-29 15:57:31 +03:00
Necrodoom
895f6269fc update warp sign permission check 2012-09-29 15:55:47 +03:00
KHobbits
4bf0d3ab24 Should fix tpaccept charge bug - needs testing 2012-09-29 03:59:31 +01:00
KHobbits
afccda6350 Merge branch 'groupmanager' of github.com:essentials/Essentials into 2.9 2012-09-28 23:01:32 +01:00
KHobbits
c0a176825c Add potion effect clearing on /heal - Chris Ward 2012-09-28 20:56:03 +01:00
KHobbits
db6512b702 Cleanup of god mode effects, suggested by gravypod. 2012-09-28 20:45:56 +01:00
KHobbits
46d3f0827a God mode cancel potion effects - Chris ward
Revert heal changes.
2012-09-28 20:35:13 +01:00
Necrodoom
838d7dd8f9 update potion aliases- add all unused potions
items.csv version 2.1_13
2012-09-28 17:02:43 +03:00
Paul A.
b9e5c8827f Fix updating version on items.csv 2012-09-27 16:39:23 +02:00
Paul A.
b8e000c7f9 Merge pull request #156 from evonuts/patch-1
Minor spelling/grammatical fixes
2012-09-27 05:47:31 -07:00
evonuts
5e7af93c77 Minor spelling/grammatical fixes 2012-09-28 00:42:25 +12:00
Paul A.
077ad8cd0f Merge pull request #154 from necrodoom/patch-9
typo fix in config.yml as found by @Evonuts
2012-09-27 05:22:09 -07:00
Necrodoom
0bf954e467 typo fix in config.yml 2012-09-27 15:19:14 +03:00
KHobbits
8a55afc4e1 Remove debug comments. 2012-09-25 22:37:58 +01:00
KHobbits
2bc9f2e386 Handle negated wildcard perms in generic superperms 2012-09-25 22:21:15 +01:00
ElgarL
920e1a3b1f Update users.yml to follow new ordering. 2012-09-25 20:41:16 +01:00
ElgarL
353253b9c5 No need for a new array. 2012-09-25 20:39:24 +01:00
ElgarL
1438230b70 Add alphabetically sorted user lists. 2012-09-25 13:23:19 +01:00
KHobbits
240aebde98 Merge branch 'groupmanager' of github.com:essentials/Essentials into 2.9 2012-09-25 13:16:41 +01:00
ElgarL
d4e2ed782e Change order of data in Users.yml to [name, Group, SubGroup,
Permissions, Info nodes].
2012-09-25 13:09:26 +01:00
ElgarL
f025cd9d2f Commenting 2012-09-25 11:27:36 +01:00
ElgarL
1ff7082892 Fix javadocs 2012-09-25 11:25:19 +01:00
ElgarL
15fa10dd29 Minor typo fix - Necrodoom 2012-09-25 11:15:28 +01:00
KHobbits
00b4bdadd4 Revert "Clean up imports"
This reverts commit d2546ebd36.
2012-09-24 23:04:33 +01:00
KHobbits
3055dd93a5 Improve fake sign check. 2012-09-24 23:01:58 +01:00
Paul A.
94dc29cc4d Merge pull request #151 from gravypod/patch-2
Clean up imports
2012-09-24 14:34:36 -07:00
KHobbits
22d1db5463 Envelope new drop/pickup/craft perms under 'essentials.build'. 2012-09-24 12:48:07 +01:00
KHobbits
f2b4bb00b6 Minor cleanup 2012-09-24 03:16:15 +01:00
gravypod
d2546ebd36 Clean up imports 2012-09-23 22:06:39 -03:00
KHobbits
f1930e76d6 Fix and give better sign errors. 2012-09-24 00:19:39 +01:00
KHobbits
d722e6a9f0 Less sign checking if certain signs aren't enabled. 2012-09-23 23:51:57 +01:00
KHobbits
8e6d4b1595 config typo. 2012-09-23 23:18:17 +01:00
KHobbits
72065c81f3 Minor colour change 2012-09-23 23:08:35 +01:00
KHobbits
2864d0186c Move wildcard perm check to superperms handler, rather than being PEX specific. 2012-09-23 23:01:14 +01:00
KHobbits
9c9b2be011 Lower reporting level of metrics errors. 2012-09-23 18:08:43 +01:00
KHobbits
2f40264c46 Support new lines in newbie welcome message. 2012-09-22 21:15:04 +01:00
KHobbits
5cc24827fc Merge branch 'groupmanager' of github.com:essentials/Essentials into 2.9
Resolved Conflicts:
	EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java
2012-09-22 20:44:45 +01:00
KHobbits
da01bdc2b0 Cleanup delhome to match normal home cases properly. 2012-09-22 20:43:27 +01:00
ElgarL
dfb81dd50f Update warning in GlobalGroups - Necrodoom. 2012-09-22 19:51:38 +01:00
ElgarL
567d52459b - Fix Synchronization on adding subgroups (thanks snowleo).
- Remove info node support from GlobalGroups. It should not have them
as GlobalGroups are only permission collections.
2012-09-22 19:18:51 +01:00
KHobbits
80a96e2a73 Reset colour code at start of default broadcast msg. 2012-09-22 15:00:00 +01:00
KHobbits
c2f8467ca9 General demo txt formatting 2012-09-22 14:44:56 +01:00
KHobbits
155ca46fef Clean chat colours. 2012-09-22 14:40:56 +01:00
KHobbits
0952150235 Clean up the info.txt 2012-09-22 14:36:07 +01:00
KHobbits
30faa39070 Merge pull request #148 from necrodoom/patch-7
fix info.txt colors and tags
I'll do a little manual cleanup.
2012-09-22 06:21:51 -07:00
KHobbits
3e367912ec Possibly solve info writing issues in globalgroups
Editing this on the ess branch, cause i'm sure there is a better fix.
2012-09-22 04:35:55 +02:00
Necrodoom
f8cff25bda fix info.txt colors and tags 2012-09-21 18:09:30 +03:00
md_5
3e80bf479e Check for explicit * permission when using PEX. 2012-09-21 19:53:20 +10:00
KHobbits
84afc80873 Update config.yml to show multiple enchantments for kits. 2012-09-21 02:10:39 +01:00
KHobbits
27a943217e Make sure we check for wildcards in PEX 2012-09-20 20:36:07 +01:00
KHobbits
16834d85c5 Switch pex permissions checks to use superperms rather than direct api call. 2012-09-20 20:21:45 +01:00
KHobbits
44d8c85450 ignoreCancelled events. 2012-09-19 21:07:50 +01:00
KHobbits
2a8e44dda8 New Permission:
essentials.build.pickup.<id>[:<datavalue>] - Allows collecting of an item
essentials.build.drop.<id>[:<datavalue>] - Allows dropping of an item
2012-09-19 20:57:06 +01:00
KHobbits
00e3957190 Merge branch '2.9' of github.com:essentials/Essentials into 2.9 2012-09-19 19:48:14 +01:00
KHobbits
a79b76e8d2 New Permission:
essentials.build.craft.<id>[:<datavalue>] - Allows crafting of an item
2012-09-19 19:47:47 +01:00
md_5
0a092ff5b3 Self indulgent commit. Door should be an alias for wood door. 2012-09-17 21:55:52 +10:00
KHobbits
e6aeefb12d Hide Protection sign option. 2012-09-17 11:29:16 +01:00
KHobbits
924b6bd2ba Fix a few minor text formatting issues. 2012-09-16 20:45:33 +01:00
KHobbits
f701090c89 Config file permissions cleanup
Removed deprecated 'restricted-commands' section.
Deprecated 'superperms' toggle.
Remove op override on essentials permissions.
Give op's all permissions by default via superperms.
2012-09-16 20:27:35 +01:00
KHobbits
b9195a561f Merge pull request #146 from necrodoom/patch-6
update dualbit, fix strength, add swift aliases
2012-09-16 08:48:16 -07:00
Necrodoom
d94e4095da update dualbit, fix strength, add swift aliases
items.csv version 2.1_12
2012-09-16 18:46:46 +03:00
md_5
fd61cd1750 Merge remote-tracking branch 'origin/groupmanager' into 2.9 2012-09-16 23:02:56 +10:00
Iaccidentally
e7ae8bcc47 Update Essentials/src/plugin.yml
updating SKYNET
2012-09-15 21:07:42 -03:00
KHobbits
edc4d62004 Missing tl key. 2012-09-15 22:06:42 +01:00
KHobbits
cdff690bb5 Add server uptime to /gc 2012-09-15 22:04:18 +01:00
KHobbits
aa14cc39d9 Add missing TL key
Fixes #1363
2012-09-15 21:16:31 +01:00
KHobbits
cdf2c8beed Allow bans on players who have never connected. 2012-09-15 20:57:44 +01:00
KHobbits
3e06c06827 Reduce the enchantment list some more. 2012-09-15 20:29:29 +01:00
KHobbits
a2886d76d2 Fix Essentials /sethome to more strictly obey home limits. 2012-09-15 19:55:12 +01:00
KHobbits
cc0a65bace /ess reset <player> - Clears stored data about a user. 2012-09-14 02:30:24 +01:00
KHobbits
d988546ef3 Merge branch '2.9' of github.com:essentials/Essentials into 2.9 2012-09-14 01:11:04 +01:00
KHobbits
b7f2add7b4 Fixed jail extend message - xGhOsTkiLLeRx 2012-09-14 01:10:22 +01:00
KHobbits
b07f65c58b Update Essentials/nbproject/project.properties
Accidentally added unneeded line...
2012-09-14 02:01:02 +02:00
KHobbits
18e315a048 Merge branch '2.9' of github.com:essentials/Essentials into 2.9 2012-09-14 00:59:25 +01:00
KHobbits
d3967297bb Don't create empty user files 2012-09-14 00:58:57 +01:00
KHobbits
ea3631ddc2 Merge pull request #141 from DerFlash/2.9
Fix problems with async chat event not sending messages to xmpp chat spy
2012-09-13 06:21:11 -07:00
DerFlash
992e473b72 Fix problems with async chat event not sending messages to xmpp chat spy 2012-09-13 14:57:02 +02:00
KHobbits
0296f4fcf1 remove users from bperm example, different yml file now. 2012-09-13 01:50:55 +01:00
KHobbits
2fc16250a3 Update bpermissions example 2012-09-13 01:46:23 +01:00
ElgarL
75f7b06a23 Remove unused imports. 2012-09-11 11:12:19 +01:00
KHobbits
a7e834e5f9 Couple extra /info aliases. 2012-09-11 05:05:55 +01:00
KHobbits
59086932bd Less strict matching on /realname 2012-09-11 01:07:31 +01:00
KHobbits
5611acf12c Make /realname throw an error if no matches were found 2012-09-11 00:53:32 +01:00
snowleo
60142d872f Missing final 2012-09-10 20:53:25 +02:00
snowleo
1cf0ebbd7f Thread safety for GM 2012-09-10 20:49:07 +02:00
snowleo
736a6d273a Revert bad synchronization
This reverts commit 96ab1b4533.
2012-09-10 19:06:17 +02:00
ElgarL
71179e3dfd Synchronize the world data holder. 2012-09-10 17:46:01 +01:00
KHobbits
24cdc37987 Patch flight disable, to not effect creative mode.
Full world change config still needs coding.
2012-09-10 01:13:30 +01:00
KHobbits
b606f153f4 Fixing map/ironore bug. 2012-09-10 01:10:32 +01:00
ElgarL
96ab1b4533 Change to Hashtables to reduce the chance of a
ConcurrentModificationException pulling group/user data in an Async
thread.
2012-09-10 00:15:42 +01:00
KHobbits
8718d59286 Little bit extra sanity checking. 2012-09-09 20:13:03 +01:00
KHobbits
5d372b8149 Move auto afk permission to 'essentials.afk.auto' 2012-09-09 19:09:35 +01:00
KHobbits
1d62de7e5e Fixing locale typo. 2012-09-09 18:35:20 +01:00
KHobbits
3691417848 Fix Missing TL key 2012-09-09 17:10:26 +01:00
KHobbits
029162bba7 Change default op colour 2012-09-09 16:55:43 +01:00
KHobbits
161a61e0c6 More message cleanup 2012-09-09 16:52:45 +01:00
KHobbits
587addb73f Manual merge necrodoom enchant changes. 2012-09-09 16:29:38 +01:00
KHobbits
d71bd7fb71 Two sets of enchantment aliases. 2012-09-09 16:27:22 +01:00
KHobbits
699ec273dd More message cleanup 2012-09-09 16:15:12 +01:00
KHobbits
c1eed8ebcd Missing TL keys 2012-09-09 15:50:22 +01:00
KHobbits
b8d0cf4cc4 Few more message tweaks. 2012-09-09 15:27:25 +01:00
KHobbits
ff0dd00d79 If chat event doesn't resolve to valid player, cancel and exit. 2012-09-09 06:36:14 +01:00
KHobbits
e18d12f109 Message cleanup. 2012-09-09 05:41:06 +01:00
KHobbits
0a09b355b2 Update some of the example permissions files for the perm changes. 2012-09-08 23:00:57 +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
78a580bc40 Log to console the effects of /sudo 2012-09-08 21:10:26 +01:00
KHobbits
8c4d6ad4df Remove dead setting.
Fixes #2465
2012-09-08 20:41:38 +01:00
KHobbits
9c9d4e1da5 Move the per kit and warp permissions:
essentials.kit.kitname is moved to essentials.kits.kitname
essentials.warp.warpname is moved to essentials.warps.warpname
2012-09-08 20:32:48 +01:00
KHobbits
ce50e1448b Look out for nulls. 2012-09-08 18:41:21 +01:00
KHobbits
8e885a3a6e Make /itemdb command list the 15 shortest item.csv names for said item.
This will be useful when making eco signs.
2012-09-08 18:33:06 +01:00
KHobbits
ecd96a81dd Fix /itemdb showing 'uses left' on none held items. 2012-09-08 16:33:00 +01:00
KHobbits
427108574e Fix compile error. 2012-09-08 16:03:54 +01:00
KHobbits
62381a7f52 Async EssentialsSpawn join event, like the others. 2012-09-08 14:55:37 +01:00
KHobbits
b1b09ea542 New Permission: essentials.god.pvp
Unless you have this permission you will be unable to attack other players while in god mode.
2012-09-08 14:51:03 +01:00
KHobbits
e502a7e6fd Give user chance to get display name set before displaying geoip. 2012-09-08 14:40:19 +01:00
KHobbits
acf4d0bcf5 Potential fix for teleporting issue. 2012-09-08 14:30:11 +01:00
KHobbits
6c3b13a7a4 Switch default antibuild status to false. Antibuild toggling shouldn't be an issue with it as a stand alone plugin. 2012-09-08 14:11:12 +01:00
snowleo
cababcbfcf Fix ConcurrentModification bugs
This will probably slow down any access to config
2012-09-07 18:33:28 +02:00
Iaccidentally
a032d0f19f Update Essentials/src/com/earth2me/essentials/commands/Commandburn.java
typo fix
2012-09-04 00:16:23 -03:00
KHobbits
f808e6fa8e Catch null eco symbol. 2012-09-02 20:17:28 +01:00
KHobbits
842d9f73a4 More error on 'Permissions system error' in debug mode. 2012-09-02 18:30:59 +01:00
KHobbits
c2893788e7 Merge branch '2.9' of github.com:essentials/Essentials into 2.9 2012-09-02 18:11:54 +01:00
KHobbits
0b8a6c45c6 Update /kit delay to use updated yaml code. 2012-09-02 18:11:29 +01:00
KHobbits
2049e630fb Merge pull request #136 from necrodoom/patch-3
update enchants with 3-1 letter aliases
2012-09-02 07:51:29 -07:00
KHobbits
6fd82480a3 Add support for /gamemode toggle | /gamemode t and /gmt to toggle between the 3 gamemodes. 2012-09-02 06:54:58 +01:00
KHobbits
e919897f1b Merge branch '2.9' of github.com:essentials/Essentials into 2.9 2012-09-02 01:57:10 +01:00
Iaccidentally
0fb5fc6bcc fix burn matching all players 2012-09-01 16:40:49 -04:00
Necrodoom
a7d61b1b8d update enchants with 3-1 letter aliases 2012-09-01 10:33:20 +03:00
KHobbits
be9a58457a Another Config tweak. 2012-08-31 22:31:56 +01:00
KHobbits
b1cfc8a8ed Merge branch 'groupmanager' of github.com:essentials/Essentials into 2.9 2012-08-31 22:28:21 +01:00
KHobbits
6b9b6ba420 Config file tweaks 2012-08-31 22:26:26 +01:00
ElgarL
79c70b1f65 Include the GM version when logging errors. 2012-08-31 21:56:46 +01:00
ElgarL
cfe634e8f7 Give a better error when a subgroup is null. 2012-08-31 21:47:35 +01:00
KHobbits
8c8c6fe73a Fix powertool command logging. 2012-08-31 18:52:40 +01:00
KHobbits
a4353bc8f2 Don't need built in command logger anymore. 2012-08-31 18:44:14 +01:00
KHobbits
4015351c85 Sanity Check. 2012-08-31 17:57:57 +01:00
KHobbits
e89f1d8a03 Add missing repair cost check on /repair hand 2012-08-31 17:54:10 +01:00
KHobbits
ff461be45d Merge branch '2.9' of github.com:essentials/Essentials into 2.9 2012-08-31 17:48:25 +01:00
KHobbits
93f5a05f17 Reduce the number of permissions checks in command cost lookups
Add support for item number repair costs (repair-123: 120)
Ess charge api supports nested charges.
Slight kit optimization.
2012-08-31 17:48:07 +01:00
KHobbits
3eba7fb90f Merge pull request #134 from necrodoom/patch-16
clear whitespace in globalgroups.yml
2012-08-31 06:48:07 -07:00
Necrodoom
25d51cd79e clear whitespace in globalgroups.yml 2012-08-31 16:40:25 +03:00
KHobbits
a39824abb6 Merge branch '2.9' of github.com:essentials/Essentials into 2.9 2012-08-31 14:09:44 +01:00
KHobbits
2ac4c8e665 Fix metrics when kits are improperly configured. 2012-08-31 14:09:20 +01:00
Paul A.
a84afbaa6e Update Essentials/src/config.yml
More grammar from Evonuts
2012-08-31 12:30:40 +02:00
Paul A.
41f7b4ec2d Update Essentials/src/config.yml
Grammar update thanks to Evonuts
2012-08-31 11:37:10 +02:00
KHobbits
ce90e9710e Fix painting break in antibuild. 2012-08-31 06:06:33 +01:00
KHobbits
930eb7ae86 Fix IllegalStateException in sign click patch
Cleanup
2012-08-31 00:47:53 +01:00
KHobbits
cf79a8fdca Fix min bukkit version warning. 2012-08-30 23:28:16 +01:00
KHobbits
1773a6060d Reset fly/speed on world change
This will be optional in a future version - Discuss http://goo.gl/Vuh4N
2012-08-30 23:13:50 +01:00
KHobbits
5755d647a3 Update chat formatting to use &r instead of &f 2012-08-30 20:43:33 +01:00
KHobbits
5032142a49 Clear up overriding comments on config file.
Closes #2725
2012-08-30 19:19:03 +01:00
KHobbits
15e996f485 Merge pull request #133 from necrodoom/patch-15
clarify some things on config
2012-08-30 10:08:38 -07:00
Necrodoom
b37c08fd31 minor fix 2012-08-30 19:00:53 +03:00
Necrodoom
eaca7f9c09 clarify some things on config 2012-08-30 18:58:43 +03:00
KHobbits
00072501c9 Merge pull request #131 from necrodoom/patch-14
update pork aliases
2012-08-29 08:22:04 -07:00
Necrodoom
b50bb03814 update pork aliases
items.csv version 2.1_11
2012-08-29 16:51:38 +03:00
KHobbits
f55316281c Merge branch 'groupmanager' of github.com:essentials/Essentials into 2.9 2012-08-28 03:12:16 +01:00
KHobbits
413a7beaa4 Fix CB. 2012-08-28 03:08:06 +01:00
KHobbits
88140f0610 Merge branch '2.9' into release 2012-08-28 03:05:13 +01:00
KHobbits
4996171b6e Update CB :: Bukkit 1536 || Craftbukkit 2352 (1.3.2-R0.1) 2012-08-28 03:01:49 +01:00
KHobbits
d201286fc5 Merge branch '2.9' of github.com:essentials/Essentials into release 2012-08-28 02:55:02 +01:00
KHobbits
12b527be99 If both freeze-afk-players and cancel-afk-on-move is turned on, cancel AFK on player jump. 2012-08-28 02:50:59 +01:00
KHobbits
e666c27d96 Disable AFK when player damages entity. 2012-08-28 02:24:01 +01:00
KHobbits
56cfc47ef6 Manually merge Nickshelton80's alias change. 2012-08-28 02:08:58 +01:00
KHobbits
c4e4235f30 Handle jail teleport locations slightly better. 2012-08-28 02:06:11 +01:00
KHobbits
e045f9d983 Optimize AntiBuild a little
Support item name deny messages in antibuild.
2012-08-28 01:38:16 +01:00
KHobbits
ba8d060927 Fix minor typo in plugin.yml
Remove 'essentials.interact' permission from antibuild - Not needed
2012-08-27 23:59:29 +01:00
KHobbits
5f73bf12d7 Remove max walk option to config, until its fixed in the client. 2012-08-27 03:09:56 +01:00
KHobbits
616f92c214 Missing [player] param syntax on /afk 2012-08-26 20:26:06 +01:00
KHobbits
298f3dc3b2 Comment out/remove the /speed walk code, until the client properly supports this function. 2012-08-26 19:53:58 +01:00
KHobbits
65741403e0 New command /speed [walk|fly] <speed> [player]
New permissions:
essentials.speed = access to the command
essentials.speed.others = ability to change the speed of another player
essentials.speed.bypass = override max speed limits in config.yml
New config options:
max-fly-speed
max-walk-speed
2012-08-26 19:35:39 +01:00
KHobbits
2b6d41ac5f More work on /fly command - Still incomplete
Updated and fixed messages files for missing keys.
2012-08-26 17:16:22 +01:00
KHobbits
a4936355b5 Updated Spanish Translation 2012-08-26 00:36:35 +01:00
KHobbits
02d6eade28 Foundation for speed command - not yet implemented. 2012-08-25 19:23:41 +01:00
KHobbits
089fa8c19b Add AntiBuild to Metrics. 2012-08-25 16:57:36 +01:00
KHobbits
7c687831bc Don't check for loan permission is there is no cost. 2012-08-22 09:12:38 +01:00
KHobbits
d43cb95d72 New perm: essentials.kit.exemptdelay
Allows you to exempt from kit delays.
2012-08-22 00:27:33 +01:00
ElgarL
d588c3f271 iacc's anal 2012-08-21 21:28:26 +01:00
KHobbits
eaa93d545d Remove debug messages. 2012-08-21 20:45:27 +01:00
KHobbits
e324a21b60 New command: /enderchest [player] (alias /endersee and /echest)
This command lets you look inside your or another players enderchest
New Permissions:
essentials.enderchest - Access to the command
essentials.enderchest.others - Lets you look at other enderchests
essentials.enderchest.modify - Lets you modify other enderchests
2012-08-21 20:44:09 +01:00
KHobbits
b9cfd44588 Update CB
Bukkit 1533 || Craftbukkit 2345 (1.3.1-R2.1)
2012-08-21 19:56:14 +01:00
KHobbits
44e9c6ebfc Merge branch '2.9' into release 2012-08-21 19:34:26 +01:00
KHobbits
a836576211 Reorder perm check in antibuild 2012-08-20 08:41:22 +01:00
KHobbits
1ad8c95e3e Merge branch '2.9' of github.com:essentials/Essentials into 2.9 2012-08-19 23:42:05 +01:00
KHobbits
2dff343c10 Merge branch 'antibuild' into 2.9 2012-08-19 23:41:28 +01:00
KHobbits
fa2a041102 Reduce permissions checks in antibuild.
Add a little debug logging for those with it enabled.
2012-08-19 21:20:55 +01:00
KHobbits
86f8f9c83f Merge pull request #124 from necrodoom/patch-11
patch ID 322 and update ID 260
2012-08-19 12:52:32 -07:00
KHobbits
e359e8ab6e Correct antibuild perm check
(still need to abort interact/use checks on block place)
2012-08-19 16:08:36 +01:00
KHobbits
2f8f3aaa8d Attempt to add support for metadata permissions. 2012-08-19 15:25:40 +01:00
KHobbits
f5bf5ed251 Split Ess protect into EssProtect and EssAntiBuild
New permissions:
essentials.build - same as build: true
essentials.build.interact.<id> - whitelist single interact block
essentials.build.place.<id> - whitelist single place block
essentials.build.break.<id> - whitelist single break block
essentials.build.use.<id> - whitelist single use item
2012-08-19 14:54:58 +01:00
ElgarL
979da6e713 No more null errors from corrupt config.yml's. 2012-08-19 14:49:16 +01:00
necrodoom
6c86fe6117 patch ID 322 and update ID 260
items.csv version 2.1_10
2012-08-19 09:50:19 +03:00
KHobbits
9018fc8324 Add some command cost debugging messages to /ess debug 2012-08-19 03:38:09 +01:00
KHobbits
2f57961ce4 Slightly more realistic worth prices. 2012-08-19 02:49:32 +01:00
KHobbits
4478d438d6 Tidy the worth file formatting. 2012-08-19 02:25:30 +01:00
KHobbits
9261b259a9 Merge branch '2.9' of github.com:essentials/Essentials into 2.9 2012-08-18 16:10:36 +01:00
Iaccidentally
3f3d8c58bc Merge pull request #123 from necrodoom/patch-9
fix ID 2259, pointed out by tanite
2012-08-18 07:59:16 -07:00
KHobbits
e42f7e4ffa Removing EssentialsUpdate from 2.9 branch.
Development may be continued in 3.x branch.
2012-08-18 15:51:55 +01: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
KHobbits
7d5e0352d2 Fix /warp command matching in console. 2012-08-18 15:25:14 +01:00
necrodoom
05eef76134 fix ID 2259, pointed out by tanite
items.csv version 2.1_09
2012-08-18 10:22:12 +03:00
Iaccidentally
e6ef67f7bf Merge pull request #122 from necrodoom/patch-8
update IDs: 5,6,17,18 - erase unused and add new
2012-08-15 01:20:40 -07:00
necrodoom
bbd93f333d update IDs: 5,6,17,18 - erase unused and add new
items.csv version 2.1_08
2012-08-15 10:39:34 +03:00
ElgarL
84f7859ca9 Fix an error with Logging set to 'OFF' triggering a cast exception. 2012-08-14 13:26:02 +01:00
Iaccidentally
1c0dffa67c Merge pull request #121 from necrodoom/patch-6
few extra fixes to several ID item name aliases
2012-08-13 01:17:22 -07:00
necrodoom
5f3fb9b595 few extra fixes to several IDs
items.csv version 2.1_07
2012-08-13 10:03:39 +03:00
Iaccidentally
4ce1e2d9bf add spruce/pine tree to items.csv 2012-08-13 01:45:10 -04:00
KHobbits
e40f364c1e Merge branch '2.9' of github.com:essentials/Essentials into 2.9 2012-08-13 02:33:09 +01:00
KHobbits
6bd2d2c4b9 Try and prevent 'corrupt' messages files from breaking essentials. 2012-08-13 02:32:45 +01:00
snowleo
47f06e5c1b Fix encoding of swedish locale 2012-08-13 01:36:39 +02:00
KHobbits
4c4df13c2f Update Essentials/src/items.csv 2012-08-13 01:19:10 +02:00
KHobbits
6ca037ae3e Update Essentials/src/items.csv 2012-08-13 01:15:53 +02:00
KHobbits
47c708fd33 Merge pull request #115 from necrodoom/patch-3
grammar check on plugin.yml
2012-08-11 18:08:50 -07:00
KHobbits
c40b23d80e Add command name matching to /gamemode
This allows aliases such as /gmc and /creative [player] to be used without stating gamemode as a parameter.
2012-08-12 01:13:52 +01:00
KHobbits
f17a790d78 Improve player matching in /gamemode
Add extra aliases to /gamemode
2012-08-12 01:12:10 +01:00
Iaccidentally
bdf67db6ed fix name length check in /kill 2012-08-10 07:17:05 -04:00
Iaccidentally
3e203d193c fix msg and pay to accept 2 character names 2012-08-10 06:54:42 -04:00
KHobbits
a92eb4dee6 Throw warning when using /kill without valid player. 2012-08-10 02:40:05 +01:00
KHobbits
ed411ee217 Add console log message when player is /kicked 2012-08-10 02:35:05 +01:00
KHobbits
368d3a4046 Add console log message when player is /banned 2012-08-10 02:27:10 +01:00
KHobbits
8aab57e86b Fix yaml issue with /kit 2012-08-10 02:26:23 +01:00
KHobbits
e198b61eae Fix Chat Formatting so chat type is shown first. 2012-08-09 13:11:51 +01:00
Iaccidentally
9824cd75b6 Merge pull request #117 from necrodoom/patch-5
items.csv update with ticket #2559 suggestions
2012-08-09 02:07:13 -07:00
necrodoom
562274706b items.csv update with ticket #2559 suggestions
items.csv 2.1_06
2012-08-09 10:24:07 +03:00
KHobbits
03a93bfeff Merge branch 'release' of github.com:essentials/Essentials into release 2012-08-08 23:13:56 +01:00
KHobbits
86749c433c Merge branch '2.9' into release 2012-08-08 23:13:33 +01:00
KHobbits
17adafecf9 Fix /top so that glass counts as a real block. 2012-08-08 23:00:09 +01:00
KHobbits
dd12e5db66 Fix tp permissions check to check player typing command not teleportee.
If you don't want players inviting players to other worlds, do not give them essentials.world.<currentworld>
2012-08-08 22:50:54 +01:00
snowleo
94947ecc21 Merge branch 'refs/heads/2.9' into release 2012-08-08 14:22:13 +02:00
snowleo
8e50158af8 Correct material for beds 2012-08-08 14:21:25 +02:00
snowleo
610fae63d2 Merge branch 'refs/heads/2.9' into release 2012-08-08 14:14:42 +02:00
snowleo
ee072e844b Fix right click on signs 2012-08-08 14:11:40 +02:00
snowleo
0319415f1b Test the places around the location first, then go up 2012-08-08 13:13:39 +02:00
necrodoom
8fdd32a210 sets, not setting 2012-08-08 11:32:21 +03:00
snowleo
32240cd00d Fix teleports on beds 2012-08-08 10:16:06 +02:00
KHobbits
94f9aedf4b Merge branch 'release' of github.com:essentials/Essentials into release 2012-08-08 02:11:04 +01:00
KHobbits
fca3ad4df9 Merge branch '2.9' into release 2012-08-08 02:10:25 +01:00
KHobbits
ba6cc5a9ee Fix minor Exp discrepancy
Add 'l<level>' syntax to /exp command
EG: /exp set l20
2012-08-08 02:07:47 +01:00
KHobbits
101ae201d6 Fix /day /night /sun and /storm aliases to actually set to the current status if used without parameters.
fixes #2365
2012-08-08 00:52:43 +01:00
KHobbits
5c1eea0953 Don't show two error messages on [kit] signs.
Fixes #2508
2012-08-08 00:14:07 +01:00
snowleo
733fcc9d87 Merge branch 'refs/heads/2.9' into release 2012-08-07 21:11:34 +02:00
snowleo
738b895cba Merge branch 'refs/heads/groupmanager' into 2.9 2012-08-07 20:13:27 +02:00
ElgarL
72aeec58ed Better error report on malformed GlobalGroups. 2012-08-07 17:58:57 +01:00
snowleo
4d8116cc39 Merge branch 'refs/heads/2.9' into release 2012-08-07 17:45:40 +02:00
snowleo
54133cd75e Prevent errors in listeners affecting EssentialsChat 2012-08-07 16:03:39 +02:00
Alexander Schepp
322fe386f6 Merge pull request #114 from necrodoom/patch-2
another extra space
2012-08-07 05:44:23 -07:00
necrodoom
d2b30bad99 another extra space 2012-08-07 15:27:25 +03:00
md_5
264eb318b8 Clean up spaces in config. Please don't break this in the future, this is the second fix guys. 2012-08-07 20:39:55 +10:00
Iaccidentally
cebe291a6f Merge pull request #112 from necrodoom/patch-1
update permissions to include new nodes
2012-08-07 01:34:34 -07:00
necrodoom
30d5468be0 update with new workbench node 2012-08-07 11:07:52 +03:00
necrodoom
fbfd62b73e update permissions to include new nodes 2012-08-07 11:04:01 +03:00
KHobbits
0b9725bf77 Merge branch '2.9' of github.com:essentials/Essentials into release 2012-08-07 08:55:35 +01:00
KHobbits
3c268312a2 Fix CB. 2012-08-07 08:52:57 +01:00
KHobbits
4c2d220176 Merge branch '2.9' into release 2012-08-07 08:50:06 +01:00
KHobbits
a855eaf8d0 Updating CB:
CB: 2317 Bukkit 1521
2012-08-07 08:49:09 +01:00
KHobbits
e5c70713b8 Merge branch '2.9' of github.com:essentials/Essentials into release 2012-08-07 08:45:16 +01:00
snowleo
92267fa7f8 Merge branch 'refs/heads/groupmanager' into 2.9 2012-08-06 18:25:55 +02:00
ElgarL
3c5f9e1616 Fix GlobalGroups not loading permission nodes. 2012-08-06 17:15:56 +01:00
snowleo
c2db96edc8 Just don't use nio, this might be slower. 2012-08-06 15:57:54 +02:00
Iaccidentally
4ca09cea2d update gc for all worlds (thanks to Yofel) 2012-08-06 06:54:55 -04:00
KHobbits
9b39a227c9 Merge branch 'groupmanager' of github.com:essentials/Essentials into 2.9 2012-08-06 09:17:19 +01:00
ElgarL
a7a06963ac Ignore stupid plugins which add empty permission nodes. 2012-08-06 07:05:20 +01:00
KHobbits
38655811b7 Don't bomb if userMap isn't initialized. 2012-08-06 02:44:01 +01:00
KHobbits
2f562f79aa New Sign: Info
Syntax: [info] / [chapter] / [page number] / [cost]
2012-08-06 00:58:35 +01:00
KHobbits
ee608d944a New Sign: Repair
Syntax: [repair] / <hand|all> / [cost]
2012-08-06 00:33:29 +01:00
KHobbits
9e975568be New command: /workbench (aliases /wb and /wbench)
Permission: essentials.workbench
2012-08-06 00:26:42 +01:00
KHobbits
3dbabfa11d Default value for [gamemode] sign
New syntax: [gamemode] / <mode>  / [price]
2012-08-06 00:23:47 +01:00
snowleo
7a96fd1dce I should read javadoc properly. 2012-08-06 00:55:25 +02:00
snowleo
5174b6fe93 Move FileChannel inside the loop 2012-08-05 20:16:53 +02:00
snowleo
c6617324af Throw exception after 5 attempts 2012-08-05 19:50:37 +02:00
snowleo
c7b90f61f7 Try to fix interrupt problem. 2012-08-05 19:41:28 +02:00
Alexander Schepp
7beab59c1a Fix /gamemode 2 playername 2012-08-04 14:17:41 +03:00
Iaccidentally
55c9cacaa3 i'm in ur config, fixxn ur grammer 2012-08-04 06:56:10 -04:00
Iaccidentally
58fc3f4338 I am a grammar nazi. 2012-08-04 07:40:54 -03:00
snowleo
5379b3955f More thread safety 2012-08-04 11:10:57 +02:00
snowleo
bf93bb2026 Thread safety for XMPP 2012-08-04 10:48:56 +02:00
ementalo
af73c11638 CB #2289 Bukkit #1512
Change PlayerChatEvent to AsyncPlayerChatEvent
2012-08-04 09:25:54 +01:00
snowleo
1a07815f4b Make chat handling more thread safe (and also faster) 2012-08-03 22:57:29 +02:00
snowleo
52702894af Synchronized chatStore 2012-08-03 21:45:32 +02:00
ElgarL
73fb2d3735 Fix mirroring now we are not using any Bukkit methods. 2012-08-03 11:15:14 +01:00
ElgarL
7b482b612e Stop using the YamlConfiguration in bukkit for our config handling. We
can now support periods in world names.
2012-08-03 10:36:26 +01:00
snowleo
bd6614328b Ignore case on /gm command 2012-08-03 10:41:23 +02:00
snowleo
45cd9597c9 Code cleanup 2012-08-03 10:39:45 +02:00
snowleo
b40d663c7e Ignore case on gamemode signs and code cleanup 2012-08-03 10:36:50 +02:00
snowleo
6513842d28 Less loops please 2012-08-03 10:33:45 +02:00
snowleo
c8a07ecdb5 Another fix for /exp 2012-08-03 10:29:22 +02:00
snowleo
80f001fdb7 New exp calculations. 2012-08-03 10:21:03 +02:00
snowleo
ab82f550cf Fix broken output of /itemdb 2012-08-03 10:02:47 +02:00
ElgarL
6064b9760b Fix a cases sensitivity bug in world loading. 2012-08-03 08:54:06 +01:00
snowleo
7802192faa Netbeans 7.2 changes 2012-08-03 09:45:44 +02:00
Iaccidentally
cd437f95f1 Merge branch '2.9' of https://github.com/essentials/Essentials 2012-08-02 20:30:09 -04:00
Iaccidentally
da735b496f update 2.9 item.csv for 1.3 (changes by necrodoom) 2012-08-02 20:29:09 -04:00
ementalo
fc288718b7 Switching the syntax of gamemode /gm mode player and adding mode aliases
Fixing translation keys
Fix plugin.yml gamemode syntax
2012-08-02 17:43:58 +01:00
ementalo
766f9b4dbd CB #2267 Bukkit #1505
Updates to gamemode command, mode is now mandatory [creative|survival|adventure]
Updates to gamemode sign, now requires another line with gamemode
2012-08-02 13:52:11 +01:00
Paul A.
a1ac58d17c Check the player we are bringing has permission to enter the world vs the initiating user the final frontier 2012-08-01 16:04:13 +02:00
Paul A.
2fbdf7e4d6 re: re: Check the player we are bringing has permission to enter the world vs the initiating user 2012-08-01 15:56:58 +02:00
Paul A.
d5ed474be7 Check the player we are bringing has permission to enter the world vs the initiating user part 4 2012-08-01 15:55:04 +02:00
Paul A.
1d92cb0e0a Check the player we are bringing has permission to enter the world vs the initiating user 2012-08-01 15:53:30 +02:00
Paul A.
ab7a19b6e6 Check the player we are bringing has permission to enter the world vs the initiating user 2012-08-01 15:52:55 +02:00
Paul A.
7b94adfac8 Check the player we are bringing has permission to enter the world vs the initiating user 2012-08-01 15:50:28 +02:00
Alexander Schepp
33d7776a8e Fix "x times" on signs. 2012-07-31 13:13:18 +03:00
Iaccidentally
d299309c67 Merge branch '2.9' of https://github.com/essentials/Essentials 2012-07-29 14:23:36 -04:00
Iaccidentally
fcf39ed85b KeepXp fixed. 2012-07-29 14:20:09 -04:00
KHobbits
0badd09ad3 Merge branch '2.9' of github.com:essentials/Essentials into 2.9 2012-07-29 17:16:10 +01:00
KHobbits
cfc8faa43a Recommit Keep Exp on death permission
Permission: essentials.keepxp
Code by Iaccidentially.
2012-07-29 17:15:44 +01:00
Alexander Schepp
b0586abc67 Prevent that Essentials breaks other plugins signs 2012-07-28 00:26:04 +03:00
KHobbits
41235b6ee1 Revert optimization, doesn't find glass blocks. 2012-07-17 21:05:13 +01:00
KHobbits
141a2bb190 Add small optimization tweak to new safe block function. 2012-07-17 01:28:20 +01:00
KHobbits
fb71ebdfdf Remove debugging messages. 2012-07-17 00:47:23 +01:00
KHobbits
66ae1d5b94 Try to do a little better when searching for safe teleport locations. 2012-07-17 00:46:07 +01:00
KHobbits
ada077fead Merge pull request #101 from chrisgward/patch-1
Adding enchantment aliases for fire protection
2012-07-15 10:13:33 -07:00
Chris Ward
45367b17a5 Adding enchantment aliases for fire protection 2012-07-15 19:47:53 +10:00
ElgarL
76717350d6 Fix a typo because Necrodoom is anal. 2012-07-13 16:22:52 +01:00
ElgarL
b71a6ac5e1 Change to our own Yaml parsing for globalgroups instead of using the
YAMLConfiguration class in bukkit.
2012-07-13 13:38:53 +01:00
snowleo
58544c9eea Fix version in messages_se.properties 2012-07-11 13:22:44 +02:00
snowleo
f15cb410ce Added swedish translation (from 3.0 branch) 2012-07-11 13:18:54 +02:00
KHobbits
b0cec9782d Add missing triggers from /mute block list 2012-07-11 02:46:45 +02:00
ElgarL
1eac05799f If a permission is found return the correct node for mangcheckp (not
null).
2012-07-10 14:35:08 +01:00
ElgarL
8fac5f6beb Merge branch 'groupmanager' of
https://ElgarL@github.com/essentials/Essentials.git into groupmanager

Conflicts:
	EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java
2012-07-10 14:27:50 +01:00
ElgarL
a46497255e Stop force removing attachments and let Bukkit handle it's own mess. 2012-07-10 14:10:13 +01:00
Alexander Schepp
89670bdfd1 Ignore players, that don't have an IP 2012-07-10 15:57:49 +03:00
Alexander Schepp
71e552c0d1 Another NPE fix for bots 2012-07-10 15:56:12 +03:00
md-5
efec7c8f95 Merge pull request #96 from mbax/groupmanager
Fix critical flaw in permissions removal with regards to fake players and Tekkit.
2012-07-10 02:25:56 -07:00
Matt Baxter
ed668fcac4 Fix critical flaw in permissions removal.
Potential for removing the removal entirely but this can be figured out later.
2012-07-10 06:24:17 -03:00
ElgarL
72015d42fc Throw a better error than 'null' when someone removes all groups from a
yml.
2012-07-06 08:33:57 +01:00
ElgarL
24ec84730e Ignore any sub folders in the Worlds folder which start with a period
(fix for storing data in svn respoitories).
2012-07-04 11:32:17 +01:00
Iaccidentally
dab13931ca Update 2.9 2012-07-03 04:50:29 -03:00
KHobbits
b1c7004d7e Update 2.9 2012-07-01 16:40:48 +02:00
md_5
69ff8b28d8 Fix issue with cross world local chat. 2012-06-26 18:13:53 +10:00
ementalo
0395b5d222 Revert "add essentials.keepxp to allow a player to keep their level after death."
This reverts commit 3b25235755.
2012-06-25 21:40:22 +01:00
Iaccidentally
3b25235755 add essentials.keepxp to allow a player to keep their level after death. 2012-06-24 23:27:30 -04:00
ElgarL
51d61e7a91 Fix loading users with only numerals in their names to be seen as
strings.
2012-06-24 13:10:22 +01:00
KHobbits
4d0ce90787 Merge branch 'master' of github.com:essentials/Essentials into release 2012-06-23 13:47:32 +01:00
KHobbits
4d17b73291 Revert "fix /back resetting on logout"
This is desired behavior, and required for other features.
This reverts commit 329f93a4f6.
2012-06-23 13:33:36 +01:00
md-5
f7a34c49fb Merge pull request #89 from necrodoom/patch-7
major slab alias expansion for items.csv
2012-06-23 02:07:34 -07:00
necrodoom
d0a8dc4812 major slab alias expansion for items.csv 2012-06-23 12:02:28 +03:00
Alexander Schepp
0466a60093 Too much space :D 2012-06-22 20:12:56 +03:00
Alexander Schepp
2c6a81a916 Prevent NPEs in KeywordReplacer 2012-06-22 19:16:40 +03:00
ElgarL
656f25dc97 Only output a Data update message if something has changed. 2012-06-22 15:44:04 +01:00
Iaccidentally
329f93a4f6 fix /back resetting on logout 2012-06-22 03:44:19 -04:00
md-5
b70f950479 Merge pull request #88 from SyntaxBlitz/master
Fix /vanish with no arguments doing nothing
2012-06-21 04:31:18 -07:00
Timothy Aveni
38a2e2bcfd Fix /vanish with no arguments doing nothing 2012-06-21 06:17:26 -04:00
md-5
d9b91e0c34 Merge pull request #87 from necrodoom/patch-5
updated items.csv, 43:4, 43:5, 44:4, 44:5
2012-06-21 03:03:39 -07:00
necrodoom
4ae5579068 while enraged at mibbit and esper failing to work, updated items.csv 2012-06-21 12:18:14 +03:00
md_5
622d710aa9 Merge branch 'master' into release 2012-06-21 18:27:54 +10:00
md_5
f1a7be09c2 Merge remote-tracking branch 'origin/groupmanager' 2012-06-21 18:27:21 +10:00
md_5
0742ca23c1 Update Czech translation. 2012-06-21 18:18:57 +10:00
Iaccidentally
8823ce070e change some default values 2012-06-21 05:05:22 -03:00
Iaccidentally
d77f6cbbf1 fixxy fixxy 2012-06-19 18:13:47 -04:00
Iaccidentally
909c8b3cb5 Add Finnish translation 2012-06-19 18:02:05 -04:00
Iaccidentally
5b7d29fa55 Merge branch 'master' of https://github.com/essentials/Essentials 2012-06-19 17:56:43 -04:00
KHobbits
8dfb3c03c7 *borrows snowleo's strainer* 2012-06-19 20:57:40 +01:00
Iaccidentally
6e8031f477 Merge branch 'master' of https://github.com/essentials/Essentials 2012-06-19 12:48:55 -04:00
Paul A.
81c545f45b Merge pull request #86 from necrodoom/patch-4
adding beef and steak to items.csv - thanks @necrodoom
2012-06-19 07:13:37 -07:00
KHobbits
65025d47c5 Little safety check for bad plugins. 2012-06-19 09:03:37 +01:00
KHobbits
4f23e8aaeb Patch to allow plugins to use ignore lookup, without updating their own code. 2012-06-19 08:59:26 +01:00
KHobbits
aea2c00a95 Add optional 2n'd param to temp ban reason TL key. 2012-06-19 08:46:33 +01:00
necrodoom
eafe0380e1 hotfix before 2.9.2 release 2012-06-19 10:04:13 +03:00
ementalo
3975ceb2a0 Fixing vanish on off arguments 2012-06-18 15:35:21 +01:00
ementalo
0a3ecbcd0e Use the assigned variable when looking at durability in itemdb 2012-06-18 10:28:37 +01:00
KHobbits
9679a90d88 Add sign throttle config option.
Allows you to limit how often an Essentials sign can be spammed per player.
2012-06-17 19:28:59 +01:00
Iaccidentally
c4a704b1a2 The French are weird : they use colons like this. 2012-06-17 11:50:52 -04:00
Iaccidentally
776900bd7b fix spacing issue in messages.properties 2012-06-17 11:41:00 -04:00
ElgarL
5683ea35fc Better update for the User object player reference. 2012-06-16 19:12:54 +01:00
ElgarL
78d4987d5d Clear the player reference on logout so it's refreshed upon a reconnect. 2012-06-16 19:04:40 +01:00
KHobbits
9f852b3a41 Using /exp, show can't find player message, if no matching player is found. 2012-06-16 18:22:31 +01:00
KHobbits
edca2cbdff Added missing syntax to plugin.yml 2012-06-16 17:56:12 +01:00
KHobbits
c578302d7c Fix playerlistname update when prefix/suffix option is disabled.
Fixes #2216
2012-06-16 17:42:42 +01:00
KHobbits
dfce4b31f3 Adjust kit delay description.
Fixes #1580
2012-06-16 17:37:42 +01:00
KHobbits
669edfc048 Prevent joinbots from triggering join code, unless they are actually connected to the server and online. 2012-06-16 17:31:33 +01:00
KHobbits
0a9c88a990 Added TL key for ban syntax,
Default message: "Banned: <reason>"
Default reason: The Ban Hammer has spoken!
Optional 2nd param to banReason, {1}, will contain user who made the ban.
Example use: "banReason=Banned for {0} by {1}"
2012-06-16 17:10:47 +01:00
KHobbits
4e5e5a9684 Fix teleport cooldowns - thanks @basicsensei
Fixes #2260
2012-06-16 16:46:40 +01:00
KHobbits
97eada7dd6 Players should not be able to ignore Console
Also implement chat exempt permission in other commands.
2012-06-16 16:22:51 +01:00
KHobbits
a764f8c929 Fix chat showing [spy] prefix when social spy was not required to see the message.
Fixes #2263
2012-06-16 16:05:48 +01:00
KHobbits
5da886593b Replace op ignore exempt with ignore exempt chat permission:
essentials.chat.ignoreexempt
This permission won't prevent a player from ignoring the player, but the player will see the chat messages anyway.
2012-06-16 16:01:27 +01:00
KHobbits
4c5a88929c Fix /exp so it can be used in the console 2012-06-16 14:26:29 +01:00
KHobbits
af7e427545 Avoid silent command failures on /hat (ie typing /hat fish will no longer silently return as if broken) 2012-06-16 14:02:13 +01:00
KHobbits
4638c5ab55 Added missing TL key 'hatRemoved' 2012-06-16 13:56:36 +01:00
KHobbits
0c2e63baad Make /vanish follow the same rules as /fly, /god and /gamemode 2012-06-16 13:53:46 +01:00
Iaccidentally
ee61ce35c8 Merge pull request #85 from kukelekuuk00/master
Updated dutch translation and fixed many grammar and spelling mistakes.
2012-06-15 15:06:38 -07:00
kukelekuuk00
6ec5b4a5da Updated dutch translation and fixed many grammar and spelling mistakes. 2012-06-16 00:02:19 +02:00
Iaccidentally
d63ad6fc0c Merge pull request #82 from kukelekuuk00/master
Allow your hat to be removed with /hat remove
2012-06-15 13:44:51 -07:00
kukelekuuk00
641a4b9dff Allow your hat to be removed with /hat remove 2012-06-15 22:36:26 +02:00
Paul A.
31001d6b1a Merge pull request #81 from kukelekuuk00/master
/vanish [on|off] - thanks kukelekuuk00
2012-06-15 03:05:13 -07:00
kukelekuuk00
d1a1559dca args[0] instead of args[1]
derp
2012-06-15 11:41:06 +02:00
kukelekuuk00
0d56b700bf /vanish [on|off] 2012-06-15 11:02:04 +02:00
Iaccidentally
cafdb919e4 Merge branch 'master' of https://github.com/essentials/Essentials 2012-06-12 22:33:12 -04:00
Iaccidentally
808f448399 add /e<command> aliases to essentials spawn 2012-06-12 22:28:10 -04:00
KHobbits
10d902e730 Revert "Invert teleport timer."
This reverts commit 0436962ee7.
2012-06-13 03:06:42 +01:00
KHobbits
0436962ee7 Invert teleport timer. 2012-06-13 02:51:47 +01:00
KHobbits
2bebb0bd61 3 char min length on /pay and /msg 2012-06-13 00:49:36 +01:00
Iaccidentally
1e04e3f80d This is broken for some reason. Removing until fixed. 2012-06-12 01:41:39 -04:00
Iaccidentally
c32e10caac oops. forgot this. 2012-06-12 01:13:12 -04:00
Iaccidentally
120440d45b add admin chat 2012-06-12 00:59:53 -04:00
Iaccidentally
61b85901a3 Merge pull request #79 from Iaccidentally/master
update messages_pt.properties
2012-06-11 19:40:42 -07:00
Iaccidentally
f0b3acf491 fix Portuguese translation with new messages 2012-06-11 22:34:40 -04:00
Alexander Schepp
f2d624a795 Merge pull request #78 from Iaccidentally/master
fix some tl keys
2012-06-11 19:17:44 -07:00
Iaccidentally
9e1d7aca92 fix some tl keys 2012-06-11 22:05:30 -04:00
KHobbits
3b43f7bf03 Messing around with whois syntax
(TL's probably need some love)
2012-06-12 01:43:20 +01:00
KHobbits
2f18c6edf1 Fix spacing issue in /list 2012-06-12 00:27:21 +01:00
KHobbits
79f8699174 Fixing messed enchantment. 2012-06-12 00:18:53 +01:00
KHobbits
602681dcc2 Merge pull request #76 from necrodoom/patch-2
pull request for expanding enchant database
2012-06-11 16:17:53 -07:00
KHobbits
3e63047c38 Merge pull request #77 from necrodoom/patch-3
woodenslab fix, pointed out by branicyeti
2012-06-11 16:17:21 -07:00
KHobbits
4f2f166824 Adding mute status to /whois 2012-06-12 00:16:09 +01:00
necrodoom
fc782f286d woodenslab fix, pointed out by branicyeti 2012-06-11 16:39:18 +03:00
necrodoom
425c548611 pull request for expanding enchant database 2012-06-11 15:08:12 +03:00
KHobbits
593f1dd67f Update Bukkit to 1.2.5-R4
Bukkit: #1473 CB: #2222
2012-06-11 00:40:45 +01:00
md_5
8cff4348a6 Fix the vanish command for good. 2012-06-11 09:18:06 +10:00
KHobbits
40271f2ddf I spied some more big Booleans. 2012-06-11 00:14:19 +01:00
KHobbits
aa1205f42d i should prefer boolean to Boolean. 2012-06-11 00:08:31 +01:00
KHobbits
2e15de483d Make /whois throw an error if no matching players are found. 2012-06-11 00:07:22 +01:00
md_5
77b0415c1b Pass the actual player object to Bukkit. 2012-06-11 08:45:24 +10:00
KHobbits
43b3a9df23 /vanish command sets players invisible to essentials commands. 2012-06-10 23:36:10 +01:00
KHobbits
8b47b80b0b Broadcast command allows colour formatting. 2012-06-10 23:35:50 +01:00
KHobbits
13da8c3adc Fix /lightning <player> <damage> to actually deal the proper set damage (5 or 25% by default). 2012-06-10 23:00:49 +01:00
KHobbits
a10190df51 Fix /essentials command to not show command debugging if there were no conflicts. 2012-06-10 22:46:56 +01:00
KHobbits
ecfa745484 Try to be a little more sensible with stored cooldowns. 2012-06-10 21:55:48 +01:00
KHobbits
20d439578b Fix /mute to follow same convention as /tjail
Fixed #2056
2012-06-10 19:56:24 +01:00
KHobbits
dd7f1bcf25 Missing event aborts in sign code. 2012-06-10 19:40:09 +01:00
KHobbits
3b855255cf Fix bug with /remove and minecarts 2012-06-10 19:36:31 +01:00
KHobbits
23283426e0 Allow syntax: /god <player> <on/off> 2012-06-10 19:20:43 +01:00
KHobbits
c958bc78dd Allow syntax: /fly <player> <on/off> 2012-06-10 19:11:45 +01:00
KHobbits
24ec242ecf Fixing up some TL mistakes 2012-06-10 18:38:55 +01:00
KHobbits
9068c13e39 Play a bit less greedy with events 2012-06-10 18:33:07 +01:00
KHobbits
024aff0af5 Remove dura command and merge into itemdb. 2012-06-10 18:31:28 +01:00
KHobbits
57c1d75779 Fix kits to only show to people who can use them. 2012-06-10 18:27:55 +01:00
KHobbits
8c434783a2 Merge pull request #72 from kukelekuuk00/master
Durability command
2012-06-10 10:22:42 -07:00
KHobbits
85ae839211 Merge pull request #75 from necrodoom/patch-1
updating items.csv with newest pastebin, fixes duplicates and wrong alia...
2012-06-10 10:21:40 -07:00
necrodoom
b218d33a24 file indented for unknown reason 2012-06-10 18:06:26 +03:00
necrodoom
6e0f4674d5 updating items.csv with newest pastebin, fixes duplicates and wrong aliases. 2012-06-10 15:29:34 +03:00
kukelekuuk00
62812e1e3a DERP #2 2012-06-10 14:19:03 +02:00
kukelekuuk00
63680b4911 DERP 2012-06-09 23:06:09 +02:00
snowleo
071254ed8d Fix xmpp format stripping 2012-06-08 00:34:25 +03:00
KHobbits
93980629d3 Merge branch 'master' of github.com:essentials/Essentials 2012-06-03 16:35:12 +01:00
KHobbits
f299771044 Fix broken preventmodify permissions check in invsee (*scowls at ementalo*)
Also added check to prevent duping items
2012-06-03 16:34:27 +01:00
md-5
8c013b7680 Merge pull request #74 from Rutr/master
Edit the polish translation, thanks Rutr.
2012-06-02 14:36:00 -07:00
Rutr
78fe659677 translation some new messages and edit some existing 2012-06-02 17:46:26 +03:00
kukelekuuk00
98de950ae2 some more aliases for /durability 2012-06-02 00:36:27 +02:00
kukelekuuk00
96eb9c5db7 added /dura a durability check 2012-05-30 13:42:38 +02:00
md_5
45c1e347b0 Don't allow armor to be used as a hat. 2012-05-27 17:36:04 +10:00
md_5
0559b935e9 Add new command /hat and update translate keys as well as fix colour codes. 2012-05-27 17:24:49 +10:00
md_5
409f337973 Client side note blocks don't play it seems (reverse-merged from commit 0b60d4efe2) 2012-05-26 14:47:30 +10:00
KHobbits
7f5f6b6ac9 Tidy up PVP attack delay. 2012-05-22 21:02:28 +01:00
KHobbits
dc36a50d85 Merge branch 'master' of github.com:essentials/Essentials 2012-05-22 17:54:39 +01:00
KHobbits
74f0babc7d Separate toggle for world teleports using homes. 2012-05-22 17:54:19 +01:00
ementalo
5eeaeaee5d Adding new config setting login-attack-delay. Set this in seconds for a delay before players can attack each other after logging on.
Use permission "essentials.pvpdelay.exempt" to bypass this restriction
2012-05-22 01:29:47 +01:00
KHobbits
fa58503c9f Code tidy. 2012-05-22 00:41:03 +01:00
KHobbits
9fca3728c3 Merge branch 'master' of github.com:essentials/Essentials 2012-05-22 00:39:44 +01:00
KHobbits
56fccb9645 Patch null error in /home after recent update. 2012-05-22 00:39:23 +01:00
md_5
cab40d7893 Keep track of vanished players and tweak lag meter. 2012-05-21 15:13:24 +10: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
1c0838aa5d Fixing unit tests. 2012-05-19 22:19:24 +01:00
KHobbits
32fa834f3f Forgot to update plugin syntax.
Added missing perm checks.
2012-05-19 22:02:42 +01:00
KHobbits
051af644a7 Exp command cleanup 2012-05-19 21:52:54 +01:00
KHobbits
9b9a6a3148 Merge pull request #70 from kukelekuuk00/master
/exp [set|give|player] [player] [amount]
2012-05-19 12:42:33 -07:00
KHobbits
711426fe69 Update CraftBukkit: 1.2.5-R2.0 - 2190
Update Bukkit: 1.2.5-R2.0 - 1459
2012-05-19 20:35:36 +01:00
KHobbits
18c9c812d7 Merge branch 'master' of github.com:essentials/Essentials 2012-05-19 17:45:09 +01:00
KHobbits
bc798977b5 Strip invalid chars from kit names
This may possibly block some kits from working that previous worked, if the kit name contained unusual letters
2012-05-19 17:44:47 +01:00
kukelekuuk00
853d7cb668 Fixes made, added /exp fix [playername] this fixes negative exp. 2012-05-17 14:39:40 +02:00
md_5
3eac027ddb There is no need to start a second task to measure lag, it can in fact be measured with enough precision from the exisitng one. 2012-05-17 20:33:40 +10:00
md_5
1247401a5f Add a LagMeter (ticks per second) to the /gc command. This command can now be accessed with /lag as well. Also added a simple /vanish command, with the extra node essentials.vanish.see
If you require a more advanced vanish solution checkout VanishNoPacket from mbaxter.
2012-05-17 20:25:02 +10:00
kukelekuuk00
9846362836 small description change 2012-05-14 11:43:57 +02:00
kukelekuuk00
16fc88b50c new command /exp [set|give|player] [player] [amount]
perms are essentials.exp,  essentials.exp.others,  essentials.exp.set,  essentials.exp.set.others,  essentials.exp.give and  essentials.exp.give.others
2012-05-14 11:36:44 +02:00
KHobbits
fee3d7c0d3 Try to trim long displaynicks instead of blankly refusing to show them.
Will try trimming prefixes and dropping suffixes before trimming nicknames.
2012-05-13 18:58:50 +01:00
kukelekuuk00
5020f6b990 Added an /exp command that shows the amount of exp you have and how much you need for the next level.
Permissions are essentials.exp and essentials.exp.needed
2012-05-13 13:44:41 +02:00
KHobbits
a48f6c8c30 Force 3 letters before matching players for /god /gamemode and /fly 2012-05-07 00:30:09 +01:00
KHobbits
8d6b864b5b Revert "Update home count..." This reverts commit 9b731cc39c.
On second thought, this would just lead to inconsistency....
2012-05-07 00:16:45 +01:00
KHobbits
deca5e5e73 Home confirmation when using a bed. 2012-05-07 00:08:01 +01:00
KHobbits
9b731cc39c Update home count to include the bed home if set, this does not prevent people from setting a bed home if they are at max. 2012-05-07 00:05:02 +01:00
KHobbits
78cd64c388 Revert "Revert "New config option 'cancel-afk-on-move' - Set to false you don't use afk." -- This should fix afk mode."
This reverts commit 95e6db6797.

Another attempt at adding 'cancel-afk-on-move' toggle.
2012-05-06 23:38:04 +01:00
KHobbits
d9e15729fd Revert "/me crashes ementalo's face for making the client crash."
This reverts commit 6d1e2dd10e.

And fix the original bug.
2012-05-06 23:30:55 +01:00
KHobbits
0fbe2da9cb Add whisper to social spy trigger list. 2012-05-06 16:11:16 +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
md_5
705efc6002 We can't damage and kill, so we will just kill to make everyone happy, and the event pointless. 2012-05-05 20:01:18 +10:00
snowleo
3a60191a9d Merge branch 'refs/heads/groupmanager' 2012-04-26 10:42:48 +02:00
snowleo
95e6db6797 Revert "New config option 'cancel-afk-on-move' - Set to false you don't use afk." -- This should fix afk mode.
This reverts commit d927d04765.

Conflicts:

	Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
2012-04-26 10:41:24 +02:00
ementalo
e37b1946f5 Latest items.csv by necrodoom 2012-04-25 11:27:18 +01:00
md_5
6d1e2dd10e /me crashes ementalo's face for making the client crash. 2012-04-25 17:02:15 +10:00
snowleo
0668c4214e Fix items.csv 2012-04-24 21:48:28 +03:00
snowleo
1b4c803ce3 Merge pull request #66 from Iaccidentally/patch-8
Necrodoom's update to items.csv
2012-04-24 11:42:50 -07:00
Iaccidentally
8d00da9e98 Necrodoom's update to items.csv 2012-04-24 14:57:56 -03:00
ementalo
1524a06ac6 Updated czech language, thanks tommymortago 2012-04-24 12:29:24 +01:00
md_5
9ca820d45e Small cleanup of things 2012-04-24 20:31:19 +10:00
ementalo
27102d1c38 Adding the kickedAll TL key the the rest of the files 2012-04-24 10:24:08 +01:00
md_5
18b5405c76 Add message to sender when all players kicked, addresses issue #1968 2012-04-24 17:47:27 +10:00
md_5
de541f6654 Use a quick (and working comparer) 2012-04-24 17:44:49 +10:00
ementalo
9d398b1d2e New permission essentials.invsee.preventmodify. People with this permission cannot have their inventories modified by invsee 2012-04-23 23:51:10 +01:00
snowleo
caeb3279cb Merge pull request #64 from mdojcar/patch-1
0.2 version of Czech translate: optimized by mdojcar
2012-04-23 14:42:55 -07:00
ElgarL
06247732da Allow 'manucheckp' to notify when superperms reports false but it is
really negated.
2012-04-22 12:12:50 +01:00
ElgarL
fc7689354f Fix forgetting sub groups on a manload. 2012-04-21 16:58:22 +01:00
mdojcar
a50b74bb36 0.2 version: optimized by mdojcar (modojcar@seznam.cz) - mirne fixy a trochu jsem preklad vylepsil 2012-04-21 09:35:59 +03:00
ElgarL
a21b5fac76 updated classpath (eclipse) for teh whole project 2012-04-21 02:33:13 +01:00
ElgarL
3d9022d8fa remove unneeded dependency of craftbukkit 2012-04-21 02:32:37 +01:00
ElgarL
4e10470acd Remove unneeded dependency of craftbukkit (Eclipse building) 2012-04-21 02:32:02 +01:00
KHobbits
3cc1a462f5 Remove stack trace cleaning, didn't actually remove unwanted elements. 2012-04-20 22:31:25 +01:00
ElgarL
cd7bf5eff2 Prevent null perms getting past the GlobalGroups loader. 2012-04-18 22:22:35 +01:00
KHobbits
8da3b490d9 Slightly widen block break protection on protected signs (still does not block chain breaks). 2012-04-18 01:30:14 +01:00
KHobbits
00c87c0e60 Merge remote branch 'remotes/origin/groupmanager' 2012-04-18 00:39:14 +01:00
KHobbits
507ecc47b6 Switch the order of the alt give syntax to follow vanilla order. 2012-04-18 00:37:44 +01:00
ElgarL
6ac8abdac8 Fix a couple of perms in GlobalGroups 2012-04-17 18:57:11 +01:00
KHobbits
4a29dd4c9c Don't get the Essentials user object when we don't need it. 2012-04-17 01:14:07 +01:00
KHobbits
6d06636bc2 Wrong default value for AFK disable pickup. 2012-04-17 00:53:57 +01:00
ElgarL
da857895fc Re-initialize the WorldsHolder on a reload, as un-registering and
re-registering a new holder means all plugins have to check for the new
service on every quiery.
2012-04-16 23:54:33 +01:00
KHobbits
425a2184c6 Merge branch 'master' of github.com:essentials/Essentials 2012-04-16 21:43:19 +01:00
KHobbits
6919b52f61 Null check, for quick exit. 2012-04-16 21:42:53 +01:00
md_5
8eb7428ad1 Do we have to remind @khobbits not to code while drunk. Again. 2012-04-16 19:43:53 +10:00
KHobbits
327a57de3c Fixing a few TL issues. 2012-04-16 10:33:51 +01:00
KHobbits
01ba8dbc3f Don't fire entity powertool commands, with our user object. 2012-04-16 10:19:19 +01:00
KHobbits
a97b3abca3 Minor perf tweak. 2012-04-15 23:13:34 +01:00
KHobbits
d927d04765 New config option 'cancel-afk-on-move' - Set to false you don't use afk. 2012-04-15 22:50:55 +01:00
KHobbits
6dc2e96509 Few missing default permissions. 2012-04-15 22:02:08 +01:00
KHobbits
26a0cd0761 Merge remote branch 'remotes/origin/groupmanager' 2012-04-15 19:41:06 +01:00
KHobbits
75b7f7ac22 Fix metrics errors to be... descriptive. 2012-04-15 15:12:42 +01:00
KHobbits
d08ea5a650 Revert "Add option to disable jails entirely."
This reverts commit 34f5c19f99.
2012-04-14 23:18:20 +01:00
KHobbits
1bd1665faa Throw syntax error on /item, if syntax is wrong. 2012-04-14 17:53:33 +01:00
KHobbits
b3847270fa Merge branch 'master' of github.com:essentials/Essentials 2012-04-14 15:58:12 +01:00
KHobbits
055603b09e Fix null locations in /seen 2012-04-14 15:57:47 +01:00
md_5
34f5c19f99 Add option to disable jails entirely. 2012-04-14 15:21:42 +10:00
md_5
602bd5b0d4 Change some ordering and clean pmd warnings 2012-04-14 15:07:10 +10:00
KHobbits
45de85dae2 Optimize sign interacts. 2012-04-14 04:54:01 +01:00
KHobbits
8b9ff2c58a Try to speed up teleport events. 2012-04-14 04:13:37 +01:00
ElgarL
1599a36642 Correct formatting in command list. 2012-04-13 23:56:50 +01:00
ElgarL
1e30f23ca6 Finally remove all deprecated methods. 2012-04-13 15:16:08 +01:00
ElgarL
2f74510cce Code tidy 2012-04-13 15:00:55 +01:00
ElgarL
08bff3ea5f Stop using our own deprecated methods as we tell others to do. 2012-04-13 14:57:23 +01:00
ementalo
90d2451ce2 Merge branch 'master' of https://github.com/essentials/Essentials 2012-04-13 14:52:25 +01:00
ementalo
5b5df254d5 Don't kill tamed ocelots with killall Test #1921 2012-04-13 14:49:15 +01:00
ElgarL
a028abe036 Update all code formatting to use tabs for indentation. 2012-04-13 14:40:26 +01:00
ElgarL
677534c0b7 Fixed the 'last' nested throw/catch and rework all user and group
reading to be certain to trap all errors.
2012-04-13 13:58:05 +01:00
snowleo
2d319fe5aa Fix double charge in /jump 2012-04-12 23:57:19 +03:00
ementalo
bbd2c53dd8 Merge branch 'master' of github.com:essentials/Essentials 2012-04-12 21:26:34 +01:00
ementalo
d1eb7e5614 Display name of new world on world change 2012-04-12 21:26:19 +01:00
snowleo
d9ee666770 Merge branch 'refs/heads/groupmanager' 2012-04-12 04:27:04 +02:00
ElgarL
9f744beb13 Unregister the worldsHolder as a service on a reload/shutdown instead of
the whole plugin.
2012-04-12 03:21:38 +01:00
ElgarL
62a297ec6d Fix silly nested throw/catch statements. Errors are now correctly
generated when reading yml's.
2012-04-12 01:21:22 +01:00
snowleo
3f9e19d279 Merge branch 'refs/heads/groupmanager'
Conflicts:
	EssentialsGroupManager/src/globalgroups.yml
2012-04-11 21:57:58 +02:00
snowleo
c9e64d9e46 Prevent that a config file is loaded/saved by more than one thread. 2012-04-11 22:51:34 +03:00
ElgarL
25759064ff Expand GlobalGroups.yml and groups.yml to cover the VanishNoPacket
plugin. Demonstrating how to negate and add nodes when using the '*'
permission with inheritance.
2012-04-11 19:10:28 +01:00
ElgarL
cd24ffbada Fix 'manuadd' to use the default or selected world (via 'manselect'), if
the world is not specified in the command.
2012-04-10 20:48:34 +01:00
ElgarL
cdae0898c7 Stop the error on shutdown if GM failed to load at startup.
GroupManager will now generate it's own log (in the GM folder) to
keep things tidy, but also to account of those players unable to
find/access their server.log.
Startup errors will now lock out ALL commands other than '/manload'
2012-04-10 20:40:04 +01:00
ElgarL
f02691863b Properly fix concurrent modification when removing all attachments. 2012-04-10 17:02:50 +01:00
snowleo
4c8d0ea2d9 Should fix some exp math issues 2012-04-09 17:52:46 +03:00
ElgarL
ec4f5cc34d Added missing confirmation message on '/manload'. 2012-04-07 21:30:49 +01:00
ElgarL
e8a42e3947 Better handling of errors in user and group yml's. 2012-04-07 19:24:46 +01:00
ElgarL
e8dd963545 Fix a concurrent modification error when removing all attachments. 2012-04-07 17:21:48 +01:00
ElgarL
1c0a5c49a5 Expand 'manwhois' to also list a users subgroups. 2012-04-07 11:47:07 +01:00
KHobbits
bb83dcc828 Allow vanilla syntax of /give 2012-04-07 04:39:12 +01:00
KHobbits
0eefb7f5a1 Remove 'set' and 'add' from /time command args, to allow use of original syntax. 2012-04-07 04:22:17 +01:00
KHobbits
fe95cfe03b New ingame command syntax: /kit <kit> <playername>
New Permission: essentials.kit.others - allows giving kits to other people.
New console commands: /kit & /kit <kit> <playername>
2012-04-07 03:34:01 +01:00
KHobbits
7a6368a980 Console should be able to kick everyone. 2012-04-07 03:07:07 +01:00
KHobbits
9e86681722 Move player loading and updates to new thread, to reduce on join lag. 2012-04-06 19:19:08 +01:00
ElgarL
25bd91eb80 Remove all permission attachments when performing a manload or restart. 2012-04-06 12:53:36 +01:00
KHobbits
6504c88bf7 Chat spy, should show otherworld chat. 2012-04-06 02:36:27 +01:00
KHobbits
6a75d6fe86 Merge branch 'master' of github.com:essentials/Essentials 2012-04-05 23:37:33 +01:00
KHobbits
bc876611d0 Fix /time not working with the '##pm' syntax. 2012-04-05 23:36:57 +01:00
md_5
798ea77736 Add version tag 2012-04-06 07:39:25 +10:00
md_5
21ef83c0ff Add polish translation, thanks losdamianos 2012-04-06 07:33:10 +10:00
ElgarL
bd7af593e7 Don't throw errors when attempting to remove permission attachments
(bukkit will have already removed it).
2012-04-05 21:06:48 +01:00
snowleo
f73a5d0e8d Merge remote-tracking branch 'origin/groupmanager' 2012-04-05 17:05:43 +02:00
ElgarL
f7bc04bc34 Fix an error I caused trying to modify an unmodifiable list when parsing
'*' permissions.
2012-04-05 15:02:08 +01:00
KHobbits
aa43703094 Fixing up NPE bug in jails (implemented in Dev2.9.163) 2012-04-05 13:28:23 +01:00
ElgarL
381886245b Update to 2.0
Fix GM reporting of permission inheritance to retain the correct order.
Lower inheritance groups can no longer negate a higher groups
permissions.
2012-04-05 12:54:26 +01:00
KHobbits
08642ada20 Added wiki names for enchantments. 2012-04-05 05:46:36 +01:00
KHobbits
10cb4c03b7 Jail update, jailed people can't attack other players. 2012-04-05 03:22:49 +01:00
KHobbits
e7d1cb8bb6 Updating plugin.yml to add sendall syntax. 2012-04-04 23:02:13 +01:00
KHobbits
5a7d733cbf Added extra params to setHome TL key {0} world {1} x {2} y {3} z 2012-04-04 18:19:39 +01:00
ementalo
e23f491500 1.2.5 Update Craftbukkit #2149 Bukkit ??? 2012-04-04 15:33:11 +01:00
KHobbits
98b716dfbf Fix unit tests. 2012-04-04 03:21:14 +01:00
KHobbits
2ddd31a37d Report invalid enchantments in kits.
Improve error logging
2012-04-04 03:09:27 +01:00
KHobbits
2b99ed9a2a Catch all values greater than 10 years to avoid exploits. 2012-04-04 02:07:01 +01:00
KHobbits
eeea16a99a Cap mute/ban/jail to 10 years (any more is silly).
Cap time descriptions to 3 significant notions.
2012-04-04 01:55:06 +01:00
KHobbits
e52996609a Update seen to show better data for vanished users:
New Perm: essentials.seen.extra - Shows some extra information for staff
2012-04-04 01:20:57 +01:00
KHobbits
932de33349 Little bit of powertools code cleanup. 2012-04-04 00:40:58 +01:00
KHobbits
195604997b Enable powertools if they are disabled when setting a new tool. 2012-04-04 00:39:59 +01:00
KHobbits
a3a3f81e11 Better hide vanished players. 2012-04-03 16:12:49 +01:00
KHobbits
d0f3fb4417 Command cost api update: Can now set fallback costs.
Repair command addition: ontop of 'repair' and 'repair-<itemname>' you can now charge for 'repair-all' to charge more for /repair all or 'repair-item' to charge per item repaired.
2012-04-03 15:35:13 +01:00
ElgarL
183602ac28 Prevent Null entries in group inheritance from throwing errors. 2012-04-03 14:30:27 +01:00
KHobbits
37370f722c Switch sign listeners back to compare block id, rather than materials. 2012-04-02 22:58:07 +01:00
ElgarL
e2e51c9c95 Added a new permission node 'groupmanager.op'. This will cause players
with this node to be treated as op's when using GroupManager commands
(they will still require each commands
permission node to use them).
2012-04-02 21:12:19 +01:00
KHobbits
bf1e073ef4 Allow tppos to be used in console. 2012-04-02 02:47:44 +01:00
KHobbits
767703bfc9 Optional second param to /gm to force gamemode on other players. 2012-04-02 02:31:31 +01:00
KHobbits
0e0a96b6d8 Listener Cleanup 2012-04-02 02:22:30 +01:00
ElgarL
3f73272524 Force remove player attachments on disconnect, and tidyup during player
join in case of any errors. Fixes a bug of losing permissions.
2012-04-01 03:44:37 +01:00
KHobbits
d72f831519 Make sure can build checks in permbukkit/privileges work for admins/owners. 2012-04-01 02:44:11 +01:00
KHobbits
c6f25c0df6 Minor cleanup to player events. 2012-03-30 21:44:14 +01:00
KHobbits
17058c220c Add newish signs to default enabled commands config. 2012-03-30 21:04:15 +01:00
KHobbits
0e99b35ab2 Formatting. 2012-03-30 13:29:58 +01:00
KHobbits
e795c6ed0b Don't push vault version to metrics. 2012-03-30 13:27:57 +01:00
KHobbits
f3345247ed Reset ban reason to null on /ban <player>, if no reason is set. 2012-03-30 11:40:44 +01:00
KHobbits
1101a3243d Fix tpo syntax error. 2012-03-29 22:32:16 +01:00
KHobbits
c7638efc7e Iaccidentally's changes to pt TL. 2012-03-29 21:17:50 +01:00
KHobbits
d90053c8c4 Update TL header. 2012-03-29 18:49:56 +01:00
KHobbits
6235983ddd New translation messages 2012-03-29 18:37:22 +01:00
KHobbits
7a249abc67 Update default permissions. 2012-03-29 18:14:24 +01:00
KHobbits
c2c613b652 Missing air materials. 2012-03-29 16:41:13 +01:00
ElgarL
590357004d Merge branch 'groupmanager' of https://elgarl@github.com/essentials/Essentials.git into groupmanager 2012-03-29 14:09:07 +01:00
ElgarL
9dbeb1407c Catch errors caused by bad indentation in yml's. 2012-03-29 14:02:53 +01:00
ElgarL
1ef8ab70d1 Stop attempting to push empty permissions when players edit the yml's
incorrectly.
2012-03-29 13:41:59 +01:00
KHobbits
c09ada201c Interact event cleanup 2012-03-29 03:06:52 +01:00
KHobbits
d7139cb16c Update to CB #2126 B #1425
Min CB version changed to 2122
2012-03-29 02:00:51 +01:00
KHobbits
10f82a6723 Fix using /setworth <price> 2012-03-29 00:13:56 +01:00
KHobbits
2aed3af3c4 Merge branch 'groupmanager' of github.com:essentials/Essentials 2012-03-28 17:37:03 +01:00
KHobbits
c45d38ca69 Implement all abstract methods. 2012-03-28 15:12:25 +01:00
KHobbits
576642a573 Merge branch 'master' of github.com:essentials/Essentials 2012-03-28 15:03:45 +01:00
KHobbits
9d545dcbf1 Don't register jail listeners, if no jails are set. 2012-03-28 15:03:18 +01:00
snowleo
71d8744840 Fix for the fix 2012-03-28 11:21:31 +02:00
snowleo
32c689e0f5 Fix isAffordableFor in Trade class
This fixes buy signs giving out items, when the player has essentials.eco.loan permission, but min-money in config is set to 0.
2012-03-28 10:36:10 +02:00
KHobbits
5b62661404 Pull example perm files out of the ess jar. 2012-03-28 00:59:51 +01:00
KHobbits
a7df8a1a0a Try to reduce lag caused by join spam. 2012-03-27 21:08:06 +01:00
snowleo
b14e7c197f Adds pvp protection after teleport 2012-03-27 21:15:11 +02:00
KHobbits
97eed50ccc Adding world permission checks to:
tpaall tpall tpahere tphere tpohere
User is required to have the permission for the world he is in, before he can teleport users outside this world, to it.
2012-03-27 15:28:40 +01:00
ElgarL
b8453ac792 Update GlobalGroups.yml for new/changed Towny permission nodes. 2012-03-27 10:14:53 +01:00
ElgarL
fe7f479e63 Auto rename all case sensitive world folders to lower case (if
possible).
2012-03-26 20:06:59 +01:00
ElgarL
50ea442bf0 Treat all world names as lower case for file handling (please check in
your worlds folder. You should have no folders with upper case letters
from now).
2012-03-26 19:18:19 +01:00
KHobbits
5d45495371 Fix kit enchants for people without oversized stack permission.
Add permissions lookup to debug mode.
2012-03-26 13:28:32 +01:00
KHobbits
e30d900289 Clarify how backup works.
Add option for auto save-all.
2012-03-26 00:49:53 +01:00
KHobbits
2cc96e995b Update tp to check if target player has tptoggle disabled.
Update tpo to allow player to player tp.
2012-03-25 23:32:04 +01:00
KHobbits
47cf1289d7 Don't show 'backup started' on /backup if it hasn't been configured. 2012-03-25 19:10:39 +01:00
KHobbits
d2506cd928 Reorder login/join event calls. 2012-03-25 17:27:06 +01:00
KHobbits
1dbb11ea55 Don't override other plugins which allow joining over capacity. 2012-03-25 16:46:36 +01:00
KHobbits
b60363b6bd Reduce amount of move event calls being processed. 2012-03-25 16:30:22 +01:00
KHobbits
00033c11bc Update [balance] sign to use currency formatting. 2012-03-25 14:26:08 +01:00
KHobbits
c588b78adb Merge branch 'master' of github.com:essentials/Essentials 2012-03-25 14:20:53 +01:00
KHobbits
7bd7992b24 Fix chat format regex. 2012-03-25 14:20:26 +01:00
snowleo
6f86b7400a CopyPaste-Fail 2012-03-25 11:47:26 +02:00
snowleo
e13a2c371d Wrong url 2012-03-25 11:45:50 +02:00
snowleo
0cbded9fca This is no longer stored in file, so it's not part of UserData anymore. 2012-03-25 11:44:33 +02:00
snowleo
3e6e71ca41 Optimize metrics 2012-03-25 11:39:19 +02:00
snowleo
1b2e3b1951 AntiCheat has different version numbers, so don't check. 2012-03-25 11:09:13 +02:00
KHobbits
e53a480c22 Should probably cancel this at lowest. 2012-03-25 02:55:19 +01:00
KHobbits
7280c1c468 Merge branch 'master' of github.com:essentials/Essentials 2012-03-25 02:34:19 +01:00
KHobbits
b7221516dc Invsee now shows a live player inventory in a window, rather than cloning players inventory.
New Permission: essentials.invsee.modify - Player with this permission will be able to add/remove items from the other players inventory.
2012-03-25 02:33:52 +01:00
KHobbits
71aaf81bba Update Essentials/src/config.yml 2012-03-24 23:28:56 +00:00
KHobbits
160c3f428c Mysql is bad. 2012-03-24 23:25:43 +00:00
KHobbits
3c3e8d167f Better English. 2012-03-24 21:12:15 +00:00
KHobbits
7ca2b65c4f New permission check: essentials.list.hidden is now required to /getpos hidden players. 2012-03-24 21:08:45 +00:00
KHobbits
a8cbb5c8f5 Extra itemcsv. 2012-03-23 23:13:04 +00:00
KHobbits
72028086c0 'Enabled' looks better than 'true'. 2012-03-23 22:38:01 +00:00
KHobbits
dddf529ff5 Make sure items don't stack wrong in [free] signs. 2012-03-23 20:15:03 +00:00
KHobbits
b3de0aabae Fix for showing plugins when user has no permission. 2012-03-23 18:26:19 +00:00
KHobbits
77c6a3b730 Wrong colour code symbol. 2012-03-23 17:50:15 +00:00
KHobbits
bb54dbb688 Merge remote branch 'remotes/origin/groupmanager' 2012-03-23 17:44:00 +00:00
KHobbits
0a74da88d6 Help command refresh. 2012-03-23 17:16:09 +00:00
KHobbits
d0b94938e0 Merge branch 'master' of github.com:essentials/Essentials 2012-03-23 13:53:08 +00:00
snowleo
a0cba8e63d Spaaaaaace! So much space! Gotta see it all! 2012-03-23 14:30:00 +01:00
KHobbits
a4d7b5dcf8 Merge branch 'master' of github.com:essentials/Essentials 2012-03-23 13:26:12 +00:00
KHobbits
c503adabc5 Fix url matching. 2012-03-23 13:26:03 +00:00
snowleo
8a22258945 Fix utf-8 decoding problems. 2012-03-23 14:22:10 +01:00
snowleo
29a190f93a http://youtu.be/8DdeLUA0Fms 2012-03-23 12:11:01 +01:00
KHobbits
5c0b522026 Merge branch 'master' of github.com:essentials/Essentials 2012-03-23 10:18:16 +00:00
KHobbits
c46f14665c Adding missing entities to Protect Spawn Blacklist 2012-03-23 10:16:38 +00:00
snowleo
20c973dab2 Fix UTF8 handling in Configuration class 2012-03-23 11:13:44 +01:00
KHobbits
49cb482ca5 Update Essentials/src/config.yml 2012-03-23 10:03:15 +00:00
KHobbits
033c2e22cd Remove white user prefix, if prefix is blank. Messes with EssentialsChat colouring. 2012-03-23 07:56:44 +00:00
KHobbits
2f434291cb Fixing chat color formatting. 2012-03-23 00:19:27 +00:00
KHobbits
42d01471d3 Disabling player list updates by default (can mess with tab completion)
Hopefully this will be reverted if/when patch is found.
2012-03-23 00:15:22 +00:00
KHobbits
c5eb1bb105 Improve kit matching, and add enchantments.
Enchanted kit example in config.yml
2012-03-22 23:47:35 +00:00
KHobbits
3c9057f68e Fix jar building. 2012-03-22 23:10:59 +00:00
KHobbits
96f0dd5824 Update CB to 2105 2012-03-22 23:07:23 +00:00
KHobbits
71358629f4 New command: /fly
New perm: essentials.fly.others
2012-03-22 22:59:52 +00:00
KHobbits
284fef00e7 Split formatting perms for signs as well. 2012-03-22 22:26:04 +00:00
KHobbits
d20519ef8b New Permission: essentials.chat.url
Without this perm, URLs will be modified not to be links.
2012-03-22 22:19:58 +00:00
KHobbits
0dc1270aed Split colour permissions into 3: color/magic/format 2012-03-22 22:07:13 +00:00
KHobbits
cd0d37f73c Update to 1.2.4 (R0.1)
New Minimum CB version: 2100
2012-03-22 20:55:56 +00:00
KHobbits
56fce34539 Extra items in 1.2.4 2012-03-22 20:48:27 +00:00
KHobbits
165a76d492 Add villager professions to /spawnmob 2012-03-22 20:03:52 +00:00
ElgarL
9570e5cfd9 Correct Grammar 2012-03-22 17:54:59 +00:00
ElgarL
c6bb10489e Merge pull request #62 from bonney12/groupmanager
Update language and commenting
2012-03-22 10:53:25 -07:00
KHobbits
3d7d4a47d9 Bukkit R0.3 api updates. 2012-03-22 17:26:05 +00:00
KHobbits
968c849b13 Update missing 1.2.3 items in items.csv 2012-03-22 17:25:42 +00:00
KHobbits
1746569e1a Extra Trees 2012-03-22 17:25:13 +00:00
KHobbits
209c91d3de Fixed again. 2012-03-22 12:02:19 +00:00
KHobbits
7d7c1d34cf Fix typo. 2012-03-22 11:57:30 +00:00
KHobbits
c3ad486f65 Merge branch 'master' of github.com:essentials/Essentials 2012-03-21 23:55:19 +00:00
KHobbits
7bcec32134 Cleaning up displaynames 2012-03-21 23:54:57 +00:00
KHobbits
b19b08dc6e Merge pull request #63 from Iaccidentally/patch-6
update default player-commands to support new and missed commands
2012-03-21 09:25:05 -07:00
Iaccidentally
264e175d6c update default player-commands to support new and missed commands 2012-03-21 13:23:36 -03:00
Michael Bonney
bcd4fd9bff Removed Portuguese text, and added English replacements. Made more sense of the sentences, and also changed an incorrect message to it's proper form. 2012-03-21 16:13:34 +00:00
KHobbits
3e88fb44f4 Split if tree for readability. 2012-03-20 15:03:53 +00:00
KHobbits
518b013a63 Teleport check cleanup 2012-03-20 13:26:49 +00:00
KHobbits
e752538568 Fix per world teleport permission checking. 2012-03-20 11:53:05 +00:00
KHobbits
970364886c Add 'color' sign type to config file.
Enforce colour permission on signs when essentials signs are enabled.
2012-03-19 08:21:39 +00:00
KHobbits
07f859e38b Missing kit time check from [kit] signs. 2012-03-18 17:15:46 +00:00
KHobbits
c806059958 Only show nickname update message in debug mode. 2012-03-18 03:29:49 +00:00
KHobbits
14bce8fd82 Shorten help messages. 2012-03-18 03:01:44 +00:00
KHobbits
17be04cd99 Error and info cleanup. 2012-03-17 20:23:46 +00:00
KHobbits
b93847f077 Merge remote branch 'remotes/origin/groupmanager' 2012-03-17 18:20:33 +00:00
ElgarL
6476158462 Don't remove an attachment on a player leaving as Bukkit never forgets
it. This fixes non mirrored permissions being messed up if a player
relogs.
2012-03-17 15:56:40 +00:00
snowleo
6dd73ff9d0 Merge branch 'refs/heads/groupmanager' 2012-03-17 13:38:51 +01:00
ElgarL
b72083fb18 Removed some debug spam. 2012-03-17 12:37:23 +00:00
snowleo
ca11d4d98b Fix bukkit download url 2012-03-17 11:15:28 +01:00
snowleo
12cb4fd5f8 Fix bukkit download url 2012-03-17 11:12:32 +01:00
KHobbits
4df4eba2a5 Merge remote branch 'remotes/origin/groupmanager' 2012-03-17 08:01:19 +00:00
KHobbits
762105d692 New permission: essentials.tp.others - Allows players to /tp <p1> <p2> replaces old reused permission.
New permission usage: if world-teleport-permissions is true in the config, TP commands will now check for essentials.world.<worldname> when a tp would switch worlds.
2012-03-17 06:10:02 +00:00
KHobbits
e4ce814c2f Comments to SetExpFix. 2012-03-17 03:38:32 +00:00
KHobbits
87cd693020 Adding Exp to /whois, shows total exp and ingame level.
Due to the way minecraft calculates levels (flawed formula), its possible to not match calculated level.
2012-03-17 01:43:49 +00:00
KHobbits
baadd4b1cb Adding reference to &k in MOTD. 2012-03-16 23:03:22 +00:00
KHobbits
adf3755abb Handle permission check failures better. 2012-03-15 23:15:19 +00:00
KHobbits
5c280e7cb7 Add missing methods. 2012-03-15 22:23:26 +00:00
KHobbits
4a149855ab Updating Bukkit/CraftBukkit to match minimum ver. 2012-03-15 22:15:17 +00:00
md_5
cf000b04e4 Fill the entire sign with free goodness 2012-03-15 20:55:56 +11:00
md_5
79cd8d6065 Update minimum CraftBukkit version 2012-03-15 20:51:51 +11:00
md_5
5b930cdc3b Restore [free] and [disposal] signs back to their intended behaviour 2012-03-15 20:48:55 +11:00
snowleo
c09329e5be :P 2012-03-15 09:15:28 +01:00
KHobbits
c513014732 Graph a little bit extra information. 2012-03-15 08:08:25 +00:00
KHobbits
bada36be68 Fix fake explosions. 2012-03-15 06:42:58 +00:00
KHobbits
e5e81eda72 Make /nuke drop tnt from a more reasonable height. 2012-03-15 05:09:34 +00:00
KHobbits
45cf2ae960 Make /spawner errors more descriptive. 2012-03-15 04:41:56 +00:00
KHobbits
d0d0117411 Add metric opt out toggle ingame. 2012-03-15 03:49:17 +00:00
KHobbits
5d79863cfc Fixing setwarp command. 2012-03-15 02:12:43 +00:00
KHobbits
b85756f8b1 Adding some simple feature metrics. 2012-03-15 02:12:27 +00:00
KHobbits
8776f4c1c0 Metrics errors aren't important. 2012-03-15 01:32:08 +00:00
KHobbits
5e8fd3993d Basic module graph. 2012-03-15 01:17:12 +00:00
KHobbits
d3033716ca Add Griefcraft metrics to Essentials
Warns on first start, and first staff join, and 5 minute warning before logging starts.
2012-03-15 00:49:22 +00:00
ementalo
6cf2bb5cd9 Adding permissions for overwriting exisitng warps
essentials.warp.overwrite.[warpname] will allow overwrting of exsiting warps
essentials.warp.overwrite.* for all warps
Adding WarpNotFoundException class
2012-03-14 21:16:22 +00:00
KHobbits
267495a406 Fixing warp command costs. 2012-03-13 16:15:01 +00:00
ElgarL
a8937f7bf0 Fix a globalgroup inheritance in groups.yml 2012-03-12 22:18:25 +00:00
KHobbits
dfd63a81ac Missed a TL key. 2012-03-12 16:50:32 +00:00
KHobbits
dfbc1956c9 Fixing a few TL Keys 2012-03-12 15:35:20 +00:00
KHobbits
c0490c0890 New TL Key, allow formatting/colouring of help output. 2012-03-12 15:21:37 +00:00
KHobbits
2da802d4b7 New permission: essentials.seen.banreason
With this permission players can see why a user was banned, in /seen.
2012-03-12 15:00:44 +00:00
KHobbits
adffbab678 Adding jail time to /whois. 2012-03-12 01:15:10 +00:00
KHobbits
e11525ab64 Update offline user check.
Add ban reason to /seen
2012-03-12 01:00:57 +00:00
KHobbits
8dcd591beb Update setworth to allow /setworth <price> ingame
Allow /setworth to be used from console.
2012-03-11 23:59:59 +00:00
KHobbits
a40c936bcf New Permission: essentials.lightning.others
With this permission you can use /lightning <player>, without only strike based on direction.
2012-03-11 20:58:54 +00:00
KHobbits
5c2622b390 Add Enderman check to EntityChangeEvent (Should fix sheep eating grass). 2012-03-11 01:46:01 +00:00
KHobbits
c7046b696a Use ignoreCancelled on event registration. 2012-03-10 21:42:46 +00:00
KHobbits
9ac5ce8a75 Update info.txt to hint at /einfo. 2012-03-07 12:14:32 +00:00
KHobbits
5c55e18d33 Fixing typo in config.yml 2012-03-06 23:17:10 +00:00
ElgarL
19d233454e change []<> for optional command components 2012-03-06 16:23:57 +00:00
ElgarL
1f761ee1cb Expanded '/manuadd'to accept an optional variable for the world (eg
'/manuadd <player> <group> <world>').
2012-03-06 11:02:48 +00:00
KHobbits
1db5d61945 Merge branch 'release'
Conflicts:
	lib/bukkit.jar
	lib/craftbukkit.jar
2012-03-05 16:25:35 +00:00
KHobbits
1e34a396cd Change starter kit to default to stone tools 2012-03-05 15:51:15 +00:00
KHobbits
ba96117f55 Temp fix to disable version check on R7 2012-03-05 14:17:09 +00:00
KHobbits
96b217cbe8 Craftbukkit/Bukkit R7 2012-03-05 08:41:19 +00:00
md_5
0dd5c0370e I dont think free noteblocks are a good idea 2012-03-05 08:37:16 +00:00
KHobbits
bdf32cde9e Missed one. 2012-03-05 08:37:15 +00:00
KHobbits
e91ed60441 Fixing spawnmob count. 2012-03-05 08:37:15 +00:00
KHobbits
8577202f48 Add listgroups as TL key 2012-03-05 08:37:15 +00:00
KHobbits
7819b9d2f0 Apply colors to group tags. 2012-03-05 08:37:15 +00:00
KHobbits
15c0565923 Build custom mob list /spawnmob 2012-03-05 08:37:14 +00:00
KHobbits
2b25ca2932 CME 2012-03-05 08:37:14 +00:00
KHobbits
c7a6677d52 Adding starter/newbie kit to EssentialsSpawn
Optimization to EssentialsSpawn join event.
2012-03-05 08:37:14 +00:00
KHobbits
c3d5b32986 Extra command alias. 2012-03-05 08:37:14 +00:00
KHobbits
cbfb524195 Allow more currency customization.
Added currency key to messages.
2012-03-05 08:37:14 +00:00
KHobbits
b16a1f7237 Adding option to modify all users balances (including offline) /eco reset ** <amount> 2012-03-05 08:37:14 +00:00
KHobbits
e28f1b1be3 Half-revert double backflip. 10 points.
(op prefix changes that md-5 broke, thinking I broke op prefixes)
2012-03-05 08:37:14 +00:00
md_5
b512a243e7 Fix op colours, which KHobbits broke! 2012-03-05 08:37:13 +00:00
Chris Ward
873c9880dd Cleanup
Signed-off-by: Chris Ward <chris@chrisgward.com>
2012-03-05 08:35:48 +00:00
Chris Ward
e6736e48a5 Cleanup
Signed-off-by: Chris Ward <chris@chrisgward.com>
2012-03-05 08:35:48 +00:00
KHobbits
caf598f55b Capital case for formatting. 2012-03-05 08:35:48 +00:00
KHobbits
619e099a04 Force all kits to lowercase. 2012-03-05 08:35:48 +00:00
KHobbits
faba1e3604 *make it look like i'm doing something* 2012-03-05 08:35:48 +00:00
KHobbits
7cb728b15f I think switches are better. 2012-03-05 08:35:48 +00:00
KHobbits
3e3c7f0d54 Only update displayname on world change, not every teleport. 2012-03-05 08:35:48 +00:00
KHobbits
a45c19a08b Extra command aliases 2012-03-05 08:35:47 +00:00
KHobbits
eb74a1de9c Make the antioch message optional. 2012-03-05 08:35:47 +00:00
KHobbits
8450734cf1 Entity event cleanup 2012-03-05 08:35:47 +00:00
KHobbits
016299a1dd Shouldn't really be canceling events at priority monitor, oops. 2012-03-05 08:35:47 +00:00
KHobbits
d27ff9abb6 Don't think we need animation event anymore. 2012-03-05 08:35:47 +00:00
Iaccidentally
cdf5d45483 update messages.properties for the new bukkit download link (ci.bukkit,org no longer works) 2012-03-05 08:35:46 +00:00
md_5
0b60d4efe2 I dont think free noteblocks are a good idea 2012-03-05 18:40:18 +11:00
md_5
d31e434e4d Allow spamming of this, by reducing explosion damage to 0, same effect, no mess 2012-03-05 18:28:04 +11:00
KHobbits
fabc1c3dd9 Missed one. 2012-03-05 00:39:37 +00:00
KHobbits
68fbc40605 Fixing spawnmob count. 2012-03-05 00:22:31 +00:00
KHobbits
8b7c5cf2ed Add listgroups as TL key 2012-03-05 00:19:40 +00:00
KHobbits
1811631b93 Apply colors to group tags. 2012-03-05 00:08:37 +00:00
KHobbits
7cec1564b9 Build custom mob list /spawnmob 2012-03-04 21:54:51 +00:00
KHobbits
a75eefcdd4 CME 2012-03-04 21:43:24 +00:00
KHobbits
6a9027da6d Adding starter/newbie kit to EssentialsSpawn
Optimization to EssentialsSpawn join event.
2012-03-04 20:09:25 +00:00
KHobbits
e55aa3cea7 Extra command alias. 2012-03-04 16:17:16 +00:00
KHobbits
1ce2c60bf4 Updating Craftbukkit #2034 Bukkit #1378 2012-03-04 16:01:49 +00:00
ElgarL
7ba49afa0b Better reporting when a users.yml is failing to load. 2012-03-04 10:39:39 +00:00
KHobbits
6da705c86f Allow more currency customization.
Added currency key to messages.
2012-03-04 10:11:58 +00:00
KHobbits
c3fa56322b Adding option to modify all users balances (including offline) /eco reset ** <amount> 2012-03-04 09:20:03 +00:00
KHobbits
53cfab229b Half-revert double backflip. 10 points.
(op prefix changes that md-5 broke, thinking I broke op prefixes)
2012-03-04 08:18:25 +00:00
KHobbits
b62217f301 Merge branch 'master' of github.com:essentials/Essentials 2012-03-04 08:13:29 +00:00
md_5
d9a8453995 Fix op colours, which KHobbits broke! 2012-03-04 15:43:00 +11:00
snowleo
e6181928e8 Cleanup of /spawnmob 2012-03-03 17:01:53 +01:00
ElgarL
c33499797e Minor change to globalgroups 2012-03-03 14:03:52 +00:00
KHobbits
860f6a41ac Merge branch 'master' of github.com:essentials/Essentials 2012-03-03 13:49:26 +00:00
KHobbits
8aa7b1f301 Update CB #2032 B #1377
Min CB #2015
2012-03-03 13:48:58 +00:00
ElgarL
6efd3eaa27 Fix a silly logic error when testing bukkit perms 2012-03-03 13:47:59 +00:00
ElgarL
d2d8d191da Minor optimization when checking bukkit permissions. 2012-03-03 13:00:17 +00:00
md-5
cea5c81d44 Merge pull request #56 from Iaccidentally/patch-4
Allow spawning baby villagers and ocelots
2012-03-03 00:34:00 -08:00
md-5
504f28df1a Merge pull request #55 from chrisward/master
Just a really small cleanup
2012-03-03 00:31:48 -08:00
Chris Ward
74a57553f6 Cleanup
Signed-off-by: Chris Ward <chris@chrisgward.com>
2012-03-03 19:21:27 +11:00
Iaccidentally
35576ab64a add little babbys 2012-03-03 03:04:54 -05:00
KHobbits
33605517ff Capital case for formatting. 2012-03-03 07:09:41 +00:00
Chris Ward
6da6e4d2e8 Cleanup
Signed-off-by: Chris Ward <chris@chrisgward.com>
2012-03-03 18:07:43 +11:00
KHobbits
c0fa03ede2 Force all kits to lowercase. 2012-03-03 07:03:54 +00:00
KHobbits
301b609e93 *make it look like i'm doing something* 2012-03-03 05:27:02 +00:00
KHobbits
b6bbe237ea I think switches are better. 2012-03-03 05:09:03 +00:00
KHobbits
de7ab13c03 Only update displayname on world change, not every teleport. 2012-03-02 19:05:30 +00:00
KHobbits
7a0f4da860 Extra command aliases 2012-03-02 17:05:55 +00:00
KHobbits
1bbbfe1c96 Make the antioch message optional. 2012-03-02 17:03:34 +00:00
KHobbits
25ebe68389 Entity event cleanup 2012-03-02 16:54:12 +00:00
KHobbits
7737d19c5a Shouldn't really be canceling events at priority monitor, oops. 2012-03-02 16:33:20 +00:00
KHobbits
622ca4bf8a Don't think we need animation event anymore. 2012-03-02 16:29:06 +00:00
KHobbits
b090afbeb3 Merge pull request #54 from Iaccidentally/patch-3
update messages.properties for the new bukkit download link (ci.bukkit,o...
2012-03-01 20:15:16 -08:00
Iaccidentally
dce149511e update messages.properties for the new bukkit download link (ci.bukkit,org no longer works) 2012-03-01 23:10:32 -05:00
snowleo
21a248e94d Will be removed until the next release XD 2012-03-02 01:30:52 +01:00
snowleo
f1aed4b521 Better cats 2012-03-02 00:40:50 +01:00
snowleo
7564ebf79e Fix world heights 2012-03-02 00:18:31 +01:00
snowleo
b9aecbe1d4 Min version CB# 2004 2012-03-02 00:12:22 +01:00
snowleo
49eb451a76 New eggs 2012-03-02 00:09:50 +01:00
snowleo
64d866a77d New Entities and Items for 1.2 2012-03-02 00:06:57 +01:00
snowleo
f75779aa7a CB#2004 B#1368 2012-03-01 23:57:34 +01:00
KHobbits
5622882602 Merge branch 'master' of github.com:essentials/Essentials 2012-03-01 22:37:15 +00:00
KHobbits
b3d3928db8 Kit sign cleanup 2012-03-01 22:36:51 +00:00
snowleo
6df3b9008a update inventory 2012-03-01 23:23:23 +01:00
snowleo
c36ca65e09 Bukkit broke this sign :( 2012-03-01 23:10:12 +01:00
KHobbits
2e788802fe Fix kit timers resetting on server restart. 2012-03-01 22:04:50 +00:00
KHobbits
b0552019f5 Fix version matching. 2012-03-01 21:47:01 +00:00
snowleo
dae69622a5 Merge branch 'refs/heads/master' into release 2012-03-01 19:08:52 +01:00
snowleo
696b930fb2 EntityType instead of CreatureType 2012-03-01 19:05:50 +01:00
snowleo
e43a62f992 Requires #1988 because of the new Inventory stuff 2012-03-01 19:05:50 +01:00
snowleo
02c1cb05c7 Updated to R6 2012-03-01 19:05:50 +01:00
snowleo
b44d738867 CB# 1988 B# 1360 2012-03-01 19:05:49 +01:00
md_5
e1818f7e62 Separate config sections evenly 2012-03-01 19:05:47 +01:00
md_5
e5081db7e4 Remove old, unwanted manifest.mf files 2012-03-01 19:05:47 +01:00
ElgarL
ba346bd797 Make 'manload' reload the config correctly. 2012-03-01 19:05:47 +01:00
KHobbits
0670ece7f3 Updating Bukkit: CB #1858, B #1334 2012-03-01 19:05:47 +01:00
snowleo
a8da3eebd7 Merge remote-tracking branch 'origin/groupmanager' 2012-03-01 17:33:25 +01:00
snowleo
056303b53c EntityType instead of CreatureType 2012-03-01 17:33:09 +01:00
snowleo
454f7d30de Requires #1988 because of the new Inventory stuff 2012-03-01 16:17:40 +01:00
snowleo
6d1c270976 Updated to R6 2012-03-01 16:16:05 +01:00
snowleo
d1001274bb CB# 1988 B# 1360 2012-03-01 16:16:05 +01:00
md_5
3099855562 Merge remote-tracking branch 'origin/master' 2012-03-01 16:23:21 +11:00
md_5
3f26d4ad98 Separate config sections evenly 2012-03-01 14:40:57 +11:00
md_5
bae337cc49 Remove old, unwanted manifest.mf files 2012-03-01 12:27:59 +11:00
ElgarL
3823e7a108 Make 'manload' reload the config correctly. 2012-02-28 10:46:10 +00:00
KHobbits
1c2221f52f Adding option to log all eco api transactions. 2012-02-28 02:45:03 +00:00
KHobbits
1b780a4364 Prevent EssSpawn trying to handle spawning of jailed players. 2012-02-28 02:45:03 +00:00
KHobbits
ac3e65a829 Change jail listener to catch respawn at Highest 2012-02-28 02:45:03 +00:00
KHobbits
332f19177e Allow people to hit exactly 'min money'. 2012-02-28 02:45:03 +00:00
KHobbits
6ab57b9abe Cleanup. 2012-02-28 02:45:03 +00:00
KHobbits
862f3aad59 Adjustments to negative eco give/take. 2012-02-28 02:45:03 +00:00
KHobbits
e277acf80e Display users new balance on /eco give/take. 2012-02-28 02:45:02 +00:00
KHobbits
9f893e68e9 Add Minimum Balance, to allow people to manage overdrafts. 2012-02-28 02:45:02 +00:00
KHobbits
833a5b2b55 Adding option to log all eco api transactions. 2012-02-27 15:31:43 +00:00
KHobbits
340f0c68eb Prevent EssSpawn trying to handle spawning of jailed players. 2012-02-27 03:40:18 +00:00
KHobbits
a5e3182dad Change jail listener to catch respawn at Highest 2012-02-27 03:24:58 +00:00
KHobbits
10ae9c3aa2 Allow people to hit exactly 'min money'. 2012-02-26 05:10:04 +00:00
KHobbits
bcf903de92 Cleanup. 2012-02-26 05:06:03 +00:00
KHobbits
ad08d27504 Adjustments to negative eco give/take. 2012-02-26 05:01:40 +00:00
KHobbits
d24f77dbd5 Display users new balance on /eco give/take. 2012-02-26 04:27:29 +00:00
KHobbits
a5b38ce1a4 Add Minimum Balance, to allow people to manage overdrafts. 2012-02-26 04:15:14 +00:00
KHobbits
5d048d2c1d Updating Bukkit: CB #1858, B #1334 2012-02-25 17:57:26 +00:00
KHobbits
13d3cc3306 Lowering min bukkit to r4 - 1838, this build should still be compatible. 2012-02-25 17:40:00 +00:00
KHobbits
9f02fb4dd4 Merge branch 'master' into release 2012-02-25 17:22:39 +00:00
KHobbits
07baa6e611 Merge remote branch 'remotes/origin/groupmanager' 2012-02-25 17:22:01 +00:00
ElgarL
50bd5869bf Prevent promoting players to, and demoting to GlobalGroups. 2012-02-25 09:29:54 +00:00
ElgarL
fa49fc91d2 Prevent adding inheritances to globalgroups. These are permissions
collections, not player groups.
2012-02-25 09:22:54 +00:00
KHobbits
28f478dd04 Write to user files less, on money update. 2012-02-23 17:25:00 +00:00
KHobbits
6fb8dad0ec Balance top now has server total on first line.
Balance top will update ess balance backup if using register/vault eco.
2012-02-23 15:17:23 +00:00
KHobbits
9f605e9a88 Fixing upgrade script to allow powertool upgrade. 2012-02-23 14:49:23 +00:00
KHobbits
e5b91dae73 Fixing kits for new config classes. 2012-02-22 12:32:51 +00:00
KHobbits
e1749fecd1 Extra command aliases. 2012-02-22 01:29:37 +00:00
KHobbits
358edff798 Powertools dispatch commands as delayed tasks (should reduce any conflict issues). 2012-02-22 00:23:04 +00:00
KHobbits
34f13ba89c Switch powertools to use different event.
Reduce multiple triggering of powertool events.
Abort event when used with powertool.
2012-02-22 00:11:21 +00:00
KHobbits
945ba6f8ab Fix powertools with new config format. 2012-02-22 00:10:13 +00:00
KHobbits
46f05ee92f Check to see if home section exists. 2012-02-21 22:19:56 +00:00
KHobbits
6d46fc66ce Fixing home list. 2012-02-21 22:12:37 +00:00
KHobbits
ed7fe9213f Fix /sudo message display. 2012-02-21 21:39:25 +00:00
ElgarL
9c68cbae72 Removed BukkitPermsOverride as this is now the default with bukkit
handling child nodes.
2012-02-21 18:40:54 +00:00
ElgarL
c0df771539 Update for Bukkit R5 compatability.
Removed some unused variables.
2012-02-21 18:38:08 +00:00
snowleo
9bd0c33fef Never give our user object to other plugins! 2012-02-21 18:41:27 +01:00
snowleo
cf7da7a83f Merge branch 'refs/heads/groupmanager' 2012-02-21 17:34:45 +01:00
snowleo
f46948249e Updated Essentials to work with R5 2012-02-21 17:33:46 +01:00
snowleo
3b81593ebb CB#1952
B#1330
2012-02-21 16:47:25 +01:00
KHobbits
8042cefd3d Merge branch 'master' into release 2012-02-19 01:20:50 +00:00
KHobbits
514f07ce57 Add bPerm2 support for chat prefixes. 2012-02-18 22:47:38 +00:00
KHobbits
4f4d9f6209 Little bit of extra info in the default /einfo file 2012-02-18 22:08:18 +00:00
KHobbits
3077ea4ef1 Re-allow colours in newb welcome messages. 2012-02-18 21:34:05 +00:00
KHobbits
945ae71480 Adding full keyword support for newb join message.
Also adding {ADDRESS} and {USERNAME} as new keywords.
2012-02-18 21:09:18 +00:00
ElgarL
3d1c0fd157 A command of '/manload' with no world arguments now performs a full
reload of GM.
2012-02-18 09:05:28 +00:00
KHobbits
fab9688abb Don't try to use old bPerms API if it is not available. 2012-02-16 23:44:13 +00:00
KHobbits
b2dbb3f9e3 Fixing being charged twice for /back. 2012-02-16 16:57:50 +00:00
KHobbits
16a0f44b4d Merge remote branch 'remotes/origin/master' into release 2012-02-15 19:09:02 +00:00
md_5
7633b136e3 Its a good idea to actually register the listeners 2012-02-15 19:55:41 +11:00
md_5
0252d756f6 Make Essentials Update use new Listener system, and fix a few general mistakes, including that of the config 2012-02-15 19:34:46 +11:00
md_5
ad05516fd5 Fix formatting in the config.yml and plugin.yml files. Add a new author. 2012-02-15 17:57:53 +11:00
md_5
6d127012d8 Add all the new R4 methods 2012-02-15 17:53:47 +11:00
md_5
c064da9af8 Update to 1.1-R4 2012-02-15 17:44:35 +11:00
md_5
d05f2d7a32 Remove dropItems from the inventory work around 2012-02-15 17:21:28 +11:00
ElgarL
3fc6bb4e4f comment name change 2012-02-15 06:16:33 +00:00
ElgarL
59679e0423 Depreciate PlayerTeleportEvent, PlayerRespawnEvent and PlayerPortalEvent
as it's all handled in PlayerChangedWorldEvent.
This also means we no longer update permissions before we change
worlds.
2012-02-15 06:15:31 +00:00
KHobbits
1a2acb43ae Merge branch 'master' into release 2012-02-14 23:56:02 +00:00
KHobbits
f0c0ee1a8d /spawnmob - Only list mobs you have permission to spawn. 2012-02-14 23:55:29 +00:00
snowleo
3c98718387 Don't return null, throw an exception 2012-02-14 20:30:06 +01:00
snowleo
cfdb2a36c1 Merge pull request #49 from Iaccidentally/patch-2
fix typo in config.yml (another one)
2012-02-14 11:21:52 -08:00
Iaccidentally
3b7d194902 fix typo in config.yml (another one) 2012-02-14 14:21:07 -05:00
snowleo
72d514d52f Merge pull request #48 from Iaccidentally/patch-1
fix typo in config.yml
2012-02-14 11:18:03 -08:00
Iaccidentally
9fe119e720 fix typo in config.yml 2012-02-14 14:16:34 -05:00
ElgarL
4a5c431163 Depreciate PlayerTeleportEvent as it's all handled in
PlayerChangedWorldEvent.
2012-02-14 13:01:39 +00:00
snowleo
a6ac333a74 Less sanitizing for more performance 2012-02-13 21:32:05 +01:00
KHobbits
bc2578b788 Caching regex return in user cleanup.
(Pushing this for testing purposes).
2012-02-13 19:40:33 +00:00
KHobbits
36d07cb539 Merge branch 'master' into release 2012-02-13 17:35:05 +00:00
KHobbits
effe0d5ec5 Merge remote branch 'remotes/origin/groupmanager' 2012-02-13 17:24:32 +00:00
KHobbits
0ab2e745cf Merge branch 'master' of github.com:essentials/Essentials 2012-02-13 17:17:14 +00:00
KHobbits
57a2ef08d4 Allow charges for different mob types in /spawner 2012-02-13 17:16:27 +00:00
KHobbits
2699e02f96 Add per warp command costs
Make warp other commands charge the commander, not the warped.
2012-02-13 17:09:07 +00:00
md_5
62cd219b4e Clean up the CommandException stack traces so they appear as if Essentials was never there. 2012-02-12 08:19:24 +11:00
KHobbits
2d56de1483 Update trade signs properly, and visibly handle full signs. 2012-02-11 21:15:26 +00:00
KHobbits
bbc6da5106 Merge pull request #46 from krinsdeath/master
Added Privileges to known Permissions plugins
2012-02-11 12:12:59 -08:00
KHobbits
b0d06ce6ed Refactoring tpaccept perm check to include tpaall. 2012-02-11 20:10:19 +00:00
KHobbits
de1554cb68 Merge pull request #45 from Wolvereness/master
Fix /tpaccept permission check
Refactoring to follow.
2012-02-11 12:06:42 -08:00
Jeff Wardian
c890ea8f87 Added PrivilegesHandler.java;
Implemented privileges in PermissionsHandler.java;

Fixed PrivilegesHandler.canBuild();
2012-02-11 10:06:18 -08:00
ElgarL
c0517c1203 Change Service registration to register WorldsHolder instead of
AnjoPermissionsHandler. This is the correct entry point for all data.
2012-02-11 10:36:55 +00:00
Wolvereness
9efd0eb6f9 Fix exploit with /tpaccept if sender no longer has permission 2012-02-09 23:14:57 -06:00
KHobbits
f0ee026fb9 Allow colour codes in /ping 2012-02-09 22:13:00 +00:00
KHobbits
b3fc790000 New Permission: essentials.sudo.exempt
If a user has this perm, they cannot be controlled.
2012-02-09 22:11:46 +00:00
KHobbits
83f9209bcc Optional argument to /ping [message]- Message to be echo'd.
Possible use in scripts, checking for lag, /sudo, etc.
2012-02-09 22:02:24 +00:00
KHobbits
691a0ef4ce Fixing silly typo - Fixes shout costs. 2012-02-09 02:11:36 +00:00
ElgarL
97bd49e598 Add some commenting 2012-02-05 16:41:34 +00:00
ElgarL
e93e50f6d2 Fix world mirroring so it correctly creates data files and data sources
for partially mirrored worlds.
Fixed world mirroring so it returns the correct data for the
requested world
2012-02-05 16:30:58 +00:00
ElgarL
76ba5caeec Prevent getAllPlayersPermissions() processing a group more than once.
Improves performance when using complex inheritance structures.
2012-02-02 18:10:35 +00:00
KHobbits
6ca1cdec4f Merge branch 'master' into release 2012-02-02 11:41:18 +00:00
KHobbits
86a1dda46c Make it so ops can build, even if they don't have the matching permission. 2012-02-02 10:43:17 +00:00
KHobbits
4326ce0d4a Force minimum CB version to 1846, don't want people on #1840 due to big bugs. 2012-02-02 10:32:18 +00:00
KHobbits
3ff1f4adbb Fixing repair to not repair items with datavalues, unless they actually have a durability. 2012-02-02 10:27:35 +00:00
KHobbits
492c4e8521 Craftbukkit #1846 Bukkit #1211 2012-02-02 10:27:09 +00:00
KHobbits
e3f3fe84ea Recover from broken config files, but keep a backup of the old one for purpose of data recovery. 2012-02-02 09:48:56 +00:00
KHobbits
6e2ac3b56e Extend valid characters to be a little less strict. 2012-02-02 09:37:30 +00:00
KHobbits
5c19e71858 Sanitize mail for untoward characters.
Prevent a user error from terminating essentials timer task.
2012-02-02 09:26:36 +00:00
ElgarL
a0103afde3 fix setGroup to only block superperms update if update is false. 2012-02-02 02:41:10 +00:00
ElgarL
dbf30740fb Fix a bug with getWorldData return the main world data for all mirrors,
instead of the worlds parent data.
2012-02-02 02:01:04 +00:00
KHobbits
92fa415848 More info, and less severe warning on jail error. 2012-01-31 08:33:14 +00:00
KHobbits
2942ef40f3 Update jails to new event system. 2012-01-31 08:06:50 +00:00
ElgarL
3f02bcd702 Catch all errors in badly formatted groups. 2012-01-31 03:16:34 +00:00
ElgarL
fe050dd725 Track the 'onPlayerChangeWorld' event as some teleports seem to not be
triggering a world move.
2012-01-30 17:08:55 +00:00
ElgarL
5b4966c888 Auto sort permissions on load to speed up population of superperms.
Negating a parent node after adding all nodes with * will now
correctly remove all child nodes of that parent before populating
superperms.
	  eg.
	      - '*'
	      - -vanish.*
	      - vanish.standard
2012-01-30 14:41:19 +00:00
KHobbits
e2abf05a27 Merge branch 'master' into release 2012-01-30 05:36:03 +00:00
KHobbits
8500542e93 Remove invalid item spawn blacklist warning during startup. 2012-01-29 23:36:27 +00:00
KHobbits
d9e6f2975a Merge branch 'master' into release 2012-01-29 21:44:30 +00:00
KHobbits
2f1d9ad82c Prevent /home bed, if the bed was later destroyed. 2012-01-29 21:44:15 +00:00
KHobbits
d8ac3587ac Merge branch 'master' into release 2012-01-29 21:39:05 +00:00
ElgarL
2c8aa20542 .project change for Eclipse Build tool 2012-01-29 21:37:50 +00:00
KHobbits
a2418a68d9 Fixing Kill/suicide in creative mode. 2012-01-29 21:37:38 +00:00
KHobbits
85c4fbdf4f Merge branch 'master' into release 2012-01-29 21:20:56 +00:00
KHobbits
dff8f541fe New craftbukkit
CB 1840, B 1208
2012-01-29 21:06:55 +00:00
KHobbits
d0a5656fa4 Merge remote branch 'remotes/origin/groupmanager' 2012-01-29 20:57:54 +00:00
KHobbits
bc76e87366 Fix boolean fail in /r offline checking. 2012-01-29 20:57:17 +00:00
ElgarL
bf9a67a2e4 updating .gitignore 2012-01-29 11:04:52 +00:00
ElgarL
95885e46c9 Fix players retaining permissions when demoted. 2012-01-29 10:54:24 +00:00
KHobbits
5a7f38fa29 Merge branch 'master' into release 2012-01-29 05:00:04 +00:00
KHobbits
6a5fefb102 Optional second argument to /tpaccept, it will only accept the request if the sender matched that string. 2012-01-29 04:59:30 +00:00
KHobbits
c47c008871 Added kit note.
Fixes #1276
2012-01-29 03:26:44 +00:00
KHobbits
a31f5e219d Kill people the proper way.
Test #1410
2012-01-29 03:23:38 +00:00
KHobbits
9ee78bdaec Switch /near priority to check for int first.
Test #1269
2012-01-29 03:09:59 +00:00
KHobbits
735f9ce212 Make sure player is online when sending a /reply. 2012-01-29 02:57:52 +00:00
KHobbits
417148f5da Merge branch 'master' into release 2012-01-29 01:45:40 +00:00
KHobbits
8f0350570e Merge remote branch 'remotes/origin/groupmanager' 2012-01-29 01:45:03 +00:00
KHobbits
27365d1f1b Prevent disabled sign creation (if any of essentials signs are enabled) 2012-01-29 01:42:55 +00:00
KHobbits
ebb3a77430 Fix sign list format. 2012-01-29 01:38:24 +00:00
KHobbits
b3252168f6 Disable all signs by default. 2012-01-29 01:27:04 +00:00
KHobbits
e1abdbdd37 Added options to enable each sign type 2012-01-29 01:12:38 +00:00
ElgarL
3deff2afe7 silly formatting change to test gitbot 2012-01-28 18:01:17 +00:00
KHobbits
a85cbdd505 Merge branch 'master' into release 2012-01-28 12:59:15 +00:00
KHobbits
c6aa34076a Merge remote branch 'remotes/origin/groupmanager' 2012-01-28 12:58:37 +00:00
ElgarL
92f83dfe73 fix for an iterator error if there is only one element in the array. 2012-01-28 11:59:54 +00:00
ElgarL
00057eaca4 Fixed a bug when pushing superperms in the wrong order. 2012-01-28 11:47:39 +00:00
KHobbits
2f96c9763f Only list bed home if it is set. 2012-01-28 01:39:51 +00:00
KHobbits
137b60c5f2 Allow space as well as : in /delhome 2012-01-28 01:32:15 +00:00
KHobbits
292b7b0546 Stop users from using /sethome bed 2012-01-28 01:09:02 +00:00
KHobbits
d1d31e9769 If bed home is set, give priority when spawning. 2012-01-28 00:57:08 +00:00
KHobbits
f7c6759433 Check bed still exist, for bed homes. 2012-01-28 00:49:22 +00:00
KHobbits
5137502646 Switch website URL's to point at wiki. 2012-01-28 00:20:46 +00:00
ElgarL
9ff8b69282 Properly fix inherited negated nodes. 2012-01-27 13:09:11 +00:00
ElgarL
7f269187c5 do not allow inherited permissions to negate higher perms. 2012-01-27 12:38:00 +00:00
KHobbits
6d34a2aa17 Merge branch 'master' of github.com:essentials/Essentials 2012-01-26 21:21:35 +00:00
KHobbits
9b58b2b9c0 Revert emergency listener to old style
Stops peoples world world burning down if they throw in 2.8, on a 1.0 server.
2012-01-26 21:21:13 +00:00
snowleo
b4d91978c7 Merge branch 'refs/heads/master' into release 2012-01-26 04:51:10 +01:00
snowleo
8aa260ee34 Minor fix to french translation 2012-01-26 04:49:26 +01:00
Léa Gris
25976edc2b i18n added to command nuke 2012-01-26 04:46:00 +01:00
Léa Gris
8e9094a3ef Updated translations to Essentials Dev2.7.191 2012-01-26 04:45:16 +01:00
KHobbits
16bde87982 Merge branch 'master' into release 2012-01-26 00:31:05 +00:00
KHobbits
b8944d0b25 Set min bukkit to 1818 - RB 2012-01-26 00:30:33 +00:00
KHobbits
69209eeb2f Merge remote branch 'remotes/origin/groupmanager' 2012-01-26 00:28:10 +00:00
ElgarL
746eb353a2 Fixed an infinite loop error when using '/manudel' on a logged in
player. It caused setDefaultGroup to trigger a bukkit update when no GM
User existed yet.
2012-01-25 23:44:14 +00:00
ElgarL
3708f2b3bb Trap errors in fetching the mirrors map. 2012-01-25 22:43:07 +00:00
ElgarL
e563405a7d Check for a null player object in the PlayerTeleportEvent. 2012-01-25 22:35:24 +00:00
ElgarL
ae2cf3d95c Fixed subgroups (I broke earlier). 2012-01-25 22:33:22 +00:00
ementalo
270533652b Merge branch 'master' into release 2012-01-25 14:29:05 +00:00
paul.aston
324dd05c97 CB #1818
RB #1200
2012-01-25 14:23:46 +00:00
Paul A.
2a0c3eebbc Merge pull request #43 from essentials/groupmanager
Fix trying to modify an unmodifiable collection breaking superperms.
2012-01-24 17:29:08 -08:00
ElgarL
e1660d47ba Fix trying to modify an unmodifiable collection breaking superperms. 2012-01-25 01:20:44 +00:00
KHobbits
03d640260d Merge branch 'master' into release 2012-01-25 00:04:08 +00:00
KHobbits
da3a6af92d Merge remote branch 'remotes/origin/groupmanager' 2012-01-25 00:02:15 +00:00
ementalo
593cb8d56e Don't try to spawn users who have disconnected before we have a chance to spawn them 2012-01-24 22:43:33 +00:00
ElgarL
f40f5f880b Fix typo/wording in changelog
Allow negation to the * permission node when populating superperms.
2012-01-24 19:41:22 +00:00
ElgarL
8390594682 Allow negations with the * permission node when population superperms. 2012-01-24 19:38:22 +00:00
ElgarL
a13740f638 Fix hasOwnData to return a correct result with new mirroring system 2012-01-24 15:37:21 +00:00
ElgarL
5f19cbf17b Fixed isInList 2012-01-24 15:35:20 +00:00
ElgarL
145b0be2f3 addSubGroup now returns a boolean for success/failure.
'/manuaddsub' now correctly reports if it was able to add the sub
group.
2012-01-24 14:21:07 +00:00
ElgarL
1dab4f95dd Added recursive loop detection for World mirroring (you may not set the
main world as a mirror of another).
Fixed fetching world data so it no longer returns the mirrored world
for groups. Each world data holder now points to the correct data set,
so can be returned as an object.
2012-01-24 14:08:53 +00:00
snowleo
f27b2290dc Merge branch 'refs/heads/master' into release 2012-01-24 03:43:49 +01:00
snowleo
0ea41d9169 Merge branch 'refs/heads/groupmanager' 2012-01-24 03:43:17 +01:00
ementalo
f93769dd1d Add new permission essentials.protect.alerts.notrigger
If user has this permisson they do not trigger EssProtect block alerts
2012-01-23 15:48:56 +00:00
ElgarL
125ea7c701 Fixed infinite loop error on player join.
Optimized code to only update the player logging in instead of all
players online.
2012-01-22 23:46:26 +00:00
ElgarL
6e03ea7b7d Separated all events to be independent classes. 2012-01-21 20:18:40 +00:00
ElgarL
9041596384 Fixed a random null error upon a player portaling. 2012-01-21 19:09:08 +00:00
KHobbits
efda9beece Merge branch 'master' into release 2012-01-21 17:19:12 +00:00
ElgarL
4b61ac9043 Update to new Bukkit Event system.
Update GroupManagerBridge for new event system.
2012-01-21 11:47:08 +00:00
KHobbits
72edfacfb8 Catching throwable leads to madness, lets do this safely. 2012-01-21 00:19:13 +00:00
KHobbits
aa88205d95 Catch errors too, incase the class doesn't exist. 2012-01-21 00:01:43 +00:00
KHobbits
8d441a4cc7 Messages Cleanup 2012-01-20 23:13:37 +00:00
KHobbits
766935871f If vault throws an exception, it should not be enabled. 2012-01-20 23:04:43 +00:00
KHobbits
f5d65371b2 Adding translation keys for [L] and [Spy] 2012-01-20 22:57:35 +00:00
KHobbits
662749be8b Check shout/question messages are longer than 1 character. 2012-01-20 22:54:47 +00:00
snowleo
e46fe381b4 Removing load info, bucket displays that now. 2012-01-20 05:52:35 +01:00
snowleo
04a43eb5d0 New Event code for EssentialsSpawn 2012-01-20 05:34:28 +01:00
snowleo
792f70efa5 Update for new CraftBukkit Event Code
EssentialsSpawn can't be updated yet, because the new event system lacks dynamic priorities.
2012-01-20 05:20:37 +01:00
snowleo
46298ae858 CB#1791 2012-01-20 04:09:35 +01:00
KHobbits
d08b1a5089 Fix EssChat displayname error. 2012-01-19 15:51:55 +00:00
KHobbits
e015cad131 Merge remote branch 'remotes/origin/groupmanager' 2012-01-19 15:34:00 +00:00
KHobbits
008f0d595f Fix Lombok include. 2012-01-19 15:08:37 +00:00
snowleo
2560bdca4a Update of Lombok, fixes memory leak in Netbeans 2012-01-19 13:17:05 +01:00
snowleo
5f04d1867c Cache MessageFormats for Chat 2012-01-19 02:03:20 +01:00
KHobbits
a10f6850e5 Compiled regex is faster. 2012-01-18 23:35:30 +00:00
KHobbits
36bc1adf83 Make sure to clean the chatStore. 2012-01-18 23:08:40 +00:00
KHobbits
cd8cc63113 Reduce duplicate calls in EssentialsChat
Should cut the time down a little.
2012-01-18 22:53:39 +00:00
KHobbits
947bee98a0 Merge remote branch 'remotes/origin/groupmanager' 2012-01-18 20:04:50 +00:00
KHobbits
5c1d49fd0e Merge remote branch 'remotes/origin/groupmanager' 2012-01-17 23:50:05 +00:00
KHobbits
79a13e97a2 Merge remote branch 'remotes/origin/groupmanager' 2012-01-17 23:49:38 +00:00
KHobbits
e7fd26ee64 Merge branch 'master' of github.com:essentials/Essentials 2012-01-17 17:40:22 +00:00
KHobbits
8fc6684290 Auto Update GM Version 2012-01-17 17:24:22 +00:00
snowleo
a66ffd8921 Shorter names for enchantment signs. 2012-01-17 01:45:03 +01:00
KHobbits
1f2c669eca Stripping vanilla colour from /helpop and /mail
Adding support for &k in EssChat
Adding support for colour in /msg and /r - New perm: essentials.msg.color
2012-01-16 20:25:36 +00:00
KHobbits
1d5a09a03e Merge branch 'master' of github.com:essentials/Essentials 2012-01-16 19:42:37 +00:00
KHobbits
4435121c84 Stripping vanilla colours from /msg 2012-01-16 19:42:15 +00:00
snowleo
813e66b4f2 Fix /nick command colors 2012-01-16 20:38:53 +01:00
snowleo
26d63f3666 Strip colors from chat, if the user does not have the permission. 2012-01-16 20:29:55 +01:00
KHobbits
0fb07d4cc1 Removing debugging message from player login. 2012-01-16 18:58:44 +00:00
snowleo
cd2f819c29 Cleanup 2012-01-16 19:11:41 +01:00
KHobbits
149ce7d74d Adding support for Vault as a fallback economy method. 2012-01-16 18:00:43 +00:00
KHobbits
c7c7e5e4ce Merge remote branch 'remotes/origin/master' into release 2012-01-16 12:43:09 +00:00
snowleo
f26cccb663 Optimize TextInput to cache motd and info textfiles. 2012-01-16 04:51:27 +01:00
snowleo
81ec87d893 Revert changes to Usermap 2012-01-16 02:12:20 +01:00
snowleo
91563e9dca Optimize Break in Protect 2012-01-16 01:55:04 +01:00
snowleo
359ea194b8 Speed improvements for Move and Interact Event. 2012-01-16 00:50:52 +01:00
snowleo
c860b1c668 Reload less 2012-01-14 23:25:52 +01:00
snowleo
c584d74852 Temporary fix for Spawns and Jails when Worlds are loaded after Essentials.
This will be replaced by BetterLocation fix in 3.0 branch.
2012-01-14 23:13:58 +01:00
KHobbits
6e82419c15 Allowing use of aliases in help/info/motd, for command suggestions.
Test #1441
2012-01-14 16:53:18 +00:00
KHobbits
3f6b9586b4 Fixing double charges on /home
Test #1426
2012-01-14 16:42:53 +00:00
KHobbits
29d4e09983 Fixing {WorldDate}
Test #1353
2012-01-14 16:36:19 +00:00
KHobbits
f61f80164d Merge branch 'master' into release 2012-01-14 15:52:55 +00:00
KHobbits
f0def90301 Merge remote branch 'remotes/origin/groupmanager' 2012-01-14 15:52:22 +00:00
KHobbits
856cef3286 Update Essentials/src/com/earth2me/essentials/commands/Commanditemdb.java 2012-01-14 15:04:16 +00:00
KHobbits
d16fef9f7f Merge branch 'master' into release
~ GM needs testing before release ~
2012-01-14 13:16:33 +00:00
KHobbits
43f1c0f89d Removing debugging messages. 2012-01-13 22:50:48 +00:00
KHobbits
256d202d50 Adjusting default spawn behavior.
Moving option in config file.
2012-01-13 22:41:47 +00:00
snowleo
4884bed117 Merge branch 'refs/heads/groupmanager' 2012-01-13 01:38:54 +01:00
snowleo
3fdde2f764 Add new eggs to items.csv 2012-01-12 23:56:39 +01:00
snowleo
390b17f0d8 Min Bukkit version is 1713 now 2012-01-12 23:43:11 +01:00
snowleo
fe9d5645f6 Added the new Enchantments 2012-01-12 23:42:04 +01:00
snowleo
eb5c88ef08 Netbeans 7.1 stuff 2012-01-12 23:37:39 +01:00
snowleo
6eea852b1d CB#1713 B#1136 2012-01-12 23:36:45 +01:00
snowleo
9a568992f1 Merge pull request #42 from jjkoletar/patch-1
No sending to all players, must specify target.
2012-01-01 16:38:05 -08:00
Jeremy
283dc9b3c1 No sending to all players, must specify target. 2012-01-01 18:18:29 -06:00
snowleo
4425d53664 Only info not a warning if a file is missing 2011-12-20 12:25:30 +01:00
snowleo
791e8f2d14 Only info not a warning if a file is missing 2011-12-20 12:24:59 +01:00
snowleo
ee5e015a63 Correctly match release and non release versions of bukkit. 2011-12-20 12:20:41 +01:00
snowleo
5d4f22ad84 Correctly match release and non release versions of bukkit. 2011-12-20 12:20:12 +01:00
snowleo
839ce3d526 Fix sending our player object to other plugins. 2011-12-20 11:57:51 +01:00
snowleo
31e80ba698 Fix sending our player object to other plugins. 2011-12-20 11:57:22 +01:00
snowleo
abd86347c7 Always return an offlineplayer object with the name, that the user wants. 2011-12-19 12:57:09 +01:00
snowleo
5bb7d82fca Fix double names in /balancetop and show display name in balancetop 2011-12-19 12:39:23 +01:00
snowleo
cc06117210 Merge branch 'refs/heads/master' into release 2011-12-19 12:07:28 +01:00
KHobbits
5a092f0e99 Merge branch 'master' of github.com:essentials/Essentials 2011-12-19 10:57:44 +00:00
KHobbits
98cd03ac57 Prevent future warps being named as numbers. 2011-12-19 10:57:18 +00:00
snowleo
8761feb93f More null checks for Jails 2011-12-19 11:53:52 +01:00
KHobbits
cbd5b6c0f4 Merge remote branch 'remotes/origin/master' into release 2011-12-19 05:04:15 +00:00
KHobbits
fec3b61039 Merge branch 'master' of github.com:essentials/Essentials 2011-12-15 20:47:24 +00:00
KHobbits
01530192cf Make powertool use a chat event, instead of just messaging each user. 2011-12-15 20:47:06 +00:00
snowleo
64bc8d1133 Corrected version match for 1597 build version 2011-12-15 10:32:04 +01:00
snowleo
58bebd851c Fix failing override for /enchant /eco /ext 2011-12-14 15:07:08 +01:00
snowleo
867e66e774 Merge branch 'refs/heads/master' into release 2011-12-14 11:56:09 +01:00
snowleo
9eaebadaaa Merge branch 'refs/heads/groupmanager' 2011-12-14 10:03:32 +01:00
KHobbits
2202448cee Read current exp, instead of stored exp.
This means that exp used in enchanting is subtracted from total exp.
2011-12-14 03:41:24 +00:00
snowleo
45ffeaffec Merge branch 'refs/heads/master' into release 2011-12-13 23:52:58 +01:00
snowleo
79861b1f10 Merge branch 'refs/heads/groupmanager' 2011-12-13 23:52:25 +01:00
KHobbits
505460349f Fixing killall command definition. 2011-12-13 09:38:20 +00:00
snowleo
f91b622646 Merge branch 'refs/heads/master' into release 2011-12-13 10:32:59 +01:00
snowleo
70bd9bd1f3 Renamed /butcher to /killall and fixes to the code. 2011-12-13 10:28:15 +01:00
snowleo
32564fb4f7 Netbeans 7.1 changes for EssentialsUpdate 2011-12-13 08:46:50 +01:00
snowleo
af4dde2086 Tiny fix to the last commit. 2011-12-13 08:41:28 +01:00
snowleo
15ce04b539 Better exp fix and allow exp on buy and sell signs. 2011-12-13 08:38:15 +01:00
snowleo
907f6c6116 Disabling exp as currency. Normal money will be used. 2011-12-13 07:35:46 +01:00
KHobbits
fc1ccda0fe Update exp trade signs on purchase. 2011-12-13 04:52:09 +00:00
KHobbits
d3dd8208ef Fixing Sell/Buy Signs which use EXP as a currency. 2011-12-13 04:29:16 +00:00
KHobbits
a00f070400 Merge branch 'master' of github.com:essentials/Essentials 2011-12-13 03:12:09 +00:00
KHobbits
faddbd09a4 Update copylibs. 2011-12-13 03:11:11 +00:00
KHobbits
dfa4ecbe4f Inform user that they were healed. 2011-12-13 01:47:58 +00:00
KHobbits
40a9c28699 Merge branch 'master' into release 2011-12-12 23:15:48 +00:00
KHobbits
e37ab86c9b Updating min Bukkit version. 2011-12-12 23:13:39 +00:00
KHobbits
081491d0a1 Merge branch 'master' into release 2011-12-12 23:06:40 +00:00
KHobbits
f936cd5f27 Updating to RB
CraftBukkit #1597 Bukkit #1073
2011-12-12 23:00:21 +00:00
KHobbits
46840a686d Merge remote branch 'remotes/origin/groupmanager'
Adjusting bukkit paths to remove version number.
2011-12-12 22:51:18 +00:00
KHobbits
5f3d783e21 Update Bukkit jars and paths. 2011-12-12 22:45:59 +00:00
KHobbits
3eff598791 Merge branch 'master' of github.com:essentials/Essentials 2011-12-12 00:49:33 +00:00
KHobbits
a7b1c3d534 Switching the item value of brewing stands 2011-12-12 00:48:39 +00:00
snowleo
f8e1f02523 Fix sorting of users in /who 2011-12-11 09:22:27 +01:00
KHobbits
a63c116590 Temp Fix wildcard permissions in bperms. 2011-12-11 06:00:29 +00:00
KHobbits
fad38170a8 Make the version error messages stand out a little more... 2011-12-11 05:49:25 +00:00
KHobbits
aa5f819d7b Added cleanup note
Minecraft server usually shows players around 140-180 range, so changing default /near to 200.
2011-12-10 04:12:22 +00:00
KHobbits
f9905f9953 Make the alt command message, sound less negative/broken. 2011-12-09 22:53:36 +00:00
KHobbits
06c2453941 Update plugin information. 2011-12-09 21:51:31 +00:00
KHobbits
c0e903c1f3 New permissions: essentials.powertool.append. 2011-12-09 21:42:36 +00:00
KHobbits
f99867dd0a Simplify the protect config file examples. 2011-12-09 04:07:53 +00:00
snowleo
de12c5c6d1 Fix broken charge for shout and question 2011-12-09 02:48:57 +01:00
ementalo
95d5217f58 Allow timeout of /tpa /tpahere requests
Adds new config setting tpa-accept-cancellation
Test #781
2011-12-08 23:43:09 +00:00
KHobbits
52b1017bda Merge branch 'master' of github.com:essentials/Essentials 2011-12-08 04:44:34 +00:00
KHobbits
b102c5f3d8 First Refactor of Kits
New sign: [Kit] / <kit name> / [group] / [charge]
2011-12-08 04:44:18 +00:00
snowleo
8d0230d6a8 Merge branch 'refs/heads/master' into release 2011-12-08 05:41:00 +01:00
snowleo
e379ac5d77 Merge branch 'refs/heads/groupmanager' 2011-12-08 04:14:27 +01:00
KHobbits
221e1d3bb2 Merge branch 'master' of github.com:essentials/Essentials 2011-12-08 02:23:18 +00:00
KHobbits
9410a25cce Adjusting /spawn to not trigger respawn event. 2011-12-08 02:21:10 +00:00
snowleo
ae7d968f5c Fix for Towny using an old method. 2011-12-08 02:23:44 +01:00
snowleo
5002e7a6ad Prevent blockdamage by enderdragon (default true) in EssentialsProtect CB#1566 B#1058 2011-12-08 00:48:53 +01:00
snowleo
13a42d1937 Fix Jails not loaded after server start. 2011-12-07 16:50:16 +01:00
snowleo
46c99e5c6f /home sends the player to bed again before it tries to respawn. 2011-12-07 15:18:50 +01:00
snowleo
02b25120e8 Allow to set the Respawn priority in config. 2011-12-07 15:09:22 +01:00
snowleo
435219bab6 Fix Enchant sign, the user has to hold the item in hand now. A * or "any" in the second line allows to enchant all possible items. 2011-12-07 14:23:56 +01:00
snowleo
766f0a9f13 Use of our Inventory code in enchant sign to be reliable. 2011-12-07 13:44:51 +01:00
snowleo
d60de76d87 New config option disable-item-pickup-while-afk, defaults to true. 2011-12-07 12:10:41 +01:00
snowleo
324cd74826 Banned moved from /whois to /seen 2011-12-07 12:00:01 +01:00
snowleo
e7ebc94a9e SnakeYaml now ignores additional mapping values in files, so it throws less errors. 2011-12-07 11:57:31 +01:00
snowleo
5c02346f85 Fix I18n file not loading from Essentials folder, when the locale is not defined in config. 2011-12-07 11:22:02 +01:00
snowleo
5b539bf034 Fix /mail sendall, fixes #1209 2011-12-07 11:02:10 +01:00
snowleo
879d4913dc /balancetop now has pages instead of max argument
Test #1210
2011-12-07 10:53:06 +01:00
snowleo
ef49d92c49 Null check in new player teleport, fixes #1212 2011-12-07 10:37:34 +01:00
snowleo
719539d63b Missing translation for last commit 2011-12-07 10:35:06 +01: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
67a3a55f5a Updated /near and /getpos command, added new argument playername
Test #1214
2011-12-07 10:03:23 +01:00
Khyperia
e8eb1974b8 New feature: IsBanned to /whois 2011-12-07 09:36:11 +08:00
Khyperia
a82d8d1d44 Added new player argument: /spawnmob <mob> [amount] [player]
Test: #821
2011-12-07 09:36:11 +08:00
ementalo
9ca0e51dac Merge branch 'master' of github.com:essentials/Essentials 2011-12-07 01:13:08 +00: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
Khyperia
b49a9ef165 New feature: /mail sendall <message>
Test: #649
2011-12-07 08:53:15 +08:00
Khyperia
d573671933 Renamed /find to /itemdb 2011-12-07 08:53:14 +08:00
Khyperia
a0d66ce230 New command: /find <item>
Test #278
Test #293
Test #348
2011-12-07 08:53:14 +08:00
snowleo
854fc05c5b Fix serious bug in Dev2.7.137 - Dev2.7.144: if spawn.yml is not present, the server will run into a deadlock. 2011-12-07 00:08:45 +01:00
ementalo
b9077d91a5 Adding ability to save /back location from teleport events outside essentilals
New config setting to turn this on "register-back-in-listener"
Test #1200
CB#1560 / B#1055
2011-12-06 22:56:38 +00:00
snowleo
ff13279e6c Fixing color in announce-format 2011-12-06 22:02:19 +01:00
snowleo
ce3a7c8719 This is no longer needed 2011-12-06 17:44:02 +01:00
snowleo
9e1571a8e5 More cleanup 2011-12-06 17:42:55 +01:00
snowleo
d2953c99ef Added /jail /ejail alias to plugin.yml 2011-12-06 17:31:35 +01:00
snowleo
72e187cd5c Updated Jails to use the new config classes 2011-12-06 17:28:48 +01:00
snowleo
2851a4634c cleanup 2011-12-06 16:35:30 +01:00
snowleo
58237a796a New Interfaces in api package (WIP) 2011-12-06 16:32:06 +01:00
snowleo
5433a68502 UserBase is abstract 2011-12-06 15:40:35 +01:00
snowleo
a7097df231 Refactoring to create less redundant code 2011-12-06 15:38:14 +01:00
snowleo
51390a9698 Prevent some rare cases of NPE and Deadlocks, better error handling on yaml load 2011-12-06 14:39:52 +01: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
f3b278eac2 More work done on config code 2011-12-06 10:37:17 +01:00
snowleo
6fe8e603af Using the correct type of Set in UserMap. 2011-12-06 08:28:41 +01:00
snowleo
6b06adfc23 Check if the item can be enchanted. 2011-12-05 00:20:46 +01:00
Khyperia
2b919faa7b Added {VERSION} to motd
Test #1198
2011-12-05 06:56:20 +08:00
snowleo
b2ffdc9774 utf8 encoding 2011-12-04 23:39:08 +01:00
snowleo
e5aa7f496b Merge remote-tracking branch 'dysp/patch-1'
Conflicts:
	Essentials/src/messages_da.properties
2011-12-04 23:37:01 +01:00
snowleo
cb89fe5358 Readded because of popular demand: default-stack-size for /give and /item, values below 1 return max stack size (or oversized stack size). 2011-12-04 23:21:30 +01:00
snowleo
ad60eb538e Ignore teleport cooldown on /tjail 2011-12-04 22:57:40 +01:00
snowleo
cbc744c85a Added missing steps to items.csv (by andrewkm from ecocitycraft.com) 2011-12-04 22:53:29 +01:00
snowleo
6371a59819 Fix some rare cases, where adding an item to inventory could result in an infinite loop. 2011-12-04 22:45:47 +01:00
snowleo
20bc8840d6 Allow oversized stacks in kits. 2011-12-04 22:33:49 +01:00
snowleo
f12e9f6dfb Enchantements are now stored in one class 2011-12-04 22:28:29 +01:00
snowleo
c8814bd70e Added missing [player] to plugin.yml 2011-12-04 22:10:20 +01:00
snowleo
8417c5e1f0 New permission essentials.spawn.others 2011-12-04 22:09:36 +01:00
snowleo
ec3586c08c Added null check to /break 2011-12-04 22:06:03 +01:00
snowleo
d9c773270b Less use of sqrt 2011-12-04 22:01:50 +01:00
snowleo
dd84f5c331 Merge pull request #35 from khyperia/master
Multiple commits from khyperia
2011-12-04 12:49:52 -08:00
Khyperia
2c2f956068 Added [enchant] sign
Test #1177
2011-12-04 14:58:00 -05:00
Khyperia
ba3ccf7a2c Added /spawn <player>
Test #607
2011-12-03 20:24:35 -05:00
KHobbits
90f87804b1 Show command conflict in debug mode. 2011-12-03 23:38:28 +00:00
KHobbits
ea21e402ec Sort translation files properly. 2011-12-03 21:18:15 +00:00
KHobbits
1066f7a478 New Permission: essentials.world.<worldname>
~ Unsure about the future of this feature, its recommended you don't rely on /world to switch worlds ~
Test #1178
2011-12-03 21:15:53 +00:00
KHobbits
1c03cdb4d0 New command /remove
Test #1193
2011-12-03 21:14:03 +00:00
KHobbits
6d3e1b862e New command: /feed New permission: essentials.feed.others
Test #1191
2011-12-03 20:54:53 +00:00
KHobbits
d4c2443b5f New command: /more
Test #1189
2011-12-03 20:44:44 +00:00
KHobbits
8ce8764f6a New Command /break, and new Permission: essentials.break.bedrock
Test #1188
2011-12-03 20:41:24 +00:00
KHobbits
343618642b Merge pull request #34 from khyperia/master 2011-12-03 12:36:38 -08:00
Khyperia
1cb593dba3 Added per-world permissions for /world 2011-12-03 12:13:42 -05:00
Khyperia
85d743dce5 Merge commit 2011-12-03 11:14:53 -05:00
KHobbits
118b3638eb Small cleanup to checkActivity 2011-12-03 13:50:32 +00:00
Khyperia
dc74239edc Fixed accedental typo 2011-12-02 20:55:43 -05:00
Dysp
647eac32fc The last translation was so poorly done (I suspect the use of google-translate) that I decided to translate it myself. There may be errors due to lack of insigt for the context of the individual sentence. I can easily correct these, if I am notified. 2011-12-03 01:05:12 +01:00
Khyperia
91be153474 Added some commands from request 946 2011-12-02 19:02:12 -05:00
KHobbits
b03a327f9b Patching gamemode and god toggles to not match on ' ' 2011-12-02 21:32:32 +00:00
KHobbits
3b2403b686 items.csv update for crackedstonebrick (id98,2) 2011-12-02 09:28:57 +00:00
KHobbits
16e3830f9e Remove invalid dupe permission from permbukkit example. 2011-12-02 09:23:23 +00:00
KHobbits
73ec9978fb Make the chat formatting config file link to the wiki. 2011-12-02 09:17:20 +00:00
snowleo
055f11c89e Missing language files for last commit 2011-12-02 08:34:28 +01:00
snowleo
1489203aca New config options repair-enchanted (default true) and permission essentials.repair.enchanted 2011-12-02 08:30:52 +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
8d4d8effa0 Null check 2011-12-02 03:27:37 +01:00
snowleo
8591023ad5 Moved block to item conversion to Util class 2011-12-02 03:25:22 +01:00
snowleo
42f4bba320 Added new tags to info.txt 2011-12-02 02:01:48 +01:00
Khyperia
746c80b0d6 Added many new MOTD possibilities + getI18n() to Essentials.java 2011-12-02 08:42:48 +08:00
Khyperia
bbb47fe6d3 Added {DATE} and {TIME} to motd 2011-12-02 08:42:48 +08:00
Khyperia
4c1c3e4852 Added many new MOTD possibilities + getI18n() to Essentials.java 2011-12-01 19:37:12 -05:00
KHobbits
3b0c604de0 Missing command aliases. 2011-12-01 17:32:48 +00:00
KHobbits
7a80a36eab Missing aliases 2011-12-01 17:25:46 +00:00
KHobbits
83a4431bd7 CB#1538 b#1050 2011-12-01 16:20:53 +00:00
KHobbits
c0eec02f0a Show how far away each player is. 2011-12-01 15:58:25 +00:00
KHobbits
c97d069783 Fixing near output. 2011-12-01 15:31:53 +00:00
KHobbits
b0377498f7 Better distance checking. 2011-12-01 15:15:45 +00:00
KHobbits
00d44873ca Command: /near 2011-12-01 14:43:16 +00:00
KHobbits
2a8ccb43ae Fixing spawnmob errors to say the right thing. 2011-12-01 14:43:00 +00:00
KHobbits
f006932639 Merge branch 'master' of github.com:essentials/Essentials
Conflicts:
	Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
	Essentials/src/com/earth2me/essentials/commands/Commandenchant.java
2011-12-01 13:47:06 +00:00
KHobbits
2dc6f8c202 Command Cleanup 2011-12-01 13:42:39 +00:00
snowleo
39851694ad minor changes to items.csv 2011-12-01 04:46:43 +01:00
snowleo
737f7799fc Updated items.csv by michaelwm from ecocitycraft.com 2011-12-01 04:39:51 +01:00
Khyperia
8356624479 Added {DATE} and {TIME} to motd 2011-11-30 21:02:57 -05:00
Khyperia
dde8595c51 Updating to latest 2011-11-30 20:30:21 -05:00
snowleo
909e5bd3f8 Update of Smack to 3.2.1 2011-12-01 02:11:40 +01:00
snowleo
e6e1c7d160 We don't need them anymore. 2011-12-01 01:56:39 +01:00
snowleo
a5f4ada85d This is obsolete too. 2011-12-01 01:41:09 +01:00
snowleo
4f8be31343 Cleanup of the library folder
Also: we don't use the mysql.jar/sqlite.jar anymore, since it is included in craftbukkit. I don't know why this reference in config.yml still exists.
2011-12-01 01:35:48 +01:00
snowleo
40220960f5 We don't need that anymore. 2011-11-30 23:51:41 +01:00
snowleo
3c9f0db3d4 CB#1534 B#1048 2011-11-30 22:59:50 +01:00
snowleo
bd7bd86e62 Allow EssentialsProtect to go into emergency mode, if Essentials core is not present at all. 2011-11-30 21:25:11 +01:00
snowleo
5e2123c91e If Essentials core fails to read one of the configs now, it will disable itself. If other modules detect that Essentials is not enabled, they will be disabled too. EssentialsProtect will go into emergency mode, canceling all events that could hurt your world. Fix the file and either restart or reload the server. 2011-11-30 20:49:11 +01:00
snowleo
15d8ec6026 Removed EnchantmentFix, because it's fixed in CB#1526 2011-11-30 20:49:11 +01:00
KHobbits
a8a9fc3dd6 /spawnmob sheep:<colour> + /spawnmob sheep:baby = /spawnmob sheep:<colour>baby.
And as a nice extra, random: /spawnmob sheep:randombaby 10
2011-11-30 03:58:20 +00:00
KHobbits
1de4a40bf6 Missing an Animal. 2011-11-30 03:44:33 +00:00
snowleo
35f5578436 New config option update-bed-at-daytime that allows players to always set their bed location 2011-11-30 02:51:02 +01:00
snowleo
b8d60674cb Updated readme about format guidelines. 2011-11-30 00:54:44 +01:00
snowleo
a30a28265a Removing old settings.zip 2011-11-30 00:52:55 +01:00
snowleo
f5344b65d3 Fix /balancetop, cache was not cleared 2011-11-30 00:48:51 +01:00
snowleo
37e5260cda Merge branch 'refs/heads/master' into release 2011-11-29 21:55:09 +01:00
snowleo
e169e954ba Merge branch 'refs/heads/groupmanager' 2011-11-29 21:38:00 +01:00
snowleo
aed160b5fc Using this code until Bukkit fixes spawnCreature() 2011-11-29 19:24:54 +01:00
snowleo
0b2a3fcf7f Output the redirected plugin too. 2011-11-29 18:48:52 +01:00
snowleo
57a0ec9912 Allow joinList to understand Collections. 2011-11-29 18:40:13 +01:00
KHobbits
e5435f24db Merge branch 'master' of github.com:essentials/Essentials 2011-11-29 17:21:46 +00:00
KHobbits
af7eae6201 Adding some debug info to /essentials 2011-11-29 17:21:18 +00:00
snowleo
60067964be Fix NPE in getUser() 2011-11-29 17:39:22 +01:00
KHobbits
cdbae1631d Settings Cleanup. 2011-11-29 16:16:45 +00:00
KHobbits
414d6b79e9 GC: Never force reclaiming RAM on user logout, it will be done automatically, when the time is right.
~ Should reduce player event lag a little bit ~
2011-11-29 16:06:39 +00:00
KHobbits
dd3b1e97b6 Merge branch 'master' of github.com:essentials/Essentials 2011-11-29 13:10:19 +00:00
KHobbits
0c81a68c7b Handle a null handler (GM) 2011-11-29 13:10:00 +00:00
snowleo
183343c388 1TBS? Nope, Allman
This reverts commit a36b755248.
2011-11-29 05:06:07 +01:00
snowleo
a36b755248 New format guidelines? 2011-11-29 04:51:29 +01:00
snowleo
525fefc484 UserMap.getUser() will return null on failure. 2011-11-29 00:36:36 +01:00
snowleo
4bacdb327a Fix NPE when reading old player files 2011-11-29 00:30:06 +01:00
snowleo
19b8031933 Merge branch 'refs/heads/master' into release 2011-11-28 22:42:17 +01:00
snowleo
91cdff955a Fix another bug in /sell 2011-11-28 22:41:26 +01:00
snowleo
8c06b13a77 Allow to set size of MagmaCubes in /spawnmob 2011-11-28 22:06:59 +01:00
snowleo
7db7fd4136 Added info how to read the next page to /info /help /motd /rules 2011-11-28 20:52:15 +01:00
snowleo
99211fd407 Merge branch 'refs/heads/master' into release 2011-11-28 20:28:05 +01:00
snowleo
5e24584bf7 Fix bug in /sell command 2011-11-28 20:24:13 +01:00
snowleo
3d839c2b21 Merge branch 'refs/heads/master' into release 2011-11-28 20:03:09 +01:00
snowleo
9acc7db06f Changes to /sell /give and /item
Material.getMaxStackSize() will now be used in /give and /item
The config option default-stack-size has been removed
New config option oversized-stacksize and permission essentials.oversizedstacks
Fixes bug giving out too many items on /give and /item when a stacksize > 64 is given.
Fixes bug in /sell that ignores enchantments
/sell now uses Material.getMaxStackSize() for /sell egg 2s (will sell 32 instead of 128 now)
2011-11-28 19:55:51 +01:00
snowleo
0354b8d019 Translation of /balancetop 2011-11-28 18:59:33 +01:00
snowleo
eea7785b7f Calculation of /balancetop is now async to prevent slowdown of the server 2011-11-28 18:53:38 +01:00
snowleo
7268e1965d Ignore defaultstacksize from config, just use 64 2011-11-28 17:58:26 +01:00
KHobbits
4614d6d0dd Merge branch 'master' of github.com:essentials/Essentials 2011-11-28 12:56:20 +00:00
KHobbits
4a83d17fec Adding extra mobs to essentials protect, changing some default settings. 2011-11-28 12:55:54 +00:00
snowleo
e8d64aca5e New option for EssProtect: Prevent villager death. 2011-11-28 06:15:51 +01:00
snowleo
e1e7a1cfdb Merge branch 'refs/heads/master' into release 2011-11-28 04:23:38 +01:00
snowleo
b637e494c2 Forgot this again. :D 2011-11-28 04:15:09 +01:00
KHobbits
ccfc3b8d78 Someone said something about wanting Snowmen.
... and MagmaCubes.
Bukkit #1045 CraftBukkit #1522
2011-11-28 03:12:37 +00:00
KHobbits
05c90af1ee Fix empty argument in delhome. 2011-11-28 02:54:19 +00:00
snowleo
6603d0997e Fix broken trade/buy signs because of a wrong cast 2011-11-27 22:36:32 +01:00
snowleo
0ed7f87ee0 Merge branch 'refs/heads/master' into release 2011-11-27 20:59:19 +01:00
snowleo
aceda4c680 Allow enchantments to be removed using /enchant enchantmentname 0 2011-11-27 20:40:39 +01:00
snowleo
67be976d90 New permissions:
essentials.spawnmob.[mobname] and essentials.spawner.[mobname]
2011-11-27 19:59:06 +01:00
snowleo
ec6baa3621 Catch exception instead of checking for null 2011-11-27 19:13:55 +01:00
snowleo
82f864a7f9 Update Essentials/src/messages_fr.properties 2011-11-27 18:56:04 +01:00
snowleo
2a22c04688 Merge pull request #32 from leagris/patch-1
Up to date, more accurate french translation.
2011-11-27 09:55:33 -08:00
Léa Gris
1c6c460a09 Up to date, more accurate french translation. 2011-11-27 17:52:12 +01:00
snowleo
c5251591de Allow /unbanip playername, not just ips 2011-11-27 16:58:47 +01:00
snowleo
ccb4d3a7e8 Don't add the internal bukkit names to the enchantment list, to make it shorter. 2011-11-27 11:43:42 +01:00
snowleo
d5db9d404a Revert to the old behavior of oversized stacks. We might remove or change this in the future. 2011-11-27 10:59:28 +01:00
snowleo
0c0c9573be Updated the enchantment names to match those of the game 2011-11-27 10:48:10 +01:00
snowleo
76a8f794ef Enchantments in CraftBukkit are still broken, but it works with Essentials :) 2011-11-27 10:02:41 +01:00
snowleo
cbba3639b9 Fix Typo 2011-11-27 09:09:04 +01:00
snowleo
8791a8dbb7 Only print stack trace of motd.txt not found, if debug is on. 2011-11-27 09:07:15 +01:00
snowleo
098072517a Added enchantment to /give and /item
Updated plugin.yml
2011-11-27 08:57:21 +01:00
snowleo
b8f9a4b96f Implement correct hashCode() and equals() in EnchantmentLevel 2011-11-27 08:26:52 +01:00
snowleo
9c56b147ee Enchantment Multiplier in future Worth config 2011-11-27 08:18:41 +01:00
snowleo
41e8c4c7b8 Enchantments on Trade signs? Fixes check, so we won't add items that are enchanted. 2011-11-27 07:47:16 +01:00
snowleo
a8a72da15e Added 1.9 material where you can stand 2011-11-27 07:33:03 +01:00
snowleo
9b6c01d071 /spawner without mobname outputs available mobs 2011-11-27 07:32:42 +01:00
snowleo
3c71ae4cd9 Locale.ENGLISH!!1! 2011-11-27 06:23:07 +01:00
snowleo
34edf34ba3 Using the ItemStack.clone() method 2011-11-27 06:10:11 +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
KHobbits
d5c852b79d URL went nowhere. 2011-11-27 04:54:48 +00:00
snowleo
65776d6ed2 BedLocationFix for CraftBukkit 2011-11-27 04:46:33 +01:00
snowleo
0234c55ce3 New command /enchant
Permissions for each enchantment: essentials.enchant.[enchantmentname]
For all use *
2011-11-27 04:36:42 +01:00
KHobbits
ee42030307 Merge remote branch 'remotes/origin/groupmanager' 2011-11-27 03:16:32 +00:00
snowleo
a714e39bf4 CB#1512 B#1039 2011-11-27 03:22:39 +01:00
KHobbits
68297b5cf8 Merge branch 'master' of github.com:essentials/Essentials 2011-11-27 01:15:39 +00:00
KHobbits
ae4c10ced6 Fixing optional argument on tppos to use the correct yaw value. 2011-11-27 01:15:14 +00:00
snowleo
b5e9ad02ae arrrgggss 2011-11-27 00:31:14 +01:00
snowleo
c70700f7b8 Fix banning random player (and all other commands where a empty player is given) 2011-11-27 00:23:40 +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
f9d14697b6 Forgot to save this file before commit 2011-11-26 17:37:07 +01:00
snowleo
8ed4418d5f Translated /list command 2011-11-26 15:26:48 +01:00
snowleo
4ad19b6fad Cleanup 2011-11-26 00:34:36 +01:00
snowleo
d4685d1d10 Fix ItemDupe bug in bukkit 2011-11-25 22:26:06 +01:00
snowleo
fa73394113 Merge branch 'refs/heads/groupmanager' 2011-11-25 21:12:38 +01:00
snowleo
3daf56c8be Another safety check 2011-11-25 14:02:40 +01:00
snowleo
223028f306 Fix another NPE in AlternativeCommandsHandler 2011-11-25 13:55:09 +01:00
snowleo
7afbad3218 This config option is never read 2011-11-25 13:03:07 +01:00
snowleo
871c0e6b6a Disable god mode automatically in worlds defined by config 2011-11-25 07:12:21 +01:00
snowleo
73d13f5748 Oh no! Angry wolf babies D: 2011-11-25 06:04:19 +01:00
snowleo
03452bda68 Baby wolfs, awwwwh 2011-11-25 05:54:32 +01:00
snowleo
613cb57fdb CB#1501 B#1037
New spawnmob options: cow:baby sheep:baby chicken:baby pig:baby
2011-11-25 05:49:57 +01:00
snowleo
31b9e792bd Fix NPE in AlternativeCommandsHandler on shutdown 2011-11-25 00:22:57 +01:00
snowleo
32e43bf167 Show more then 9 lines of motd on login 2011-11-24 05:57:01 +01:00
snowleo
579bbc9f2c Merge branch 'refs/heads/master' into release 2011-11-24 04:26:05 +01:00
KHobbits
af456a73dd New permission essentials.nick.color
Allows control over who can use colour codes in nicknames.
2011-11-23 22:24:31 +00:00
snowleo
b35d5f30f9 Invert pattern 2011-11-23 02:52:08 +01:00
snowleo
8aaaed2ef8 More work on the config code 2011-11-23 02:43:38 +01:00
snowleo
e683ce5751 Merge branch 'refs/heads/groupmanager' 2011-11-22 15:12:20 +01:00
snowleo
b0aaafd08d GM does not need CraftBukkit 2011-11-22 06:02:47 +01:00
KHobbits
212442ab1c Fixing inventory method calls.
Bug report: http://pastie.org/2901587
2011-11-22 04:55:21 +00:00
KHobbits
bf244fff80 Switching priority on help permissions
Bukkit #1488
2011-11-22 04:41:34 +00:00
KHobbits
2620e2ae08 Merge branch 'master' of github.com:essentials/Essentials 2011-11-22 04:00:26 +00:00
KHobbits
d59e2834d1 Rewriting help, to use new classes. 2011-11-22 04:00:04 +00:00
snowleo
63991cb38d Moved all dependency on craftbukkit to one package in the main jar. The rest is now clean bukkit code. Also cleaned PlayerExtension class. 2011-11-22 03:02:08 +01:00
snowleo
94b70e1ee9 Corrected name in items.csv: whitestone => enderstone 2011-11-22 02:25:56 +01:00
snowleo
a5853baf4c Set shooter of Fireball or it will die instantly. 2011-11-21 03:50:31 +01:00
snowleo
90694b15cc Added new creatures to EssProtect prevent spawning
Ghast and Slime default value changed
2011-11-21 03:21:02 +01:00
snowleo
5e4b7f85c8 Cleanup 2011-11-21 03:07:44 +01:00
snowleo
b5bc83e714 Fixing the tests 2011-11-21 03:05:18 +01:00
snowleo
220d68f375 Switch to the new I18n class and format cleanup of all classes 2011-11-21 02:55:26 +01:00
snowleo
e672de949c Merge branch 'refs/heads/master' into release 2011-11-20 21:46:02 +01:00
snowleo
19f5a2340d Fix timeWorldCurrent translation key in /time command 2011-11-20 19:12:20 +01:00
snowleo
1e4a54baca Prevent NPE with creatures that are not added to bucket yet. 2011-11-20 16:50:08 +01:00
snowleo
14cc499421 Fix long prefix breaking setPlayerListName(), because they are too long.
If Essentials detects, that the player name would be too long with prefix and suffix to fit in the player list, it will only update the name without prefix and suffix but with nickname and opcolor.
2011-11-20 16:43:38 +01:00
snowleo
6633b39954 Fix Bukkit version pattern 2011-11-20 16:40:18 +01:00
snowleo
a886645afa Add SmallFireball to EssProtect 2011-11-20 15:43:39 +01:00
snowleo
8c478c76a5 Added option to /fireball command: /fireball small 2011-11-20 14:34:03 +01:00
snowleo
293f2f7cd2 Added new mobs 2011-11-20 14:33:17 +01:00
snowleo
1f6b1f4a2c Added new methods to Fake classes 2011-11-20 14:30:54 +01:00
snowleo
765ec51b32 Added the new items to items.csv 2011-11-20 14:30:21 +01:00
snowleo
c132a75c1a CB# 1467 B#1022 2011-11-20 14:03:00 +01:00
snowleo
f72762bcb2 Merge branch 'refs/heads/master' into release 2011-11-19 16:04:00 +01:00
KHobbits
4f8319bbb9 Warn in the console if group prefixes are too long.
People using displayname prefixes can set longer chat prefixes in the chat config.
2011-11-18 23:08:16 +00:00
KHobbits
cd9ea163e4 Continuing code cleanup 2011-11-18 22:09:26 +00:00
KHobbits
fc00ff471d Merge branch 'master' of github.com:essentials/Essentials into essmaster 2011-11-18 19:18:06 +00:00
snowleo
85ef892f0e Null checks 2011-11-18 20:15:26 +01:00
KHobbits
2e0fb15952 More code cleanup. 2011-11-18 18:33:22 +00:00
KHobbits
11f02fb947 Code cleanup continues... 2011-11-18 18:11:49 +00:00
KHobbits
e5a8cd88f0 Code cleanup continued. 2011-11-18 17:48:49 +00:00
snowleo
9987568ae8 New I18n code, not used yet 2011-11-18 15:04:22 +01:00
KHobbits
a05f730e76 Little more command cleanup. 2011-11-18 13:48:31 +00:00
KHobbits
5655509c62 Updating gitignore to ignore private files. 2011-11-18 12:10:36 +00:00
KHobbits
a9b77b3486 Updating gamemode to allow essentials.gamemode.other. 2011-11-18 12:08:27 +00:00
KHobbits
37bd9bc9b5 Merge branch 'master' of github.com:essentials/Essentials into essmaster 2011-11-18 12:07:11 +00:00
KHobbits
e54d73704e Command cleanup 2011-11-18 12:06:59 +00:00
KHobbits
e5c77c1aeb Updating web push to just push the zip files. 2011-11-18 12:06:19 +00:00
snowleo
edf0ab756c Updated UserMap to newest Guava-API 2011-11-18 05:29:27 +01:00
snowleo
c96b14a34c Remove useless import 2011-11-18 05:23:38 +01:00
snowleo
3841648eba Update ExecuteTimer to use ns instead of ms for calculations, output is still in ms 2011-11-18 05:13:38 +01:00
snowleo
ffc1640308 Java 1.5 clients will never reach that point, so we can remove it. 2011-11-18 04:22:09 +01:00
snowleo
0bbc1e540b motd and rules are now configured in the files motd.txt and rules.txt, values from config.yml are copied automatically
New features:
Info command now understands the tags from motd and rules
motd and rules are now multipage
On join, only the first page of motd is shown.
2011-11-18 04:18:03 +01:00
snowleo
2a98734d22 Better solution for the alternative commands 2011-11-18 01:43:58 +01:00
snowleo
603d23659b Check for other plugin aliases and run them instead. 2011-11-18 01:01:05 +01:00
snowleo
7ecc3c25b0 Merge branch 'refs/heads/master' into release 2011-11-17 19:06:44 +01:00
snowleo
41c03853ab General fix against overwriting already existing protections 2011-11-17 17:06:06 +01:00
snowleo
adcffba7cf Merge branch 'refs/heads/master' into release 2011-11-17 16:34:39 +01:00
snowleo
2a4c26ee69 Prevent that sign protection in EssProtect can be circumvented by placing signs. 2011-11-17 16:20:31 +01:00
snowleo
8143154826 The data value of leaves changed by 4
0 -> 4, 1 -> 5, 2 -> 6 to make them permanent, items.csv should be updated automatically
2011-11-17 16:14:56 +01:00
snowleo
e271e60144 Merge branch 'refs/heads/master' into release 2011-11-17 15:34:27 +01:00
snowleo
c5c29aef4e Merge branch 'refs/heads/groupmanager' 2011-11-17 15:34:05 +01:00
snowleo
af5a86c48c Fix water/lava bucket bug with mobs 2011-11-17 14:23:35 +01:00
snowleo
b9daf6aaa5 Sudo: This would break horrible for offline players and the original player object has to be used. 2011-11-16 04:26:24 +01:00
KHobbits
4be1797592 Sudo Command
This might never make it to release, needs tidying first at least.
2011-11-16 03:00:31 +00:00
KHobbits
c0d046841f Gamemode sign, standard sign permissions. 2011-11-16 00:21:55 +00:00
KHobbits
e4c3f7b115 New permission: essentials.repair.armor
If a player has this permission '/repair all' will also repair equipped armor.
2011-11-15 23:54:26 +00:00
KHobbits
f51b92c99e Updating banip to support offline players. 2011-11-15 23:01:15 +00:00
snowleo
16be86953f Merge branch 'refs/heads/master' into release 2011-11-15 22:52:42 +01:00
snowleo
eda827b244 Merge branch 'refs/heads/groupmanager' 2011-11-15 22:52:05 +01:00
snowleo
27ee7efde5 Cleanup of the /tree commands 2011-11-15 22:51:14 +01:00
snowleo
cccebdd62e null the Essentials object in static EcoApi, so it doesn't leak on /reload.
TODO: Make the eco api non-static
2011-11-15 22:51:14 +01:00
snowleo
d2f3bf94ae Prevent that players are teleported to offline players using /tpa and players that lost their tpahere permission 2011-11-15 22:51:14 +01:00
KHobbits
b619a54105 Prevent client crash on 'Free air' 2011-11-14 10:11:23 +00:00
snowleo
cd897890be Fix #1106 GeoIP announces players who are hidden, on join. 2011-11-11 03:27:09 +01:00
KHobbits
1f527cdb9e Merge branch 'essmaster' into essrelease 2011-11-08 05:17:42 +00:00
KHobbits
90c9fe7e65 Merge remote branch 'remotes/ess/groupmanager' into essmaster 2011-11-08 05:16:15 +00:00
KHobbits
cc5062828a Extra translation keys. 2011-11-05 00:12:07 +00:00
KHobbits
165d499ef3 Adding op/god mode to whois. 2011-11-04 23:41:39 +00:00
KHobbits
f0c49019dd Only pull/push data on valid player data. 2011-11-04 23:13:21 +00:00
KHobbits
05242a7e8f Force displayname update on /list.
Tidy duplicate displayname call.
2011-11-04 16:51:00 +00:00
KHobbits
fd2ec22919 Clear all powertools - /powertool c: 2011-11-04 16:42:03 +00:00
KHobbits
7618754b89 Removing Reloadall Command
Tidy plugin.yml
2011-11-04 16:20:09 +00:00
KHobbits
d8f7c82e2d Start logging players last login address. 2011-11-04 15:28:51 +00:00
KHobbits
fd4c82b0eb Merge remote branch 'remotes/ess/groupmanager' into essmaster 2011-11-04 11:40:33 +00:00
KHobbits
70d1c7d7d7 Merge branch 'master' of github.com:essentials/Essentials into essmaster 2011-11-04 11:40:18 +00:00
KHobbits
894d956ba1 Extra command alias's. 2011-11-04 11:39:31 +00:00
snowleo
8890284b3e Temporary debug mode using /essentials debug 2011-11-04 02:44:00 +01:00
KHobbits
02cc1b9fe9 Merge branch 'master' of github.com:essentials/Essentials into essmaster 2011-11-04 00:45:03 +00:00
KHobbits
6d6a29a99d Alias for 'Everyone' on warp signs. 2011-11-04 00:44:41 +00:00
snowleo
1d95f1c6d2 Fix bug in sign state loop 2011-11-04 01:24:01 +01:00
KHobbits
6e4bf932ec Adding game mode command for quick toggling (/gm /creative /gamemode) 2011-11-03 23:39:13 +00:00
KHobbits
a9a8216f4d Spanish translation 2011-11-03 23:11:04 +00:00
KHobbits
f98eb4a40d Adding gamemode to whois
Fixing exception in unban
2011-11-03 23:10:42 +00:00
KHobbits
51920420ce Allow proper escaping and use of & symbol in nicks (&& = &). 2011-11-03 22:19:33 +00:00
KHobbits
d171cce45d Trim long nicknames for use in tab list
Colour Nicknames
Refactor /nick Command
Fix nickother validity checks.
2011-11-03 22:13:50 +00:00
KHobbits
d264c26310 Allow the use of the warp command from the console 2011-11-03 16:17:39 +00:00
KHobbits
375636cd36 Code tidy, trigger build id update. 2011-11-01 16:54:36 +00:00
okamosy
dd87dcdd3d Merge branch 'master' of github.com:essentials/Essentials into ess 2011-10-30 21:30:21 +00:00
okamosy
ffd7ba7d5f EssChat update part 1. 2011-10-30 21:29:56 +00:00
snowleo
11e8240c5c Merge branch 'refs/heads/master' into release
Conflicts:
	EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
2011-10-22 11:55:01 +02:00
KHobbits
4aecc034c2 Fixing typo in release build. 2011-10-11 22:51:30 +01:00
KHobbits
a111a07bca Merge branch 'essmaster' into essrelease 2011-10-11 20:06:23 +01:00
KHobbits
eb71097546 Merge remote branch 'remotes/ess/master' into essrelease 2011-10-11 17:52:56 +01:00
KHobbits
c7fcb72d6c Merge remote branch 'remotes/ess/master' into essrelease 2011-10-10 17:21:48 +01:00
snowleo
04af8ef329 Merge branch 'master' into release 2011-10-10 00:30:47 +02:00
snowleo
4cdf803ab7 Merge branch 'master' into release 2011-10-09 23:52:15 +02:00
snowleo
4595c15bee Merge branch 'master' into release 2011-10-09 17:54:59 +02:00
snowleo
1e3d2fbfd2 Merge branch 'master' into release 2011-10-08 19:43:07 +02:00
snowleo
57c25bf151 Merge branch 'master' into release 2011-10-04 23:07:30 +02:00
snowleo
ae030b227a Merge branch 'master' into release 2011-10-04 22:20:10 +02:00
snowleo
4f85751694 Merge branch 'master' into release 2011-10-04 21:34:28 +02:00
KHobbits
6b0d0daa2e Merge branch 'essmaster' into essrelease 2011-10-04 14:40:12 +01:00
KHobbits
401498a4f7 Merge branch 'essmaster' into essrelease 2011-10-04 09:51:51 +01:00
KHobbits
8bb50189bc Merge remote branch 'remotes/ess/master' into essrelease 2011-09-29 00:43:42 +01:00
KHobbits
eb665a059a Merge branch 'essmaster' into essrelease 2011-09-29 00:40:16 +01:00
KHobbits
3dc29be083 Merge branch 'essmaster' into essrelease 2011-09-27 02:01:52 +01:00
KHobbits
82e5447526 Merge branch 'essmaster' into essrelease 2011-09-26 23:06:02 +01:00
KHobbits
066f3fd726 Merge branch 'essmaster' into essrelease 2011-09-22 15:29:47 +01:00
snowleo
f0acf733a5 Merge branch 'master' into release 2011-09-22 10:47:58 +02:00
snowleo
96c4dd2ab9 Merge branch 'master' into release 2011-09-05 14:15:07 +02:00
snowleo
df3b9a7ef9 Merge branch 'master' into release 2011-09-04 20:47:46 +02:00
snowleo
70a3a5919e Merge branch 'master' into release 2011-09-02 00:05:05 +02:00
snowleo
688d37ee60 Merge branch 'master' into release 2011-09-01 16:35:47 +02:00
snowleo
3dcf8bc8fc Merge branch 'master' into release 2011-08-30 09:46:49 +02:00
snowleo
7039d613ee Merge branch 'master' into release 2011-08-29 20:43:49 +02:00
snowleo
256c963370 Merge branch 'master' into release 2011-08-21 21:44:58 +02:00
snowleo
7b8c2a4575 Merge branch 'master' into release 2011-08-21 20:22:28 +02:00
snowleo
7f1ba0d6ae Merge branch 'master' into release 2011-08-19 02:32:56 +02:00
snowleo
7e5b79aa14 Merge branch 'master' into release 2011-08-19 02:10:36 +02:00
snowleo
086343ee48 Merge branch 'master' into release 2011-08-19 01:06:52 +02:00
snowleo
a1ad512a80 Merge branch 'master' into release 2011-08-19 00:42:26 +02:00
snowleo
9bb2ef9cbe Merge branch 'master' into release 2011-07-27 01:04:37 +02:00
snowleo
832910d480 Merge branch 'master' into release 2011-07-23 22:34:43 +02:00
snowleo
13da2b2924 Merge branch 'master' into release 2011-07-23 20:06:00 +02:00
snowleo
84ac520353 Master and Release branch are now identical again.
Removed warning for an older bukkit version.
2011-07-23 20:05:44 +02:00
snowleo
5613975314 Merge branch 'master' into release 2011-07-23 03:11:14 +02:00
snowleo
662d30ae45 Merge branch 'master' into release 2011-07-23 03:07:38 +02:00
snowleo
57bee443b1 Merge branch 'master' into release 2011-07-23 02:39:37 +02:00
snowleo
621618e41f Merge branch 'master' into release 2011-07-21 02:58:39 +02:00
snowleo
6ccb60813a Merge branch 'master' into release 2011-07-21 02:52:25 +02:00
snowleo
b34119901e Merge branch 'master' into release 2011-07-21 02:29:45 +02:00
snowleo
b317aef8c9 Merge branch 'master' into release 2011-07-21 00:31:39 +02:00
snowleo
fdbc6fa94f Merge branch 'master' into release 2011-07-20 23:18:34 +02:00
snowleo
0ffe24903a Merge branch 'master' into release 2011-07-20 23:09:40 +02:00
snowleo
e550a7cc44 Merge branch 'master' into release 2011-07-20 22:37:43 +02:00
snowleo
82165a2af6 Merge branch 'master' into release 2011-07-20 22:22:02 +02:00
snowleo
63a4fe32c1 Merge branch 'master' into release 2011-07-20 18:40:04 +02:00
snowleo
1c44a25a4a Merge branch 'master' into release 2011-07-20 12:13:24 +02:00
snowleo
cf21ecee2e Merge branch 'master' into release 2011-07-19 12:09:48 +02:00
snowleo
5467e502a5 Merge branch 'master' into release 2011-07-19 11:42:18 +02:00
snowleo
6af9ec266b Merge branch 'master' into release 2011-07-19 01:52:44 +02:00
snowleo
faa7e0e7a9 Merge branch 'master' into release 2011-07-19 00:47:14 +02:00
snowleo
aa3606007a Merge branch 'master' into release 2011-07-19 00:42:10 +02:00
snowleo
db5974970d Merge branch 'master' into release 2011-07-18 20:55:31 +02:00
snowleo
ba2539db67 Merge branch 'master' into release 2011-07-18 02:30:16 +02:00
snowleo
21d0661d79 Merge branch 'master' into release 2011-07-18 01:49:45 +02:00
snowleo
9f3eb461a9 Merge branch 'master' into release 2011-07-16 17:04:46 +02:00
snowleo
34b0deba29 Merge branch 'master' into release 2011-07-16 16:53:13 +02:00
snowleo
d9a93d8dff Merge branch 'master' into release 2011-07-16 14:04:49 +02:00
snowleo
747776344b Fixing merge error 2011-07-16 13:32:10 +02:00
snowleo
f979a79081 Merge branch 'master' into release
Conflicts:
	Essentials/src/com/earth2me/essentials/Essentials.java
	Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java
	Essentials/src/com/earth2me/essentials/commands/Commandspawner.java
	Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java
	Essentials/src/com/earth2me/essentials/register/payment/Methods.java
	Essentials/src/items.csv
	EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java
	lib/bukkit-0.0.1-SNAPSHOT.jar
	lib/craftbukkit-0.0.1-SNAPSHOT.jar
2011-07-16 13:25:12 +02:00
snowleo
367e9840cc Fix save inventory after logout for new players. 2011-07-08 02:19:59 +02:00
snowleo
ea590c2ed1 NPE fix for offline users in UserData
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1583 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-07-08 02:16:23 +02:00
snowleo
d93120257b Update of bukkit version number in essentials class 2011-07-02 01:10:48 +02:00
snowleo
e763b362d9 CB# 953
B# 754
2011-07-02 01:09:19 +02:00
snowleo
e5eb1ca0cb More names for pistons (items.csv)
Fix for /unlimited and pistons
2011-07-01 10:52:59 +02:00
snowleo
ea2649db5e Updated items.csv 2011-06-30 19:16:50 +02:00
snowleo
b53fc9cadc Renamed functions 2011-06-30 18:54:05 +02:00
snowleo
4b35e1b729 CB #946
B #750
2011-06-30 18:43:23 +02:00
snowleo
40e106db13 Fix /spawner command
The name had to be first letter uppercase, the rest lowercase
2011-06-27 11:57:03 +02:00
snowleo
3dc0659f66 Another fix to /spawnmob
Merged for release
2011-06-27 11:53:57 +02:00
snowleo
e652ed2981 Copy&Paste is bad. 2011-06-26 02:00:57 +02:00
snowleo
28db891aa5 Fix for Register inside Essentials 2011-06-26 01:43:59 +02:00
snowleo
b63ae9b771 SEVERE error messages for other plugins, that try to manually enable Essentials, FakePermissions or GroupManager 2011-06-26 01:43:19 +02:00
snowleo
27c84ceaac Remove the restriction of EssEcoApi to not use iConomy or BOSE 2011-06-25 15:35:47 +02:00
snowleo
d67ccd03ca Merge branch 'bukkitupdate' into release 2011-06-25 14:27:30 +02:00
snowleo
96b0f27c51 Fix for Craftbukkit Bug 912 2011-06-12 02:59:34 +02:00
652 changed files with 57135 additions and 58647 deletions

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="lib/bukkit-0.0.1-SNAPSHOT.jar"/>
<classpathentry kind="lib" path="lib/craftbukkit-0.0.1-SNAPSHOT.jar"/>
<classpathentry kind="lib" path="lib/Permissions3.jar"/>
</classpath>

93
.gitignore vendored
View File

@@ -1,40 +1,53 @@
.DS_Store
/BuildAll/nbproject/private/
/EssentialsProtect/nbproject/private/
/EssentialsChat/nbproject/private/
/EssentialsGroupBridge/nbproject/private/
/EssentialsGeoIP/nbproject/private/
/EssentialsSpawn/nbproject/private/
/EssentialsXMPP/nbproject/private/
/EssentialsGroupManager/nbproject/private/
/BuildAll/build/
/EssentialsGroupBridge/dist/
/EssentialsGroupBridge/build/
/EssentialsGeoIP/dist/
/EssentialsGeoIP/build/
/EssentialsGroupManager/build/
/EssentialsGroupManager/dist/
/BuildAll/dist/
/EssentialsChat/build/
/EssentialsChat/dist/
/EssentialsSpawn/build/
/EssentialsSpawn/dist/
/EssentialsXMPP/dist/
/EssentialsXMPP/build/
/EssentialsProtect/dist/
/EssentialsProtect/build/
/EssentialsPermissionsCommands/nbproject/private/
/EssentialsPermissionsCommands/build/
/EssentialsPermissionsCommands/dist/
/Essentials/nbproject/private/
/Essentials/dist/
/Essentials/build/
/YamlAnnotations/
/EssentialsUpdate/nbproject/private/
/EssentialsRelease/
/EssentialsUpdate/dist/
/EssentialsUpdate/build/
/WebPush/apikey.php
/WebPush/apikey.php
/WebPush/apikey.php
.DS_Store
/BuildAll/nbproject/private/
/EssentialsProtect/nbproject/private/
/EssentialsChat/nbproject/private/
/EssentialsGroupBridge/nbproject/private/
/EssentialsGeoIP/nbproject/private/
/EssentialsSpawn/nbproject/private/
/EssentialsXMPP/nbproject/private/
/EssentialsGroupManager/nbproject/private/
/BuildAll/build/
/EssentialsGroupBridge/dist/
/EssentialsGroupBridge/build/
/EssentialsGeoIP/dist/
/EssentialsGeoIP/build/
/EssentialsGroupManager/build/
/EssentialsGroupManager/dist/
/BuildAll/dist/
/EssentialsChat/build/
/EssentialsChat/dist/
/EssentialsSpawn/build/
/EssentialsSpawn/dist/
/EssentialsXMPP/dist/
/EssentialsXMPP/build/
/EssentialsProtect/dist/
/EssentialsProtect/build/
/EssentialsPermissionsCommands/nbproject/private/
/EssentialsPermissionsCommands/build/
/EssentialsPermissionsCommands/dist/
/Essentials/nbproject/private/
/Essentials/dist/
/Essentials/build/
/YamlAnnotations/
/EssentialsUpdate/nbproject/private/
/EssentialsRelease/
/EssentialsUpdate/dist/
/EssentialsUpdate/build/
/WebPush/apikey.php
/WebPush/nbproject/private
/EssentialsGroupManager/bin
/EssentialsGroupManager/.externalToolBuilders
/EssentialsAntiBuild/nbproject/private/
/EssentialsAntiBuild/dist/
/EssentialsAntiBuild/build/
/jars
/out
.idea/
*.iml
target/
dependency-reduced-pom.xml
/Essentials/config.yml
/Essentials/userdata/testplayer1.yml
/Essentials/usermap.csv
/Essentials/userdata

View File

@@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Essentials</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

18
.travis.yml Normal file
View File

@@ -0,0 +1,18 @@
language: java
jdk:
- oraclejdk7
- openjdk7
- openjdk6
script: mvn compile test
install: true
notifications:
irc:
channels:
- "irc.esper.net#lain"
on_success: change
on_failure: always
email:
recipients:
- "khobbits@ess3.net"
on_success: change
on_failure: always

View File

@@ -1,74 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<!-- By default, only the Clean and Build commands use this build script. -->
<!-- Commands such as Run, Debug, and Test only use this build script if -->
<!-- the Compile on Save feature is turned off for the project. -->
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
<!-- in the project's Project Properties dialog box.-->
<project name="BuildAll" default="default" basedir=".">
<description>Builds, tests, and runs the project BuildAll.</description>
<import file="nbproject/build-impl.xml"/>
<!--
There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. They are:
-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-single: called before javac compilation of single file
-post-compile-single: called after javac compilation of single file
-pre-compile-test: called before javac compilation of JUnit tests
-post-compile-test: called after javac compilation of JUnit tests
-pre-compile-test-single: called before javac compilation of single JUnit test
-post-compile-test-single: called after javac compilation of single JUunit test
-pre-jar: called before JAR building
-post-jar: called after JAR building
-post-clean: called after cleaning build products
(Targets beginning with '-' are not intended to be called on their own.)
Example of inserting an obfuscator after compilation could look like this:
<target name="-post-compile">
<obfuscate>
<fileset dir="${build.classes.dir}"/>
</obfuscate>
</target>
For list of available properties check the imported
nbproject/build-impl.xml file.
Another way to customize the build is by overriding existing main targets.
The targets of interest are:
-init-macrodef-javac: defines macro for javac compilation
-init-macrodef-junit: defines macro for junit execution
-init-macrodef-debug: defines macro for class debugging
-init-macrodef-java: defines macro for class execution
-do-jar-with-manifest: JAR building (if you are using a manifest)
-do-jar-without-manifest: JAR building (if you are not using a manifest)
run: execution of project
-javadoc-build: Javadoc generation
test-report: JUnit report generation
An example of overriding the target for project execution could look like this:
<target name="run" depends="BuildAll-impl.jar">
<exec dir="bin" executable="launcher.exe">
<arg file="${dist.jar}"/>
</exec>
</target>
Notice that the overridden target depends on the jar target and not only on
the compile target as the regular run target does. Again, for a list of available
properties which you can use, check the target you are overriding in the
nbproject/build-impl.xml file.
-->
</project>

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +0,0 @@
build.xml.data.CRC32=51b33957
build.xml.script.CRC32=7a797370
build.xml.stylesheet.CRC32=28e38971@1.44.1.45
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=51b33957
nbproject/build-impl.xml.script.CRC32=66b89647
nbproject/build-impl.xml.stylesheet.CRC32=0ae3a408@1.44.1.45

View File

@@ -1,131 +0,0 @@
annotation.processing.enabled=true
annotation.processing.enabled.in.editor=false
annotation.processing.run.all.processors=true
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
application.title=BuildAll
application.vendor=
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.expand-tabs=true
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.indent-shift-width=2
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.spaces-per-tab=2
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.tab-size=2
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width=120
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.text-line-wrap=none
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.usedProfile=project
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineAnnotationArgs=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineArrayInit=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineAssignment=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineBinaryOp=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineCallArgs=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineDisjunctiveCatchTypes=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineFor=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineImplements=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineMethodParams=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineParenthesized=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineTernaryOp=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineThrows=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineTryResources=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLinesAfterClassHeader=0
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLinesBeforeClass=2
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement=NEW_LINE
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.expand-tabs=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indent-shift-width=4
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indentCasesFromSwitch=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement=NEW_LINE
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.otherBracePlacement=NEW_LINE
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeCatchOnNewLine=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeElseOnNewLine=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeFinallyOnNewLine=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeWhileOnNewLine=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceAfterTypeCast=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaces-per-tab=4
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.tab-size=4
build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java,**/*.form
# This directory is removed when the project is cleaned:
build.dir=build
build.generated.dir=${build.dir}/generated
build.generated.sources.dir=${build.dir}/generated-sources
# Only compile against the classpath explicitly listed here:
build.sysclasspath=ignore
build.test.classes.dir=${build.dir}/test/classes
build.test.results.dir=${build.dir}/test/results
# Uncomment to specify the preferred debugger connection transport:
#debug.transport=dt_socket
debug.classpath=\
${run.classpath}
debug.test.classpath=\
${run.test.classpath}
# This directory is removed when the project is cleaned:
dist.dir=dist
dist.jar=${dist.dir}/BuildAll.jar
dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=
excludes=
includes=**
jar.compress=true
javac.classpath=\
${reference.Essentials.jar}:\
${reference.EssentialsChat.jar}:\
${reference.EssentialsProtect.jar}:\
${reference.EssentialsSpawn.jar}:\
${reference.EssentialsGeoIP.jar}:\
${reference.EssentialsGroupBridge.jar}:\
${reference.EssentialsXMPP.jar}:\
${reference.EssentialsGroupManager.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
javac.processorpath=\
${javac.classpath}
javac.source=1.6
javac.target=1.6
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}:\
${libs.junit.classpath}:\
${libs.junit_4.classpath}
javac.test.processorpath=\
${javac.test.classpath}
javadoc.additionalparam=
javadoc.author=false
javadoc.encoding=${source.encoding}
javadoc.noindex=false
javadoc.nonavbar=false
javadoc.notree=false
javadoc.private=false
javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=
meta.inf.dir=${src.dir}/META-INF
mkdist.disabled=false
platform.active=default_platform
project.Essentials=../Essentials
project.EssentialsChat=../EssentialsChat
project.EssentialsGeoIP=../EssentialsGeoIP
project.EssentialsGroupBridge=../EssentialsGroupBridge
project.EssentialsGroupManager=../EssentialsGroupManager
project.EssentialsProtect=../EssentialsProtect
project.EssentialsSpawn=../EssentialsSpawn
project.EssentialsXMPP=../EssentialsXMPP
reference.Essentials.jar=${project.Essentials}/dist/Essentials.jar
reference.EssentialsChat.jar=${project.EssentialsChat}/dist/EssentialsChat.jar
reference.EssentialsGeoIP.jar=${project.EssentialsGeoIP}/dist/EssentialsGeoIP.jar
reference.EssentialsGroupBridge.jar=${project.EssentialsGroupBridge}/dist/EssentialsGroupBridge.jar
reference.EssentialsGroupManager.jar=${project.EssentialsGroupManager}/dist/EssentialsGroupManager.jar
reference.EssentialsProtect.jar=${project.EssentialsProtect}/dist/EssentialsProtect.jar
reference.EssentialsSpawn.jar=${project.EssentialsSpawn}/dist/EssentialsSpawn.jar
reference.EssentialsXMPP.jar=${project.EssentialsXMPP}/dist/EssentialsXMPP.jar
run.classpath=\
${javac.classpath}:\
${build.classes.dir}
# Space-separated list of JVM arguments used when running the project
# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
# or test-sys-prop.name=value to set system properties for unit tests):
run.jvmargs=
run.test.classpath=\
${javac.test.classpath}:\
${build.test.classes.dir}
source.encoding=UTF-8
src.dir=src
test.src.dir=test

View File

@@ -1,84 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.java.j2seproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
<name>BuildAll</name>
<source-roots>
<root id="src.dir"/>
</source-roots>
<test-roots>
<root id="test.src.dir"/>
</test-roots>
</data>
<libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1">
<definitions>..\lib\nblibraries.properties</definitions>
</libraries>
<references xmlns="http://www.netbeans.org/ns/ant-project-references/1">
<reference>
<foreign-project>Essentials</foreign-project>
<artifact-type>jar</artifact-type>
<script>build.xml</script>
<target>jar</target>
<clean-target>clean</clean-target>
<id>jar</id>
</reference>
<reference>
<foreign-project>EssentialsChat</foreign-project>
<artifact-type>jar</artifact-type>
<script>build.xml</script>
<target>jar</target>
<clean-target>clean</clean-target>
<id>jar</id>
</reference>
<reference>
<foreign-project>EssentialsGeoIP</foreign-project>
<artifact-type>jar</artifact-type>
<script>build.xml</script>
<target>jar</target>
<clean-target>clean</clean-target>
<id>jar</id>
</reference>
<reference>
<foreign-project>EssentialsGroupBridge</foreign-project>
<artifact-type>jar</artifact-type>
<script>build.xml</script>
<target>jar</target>
<clean-target>clean</clean-target>
<id>jar</id>
</reference>
<reference>
<foreign-project>EssentialsGroupManager</foreign-project>
<artifact-type>jar</artifact-type>
<script>build.xml</script>
<target>jar</target>
<clean-target>clean</clean-target>
<id>jar</id>
</reference>
<reference>
<foreign-project>EssentialsProtect</foreign-project>
<artifact-type>jar</artifact-type>
<script>build.xml</script>
<target>jar</target>
<clean-target>clean</clean-target>
<id>jar</id>
</reference>
<reference>
<foreign-project>EssentialsSpawn</foreign-project>
<artifact-type>jar</artifact-type>
<script>build.xml</script>
<target>jar</target>
<clean-target>clean</clean-target>
<id>jar</id>
</reference>
<reference>
<foreign-project>EssentialsXMPP</foreign-project>
<artifact-type>jar</artifact-type>
<script>build.xml</script>
<target>jar</target>
<clean-target>clean</clean-target>
<id>jar</id>
</reference>
</references>
</configuration>
</project>

View File

@@ -1,84 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<!-- By default, only the Clean and Build commands use this build script. -->
<!-- Commands such as Run, Debug, and Test only use this build script if -->
<!-- the Compile on Save feature is turned off for the project. -->
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
<!-- in the project's Project Properties dialog box.-->
<project name="Essentials" default="default" basedir=".">
<description>Builds, tests, and runs the project Essentials.</description>
<import file="nbproject/build-impl.xml"/>
<!--
There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. They are:
-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-single: called before javac compilation of single file
-post-compile-single: called after javac compilation of single file
-pre-compile-test: called before javac compilation of JUnit tests
-post-compile-test: called after javac compilation of JUnit tests
-pre-compile-test-single: called before javac compilation of single JUnit test
-post-compile-test-single: called after javac compilation of single JUunit test
-pre-jar: called before JAR building
-post-jar: called after JAR building
-post-clean: called after cleaning build products
(Targets beginning with '-' are not intended to be called on their own.)
Example of inserting an obfuscator after compilation could look like this:
<target name="-post-compile">
<obfuscate>
<fileset dir="${build.classes.dir}"/>
</obfuscate>
</target>
For list of available properties check the imported
nbproject/build-impl.xml file.
Another way to customize the build is by overriding existing main targets.
The targets of interest are:
-init-macrodef-javac: defines macro for javac compilation
-init-macrodef-junit: defines macro for junit execution
-init-macrodef-debug: defines macro for class debugging
-init-macrodef-java: defines macro for class execution
-do-jar-with-manifest: JAR building (if you are using a manifest)
-do-jar-without-manifest: JAR building (if you are not using a manifest)
run: execution of project
-javadoc-build: Javadoc generation
test-report: JUnit report generation
An example of overriding the target for project execution could look like this:
<target name="run" depends="Essentials-impl.jar">
<exec dir="bin" executable="launcher.exe">
<arg file="${dist.jar}"/>
</exec>
</target>
Notice that the overridden target depends on the jar target and not only on
the compile target as the regular run target does. Again, for a list of available
properties which you can use, check the target you are overriding in the
nbproject/build-impl.xml file.
-->
<!--target name="-post-jar">
<jar jarfile="${dist.dir}/Essentials.jar">
<zipfileset src="${dist.jar}" excludes="META-INF/*" />
<zipfileset src="${dist.dir}/lib/Register.jar" excludes="META-INF/*" />
<manifest>
<attribute name="Classpath" value="Essentials.jar"/>
</manifest>
</jar>
</target-->
</project>

File diff suppressed because it is too large Load Diff

View File

@@ -1,11 +0,0 @@
build.xml.data.CRC32=7d758acf
build.xml.script.CRC32=3233ee78
build.xml.stylesheet.CRC32=28e38971@1.38.2.45
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=a830bc14
nbproject/build-impl.xml.script.CRC32=64a00ba6
nbproject/build-impl.xml.stylesheet.CRC32=0ae3a408@1.44.1.45
nbproject/profiler-build-impl.xml.data.CRC32=ab78ce15
nbproject/profiler-build-impl.xml.script.CRC32=abda56ed
nbproject/profiler-build-impl.xml.stylesheet.CRC32=f10cf54c@1.11.1

View File

@@ -1,2 +0,0 @@
DoNotUseThreads
SignatureDeclareThrowsException

View File

@@ -1,145 +0,0 @@
annotation.processing.enabled=true
annotation.processing.enabled.in.editor=false
annotation.processing.processors.list=lombok.core.AnnotationProcessor
annotation.processing.run.all.processors=false
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
application.title=Essentials
application.vendor=
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.expand-tabs=true
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.indent-shift-width=2
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.spaces-per-tab=2
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.tab-size=2
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width=120
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.text-line-wrap=none
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.usedProfile=project
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineAnnotationArgs=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineArrayInit=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineAssignment=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineBinaryOp=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineCallArgs=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineDisjunctiveCatchTypes=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineFor=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineImplements=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineMethodParams=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineParenthesized=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineTernaryOp=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineThrows=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineTryResources=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLinesAfterClassHeader=0
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLinesBeforeClass=2
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement=NEW_LINE
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.expand-tabs=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indent-shift-width=4
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indentCasesFromSwitch=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement=NEW_LINE
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.otherBracePlacement=NEW_LINE
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeCatchOnNewLine=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeElseOnNewLine=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeFinallyOnNewLine=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeWhileOnNewLine=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceAfterTypeCast=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaces-per-tab=4
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.tab-size=4
build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java,**/*.form
# This directory is removed when the project is cleaned:
build.dir=build
build.generated.dir=${build.dir}/generated
build.generated.sources.dir=${build.dir}/generated-sources
# Only compile against the classpath explicitly listed here:
build.sysclasspath=ignore
build.test.classes.dir=${build.dir}/test/classes
build.test.results.dir=${build.dir}/test/results
# Uncomment to specify the preferred debugger connection transport:
#debug.transport=dt_socket
debug.classpath=\
${run.classpath}
debug.test.classpath=\
${run.test.classpath}
# This directory is removed when the project is cleaned:
dist.dir=dist
dist.jar=${dist.dir}/Essentials.jar
dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=
excludes=
file.reference.BOSEconomy7.jar=../lib/BOSEconomy7.jar
file.reference.bPermissions.jar=../lib/bPermissions.jar
file.reference.craftbukkit-0.0.1-SNAPSHOT.jar=..\\lib\\craftbukkit-0.0.1-SNAPSHOT.jar
file.reference.iCo4.jar=../lib/iCo4.jar
file.reference.iCo5.jar=../lib/iCo5.jar
file.reference.iCo6.jar=../lib/iCo6.jar
file.reference.junit-4.5.jar=../lib/junit_4/junit-4.5.jar
file.reference.lombok-0.10.1.jar=../lib/lombok-0.10.1.jar
file.reference.MultiCurrency.jar=../lib/MultiCurrency.jar
file.reference.Permissions3.jar=../lib/Permissions3.jar
file.reference.PermissionsBukkit-1.2.jar=../lib/PermissionsBukkit-1.2.jar
file.reference.PermissionsEx.jar=../lib/PermissionsEx.jar
includes=**
jar.archive.disabled=${jnlp.enabled}
jar.compress=true
jar.index=${jnlp.enabled}
javac.classpath=\
${file.reference.Permissions3.jar}:\
${file.reference.iCo4.jar}:\
${file.reference.iCo5.jar}:\
${file.reference.iCo6.jar}:\
${file.reference.MultiCurrency.jar}:\
${file.reference.BOSEconomy7.jar}:\
${file.reference.PermissionsEx.jar}:\
${file.reference.bPermissions.jar}:\
${file.reference.PermissionsBukkit-1.2.jar}:\
${file.reference.lombok-0.10.1.jar}:\
${reference.EssentialsGroupManager.jar}:\
${file.reference.craftbukkit-0.0.1-SNAPSHOT.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
javac.processorpath=\
${javac.classpath}
javac.source=1.6
javac.target=1.6
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}:\
${file.reference.junit-4.5.jar}
javac.test.processorpath=\
${javac.test.classpath}
javadoc.additionalparam=
javadoc.author=false
javadoc.encoding=${source.encoding}
javadoc.noindex=false
javadoc.nonavbar=false
javadoc.notree=false
javadoc.private=false
javadoc.reference.PermissionsEx.jar=../lib/PermissionsEx-javadoc.jar
javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=
jnlp.codebase.type=no.codebase
jnlp.descriptor=application
jnlp.enabled=false
jnlp.mixed.code=default
jnlp.offline-allowed=false
jnlp.signed=false
jnlp.signing=
jnlp.signing.alias=
jnlp.signing.keystore=
meta.inf.dir=${src.dir}/META-INF
mkdist.disabled=true
platform.active=default_platform
project.EssentialsGroupManager=../EssentialsGroupManager
reference.EssentialsGroupManager.jar=../EssentialsGroupManager/dist/EssentialsGroupManager.jar
run.classpath=\
${javac.classpath}:\
${build.classes.dir}
# Space-separated list of JVM arguments used when running the project
# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
# or test-sys-prop.name=value to set system properties for unit tests):
run.jvmargs=-Djline.terminal=jline.UnsupportedTerminal
run.test.classpath=\
${javac.test.classpath}:\
${build.test.classes.dir}
source.encoding=UTF-8
src.dir=src
test.src.dir=test

View File

@@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.java.j2seproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
<name>Essentials</name>
<source-roots>
<root id="src.dir"/>
</source-roots>
<test-roots>
<root id="test.src.dir"/>
</test-roots>
</data>
<libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1">
<definitions>../lib/nblibraries.properties</definitions>
</libraries>
<references xmlns="http://www.netbeans.org/ns/ant-project-references/1">
<reference>
<foreign-project>EssentialsGroupManager</foreign-project>
<artifact-type>jar</artifact-type>
<script>build.xml</script>
<target>jar</target>
<clean-target>clean</clean-target>
<id>jar</id>
</reference>
</references>
</configuration>
</project>

144
Essentials/pom.xml Normal file
View File

@@ -0,0 +1,144 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.ess3</groupId>
<artifactId>EssentialsParent</artifactId>
<version>2.x-SNAPSHOT</version>
</parent>
<artifactId>Essentials</artifactId>
<url>http://ess3.net/</url>
<organization>
<name>Essentials Team</name>
<url>http://ess3.net/</url>
</organization>
<licenses>
<license>
<name>GPLv3</name>
<url>http://www.gnu.org/copyleft/gpl.html</url>
</license>
</licenses>
<scm>
<connection>scm:git:https://github.com/essentials/Essentials.git</connection>
<developerConnection>scm:git:https://github.com/essentials/Essentials.git</developerConnection>
<url>https://github.com/essentials/Essentials</url>
</scm>
<issueManagement>
<system>JIRA</system>
<url>http://essentials3.atlassian.net</url>
</issueManagement>
<ciManagement>
<system>TeamCity</system>
<url>http://ci.ess3.net/</url>
</ciManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.7.2-R0.3-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${project.basedir}/../lib/bukkit.jar</systemPath>
</dependency>
<dependency>
<groupId>BOSEconomy</groupId>
<artifactId>BOSEconomy</artifactId>
<version>v0.7.8.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/../lib/BOSEconomy.jar</systemPath>
</dependency>
<dependency>
<groupId>de.bananaco</groupId>
<artifactId>bPermissions</artifactId>
<version>v2.12-DEV</version>
</dependency>
<dependency>
<groupId>iConomy</groupId>
<artifactId>iConomy5</artifactId>
<version>5</version>
<scope>system</scope>
<systemPath>${project.basedir}/../lib/iCo5.jar</systemPath>
</dependency>
<dependency>
<groupId>iConomy</groupId>
<artifactId>iConomy6</artifactId>
<version>6</version>
<scope>system</scope>
<systemPath>${project.basedir}/../lib/iCo6.jar</systemPath>
</dependency>
<dependency>
<groupId>net.ess3</groupId>
<artifactId>GroupManager</artifactId>
<version>${project.version}</version>
<scope>system</scope>
<systemPath>${project.basedir}/../EssentialsGroupManager/dist/EssentialsGroupManager.jar</systemPath>
</dependency>
<dependency>
<groupId>MultiCurrency</groupId>
<artifactId>MultiCurrency</artifactId>
<version>2.2</version>
<scope>system</scope>
<systemPath>${project.basedir}/../lib/MultiCurrency.jar</systemPath>
</dependency>
<dependency>
<groupId>com.platymuus</groupId>
<artifactId>bukkit-permissions</artifactId>
<version>2.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/../lib/PermissionsBukkit.jar</systemPath>
</dependency>
<dependency>
<groupId>ru.tehkode</groupId>
<artifactId>PermissionsEx</artifactId>
<version>1.20.4</version>
<scope>system</scope>
<systemPath>${project.basedir}/../lib/PermissionsEx.jar</systemPath>
</dependency>
<dependency>
<groupId>Privileges</groupId>
<artifactId>Privileges</artifactId>
<version>1.8.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/../lib/Privileges.jar</systemPath>
</dependency>
<dependency>
<groupId>SimplyPerms</groupId>
<artifactId>SimplyPerms</artifactId>
<version>1.7.6</version>
<scope>system</scope>
<systemPath>${project.basedir}/../lib/SimplyPerms.jar</systemPath>
</dependency>
<dependency>
<groupId>net.milkbowl.vault</groupId>
<artifactId>Vault</artifactId>
<version>1.2.32</version>
</dependency>
<dependency>
<groupId>zPermissions</groupId>
<artifactId>zPermissions</artifactId>
<version>1.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/../lib/zPermissions.jar</systemPath>
</dependency>
</dependencies>
</project>

18
Essentials/src/book.txt Normal file
View File

@@ -0,0 +1,18 @@
This is the book file.
This file format works similar to the info.txt, motd.txt and rules.txt
Place content in here that you would like to be used by books ingame.
You can use this content by using the book:<section> meta option in kits or item spawning.
#Colors
Minecraft colors:
&0 &&0 &1 &&1 &2 &&2 &3 &&3
&4 &&4 &5 &&5 &6 &&6 &7 &&7
&8 &&8 &9 &&9 &a &&a &b &&b
&c &&c &d &&d &e &&e &f &&f
&0
&&k &kMagic&r &&l &lBold
&&m &mStrike&r &&n &nUline
&&o &oItalic&r &&r &rReset

View File

@@ -0,0 +1,139 @@
package com.earth2me.essentials;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.ess3.api.IEssentials;
import org.bukkit.command.Command;
import org.bukkit.command.PluginCommand;
import org.bukkit.command.PluginCommandYamlParser;
import org.bukkit.plugin.Plugin;
public class AlternativeCommandsHandler
{
private static final Logger LOGGER = Logger.getLogger("Essentials");
private final transient Map<String, List<PluginCommand>> altcommands = new HashMap<String, List<PluginCommand>>();
private final transient Map<String, String> disabledList = new HashMap<String, String>();
private final transient IEssentials ess;
public AlternativeCommandsHandler(final IEssentials ess)
{
this.ess = ess;
for (Plugin plugin : ess.getServer().getPluginManager().getPlugins())
{
if (plugin.isEnabled())
{
addPlugin(plugin);
}
}
}
public final void addPlugin(final Plugin plugin)
{
if (plugin.getDescription().getMain().contains("com.earth2me.essentials"))
{
return;
}
final List<Command> commands = PluginCommandYamlParser.parse(plugin);
final String pluginName = plugin.getDescription().getName().toLowerCase(Locale.ENGLISH);
for (Command command : commands)
{
final PluginCommand pc = (PluginCommand)command;
final List<String> labels = new ArrayList<String>(pc.getAliases());
labels.add(pc.getName());
PluginCommand reg = ess.getServer().getPluginCommand(pluginName + ":" + pc.getName().toLowerCase(Locale.ENGLISH));
if (reg == null)
{
reg = ess.getServer().getPluginCommand(pc.getName().toLowerCase(Locale.ENGLISH));
}
if (reg == null || !reg.getPlugin().equals(plugin))
{
continue;
}
for (String label : labels)
{
List<PluginCommand> plugincommands = altcommands.get(label.toLowerCase(Locale.ENGLISH));
if (plugincommands == null)
{
plugincommands = new ArrayList<PluginCommand>();
altcommands.put(label.toLowerCase(Locale.ENGLISH), plugincommands);
}
boolean found = false;
for (PluginCommand pc2 : plugincommands)
{
if (pc2.getPlugin().equals(plugin))
{
found = true;
}
}
if (!found)
{
plugincommands.add(reg);
}
}
}
}
public void removePlugin(final Plugin plugin)
{
final Iterator<Map.Entry<String, List<PluginCommand>>> iterator = altcommands.entrySet().iterator();
while (iterator.hasNext())
{
final Map.Entry<String, List<PluginCommand>> entry = iterator.next();
final Iterator<PluginCommand> pcIterator = entry.getValue().iterator();
while (pcIterator.hasNext())
{
final PluginCommand pc = pcIterator.next();
if (pc.getPlugin() == null || pc.getPlugin().equals(plugin))
{
pcIterator.remove();
}
}
if (entry.getValue().isEmpty())
{
iterator.remove();
}
}
}
public PluginCommand getAlternative(final String label)
{
final List<PluginCommand> commands = altcommands.get(label);
if (commands == null || commands.isEmpty())
{
return null;
}
if (commands.size() == 1)
{
return commands.get(0);
}
// return the first command that is not an alias
for (PluginCommand command : commands)
{
if (command.getName().equalsIgnoreCase(label))
{
return command;
}
}
// return the first alias
return commands.get(0);
}
public void executed(final String label, final PluginCommand pc)
{
final String altString = pc.getPlugin().getName() + ":" + pc.getLabel();
if (ess.getSettings().isDebug())
{
LOGGER.log(Level.INFO, "Essentials: Alternative command " + label + " found, using " + altString);
}
disabledList.put(label, altString);
}
public Map<String, String> disabledCommands()
{
return disabledList;
}
}

View File

@@ -1,18 +1,19 @@
package com.earth2me.essentials;
import static com.earth2me.essentials.I18n.tl;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.ess3.api.IEssentials;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.craftbukkit.CraftServer;
public class Backup implements Runnable
{
private static final Logger LOGGER = Logger.getLogger("Minecraft");
private static final Logger LOGGER = Logger.getLogger("Essentials");
private transient final Server server;
private transient final IEssentials ess;
private transient boolean running = false;
@@ -25,16 +26,33 @@ public class Backup implements Runnable
server = ess.getServer();
if (server.getOnlinePlayers().length > 0)
{
startTask();
ess.runTaskAsynchronously(new Runnable()
{
@Override
public void run()
{
startTask();
}
});
}
}
void onPlayerJoin()
public void onPlayerJoin()
{
startTask();
}
private void startTask()
public synchronized void stopTask()
{
running = false;
if (taskId != -1)
{
server.getScheduler().cancelTask(taskId);
}
taskId = -1;
}
private synchronized void startTask()
{
if (!running)
{
@@ -48,6 +66,7 @@ public class Backup implements Runnable
}
}
@Override
public void run()
{
if (active)
@@ -60,72 +79,89 @@ public class Backup implements Runnable
{
return;
}
LOGGER.log(Level.INFO, Util.i18n("backupStarted"));
if ("save-all".equalsIgnoreCase(command))
{
final CommandSender cs = server.getConsoleSender();
server.dispatchCommand(cs, "save-all");
active = false;
return;
}
LOGGER.log(Level.INFO, tl("backupStarted"));
final CommandSender cs = server.getConsoleSender();
server.dispatchCommand(cs, "save-all");
server.dispatchCommand(cs, "save-off");
ess.scheduleAsyncDelayedTask(
new Runnable()
ess.runTaskAsynchronously(new Runnable()
{
@Override
public void run()
{
try
{
public void run()
final ProcessBuilder childBuilder = new ProcessBuilder(command);
childBuilder.redirectErrorStream(true);
childBuilder.directory(ess.getDataFolder().getParentFile().getParentFile());
final Process child = childBuilder.start();
ess.runTaskAsynchronously(new Runnable()
{
try
@Override
public void run()
{
final ProcessBuilder childBuilder = new ProcessBuilder(command);
childBuilder.redirectErrorStream(true);
childBuilder.directory(ess.getDataFolder().getParentFile().getParentFile());
final Process child = childBuilder.start();
final BufferedReader reader = new BufferedReader(new InputStreamReader(child.getInputStream()));
try
{
child.waitFor();
String line;
do
final BufferedReader reader = new BufferedReader(new InputStreamReader(child.getInputStream()));
try
{
line = reader.readLine();
if (line != null)
String line;
do
{
LOGGER.log(Level.INFO, line);
}
}
while (line != null);
}
finally
{
reader.close();
}
}
catch (InterruptedException ex)
{
LOGGER.log(Level.SEVERE, null, ex);
}
catch (IOException ex)
{
LOGGER.log(Level.SEVERE, null, ex);
}
finally
{
ess.scheduleSyncDelayedTask(
new Runnable()
{
public void run()
line = reader.readLine();
if (line != null)
{
server.dispatchCommand(cs, "save-on");
if (server.getOnlinePlayers().length == 0)
{
running = false;
if (taskId != -1)
{
server.getScheduler().cancelTask(taskId);
}
}
active = false;
LOGGER.log(Level.INFO, Util.i18n("backupFinished"));
LOGGER.log(Level.INFO, line);
}
});
}
while (line != null);
}
finally
{
reader.close();
}
}
catch (IOException ex)
{
LOGGER.log(Level.SEVERE, null, ex);
}
}
}
});
});
child.waitFor();
}
catch (InterruptedException ex)
{
LOGGER.log(Level.SEVERE, null, ex);
}
catch (IOException ex)
{
LOGGER.log(Level.SEVERE, null, ex);
}
finally
{
ess.scheduleSyncDelayedTask(new Runnable()
{
@Override
public void run()
{
server.dispatchCommand(cs, "save-on");
if (server.getOnlinePlayers().length == 0)
{
stopTask();
}
active = false;
LOGGER.log(Level.INFO, tl("backupFinished"));
}
});
}
}
});
}
}

View File

@@ -0,0 +1,61 @@
package com.earth2me.essentials;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class CommandSource implements IReplyTo
{
private CommandSource replyTo = null;
protected CommandSender sender;
public CommandSource(final CommandSender base)
{
this.sender = base;
}
public final CommandSender getSender()
{
return sender;
}
public final Player getPlayer()
{
if (sender instanceof Player)
{
return (Player)sender;
}
return null;
}
public final boolean isPlayer()
{
return (sender instanceof Player);
}
public final CommandSender setSender(final CommandSender base)
{
return this.sender = base;
}
public void sendMessage(String message)
{
if (!message.isEmpty())
{
sender.sendMessage(message);
}
}
@Override
public void setReplyTo(final CommandSource user)
{
replyTo = user;
}
@Override
public CommandSource getReplyTo()
{
return replyTo;
}
}

View File

@@ -6,8 +6,8 @@ import org.bukkit.command.CommandSender;
public final class Console implements IReplyTo
{
private static Console instance = new Console();
private CommandSender replyTo;
private static final Console instance = new Console();
private CommandSource replyTo;
public final static String NAME = "Console";
private Console()
@@ -19,12 +19,14 @@ public final class Console implements IReplyTo
return server.getConsoleSender();
}
public void setReplyTo(CommandSender user)
@Override
public void setReplyTo(CommandSource user)
{
replyTo = user;
}
public CommandSender getReplyTo()
@Override
public CommandSource getReplyTo()
{
return replyTo;
}

View File

@@ -0,0 +1,187 @@
package com.earth2me.essentials;
import com.earth2me.essentials.utils.NumberUtil;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.bukkit.enchantments.Enchantment;
public class Enchantments
{
private static final Map<String, Enchantment> ENCHANTMENTS = new HashMap<String, Enchantment>();
private static final Map<String, Enchantment> ALIASENCHANTMENTS = new HashMap<String, Enchantment>();
static
{
ENCHANTMENTS.put("alldamage", Enchantment.DAMAGE_ALL);
ALIASENCHANTMENTS.put("alldmg", Enchantment.DAMAGE_ALL);
ENCHANTMENTS.put("sharpness", Enchantment.DAMAGE_ALL);
ALIASENCHANTMENTS.put("sharp", Enchantment.DAMAGE_ALL);
ALIASENCHANTMENTS.put("dal", Enchantment.DAMAGE_ALL);
ENCHANTMENTS.put("ardmg", Enchantment.DAMAGE_ARTHROPODS);
ENCHANTMENTS.put("baneofarthropods", Enchantment.DAMAGE_ARTHROPODS);
ALIASENCHANTMENTS.put("baneofarthropod", Enchantment.DAMAGE_ARTHROPODS);
ALIASENCHANTMENTS.put("arthropod", Enchantment.DAMAGE_ARTHROPODS);
ALIASENCHANTMENTS.put("dar", Enchantment.DAMAGE_ARTHROPODS);
ENCHANTMENTS.put("undeaddamage", Enchantment.DAMAGE_UNDEAD);
ENCHANTMENTS.put("smite", Enchantment.DAMAGE_UNDEAD);
ALIASENCHANTMENTS.put("du", Enchantment.DAMAGE_UNDEAD);
ENCHANTMENTS.put("digspeed", Enchantment.DIG_SPEED);
ENCHANTMENTS.put("efficiency", Enchantment.DIG_SPEED);
ALIASENCHANTMENTS.put("minespeed", Enchantment.DIG_SPEED);
ALIASENCHANTMENTS.put("cutspeed", Enchantment.DIG_SPEED);
ALIASENCHANTMENTS.put("ds", Enchantment.DIG_SPEED);
ALIASENCHANTMENTS.put("eff", Enchantment.DIG_SPEED);
ENCHANTMENTS.put("durability", Enchantment.DURABILITY);
ALIASENCHANTMENTS.put("dura", Enchantment.DURABILITY);
ENCHANTMENTS.put("unbreaking", Enchantment.DURABILITY);
ALIASENCHANTMENTS.put("d", Enchantment.DURABILITY);
ENCHANTMENTS.put("thorns", Enchantment.THORNS);
ENCHANTMENTS.put("highcrit", Enchantment.THORNS);
ALIASENCHANTMENTS.put("thorn", Enchantment.THORNS);
ALIASENCHANTMENTS.put("highercrit", Enchantment.THORNS);
ALIASENCHANTMENTS.put("t", Enchantment.THORNS);
ENCHANTMENTS.put("fireaspect", Enchantment.FIRE_ASPECT);
ENCHANTMENTS.put("fire", Enchantment.FIRE_ASPECT);
ALIASENCHANTMENTS.put("meleefire", Enchantment.FIRE_ASPECT);
ALIASENCHANTMENTS.put("meleeflame", Enchantment.FIRE_ASPECT);
ALIASENCHANTMENTS.put("fa", Enchantment.FIRE_ASPECT);
ENCHANTMENTS.put("knockback", Enchantment.KNOCKBACK);
ALIASENCHANTMENTS.put("kback", Enchantment.KNOCKBACK);
ALIASENCHANTMENTS.put("kb", Enchantment.KNOCKBACK);
ALIASENCHANTMENTS.put("k", Enchantment.KNOCKBACK);
ALIASENCHANTMENTS.put("blockslootbonus", Enchantment.LOOT_BONUS_BLOCKS);
ENCHANTMENTS.put("fortune", Enchantment.LOOT_BONUS_BLOCKS);
ALIASENCHANTMENTS.put("fort", Enchantment.LOOT_BONUS_BLOCKS);
ALIASENCHANTMENTS.put("lbb", Enchantment.LOOT_BONUS_BLOCKS);
ALIASENCHANTMENTS.put("mobslootbonus", Enchantment.LOOT_BONUS_MOBS);
ENCHANTMENTS.put("mobloot", Enchantment.LOOT_BONUS_MOBS);
ENCHANTMENTS.put("looting", Enchantment.LOOT_BONUS_MOBS);
ALIASENCHANTMENTS.put("lbm", Enchantment.LOOT_BONUS_MOBS);
ALIASENCHANTMENTS.put("oxygen", Enchantment.OXYGEN);
ENCHANTMENTS.put("respiration", Enchantment.OXYGEN);
ALIASENCHANTMENTS.put("breathing", Enchantment.OXYGEN);
ENCHANTMENTS.put("breath", Enchantment.OXYGEN);
ALIASENCHANTMENTS.put("o", Enchantment.OXYGEN);
ENCHANTMENTS.put("protection", Enchantment.PROTECTION_ENVIRONMENTAL);
ALIASENCHANTMENTS.put("prot", Enchantment.PROTECTION_ENVIRONMENTAL);
ENCHANTMENTS.put("protect", Enchantment.PROTECTION_ENVIRONMENTAL);
ALIASENCHANTMENTS.put("p", Enchantment.PROTECTION_ENVIRONMENTAL);
ALIASENCHANTMENTS.put("explosionsprotection", Enchantment.PROTECTION_EXPLOSIONS);
ALIASENCHANTMENTS.put("explosionprotection", Enchantment.PROTECTION_EXPLOSIONS);
ALIASENCHANTMENTS.put("expprot", Enchantment.PROTECTION_EXPLOSIONS);
ALIASENCHANTMENTS.put("blastprotection", Enchantment.PROTECTION_EXPLOSIONS);
ALIASENCHANTMENTS.put("bprotection", Enchantment.PROTECTION_EXPLOSIONS);
ALIASENCHANTMENTS.put("bprotect", Enchantment.PROTECTION_EXPLOSIONS);
ENCHANTMENTS.put("blastprotect", Enchantment.PROTECTION_EXPLOSIONS);
ALIASENCHANTMENTS.put("pe", Enchantment.PROTECTION_EXPLOSIONS);
ALIASENCHANTMENTS.put("fallprotection", Enchantment.PROTECTION_FALL);
ENCHANTMENTS.put("fallprot", Enchantment.PROTECTION_FALL);
ENCHANTMENTS.put("featherfall", Enchantment.PROTECTION_FALL);
ALIASENCHANTMENTS.put("featherfalling", Enchantment.PROTECTION_FALL);
ALIASENCHANTMENTS.put("pfa", Enchantment.PROTECTION_FALL);
ALIASENCHANTMENTS.put("fireprotection", Enchantment.PROTECTION_FIRE);
ALIASENCHANTMENTS.put("flameprotection", Enchantment.PROTECTION_FIRE);
ENCHANTMENTS.put("fireprotect", Enchantment.PROTECTION_FIRE);
ALIASENCHANTMENTS.put("flameprotect", Enchantment.PROTECTION_FIRE);
ENCHANTMENTS.put("fireprot", Enchantment.PROTECTION_FIRE);
ALIASENCHANTMENTS.put("flameprot", Enchantment.PROTECTION_FIRE);
ALIASENCHANTMENTS.put("pf", Enchantment.PROTECTION_FIRE);
ENCHANTMENTS.put("projectileprotection", Enchantment.PROTECTION_PROJECTILE);
ENCHANTMENTS.put("projprot", Enchantment.PROTECTION_PROJECTILE);
ALIASENCHANTMENTS.put("pp", Enchantment.PROTECTION_PROJECTILE);
ENCHANTMENTS.put("silktouch", Enchantment.SILK_TOUCH);
ALIASENCHANTMENTS.put("softtouch", Enchantment.SILK_TOUCH);
ALIASENCHANTMENTS.put("st", Enchantment.SILK_TOUCH);
ENCHANTMENTS.put("waterworker", Enchantment.WATER_WORKER);
ENCHANTMENTS.put("aquaaffinity", Enchantment.WATER_WORKER);
ALIASENCHANTMENTS.put("watermine", Enchantment.WATER_WORKER);
ALIASENCHANTMENTS.put("ww", Enchantment.WATER_WORKER);
ALIASENCHANTMENTS.put("firearrow", Enchantment.ARROW_FIRE);
ENCHANTMENTS.put("flame", Enchantment.ARROW_FIRE);
ENCHANTMENTS.put("flamearrow", Enchantment.ARROW_FIRE);
ALIASENCHANTMENTS.put("af", Enchantment.ARROW_FIRE);
ENCHANTMENTS.put("arrowdamage", Enchantment.ARROW_DAMAGE);
ENCHANTMENTS.put("power", Enchantment.ARROW_DAMAGE);
ALIASENCHANTMENTS.put("arrowpower", Enchantment.ARROW_DAMAGE);
ALIASENCHANTMENTS.put("ad", Enchantment.ARROW_DAMAGE);
ENCHANTMENTS.put("arrowknockback", Enchantment.ARROW_KNOCKBACK);
ALIASENCHANTMENTS.put("arrowkb", Enchantment.ARROW_KNOCKBACK);
ENCHANTMENTS.put("punch", Enchantment.ARROW_KNOCKBACK);
ALIASENCHANTMENTS.put("arrowpunch", Enchantment.ARROW_KNOCKBACK);
ALIASENCHANTMENTS.put("ak", Enchantment.ARROW_KNOCKBACK);
ALIASENCHANTMENTS.put("infinitearrows", Enchantment.ARROW_INFINITE);
ENCHANTMENTS.put("infarrows", Enchantment.ARROW_INFINITE);
ENCHANTMENTS.put("infinity", Enchantment.ARROW_INFINITE);
ALIASENCHANTMENTS.put("infinite", Enchantment.ARROW_INFINITE);
ALIASENCHANTMENTS.put("unlimited", Enchantment.ARROW_INFINITE);
ALIASENCHANTMENTS.put("unlimitedarrows", Enchantment.ARROW_INFINITE);
ALIASENCHANTMENTS.put("ai", Enchantment.ARROW_INFINITE);
try // 1.7 update
{
ENCHANTMENTS.put("luck", Enchantment.LUCK);
ALIASENCHANTMENTS.put("luckofsea", Enchantment.LUCK);
ALIASENCHANTMENTS.put("luckofseas", Enchantment.LUCK);
ALIASENCHANTMENTS.put("rodluck", Enchantment.LUCK);
ENCHANTMENTS.put("lure", Enchantment.LURE);
ALIASENCHANTMENTS.put("rodlure", Enchantment.LURE);
}
catch (java.lang.NoSuchFieldError e)
{
Essentials.wrongVersion();
}
}
public static Enchantment getByName(String name)
{
Enchantment enchantment;
if (NumberUtil.isInt(name))
{
enchantment = Enchantment.getById(Integer.parseInt(name));
}
else
{
enchantment = Enchantment.getByName(name.toUpperCase(Locale.ENGLISH));
}
if (enchantment == null)
{
enchantment = ENCHANTMENTS.get(name.toLowerCase(Locale.ENGLISH));
}
if (enchantment == null)
{
enchantment = ALIASENCHANTMENTS.get(name.toLowerCase(Locale.ENGLISH));
}
return enchantment;
}
public static Set<Entry<String, Enchantment>> entrySet()
{
return ENCHANTMENTS.entrySet();
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,110 +1,71 @@
package com.earth2me.essentials;
import java.util.logging.Logger;
import com.earth2me.essentials.utils.LocationUtil;
import java.util.Locale;
import net.ess3.api.IEssentials;
import org.bukkit.GameMode;
import org.bukkit.Material;
import org.bukkit.event.block.BlockListener;
import org.bukkit.block.BlockState;
import org.bukkit.block.CreatureSpawner;
import org.bukkit.entity.EntityType;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.inventory.ItemStack;
public class EssentialsBlockListener extends BlockListener
public class EssentialsBlockListener implements Listener
{
private final IEssentials ess;
private static final Logger logger = Logger.getLogger("Minecraft");
private final transient IEssentials ess;
public EssentialsBlockListener(IEssentials ess)
public EssentialsBlockListener(final IEssentials ess)
{
this.ess = ess;
}
@Override
public void onBlockPlace(BlockPlaceEvent event)
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onBlockPlace(final BlockPlaceEvent event)
{
if (event.isCancelled())
{
return;
}
final User user = ess.getUser(event.getPlayer());
// Do not rely on getItemInHand();
// http://leaky.bukkit.org/issues/663
final ItemStack is = new ItemStack(event.getBlockPlaced().getType(), 1, (short)0, event.getBlockPlaced().getData());
switch (is.getType())
final ItemStack is = LocationUtil.convertBlockToItem(event.getBlockPlaced());
if (is == null)
{
case WOODEN_DOOR:
is.setType(Material.WOOD_DOOR);
is.setDurability((short)0);
break;
case IRON_DOOR_BLOCK:
is.setType(Material.IRON_DOOR);
is.setDurability((short)0);
break;
case SIGN_POST:
case WALL_SIGN:
is.setType(Material.SIGN);
is.setDurability((short)0);
break;
case CROPS:
is.setType(Material.SEEDS);
is.setDurability((short)0);
break;
case CAKE_BLOCK:
is.setType(Material.CAKE);
is.setDurability((short)0);
break;
case BED_BLOCK:
is.setType(Material.BED);
is.setDurability((short)0);
break;
case REDSTONE_WIRE:
is.setType(Material.REDSTONE);
is.setDurability((short)0);
break;
case REDSTONE_TORCH_OFF:
case REDSTONE_TORCH_ON:
is.setType(Material.REDSTONE_TORCH_ON);
is.setDurability((short)0);
break;
case DIODE_BLOCK_OFF:
case DIODE_BLOCK_ON:
is.setType(Material.DIODE);
is.setDurability((short)0);
break;
case DOUBLE_STEP:
is.setType(Material.STEP);
break;
case TORCH:
case RAILS:
case LADDER:
case WOOD_STAIRS:
case COBBLESTONE_STAIRS:
case LEVER:
case STONE_BUTTON:
case FURNACE:
case DISPENSER:
case PUMPKIN:
case JACK_O_LANTERN:
case WOOD_PLATE:
case STONE_PLATE:
case PISTON_STICKY_BASE:
case PISTON_BASE:
is.setDurability((short)0);
break;
case FIRE:
return;
}
boolean unlimitedForUser = user.hasUnlimited(is);
if (unlimitedForUser && user.getGameMode() == GameMode.SURVIVAL)
if (is.getType() == Material.MOB_SPAWNER && event.getItemInHand() != null && event.getPlayer() != null
&& event.getItemInHand().getType() == Material.MOB_SPAWNER)
{
final BlockState blockState = event.getBlockPlaced().getState();
if (blockState instanceof CreatureSpawner)
{
final CreatureSpawner spawner = (CreatureSpawner)blockState;
final EntityType type = EntityType.fromId(event.getItemInHand().getData().getData());
if (type != null && Mob.fromBukkitType(type) != null)
{
if (ess.getUser(event.getPlayer()).isAuthorized("essentials.spawnerconvert." + Mob.fromBukkitType(type).name().toLowerCase(Locale.ENGLISH)))
{
spawner.setSpawnedType(type);
}
}
}
}
final User user = ess.getUser(event.getPlayer());
if (user.hasUnlimited(is) && user.getBase().getGameMode() == GameMode.SURVIVAL)
{
ess.scheduleSyncDelayedTask(
new Runnable()
{
public void run()
{
user.getInventory().addItem(is);
user.updateInventory();
}
});
{
@Override
public void run()
{
user.getBase().getInventory().addItem(is);
user.getBase().updateInventory();
}
});
}
}
}

View File

@@ -1,50 +1,63 @@
package com.earth2me.essentials;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.Map;
import static com.earth2me.essentials.I18n.tl;
import com.google.common.io.Files;
import java.io.*;
import java.math.BigDecimal;
import java.math.MathContext;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CoderResult;
import java.util.*;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Server;
import org.bukkit.World;
import net.ess3.api.InvalidWorldException;
import org.bukkit.*;
import org.bukkit.OfflinePlayer;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack;
import org.bukkit.util.config.Configuration;
import org.bukkit.util.Vector;
public class EssentialsConf extends Configuration
public class EssentialsConf extends YamlConfiguration
{
private static final Logger LOGGER = Logger.getLogger("Minecraft");
private transient File configFile;
private transient String templateName = null;
private transient Class<?> resourceClass = EssentialsConf.class;
protected static final Logger LOGGER = Logger.getLogger("Essentials");
protected final File configFile;
protected String templateName = null;
protected static final Charset UTF8 = Charset.forName("UTF-8");
private Class<?> resourceClass = EssentialsConf.class;
private static final ExecutorService EXECUTOR_SERVICE = Executors.newSingleThreadExecutor();
private final AtomicInteger pendingDiskWrites = new AtomicInteger(0);
public EssentialsConf(final File configFile)
{
super(configFile);
this.configFile = configFile;
if (this.root == null)
{
this.root = new HashMap<String, Object>();
}
super();
this.configFile = configFile.getAbsoluteFile();
}
private final byte[] bytebuffer = new byte[1024];
@Override
public void load()
public synchronized void load()
{
configFile = configFile.getAbsoluteFile();
if (pendingDiskWrites.get() != 0)
{
LOGGER.log(Level.INFO, "File {0} not read, because it''s not yet written to disk.", configFile);
return;
}
if (!configFile.getParentFile().exists())
{
if (!configFile.getParentFile().mkdirs())
{
LOGGER.log(Level.SEVERE, Util.format("failedToCreateConfig", configFile.toString()));
LOGGER.log(Level.SEVERE, tl("failedToCreateConfig", configFile.toString()));
}
}
// This will delete files where the first character is 0. In most cases they are broken.
@@ -82,46 +95,118 @@ public class EssentialsConf extends Configuration
LOGGER.log(Level.SEVERE, null, ex);
}
}
if (!configFile.exists())
{
if (templateName != null)
if (legacyFileExists())
{
LOGGER.log(Level.INFO, Util.format("creatingConfigFromTemplate", configFile.toString()));
convertLegacyFile();
}
else if (altFileExists())
{
convertAltFile();
}
else if (templateName != null)
{
LOGGER.log(Level.INFO, tl("creatingConfigFromTemplate", configFile.toString()));
createFromTemplate();
}
else
{
try
{
LOGGER.log(Level.INFO, Util.format("creatingEmptyConfig", configFile.toString()));
if (!configFile.createNewFile())
{
LOGGER.log(Level.SEVERE, Util.format("failedToCreateConfig", configFile.toString()));
}
}
catch (IOException ex)
{
LOGGER.log(Level.SEVERE, Util.format("failedToCreateConfig", configFile.toString()), ex);
}
return;
}
}
try
{
super.load();
final FileInputStream inputStream = new FileInputStream(configFile);
try
{
long startSize = configFile.length();
if (startSize > Integer.MAX_VALUE)
{
throw new InvalidConfigurationException("File too big");
}
ByteBuffer buffer = ByteBuffer.allocate((int)startSize);
int length;
while ((length = inputStream.read(bytebuffer)) != -1)
{
if (length > buffer.remaining())
{
ByteBuffer resize = ByteBuffer.allocate(buffer.capacity() + length - buffer.remaining());
int resizePosition = buffer.position();
buffer.rewind();
resize.put(buffer);
resize.position(resizePosition);
buffer = resize;
}
buffer.put(bytebuffer, 0, length);
}
buffer.rewind();
final CharBuffer data = CharBuffer.allocate(buffer.capacity());
CharsetDecoder decoder = UTF8.newDecoder();
CoderResult result = decoder.decode(buffer, data, true);
if (result.isError())
{
buffer.rewind();
data.clear();
LOGGER.log(Level.INFO, "File " + configFile.getAbsolutePath().toString() + " is not utf-8 encoded, trying " + Charset.defaultCharset().displayName());
decoder = Charset.defaultCharset().newDecoder();
result = decoder.decode(buffer, data, true);
if (result.isError())
{
throw new InvalidConfigurationException("Invalid Characters in file " + configFile.getAbsolutePath().toString());
}
else
{
decoder.flush(data);
}
}
else
{
decoder.flush(data);
}
final int end = data.position();
data.rewind();
super.loadFromString(data.subSequence(0, end).toString());
}
finally
{
inputStream.close();
}
}
catch (RuntimeException e)
catch (IOException ex)
{
LOGGER.log(Level.INFO, "File: " + configFile.toString());
throw e;
LOGGER.log(Level.SEVERE, ex.getMessage(), ex);
}
if (this.root == null)
catch (InvalidConfigurationException ex)
{
this.root = new HashMap<String, Object>();
File broken = new File(configFile.getAbsolutePath() + ".broken." + System.currentTimeMillis());
configFile.renameTo(broken);
LOGGER.log(Level.SEVERE, "The file " + configFile.toString() + " is broken, it has been renamed to " + broken.toString(), ex.getCause());
}
}
public boolean legacyFileExists()
{
return false;
}
public void convertLegacyFile()
{
LOGGER.log(Level.SEVERE, "Unable to import legacy config file.");
}
public boolean altFileExists()
{
return false;
}
public void convertAltFile()
{
LOGGER.log(Level.SEVERE, "Unable to import alt config file.");
}
private void createFromTemplate()
{
@@ -132,7 +217,7 @@ public class EssentialsConf extends Configuration
istr = resourceClass.getResourceAsStream(templateName);
if (istr == null)
{
LOGGER.log(Level.SEVERE, Util.format("couldNotFindTemplate", templateName));
LOGGER.log(Level.SEVERE, tl("couldNotFindTemplate", templateName));
return;
}
ostr = new FileOutputStream(configFile);
@@ -147,8 +232,7 @@ public class EssentialsConf extends Configuration
}
catch (IOException ex)
{
LOGGER.log(Level.SEVERE, Util.format("failedToWriteConfig", configFile.toString()), ex);
return;
LOGGER.log(Level.SEVERE, tl("failedToWriteConfig", configFile.toString()), ex);
}
finally
{
@@ -172,7 +256,7 @@ public class EssentialsConf extends Configuration
}
catch (IOException ex)
{
LOGGER.log(Level.SEVERE, Util.format("failedToCloseConfig", configFile.toString()), ex);
LOGGER.log(Level.SEVERE, tl("failedToCloseConfig", configFile.toString()), ex);
}
}
}
@@ -193,14 +277,164 @@ public class EssentialsConf extends Configuration
this.resourceClass = resClass;
}
public boolean hasProperty(final String path)
public void save()
{
return getProperty(path) != null;
try
{
save(configFile);
}
catch (IOException ex)
{
LOGGER.log(Level.SEVERE, ex.getMessage(), ex);
}
}
public Location getLocation(final String path, final Server server) throws Exception
public void saveWithError() throws IOException
{
final String worldName = getString((path == null ? "" : path + ".") + "world");
save(configFile);
}
@Override
public synchronized void save(final File file) throws IOException
{
delayedSave(file);
}
public synchronized void forceSave()
{
try
{
Future<?> future = delayedSave(configFile);
if (future != null)
{
future.get();
}
}
catch (InterruptedException ex)
{
LOGGER.log(Level.SEVERE, ex.getMessage(), ex);
}
catch (ExecutionException ex)
{
LOGGER.log(Level.SEVERE, ex.getMessage(), ex);
}
}
private Future<?> delayedSave(final File file)
{
//long startTime = System.nanoTime();
if (file == null)
{
throw new IllegalArgumentException("File cannot be null");
}
final String data = saveToString();
if (data.length() == 0)
{
return null;
}
pendingDiskWrites.incrementAndGet();
Future<?> future = EXECUTOR_SERVICE.submit(new WriteRunner(configFile, data, pendingDiskWrites));
//LOGGER.log(Level.INFO, configFile + " prepared for writing in " + (System.nanoTime() - startTime) + " nsec.");
return future;
}
private static class WriteRunner implements Runnable
{
private final File configFile;
private final String data;
private final AtomicInteger pendingDiskWrites;
private WriteRunner(final File configFile, final String data, final AtomicInteger pendingDiskWrites)
{
this.configFile = configFile;
this.data = data;
this.pendingDiskWrites = pendingDiskWrites;
}
@Override
public void run()
{
//long startTime = System.nanoTime();
synchronized (configFile)
{
if (pendingDiskWrites.get() > 1)
{
// Writes can be skipped, because they are stored in a queue (in the executor).
// Only the last is actually written.
pendingDiskWrites.decrementAndGet();
//LOGGER.log(Level.INFO, configFile + " skipped writing in " + (System.nanoTime() - startTime) + " nsec.");
return;
}
try
{
Files.createParentDirs(configFile);
if (!configFile.exists())
{
try
{
LOGGER.log(Level.INFO, tl("creatingEmptyConfig", configFile.toString()));
if (!configFile.createNewFile())
{
LOGGER.log(Level.SEVERE, tl("failedToCreateConfig", configFile.toString()));
return;
}
}
catch (IOException ex)
{
LOGGER.log(Level.SEVERE, tl("failedToCreateConfig", configFile.toString()), ex);
return;
}
}
final FileOutputStream fos = new FileOutputStream(configFile);
try
{
final OutputStreamWriter writer = new OutputStreamWriter(fos, UTF8);
try
{
writer.write(data);
}
finally
{
writer.close();
}
}
finally
{
fos.close();
}
}
catch (IOException e)
{
LOGGER.log(Level.SEVERE, e.getMessage(), e);
}
finally
{
//LOGGER.log(Level.INFO, configFile + " written to disk in " + (System.nanoTime() - startTime) + " nsec.");
pendingDiskWrites.decrementAndGet();
}
}
}
}
public boolean hasProperty(final String path)
{
return isSet(path);
}
public Location getLocation(final String path, final Server server) throws InvalidWorldException
{
final String worldString = (path == null ? "" : path + ".") + "world";
final String worldName = getString(worldString);
if (worldName == null || worldName.isEmpty())
{
return null;
@@ -208,7 +442,7 @@ public class EssentialsConf extends Configuration
final World world = server.getWorld(worldName);
if (world == null)
{
throw new Exception(Util.i18n("invalidWorld"));
throw new InvalidWorldException(worldName);
}
return new Location(world,
getDouble((path == null ? "" : path + ".") + "x", 0),
@@ -220,21 +454,40 @@ public class EssentialsConf extends Configuration
public void setProperty(final String path, final Location loc)
{
setProperty((path == null ? "" : path + ".") + "world", loc.getWorld().getName());
setProperty((path == null ? "" : path + ".") + "x", loc.getX());
setProperty((path == null ? "" : path + ".") + "y", loc.getY());
setProperty((path == null ? "" : path + ".") + "z", loc.getZ());
setProperty((path == null ? "" : path + ".") + "yaw", loc.getYaw());
setProperty((path == null ? "" : path + ".") + "pitch", loc.getPitch());
set((path == null ? "" : path + ".") + "world", loc.getWorld().getName());
set((path == null ? "" : path + ".") + "x", loc.getX());
set((path == null ? "" : path + ".") + "y", loc.getY());
set((path == null ? "" : path + ".") + "z", loc.getZ());
set((path == null ? "" : path + ".") + "yaw", loc.getYaw());
set((path == null ? "" : path + ".") + "pitch", loc.getPitch());
}
@Override
public ItemStack getItemStack(final String path)
{
return new ItemStack(
final ItemStack stack = new ItemStack(
Material.valueOf(getString(path + ".type", "AIR")),
getInt(path + ".amount", 1),
(short)getInt(path + ".damage", 0)/*,
(byte)getInt(path + ".data", 0)*/);
(short)getInt(path + ".damage", 0));
final ConfigurationSection enchants = getConfigurationSection(path + ".enchant");
if (enchants != null)
{
for (String enchant : enchants.getKeys(false))
{
final Enchantment enchantment = Enchantment.getByName(enchant.toUpperCase(Locale.ENGLISH));
if (enchantment == null)
{
continue;
}
final int level = getInt(path + ".enchant." + enchant, enchantment.getStartLevel());
stack.addUnsafeEnchantment(enchantment, level);
}
}
return stack;
/*
* ,
* (byte)getInt(path + ".data", 0)
*/
}
public void setProperty(final String path, final ItemStack stack)
@@ -243,35 +496,346 @@ public class EssentialsConf extends Configuration
map.put("type", stack.getType().toString());
map.put("amount", stack.getAmount());
map.put("damage", stack.getDurability());
Map<Enchantment, Integer> enchantments = stack.getEnchantments();
if (!enchantments.isEmpty())
{
Map<String, Integer> enchant = new HashMap<String, Integer>();
for (Map.Entry<Enchantment, Integer> entry : enchantments.entrySet())
{
enchant.put(entry.getKey().getName().toLowerCase(Locale.ENGLISH), entry.getValue());
}
map.put("enchant", enchant);
}
// getData().getData() is broken
//map.put("data", stack.getDurability());
setProperty(path, map);
set(path, map);
}
public long getLong(final String path, final long def)
public void setProperty(String path, List object)
{
try
{
final Number num = (Number)getProperty(path);
return num == null ? def : num.longValue();
}
catch (ClassCastException ex)
set(path, new ArrayList(object));
}
public void setProperty(String path, Map object)
{
set(path, new LinkedHashMap(object));
}
public Object getProperty(String path)
{
return get(path);
}
public void setProperty(final String path, final BigDecimal bigDecimal)
{
set(path, bigDecimal.toString());
}
public void setProperty(String path, Object object)
{
set(path, object);
}
public void removeProperty(String path)
{
set(path, null);
}
@Override
public synchronized Object get(String path)
{
return super.get(path);
}
@Override
public synchronized Object get(String path, Object def)
{
return super.get(path, def);
}
public synchronized BigDecimal getBigDecimal(final String path, final BigDecimal def)
{
final String input = super.getString(path);
return toBigDecimal(input, def);
}
public static BigDecimal toBigDecimal(final String input, final BigDecimal def)
{
if (input == null || input.isEmpty())
{
return def;
}
else
{
try
{
return new BigDecimal(input, MathContext.DECIMAL128);
}
catch (NumberFormatException e)
{
return def;
}
catch (ArithmeticException e)
{
return def;
}
}
}
@Override
public double getDouble(final String path, final double def)
public synchronized boolean getBoolean(String path)
{
try
{
Number num = (Number)getProperty(path);
return num == null ? def : num.doubleValue();
}
catch (ClassCastException ex)
{
return def;
}
return super.getBoolean(path);
}
@Override
public synchronized boolean getBoolean(String path, boolean def)
{
return super.getBoolean(path, def);
}
@Override
public synchronized List<Boolean> getBooleanList(String path)
{
return super.getBooleanList(path);
}
@Override
public synchronized List<Byte> getByteList(String path)
{
return super.getByteList(path);
}
@Override
public synchronized List<Character> getCharacterList(String path)
{
return super.getCharacterList(path);
}
@Override
public synchronized ConfigurationSection getConfigurationSection(String path)
{
return super.getConfigurationSection(path);
}
@Override
public synchronized double getDouble(String path)
{
return super.getDouble(path);
}
@Override
public synchronized double getDouble(final String path, final double def)
{
return super.getDouble(path, def);
}
@Override
public synchronized List<Double> getDoubleList(String path)
{
return super.getDoubleList(path);
}
@Override
public synchronized List<Float> getFloatList(String path)
{
return super.getFloatList(path);
}
@Override
public synchronized int getInt(String path)
{
return super.getInt(path);
}
@Override
public synchronized int getInt(String path, int def)
{
return super.getInt(path, def);
}
@Override
public synchronized List<Integer> getIntegerList(String path)
{
return super.getIntegerList(path);
}
@Override
public synchronized ItemStack getItemStack(String path, ItemStack def)
{
return super.getItemStack(path, def);
}
@Override
public synchronized Set<String> getKeys(boolean deep)
{
return super.getKeys(deep);
}
@Override
public synchronized List<?> getList(String path)
{
return super.getList(path);
}
@Override
public synchronized List<?> getList(String path, List<?> def)
{
return super.getList(path, def);
}
@Override
public synchronized long getLong(String path)
{
return super.getLong(path);
}
@Override
public synchronized long getLong(final String path, final long def)
{
return super.getLong(path, def);
}
@Override
public synchronized List<Long> getLongList(String path)
{
return super.getLongList(path);
}
public synchronized Map<String, Object> getMap()
{
return map;
}
@Override
public synchronized List<Map<?, ?>> getMapList(String path)
{
return super.getMapList(path);
}
@Override
public synchronized OfflinePlayer getOfflinePlayer(String path)
{
return super.getOfflinePlayer(path);
}
@Override
public synchronized OfflinePlayer getOfflinePlayer(String path, OfflinePlayer def)
{
return super.getOfflinePlayer(path, def);
}
@Override
public synchronized List<Short> getShortList(String path)
{
return super.getShortList(path);
}
@Override
public synchronized String getString(String path)
{
return super.getString(path);
}
@Override
public synchronized String getString(String path, String def)
{
return super.getString(path, def);
}
@Override
public synchronized List<String> getStringList(String path)
{
return super.getStringList(path);
}
@Override
public synchronized Map<String, Object> getValues(boolean deep)
{
return super.getValues(deep);
}
@Override
public synchronized Vector getVector(String path)
{
return super.getVector(path);
}
@Override
public synchronized Vector getVector(String path, Vector def)
{
return super.getVector(path, def);
}
@Override
public synchronized boolean isBoolean(String path)
{
return super.isBoolean(path);
}
@Override
public synchronized boolean isConfigurationSection(String path)
{
return super.isConfigurationSection(path);
}
@Override
public synchronized boolean isDouble(String path)
{
return super.isDouble(path);
}
@Override
public synchronized boolean isInt(String path)
{
return super.isInt(path);
}
@Override
public synchronized boolean isItemStack(String path)
{
return super.isItemStack(path);
}
@Override
public synchronized boolean isList(String path)
{
return super.isList(path);
}
@Override
public synchronized boolean isLong(String path)
{
return super.isLong(path);
}
@Override
public synchronized boolean isOfflinePlayer(String path)
{
return super.isOfflinePlayer(path);
}
@Override
public synchronized boolean isSet(String path)
{
return super.isSet(path);
}
@Override
public synchronized boolean isString(String path)
{
return super.isString(path);
}
@Override
public synchronized boolean isVector(String path)
{
return super.isVector(path);
}
@Override
public synchronized void set(String path, Object value)
{
super.set(path, value);
}
}

View File

@@ -1,25 +1,25 @@
package com.earth2me.essentials;
import static com.earth2me.essentials.I18n.tl;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityCombustEvent;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.event.entity.EntityListener;
import org.bukkit.event.entity.EntityRegainHealthEvent;
import java.util.regex.Pattern;
import net.ess3.api.IEssentials;
import org.bukkit.Material;
import org.bukkit.entity.*;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.*;
import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
import org.bukkit.event.entity.FoodLevelChangeEvent;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.inventory.ItemStack;
public class EssentialsEntityListener extends EntityListener
public class EssentialsEntityListener implements Listener
{
private static final Logger LOGGER = Logger.getLogger("Minecraft");
private static final Logger LOGGER = Logger.getLogger("Essentials");
private static final transient Pattern powertoolPlayer = Pattern.compile("\\{player\\}");
private final IEssentials ess;
public EssentialsEntityListener(IEssentials ess)
@@ -27,37 +27,106 @@ public class EssentialsEntityListener extends EntityListener
this.ess = ess;
}
@Override
public void onEntityDamage(EntityDamageEvent event)
// This method does something undocumented reguarding certain bucket types #EasterEgg
@EventHandler(priority = EventPriority.LOW)
public void onEntityDamage(final EntityDamageByEntityEvent event)
{
if (event instanceof EntityDamageByEntityEvent)
final Entity eAttack = event.getDamager();
final Entity eDefend = event.getEntity();
if (eAttack instanceof Player)
{
EntityDamageByEntityEvent edEvent = (EntityDamageByEntityEvent)event;
Entity eAttack = edEvent.getDamager();
Entity eDefend = edEvent.getEntity();
if (eDefend instanceof Player && eAttack instanceof Player)
final User attacker = ess.getUser((Player)eAttack);
if (eDefend instanceof Player)
{
User defender = ess.getUser(eDefend);
User attacker = ess.getUser(eAttack);
attacker.updateActivity(true);
ItemStack is = attacker.getItemInHand();
List<String> commandList = attacker.getPowertool(is);
if (commandList != null && !commandList.isEmpty())
onPlayerVsPlayerDamage(event, (Player)eDefend, attacker);
}
else if (eDefend instanceof Ageable)
{
final ItemStack hand = attacker.getBase().getItemInHand();
if (hand != null && hand.getType() == Material.MILK_BUCKET)
{
for (String command : commandList)
{
((Ageable)eDefend).setBaby();
hand.setType(Material.BUCKET);
attacker.getBase().setItemInHand(hand);
attacker.getBase().updateInventory();
event.setCancelled(true);
}
}
attacker.updateActivity(true);
}
else if (eAttack instanceof Projectile && eDefend instanceof Player)
{
final Projectile projectile = (Projectile)event.getDamager();
//This should return a ProjectileSource on 1.7.3 beta +
final Object shooter = projectile.getShooter();
if (shooter instanceof Player)
{
final User attacker = ess.getUser((Player)shooter);
onPlayerVsPlayerDamage(event, (Player)eDefend, attacker);
attacker.updateActivity(true);
}
}
}
if (command != null && !command.isEmpty())
private void onPlayerVsPlayerDamage(final EntityDamageByEntityEvent event, final Player defender, final User attacker)
{
if (ess.getSettings().getLoginAttackDelay() > 0
&& (System.currentTimeMillis() < (attacker.getLastLogin() + ess.getSettings().getLoginAttackDelay()))
&& !attacker.isAuthorized("essentials.pvpdelay.exempt"))
{
event.setCancelled(true);
}
if (!defender.equals(attacker.getBase()) && (attacker.hasInvulnerabilityAfterTeleport() || ess.getUser(defender).hasInvulnerabilityAfterTeleport()))
{
event.setCancelled(true);
}
if (attacker.isGodModeEnabled() && !attacker.isAuthorized("essentials.god.pvp"))
{
event.setCancelled(true);
}
if (attacker.isHidden() && !attacker.isAuthorized("essentials.vanish.pvp"))
{
event.setCancelled(true);
}
onPlayerVsPlayerPowertool(event, defender, attacker);
}
private void onPlayerVsPlayerPowertool(final EntityDamageByEntityEvent event, final Player defender, final User attacker)
{
final List<String> commandList = attacker.getPowertool(attacker.getBase().getItemInHand());
if (commandList != null && !commandList.isEmpty())
{
for (final String tempCommand : commandList)
{
final String command = powertoolPlayer.matcher(tempCommand).replaceAll(defender.getName());
if (command != null && !command.isEmpty() && !command.equals(tempCommand))
{
ess.scheduleSyncDelayedTask(
new Runnable()
{
@Override
public void run()
{
attacker.getServer().dispatchCommand(attacker, command.replaceAll("\\{player\\}", defender.getName()));
event.setCancelled(true);
return;
attacker.getServer().dispatchCommand(attacker.getBase(), command);
LOGGER.log(Level.INFO, String.format("[PT] %s issued server command: /%s", attacker.getName(), command));
}
}
});
event.setCancelled(true);
return;
}
}
}
if (event.getEntity() instanceof Player && ess.getUser(event.getEntity()).isGodModeEnabled())
}
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onEntityDamage(final EntityDamageEvent event)
{
if (event.getEntity() instanceof Player && ess.getUser((Player)event.getEntity()).isGodModeEnabled())
{
final Player player = (Player)event.getEntity();
player.setFireTicks(0);
@@ -66,50 +135,91 @@ public class EssentialsEntityListener extends EntityListener
}
}
@Override
public void onEntityCombust(EntityCombustEvent event)
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onEntityCombust(final EntityCombustEvent event)
{
if (event.getEntity() instanceof Player && ess.getUser(event.getEntity()).isGodModeEnabled())
if (event.getEntity() instanceof Player && ess.getUser((Player)event.getEntity()).isGodModeEnabled())
{
event.setCancelled(true);
}
}
@Override
public void onEntityDeath(final EntityDeathEvent event)
@EventHandler(priority = EventPriority.LOWEST)
public void onPlayerDeathEvent(final PlayerDeathEvent event)
{
if (event instanceof PlayerDeathEvent)
final User user = ess.getUser(event.getEntity());
if (user.isAuthorized("essentials.back.ondeath") && !ess.getSettings().isCommandDisabled("back"))
{
final PlayerDeathEvent pdevent = (PlayerDeathEvent)event;
final User user = ess.getUser(pdevent.getEntity());
if (user.isAuthorized("essentials.back.ondeath") && !ess.getSettings().isCommandDisabled("back"))
user.setLastLocation();
user.sendMessage(tl("backAfterDeath"));
}
if (!ess.getSettings().areDeathMessagesEnabled())
{
event.setDeathMessage("");
}
}
@EventHandler(priority = EventPriority.LOW)
public void onPlayerDeathExpEvent(final PlayerDeathEvent event)
{
final User user = ess.getUser(event.getEntity());
if (user.isAuthorized("essentials.keepxp"))
{
event.setKeepLevel(true);
event.setDroppedExp(0);
}
}
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onFoodLevelChange(final FoodLevelChangeEvent event)
{
if (event.getEntity() instanceof Player)
{
final User user = ess.getUser((Player)event.getEntity());
if (user.isGodModeEnabled())
{
user.setLastLocation();
user.sendMessage(Util.i18n("backAfterDeath"));
}
if (!ess.getSettings().areDeathMessagesEnabled())
{
pdevent.setDeathMessage("");
if (user.isGodModeEnabledRaw())
{
user.getBase().setFoodLevel(20);
user.getBase().setSaturation(10);
}
event.setCancelled(true);
}
}
}
@Override
public void onFoodLevelChange(FoodLevelChangeEvent event)
{
if (event.getEntity() instanceof Player && ess.getUser(event.getEntity()).isGodModeEnabled())
{
event.setCancelled(true);
}
}
@Override
public void onEntityRegainHealth(EntityRegainHealthEvent event)
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onEntityRegainHealth(final EntityRegainHealthEvent event)
{
if (event.getRegainReason() == RegainReason.SATIATED && event.getEntity() instanceof Player
&& ess.getUser(event.getEntity()).isAfk() && ess.getSettings().getFreezeAfkPlayers())
&& ess.getUser((Player)event.getEntity()).isAfk() && ess.getSettings().getFreezeAfkPlayers())
{
event.setCancelled(true);
}
}
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onPotionSplashEvent(final PotionSplashEvent event)
{
for (LivingEntity entity : event.getAffectedEntities())
{
if (entity instanceof Player && ess.getUser((Player)entity).isGodModeEnabled())
{
event.setIntensity(entity, 0d);
}
}
}
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onEntityShootBow(EntityShootBowEvent event)
{
if (event.getEntity() instanceof Player)
{
final User user = ess.getUser((Player)event.getEntity());
if (user.isAfk())
{
user.updateActivity(true);
}
}
}
}

View File

@@ -1,105 +1,138 @@
package com.earth2me.essentials;
import java.util.Arrays;
import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.textreader.IText;
import com.earth2me.essentials.textreader.KeywordReplacer;
import com.earth2me.essentials.textreader.TextInput;
import com.earth2me.essentials.textreader.TextPager;
import com.earth2me.essentials.utils.DateUtil;
import com.earth2me.essentials.utils.LocationUtil;
import java.io.IOException;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.ess3.api.IEssentials;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Server;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerAnimationEvent;
import org.bukkit.event.player.PlayerAnimationType;
import org.bukkit.event.player.PlayerBedEnterEvent;
import org.bukkit.event.player.PlayerBucketEmptyEvent;
import org.bukkit.event.player.PlayerChatEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerEggThrowEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerListener;
import org.bukkit.event.player.PlayerLoginEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.event.player.*;
import org.bukkit.event.player.PlayerLoginEvent.Result;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.player.PlayerRespawnEvent;
import org.bukkit.event.player.PlayerTeleportEvent;
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
public class EssentialsPlayerListener extends PlayerListener
public class EssentialsPlayerListener implements Listener
{
private static final Logger LOGGER = Logger.getLogger("Minecraft");
private final transient Server server;
private static final Logger LOGGER = Logger.getLogger("Essentials");
private final transient IEssentials ess;
public EssentialsPlayerListener(final IEssentials parent)
{
this.ess = parent;
this.server = parent.getServer();
}
@Override
@EventHandler(priority = EventPriority.NORMAL)
public void onPlayerRespawn(final PlayerRespawnEvent event)
{
final User user = ess.getUser(event.getPlayer());
user.setDisplayNick(user.getNick());
updateCompass(user);
if (ess.getSettings().changeDisplayName())
user.setDisplayNick();
if (ess.getSettings().isTeleportInvulnerability())
{
user.setDisplayNick(user.getNick());
user.enableInvulnerabilityAfterTeleport();
}
}
@Override
public void onPlayerChat(final PlayerChatEvent event)
@EventHandler(priority = EventPriority.LOWEST)
public void onPlayerChat(final AsyncPlayerChatEvent event)
{
final User user = ess.getUser(event.getPlayer());
if (user.isMuted())
{
event.setCancelled(true);
user.sendMessage(Util.i18n("playerMuted"));
LOGGER.info(Util.format("mutedUserSpeaks", user.getName()));
user.sendMessage(tl("voiceSilenced"));
LOGGER.info(tl("mutedUserSpeaks", user.getName()));
}
final Iterator<Player> it = event.getRecipients().iterator();
while (it.hasNext())
try
{
final User u = ess.getUser(it.next());
if (u.isIgnoredPlayer(user.getName()))
final Iterator<Player> it = event.getRecipients().iterator();
while (it.hasNext())
{
it.remove();
final User u = ess.getUser(it.next());
if (u.isIgnoredPlayer(user))
{
it.remove();
}
}
}
user.updateActivity(true);
if (ess.getSettings().changeDisplayName())
catch (UnsupportedOperationException ex)
{
user.setDisplayNick(user.getNick());
if (ess.getSettings().isDebug())
{
ess.getLogger().log(Level.INFO, "Ignore could not block chat due to custom chat plugin event.", ex);
}
else
{
ess.getLogger().info("Ignore could not block chat due to custom chat plugin event.");
}
}
user.updateActivity(true);
user.setDisplayNick();
}
@Override
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onPlayerMove(final PlayerMoveEvent event)
{
if (event.isCancelled())
if (event.getFrom().getBlockX() == event.getTo().getBlockX()
&& event.getFrom().getBlockZ() == event.getTo().getBlockZ()
&& event.getFrom().getBlockY() == event.getTo().getBlockY())
{
return;
}
if (!ess.getSettings().cancelAfkOnMove() && !ess.getSettings().getFreezeAfkPlayers())
{
event.getHandlers().unregister(this);
if (ess.getSettings().isDebug())
{
LOGGER.log(Level.INFO, "Unregistering move listener");
}
return;
}
final User user = ess.getUser(event.getPlayer());
if (user.isAfk() && ess.getSettings().getFreezeAfkPlayers())
{
final Location from = event.getFrom();
final Location to = event.getTo().clone();
final Location origTo = event.getTo();
final Location to = origTo.clone();
if (ess.getSettings().cancelAfkOnMove() && origTo.getY() >= from.getBlockY() + 1)
{
user.updateActivity(true);
return;
}
to.setX(from.getX());
to.setY(from.getY());
to.setZ(from.getZ());
try
{
event.setTo(Util.getSafeDestination(to));
event.setTo(LocationUtil.getSafeDestination(to));
}
catch (Exception ex)
{
@@ -107,199 +140,291 @@ public class EssentialsPlayerListener extends PlayerListener
}
return;
}
final Location afk = user.getAfkPosition();
if (afk == null || !event.getTo().getWorld().equals(afk.getWorld()) || afk.distanceSquared(event.getTo()) > 9)
{
user.updateActivity(true);
}
}
@Override
@EventHandler(priority = EventPriority.HIGHEST)
public void onPlayerQuit(final PlayerQuitEvent event)
{
final User user = ess.getUser(event.getPlayer());
if (ess.getSettings().allowSilentJoinQuit() && user.isAuthorized("essentials.silentquit"))
{
event.setQuitMessage(null);
}
else if (ess.getSettings().isCustomQuitMessage() && event.getQuitMessage() != null)
{
final Player player = event.getPlayer();
event.setQuitMessage(
ess.getSettings().getCustomQuitMessage()
.replace("{PLAYER}", player.getDisplayName())
.replace("{USERNAME}", player.getName()));
}
if (ess.getSettings().removeGodOnDisconnect() && user.isGodModeEnabled())
{
user.toggleGodModeEnabled();
user.setGodModeEnabled(false);
}
if (user.getSavedInventory() != null)
if (user.isVanished())
{
user.getInventory().setContents(user.getSavedInventory());
user.setSavedInventory(null);
user.setVanished(false);
}
user.setLogoutLocation();
if (user.isRecipeSee())
{
user.getBase().getOpenInventory().getTopInventory().clear();
}
user.updateActivity(false);
user.dispose();
if (!ess.getSettings().getReclaimSetting())
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onPlayerJoin(final PlayerJoinEvent event)
{
final String joinMessage = event.getJoinMessage();
ess.runTaskAsynchronously(new Runnable()
{
@Override
public void run()
{
delayedJoin(event.getPlayer(), joinMessage);
}
});
if (ess.getSettings().allowSilentJoinQuit() || ess.getSettings().isCustomJoinMessage())
{
event.setJoinMessage(null);
}
}
public void delayedJoin(final Player player, final String message)
{
if (!player.isOnline())
{
return;
}
final Thread thread = new Thread(new Runnable()
ess.getBackup().onPlayerJoin();
final User user = ess.getUser(player);
if (user.isNPC())
{
user.setNPC(false);
}
final long currentTime = System.currentTimeMillis();
user.checkMuteTimeout(currentTime);
user.updateActivity(false);
ess.scheduleSyncDelayedTask(new Runnable()
{
@Override
public void run()
{
try
{
Thread.sleep(1000);
Runtime rt = Runtime.getRuntime();
double mem = rt.freeMemory();
rt.runFinalization();
rt.gc();
mem = rt.freeMemory() - mem;
mem /= 1024 * 1024;
LOGGER.log(Level.INFO, Util.format("freedMemory", mem));
}
catch (InterruptedException ex)
if (!user.getBase().isOnline())
{
return;
}
user.setLastAccountName(user.getBase().getName());
user.setLastLogin(currentTime);
user.setDisplayNick();
updateCompass(user);
if (!ess.getVanishedPlayers().isEmpty() && !user.isAuthorized("essentials.vanish.see"))
{
for (String p : ess.getVanishedPlayers())
{
Player toVanish = ess.getServer().getPlayerExact(p);
if (toVanish != null && toVanish.isOnline())
{
user.getBase().hidePlayer(toVanish);
}
}
}
if (user.isAuthorized("essentials.sleepingignored"))
{
user.getBase().setSleepingIgnored(true);
}
if ((ess.getSettings().allowSilentJoinQuit() && user.isAuthorized("essentials.silentjoin")) || message == null)
{
// Do nothing - silently join
}
else if (ess.getSettings().isCustomJoinMessage())
{
ess.getServer().broadcastMessage(
ess.getSettings().getCustomJoinMessage()
.replace("{PLAYER}", player.getDisplayName())
.replace("{USERNAME}", player.getName()));
}
else if (ess.getSettings().allowSilentJoinQuit())
{
ess.getServer().broadcastMessage(message);
}
if (!ess.getSettings().isCommandDisabled("motd") && user.isAuthorized("essentials.motd"))
{
try
{
final IText input = new TextInput(user.getSource(), "motd", true, ess);
final IText output = new KeywordReplacer(input, user.getSource(), ess);
final TextPager pager = new TextPager(output, true);
pager.showPage("1", null, "motd", user.getSource());
}
catch (IOException ex)
{
if (ess.getSettings().isDebug())
{
LOGGER.log(Level.WARNING, ex.getMessage(), ex);
}
else
{
LOGGER.log(Level.WARNING, ex.getMessage());
}
}
}
if (!ess.getSettings().isCommandDisabled("mail") && user.isAuthorized("essentials.mail"))
{
final List<String> mail = user.getMails();
if (mail.isEmpty())
{
user.sendMessage(tl("noNewMail"));
}
else
{
user.sendMessage(tl("youHaveNewMail", mail.size()));
}
}
if (user.isAuthorized("essentials.fly.safelogin"))
{
user.getBase().setFallDistance(0);
if (LocationUtil.shouldFly(user.getLocation()))
{
user.getBase().setAllowFlight(true);
user.getBase().setFlying(true);
user.getBase().sendMessage(tl("flyMode", tl("enabled"), user.getDisplayName()));
}
}
user.getBase().setFlySpeed(0.1f);
user.getBase().setWalkSpeed(0.2f);
}
});
thread.setPriority(Thread.MIN_PRIORITY);
thread.start();
}
@Override
public void onPlayerJoin(final PlayerJoinEvent event)
// Makes the compass item ingame always point to the first essentials home. #EasterEgg
private void updateCompass(final User user)
{
ess.getBackup().onPlayerJoin();
final User user = ess.getUser(event.getPlayer());
if (ess.getSettings().changeDisplayName())
Location loc = user.getHome(user.getLocation());
if (loc == null)
{
user.setDisplayNick(user.getNick());
loc = user.getBase().getBedSpawnLocation();
}
user.updateActivity(false);
if (user.isAuthorized("essentials.sleepingignored"))
if (loc != null)
{
user.setSleepingIgnored(true);
}
if (!ess.getSettings().isCommandDisabled("motd") && user.isAuthorized("essentials.motd"))
{
for (String m : ess.getMotd(user, null))
{
if (m == null)
{
continue;
}
user.sendMessage(m);
}
}
if (!ess.getSettings().isCommandDisabled("mail") && user.isAuthorized("essentials.mail"))
{
final List<String> mail = user.getMails();
if (mail.isEmpty())
{
user.sendMessage(Util.i18n("noNewMail"));
}
else
{
user.sendMessage(Util.format("youHaveNewMail", mail.size()));
}
final Location updateLoc = loc;
user.getBase().setCompassTarget(updateLoc);
}
}
@Override
@EventHandler(priority = EventPriority.LOWEST)
public void onPlayerLogin2(final PlayerLoginEvent event)
{
switch (event.getResult())
{
case KICK_BANNED:
break;
default:
return;
}
final String banReason = tl("banFormat", tl("defaultBanReason"), "Console");
event.disallow(Result.KICK_BANNED, banReason);
}
@EventHandler(priority = EventPriority.HIGH)
public void onPlayerLogin(final PlayerLoginEvent event)
{
if (event.getResult() != Result.ALLOWED && event.getResult() != Result.KICK_FULL && event.getResult() != Result.KICK_BANNED)
switch (event.getResult())
{
LOGGER.log(Level.INFO, "Disconnecting user " + event.getPlayer().toString() + " due to " + event.getResult().toString());
case KICK_FULL:
case KICK_BANNED:
break;
default:
return;
}
User user = ess.getUser(event.getPlayer());
user.setNPC(false);
final long currentTime = System.currentTimeMillis();
boolean banExpired = user.checkBanTimeout(currentTime);
user.checkMuteTimeout(currentTime);
user.checkJailTimeout(currentTime);
if (banExpired == false && (user.isBanned() || event.getResult() == Result.KICK_BANNED))
final User user = ess.getUser(event.getPlayer());
if (event.getResult() == Result.KICK_BANNED || user.getBase().isBanned())
{
final String banReason = user.getBanReason();
event.disallow(Result.KICK_BANNED, banReason != null && !banReason.isEmpty() && !banReason.equalsIgnoreCase("ban") ? banReason : Util.i18n("defaultBanReason"));
return;
final boolean banExpired = user.checkBanTimeout(System.currentTimeMillis());
if (!banExpired)
{
String banReason = user.getBanReason();
if (banReason == null || banReason.isEmpty() || banReason.equalsIgnoreCase("ban"))
{
banReason = event.getKickMessage();
}
if (user.getBanTimeout() > 0)
{
//TODO: TL This
banReason += "\n\n" + "Expires in " + DateUtil.formatDateDiff(user.getBanTimeout());
}
event.disallow(Result.KICK_BANNED, banReason);
return;
}
}
if (server.getOnlinePlayers().length >= server.getMaxPlayers() && !user.isAuthorized("essentials.joinfullserver"))
if (event.getResult() == Result.KICK_FULL && !user.isAuthorized("essentials.joinfullserver"))
{
event.disallow(Result.KICK_FULL, Util.i18n("serverFull"));
event.disallow(Result.KICK_FULL, tl("serverFull"));
return;
}
event.allow();
user.setLastLogin(System.currentTimeMillis());
updateCompass(user);
}
private void updateCompass(final User user)
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onPlayerTeleport(final PlayerTeleportEvent event)
{
try
final boolean backListener = ess.getSettings().registerBackInListener();
final boolean teleportInvulnerability = ess.getSettings().isTeleportInvulnerability();
if (backListener || teleportInvulnerability)
{
user.setCompassTarget(user.getHome(user.getLocation()));
}
catch (Exception ex)
{
}
}
@Override
public void onPlayerTeleport(PlayerTeleportEvent event)
{
if (event.isCancelled())
{
return;
}
final User user = ess.getUser(event.getPlayer());
if (ess.getSettings().changeDisplayName())
{
user.setDisplayNick(user.getNick());
}
updateCompass(user);
}
@Override
public void onPlayerInteract(final PlayerInteractEvent event)
{
if (event.isCancelled())
{
return;
}
if (event.getAction() != Action.RIGHT_CLICK_BLOCK)
{
return;
}
if (ess.getSettings().getBedSetsHome() && event.getClickedBlock().getType() == Material.BED_BLOCK)
{
try
final User user = ess.getUser(event.getPlayer());
//There is TeleportCause.COMMMAND but plugins have to actively pass the cause in on their teleports.
if (backListener && (event.getCause() == TeleportCause.PLUGIN || event.getCause() == TeleportCause.COMMAND))
{
final User user = ess.getUser(event.getPlayer());
user.setHome();
user.sendMessage(Util.i18n("homeSetToBed"));
user.setLastLocation();
}
catch (Throwable ex)
if (teleportInvulnerability && (event.getCause() == TeleportCause.PLUGIN || event.getCause() == TeleportCause.COMMAND))
{
user.enableInvulnerabilityAfterTeleport();
}
}
}
@Override
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onPlayerEggThrow(final PlayerEggThrowEvent event)
{
final User user = ess.getUser(event.getPlayer());
final ItemStack is = new ItemStack(Material.EGG, 1);
if (user.hasUnlimited(is))
final ItemStack stack = new ItemStack(Material.EGG, 1);
if (user.hasUnlimited(stack))
{
user.getInventory().addItem(is);
user.updateInventory();
user.getBase().getInventory().addItem(stack);
user.getBase().updateInventory();
}
}
@Override
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onPlayerBucketEmpty(final PlayerBucketEmptyEvent event)
{
final User user = ess.getUser(event.getPlayer());
@@ -308,86 +433,344 @@ public class EssentialsPlayerListener extends PlayerListener
event.getItemStack().setType(event.getBucket());
ess.scheduleSyncDelayedTask(new Runnable()
{
@Override
public void run()
{
user.updateInventory();
user.getBase().updateInventory();
}
});
}
}
@Override
public void onPlayerAnimation(final PlayerAnimationEvent event)
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerCommandPreprocess(final PlayerCommandPreprocessEvent event)
{
final Player player = event.getPlayer();
final String cmd = event.getMessage().toLowerCase(Locale.ENGLISH).split(" ")[0].replace("/", "").toLowerCase(Locale.ENGLISH);
if (ess.getSettings().getSocialSpyCommands().contains(cmd) || ess.getSettings().getSocialSpyCommands().contains("*"))
{
for (Player onlinePlayer : ess.getServer().getOnlinePlayers())
{
final User spyer = ess.getUser(onlinePlayer);
if (spyer.isSocialSpyEnabled() && !player.equals(onlinePlayer))
{
spyer.sendMessage(player.getDisplayName() + " : " + event.getMessage());
}
}
}
else if (!cmd.equalsIgnoreCase("afk"))
{
final User user = ess.getUser(player);
user.updateActivity(true);
}
}
@EventHandler(priority = EventPriority.NORMAL)
public void onPlayerChangedWorldFlyReset(final PlayerChangedWorldEvent event)
{
final User user = ess.getUser(event.getPlayer());
user.updateActivity(true);
usePowertools(event);
if (user.getBase().getGameMode() != GameMode.CREATIVE && !user.isAuthorized("essentials.fly"))
{
user.getBase().setFallDistance(0f);
user.getBase().setAllowFlight(false);
}
if (!user.isAuthorized("essentials.speed"))
{
user.getBase().setFlySpeed(0.1f);
user.getBase().setWalkSpeed(0.2f);
}
else
{
if (user.getBase().getFlySpeed() > ess.getSettings().getMaxFlySpeed() && !user.isAuthorized("essentials.speed.bypass"))
{
user.getBase().setFlySpeed((float)ess.getSettings().getMaxFlySpeed());
}
else
{
user.getBase().setFlySpeed(user.getBase().getFlySpeed() * 0.99999f);
}
if (user.getBase().getWalkSpeed() > ess.getSettings().getMaxWalkSpeed() && !user.isAuthorized("essentials.speed.bypass"))
{
user.getBase().setWalkSpeed((float)ess.getSettings().getMaxWalkSpeed());
}
else
{
user.getBase().setWalkSpeed(user.getBase().getWalkSpeed() * 0.99999f);
}
}
}
@EventHandler(priority = EventPriority.MONITOR)
public void onPlayerChangedWorld(final PlayerChangedWorldEvent event)
{
final User user = ess.getUser(event.getPlayer());
final String newWorld = event.getPlayer().getLocation().getWorld().getName();
user.setDisplayNick();
updateCompass(user);
if (ess.getSettings().getNoGodWorlds().contains(newWorld) && user.isGodModeEnabledRaw())
{
user.sendMessage(tl("noGodWorldWarning"));
}
if (!user.getWorld().getName().equals(newWorld))
{
user.sendMessage(tl("currentWorld", newWorld));
}
if (user.isVanished())
{
user.setVanished(user.isAuthorized("essentials.vanish"));
}
}
@EventHandler(priority = EventPriority.NORMAL)
public void onPlayerInteract(final PlayerInteractEvent event)
{
switch (event.getAction())
{
case RIGHT_CLICK_BLOCK:
if (!event.isCancelled() && event.getClickedBlock().getType() == Material.BED_BLOCK && ess.getSettings().getUpdateBedAtDaytime())
{
User player = ess.getUser(event.getPlayer());
if (player.isAuthorized("essentials.sethome.bed"))
{
player.getBase().setBedSpawnLocation(event.getClickedBlock().getLocation());
player.sendMessage(tl("bedSet", player.getLocation().getWorld().getName(), player.getLocation().getBlockX(), player.getLocation().getBlockY(), player.getLocation().getBlockZ()));
}
}
break;
case LEFT_CLICK_AIR:
if (event.getPlayer().isFlying())
{
final User user = ess.getUser(event.getPlayer());
if (user.isFlyClickJump())
{
useFlyClickJump(user);
return;
}
}
case LEFT_CLICK_BLOCK:
if (event.getItem() != null && event.getItem().getType() != Material.AIR)
{
final User user = ess.getUser(event.getPlayer());
user.updateActivity(true);
if (user.hasPowerTools() && user.arePowerToolsEnabled() && usePowertools(user, event.getItem().getTypeId()))
{
event.setCancelled(true);
}
}
break;
default:
break;
}
}
private void usePowertools(final PlayerAnimationEvent event)
// This method allows the /jump lock feature to work, allows teleporting while flying #EasterEgg
private void useFlyClickJump(final User user)
{
if (event.getAnimationType() != PlayerAnimationType.ARM_SWING)
try
{
return;
final Location otarget = LocationUtil.getTarget(user.getBase());
ess.scheduleSyncDelayedTask(
new Runnable()
{
@Override
public void run()
{
Location loc = user.getLocation();
loc.setX(otarget.getX());
loc.setZ(otarget.getZ());
while (LocationUtil.isBlockDamaging(loc.getWorld(), loc.getBlockX(), loc.getBlockY() - 1, loc.getBlockZ()))
{
loc.setY(loc.getY() + 1d);
}
user.getBase().teleport(loc, TeleportCause.PLUGIN);
}
});
}
final User user = ess.getUser(event.getPlayer());
final ItemStack is = user.getItemInHand();
if (is == null || is.getType() == Material.AIR || !user.arePowerToolsEnabled())
catch (Exception ex)
{
return;
if (ess.getSettings().isDebug())
{
LOGGER.log(Level.WARNING, ex.getMessage(), ex);
}
}
final List<String> commandList = user.getPowertool(is);
}
private boolean usePowertools(final User user, final int id)
{
final List<String> commandList = user.getPowertool(id);
if (commandList == null || commandList.isEmpty())
{
return;
return false;
}
boolean used = false;
// We need to loop through each command and execute
for (String command : commandList)
for (final String command : commandList)
{
if (command.matches(".*\\{player\\}.*"))
if (command.contains("{player}"))
{
//user.sendMessage("Click a player to use this command");
continue;
}
else if (command.startsWith("c:"))
{
for (Player p : server.getOnlinePlayers())
{
p.sendMessage(user.getDisplayName() + ":" + command.substring(2));
}
used = true;
user.getBase().chat(command.substring(2));
}
else
{
user.getServer().dispatchCommand(event.getPlayer(), command);
used = true;
ess.scheduleSyncDelayedTask(
new Runnable()
{
@Override
public void run()
{
user.getServer().dispatchCommand(user.getBase(), command);
LOGGER.log(Level.INFO, String.format("[PT] %s issued server command: /%s", user.getName(), command));
}
});
}
}
return used;
}
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onPlayerPickupItem(final PlayerPickupItemEvent event)
{
if (ess.getSettings().getDisableItemPickupWhileAfk())
{
if (ess.getUser(event.getPlayer()).isAfk())
{
event.setCancelled(true);
}
}
}
@Override
public void onPlayerCommandPreprocess(final PlayerCommandPreprocessEvent event)
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onInventoryClickEvent(final InventoryClickEvent event)
{
if (event.isCancelled())
Player refreshPlayer = null;
final Inventory top = event.getView().getTopInventory();
final InventoryType type = top.getType();
if (type == InventoryType.PLAYER)
{
return;
}
final User user = ess.getUser(event.getPlayer());
final String cmd = event.getMessage().toLowerCase().split(" ")[0].replace("/", "").toLowerCase();
final List<String> commands = Arrays.asList("msg", "r", "mail", "m", "t", "emsg", "tell", "er", "reply", "ereply", "email");
if (commands.contains(cmd))
{
for (Player player : ess.getServer().getOnlinePlayers())
final User user = ess.getUser((Player)event.getWhoClicked());
final InventoryHolder invHolder = top.getHolder();
if (invHolder != null && invHolder instanceof HumanEntity)
{
User spyer = ess.getUser(player);
if (spyer.isSocialSpyEnabled() && !user.equals(spyer))
final User invOwner = ess.getUser((Player)invHolder);
if (user.isInvSee() && (!user.isAuthorized("essentials.invsee.modify")
|| invOwner.isAuthorized("essentials.invsee.preventmodify")
|| !invOwner.getBase().isOnline()))
{
player.sendMessage(user.getDisplayName() + " : " + event.getMessage());
event.setCancelled(true);
refreshPlayer = user.getBase();
}
}
}
if (!cmd.equalsIgnoreCase("afk"))
else if (type == InventoryType.ENDER_CHEST)
{
user.updateActivity(true);
final User user = ess.getUser((Player)event.getWhoClicked());
if (user.isEnderSee() && (!user.isAuthorized("essentials.enderchest.modify")))
{
event.setCancelled(true);
refreshPlayer = user.getBase();
}
}
else if (type == InventoryType.WORKBENCH)
{
User user = ess.getUser((Player)event.getWhoClicked());
if (user.isRecipeSee())
{
event.setCancelled(true);
refreshPlayer = user.getBase();
}
}
else if (type == InventoryType.CHEST && top.getSize() == 9)
{
final User user = ess.getUser((Player)event.getWhoClicked());
final InventoryHolder invHolder = top.getHolder();
if (invHolder != null && invHolder instanceof HumanEntity && user.isInvSee())
{
event.setCancelled(true);
refreshPlayer = user.getBase();
}
}
if (refreshPlayer != null)
{
final Player player = refreshPlayer;
ess.scheduleSyncDelayedTask(new Runnable()
{
@Override
public void run()
{
player.updateInventory();
}
}, 1);
}
}
@EventHandler(priority = EventPriority.MONITOR)
public void onInventoryCloseEvent(final InventoryCloseEvent event)
{
Player refreshPlayer = null;
final Inventory top = event.getView().getTopInventory();
final InventoryType type = top.getType();
if (type == InventoryType.PLAYER)
{
final User user = ess.getUser((Player)event.getPlayer());
user.setInvSee(false);
refreshPlayer = user.getBase();
}
else if (type == InventoryType.ENDER_CHEST)
{
final User user = ess.getUser((Player)event.getPlayer());
user.setEnderSee(false);
refreshPlayer = user.getBase();
}
else if (type == InventoryType.WORKBENCH)
{
final User user = ess.getUser((Player)event.getPlayer());
if (user.isRecipeSee())
{
user.setRecipeSee(false);
event.getView().getTopInventory().clear();
refreshPlayer = user.getBase();
}
}
else if (type == InventoryType.CHEST && top.getSize() == 9)
{
final InventoryHolder invHolder = top.getHolder();
if (invHolder != null && invHolder instanceof HumanEntity)
{
final User user = ess.getUser((Player)event.getPlayer());
user.setInvSee(false);
refreshPlayer = user.getBase();
}
}
if (refreshPlayer != null)
{
final Player player = refreshPlayer;
ess.scheduleSyncDelayedTask(new Runnable()
{
@Override
public void run()
{
player.updateInventory();
}
}, 1);
}
}
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onPlayerFishEvent(final PlayerFishEvent event)
{
final User user = ess.getUser(event.getPlayer());
user.updateActivity(true);
}
}

View File

@@ -1,41 +1,58 @@
package com.earth2me.essentials;
import com.earth2me.essentials.perm.PermissionsHandler;
import com.earth2me.essentials.register.payment.Methods;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.ess3.api.IEssentials;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.server.PluginDisableEvent;
import org.bukkit.event.server.PluginEnableEvent;
import org.bukkit.event.server.ServerListener;
public class EssentialsPluginListener extends ServerListener implements IConf
public class EssentialsPluginListener implements Listener, IConf
{
private final transient IEssentials ess;
private static final Logger LOGGER = Logger.getLogger("Minecraft");
public EssentialsPluginListener(final IEssentials ess)
{
this.ess = ess;
}
@Override
@EventHandler(priority = EventPriority.MONITOR)
public void onPluginEnable(final PluginEnableEvent event)
{
ess.getPermissionsHandler().checkPermissions();
if (!ess.getPaymentMethod().hasMethod() && ess.getPaymentMethod().setMethod(ess.getServer().getPluginManager()))
if (event.getPlugin().getName().equals("EssentialsChat"))
{
LOGGER.log(Level.INFO, "[Essentials] Payment method found (" + ess.getPaymentMethod().getMethod().getName() + " version: " + ess.getPaymentMethod().getMethod().getVersion() + ")");
ess.getSettings().setEssentialsChatActive(true);
}
ess.getPermissionsHandler().checkPermissions();
ess.getAlternativeCommandsHandler().addPlugin(event.getPlugin());
if (!Methods.hasMethod() && Methods.setMethod(ess.getServer().getPluginManager()))
{
ess.getLogger().log(Level.INFO, "Payment method found (" + Methods.getMethod().getLongName() + " version: " + ess.getPaymentMethod().getMethod().getVersion() + ")");
}
}
@Override
@EventHandler(priority = EventPriority.MONITOR)
public void onPluginDisable(final PluginDisableEvent event)
{
ess.getPermissionsHandler().checkPermissions();
if (event.getPlugin().getName().equals("EssentialsChat"))
{
ess.getSettings().setEssentialsChatActive(false);
}
PermissionsHandler permHandler = ess.getPermissionsHandler();
if (permHandler != null)
{
permHandler.checkPermissions();
}
ess.getAlternativeCommandsHandler().removePlugin(event.getPlugin());
// Check to see if the plugin thats being disabled is the one we are using
if (ess.getPaymentMethod() != null && ess.getPaymentMethod().hasMethod() && ess.getPaymentMethod().checkDisabled(event.getPlugin()))
if (ess.getPaymentMethod() != null && Methods.hasMethod() && Methods.checkDisabled(event.getPlugin()))
{
ess.getPaymentMethod().reset();
LOGGER.log(Level.INFO, "[Essentials] Payment method was disabled. No longer accepting payments.");
ess.getLogger().log(Level.INFO, "Payment method was disabled. No longer accepting payments.");
}
}

View File

@@ -2,44 +2,124 @@ package com.earth2me.essentials;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Set;
import java.util.UUID;
import java.util.logging.Level;
import net.ess3.api.IEssentials;
import org.bukkit.entity.Player;
public class EssentialsTimer implements Runnable
{
private final transient IEssentials ess;
private final transient Set<User> onlineUsers = new HashSet<User>();
private final transient Set<UUID> onlineUsers = new HashSet<UUID>();
private transient long lastPoll = System.nanoTime();
private final LinkedList<Double> history = new LinkedList<Double>();
private int skip1 = 0;
private int skip2 = 0;
private final long maxTime = 10 * 1000000;
private final long tickInterval = 50;
EssentialsTimer(final IEssentials ess)
{
this.ess = ess;
history.add(20d);
}
@Override
public void run()
{
final long startTime = System.nanoTime();
final long currentTime = System.currentTimeMillis();
long timeSpent = (startTime - lastPoll) / 1000;
if (timeSpent == 0)
{
timeSpent = 1;
}
if (history.size() > 10)
{
history.remove();
}
double tps = tickInterval * 1000000.0 / timeSpent;
if (tps <= 21)
{
history.add(tps);
}
lastPoll = startTime;
int count = 0;
for (Player player : ess.getServer().getOnlinePlayers())
{
final User user = ess.getUser(player);
onlineUsers.add(user);
user.setLastOnlineActivity(currentTime);
user.checkActivity();
count++;
if (skip1 > 0)
{
skip1--;
continue;
}
if (count % 10 == 0)
{
if (System.nanoTime() - startTime > maxTime / 2)
{
skip1 = count - 1;
break;
}
}
try
{
final User user = ess.getUser(player);
onlineUsers.add(user.getBase().getUniqueId());
user.setLastOnlineActivity(currentTime);
user.checkActivity();
}
catch (Exception e)
{
ess.getLogger().log(Level.WARNING, "EssentialsTimer Error:", e);
}
}
final Iterator<User> iterator = onlineUsers.iterator();
count = 0;
final Iterator<UUID> iterator = onlineUsers.iterator();
while (iterator.hasNext())
{
final User user = iterator.next();
count++;
if (skip2 > 0)
{
skip2--;
continue;
}
if (count % 10 == 0)
{
if (System.nanoTime() - startTime > maxTime)
{
skip2 = count - 1;
break;
}
}
final User user = ess.getUser(iterator.next());
if (user.getLastOnlineActivity() < currentTime && user.getLastOnlineActivity() > user.getLastLogout())
{
user.setLastLogout(user.getLastOnlineActivity());
if (!user.isHidden()) {
user.setLastLogout(user.getLastOnlineActivity());
}
iterator.remove();
continue;
}
user.checkMuteTimeout(currentTime);
user.checkJailTimeout(currentTime);
user.resetInvulnerabilityAfterTeleport();
}
}
public double getAverageTPS()
{
double avg = 0;
for (Double f : history)
{
if (f != null)
{
avg += f;
}
}
return avg / history.size();
}
}

View File

@@ -1,33 +1,27 @@
package com.earth2me.essentials;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.craftbukkit.FakeWorld;
import com.earth2me.essentials.settings.Spawns;
import com.earth2me.essentials.storage.YamlStorageWriter;
import com.earth2me.essentials.utils.StringUtil;
import com.google.common.base.Charsets;
import java.io.*;
import java.math.BigInteger;
import java.security.DigestInputStream;
import java.security.MessageDigest;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.ess3.api.IEssentials;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.inventory.ItemStack;
public class EssentialsUpgrade
{
private final static Logger LOGGER = Logger.getLogger("Minecraft");
private final static Logger LOGGER = Logger.getLogger("Essentials");
private final transient IEssentials ess;
private final transient EssentialsConf doneFile;
@@ -42,14 +36,19 @@ public class EssentialsUpgrade
doneFile.load();
}
private void moveWorthValuesToWorthYml()
private void moveMotdRulesToFile(String name)
{
if (doneFile.getBoolean("moveWorthValuesToWorthYml", false))
if (doneFile.getBoolean("move" + name + "ToFile", false))
{
return;
}
try
{
final File file = new File(ess.getDataFolder(), name + ".txt");
if (file.exists())
{
return;
}
final File configFile = new File(ess.getDataFolder(), "config.yml");
if (!configFile.exists())
{
@@ -57,28 +56,27 @@ public class EssentialsUpgrade
}
final EssentialsConf conf = new EssentialsConf(configFile);
conf.load();
final Worth worth = new Worth(ess.getDataFolder());
boolean found = false;
for (Material mat : Material.values())
List<String> lines = conf.getStringList(name);
if (lines != null && !lines.isEmpty())
{
final int id = mat.getId();
final double value = conf.getDouble("worth-" + id, Double.NaN);
if (!Double.isNaN(value))
if (!file.createNewFile())
{
found = true;
worth.setPrice(new ItemStack(mat, 1, (short)0, (byte)0), value);
throw new IOException("Failed to create file " + file);
}
PrintWriter writer = new PrintWriter(file);
for (String line : lines)
{
writer.println(line);
}
writer.close();
}
if (found)
{
removeLinesFromConfig(configFile, "\\s*#?\\s*worth-[0-9]+.*", "# Worth values have been moved to worth.yml");
}
doneFile.setProperty("moveWorthValuesToWorthYml", true);
doneFile.setProperty("move" + name + "ToFile", true);
doneFile.save();
}
catch (Throwable e)
catch (IOException e)
{
LOGGER.log(Level.SEVERE, Util.i18n("upgradingFilesError"), e);
LOGGER.log(Level.SEVERE, tl("upgradingFilesError"), e);
}
}
@@ -128,11 +126,11 @@ public class EssentialsUpgrade
{
if (!file.renameTo(new File(file.getParentFile(), file.getName().concat("." + System.currentTimeMillis() + ".upgradebackup"))))
{
throw new Exception(Util.i18n("configFileMoveError"));
throw new Exception(tl("configFileMoveError"));
}
if (!tempFile.renameTo(file))
{
throw new Exception(Util.i18n("configFileRenameError"));
throw new Exception(tl("configFileRenameError"));
}
}
else
@@ -141,73 +139,6 @@ public class EssentialsUpgrade
}
}
private void updateUsersToNewDefaultHome()
{
if (doneFile.getBoolean("updateUsersToNewDefaultHome", false))
{
return;
}
final File userdataFolder = new File(ess.getDataFolder(), "userdata");
if (!userdataFolder.exists() || !userdataFolder.isDirectory())
{
return;
}
final File[] userFiles = userdataFolder.listFiles();
for (File file : userFiles)
{
if (!file.isFile() || !file.getName().endsWith(".yml"))
{
continue;
}
final EssentialsConf config = new EssentialsConf(file);
try
{
config.load();
if (config.hasProperty("home") && !config.hasProperty("home.default"))
{
@SuppressWarnings("unchecked")
final List<Object> vals = (List<Object>)config.getProperty("home");
if (vals == null)
{
continue;
}
World world = ess.getServer().getWorlds().get(0);
if (vals.size() > 5)
{
world = ess.getServer().getWorld((String)vals.get(5));
}
if (world != null)
{
final Location loc = new Location(
world,
((Number)vals.get(0)).doubleValue(),
((Number)vals.get(1)).doubleValue(),
((Number)vals.get(2)).doubleValue(),
((Number)vals.get(3)).floatValue(),
((Number)vals.get(4)).floatValue());
final String worldName = world.getName().toLowerCase();
if (worldName != null && !worldName.isEmpty())
{
config.removeProperty("home");
config.setProperty("home.default", worldName);
config.setProperty("home.worlds." + worldName, loc);
config.save();
}
}
}
}
catch (RuntimeException ex)
{
LOGGER.log(Level.INFO, "File: " + file.toString());
throw ex;
}
}
doneFile.setProperty("updateUsersToNewDefaultHome", true);
doneFile.save();
}
private void updateUsersPowerToolsFormat()
{
if (doneFile.getBoolean("updateUsersPowerToolsFormat", false))
@@ -234,21 +165,21 @@ public class EssentialsUpgrade
if (config.hasProperty("powertools"))
{
@SuppressWarnings("unchecked")
final Map<Integer, Object> powertools = (Map<Integer, Object>)config.getProperty("powertools");
final Map<String, Object> powertools = config.getConfigurationSection("powertools").getValues(false);
if (powertools == null)
{
continue;
}
for (Map.Entry<Integer, Object> entry : powertools.entrySet())
for (Map.Entry<String, Object> entry : powertools.entrySet())
{
if (entry.getValue() instanceof String)
{
List<String> temp = new ArrayList<String>();
temp.add((String)entry.getValue());
((Map<Integer, Object>)powertools).put(entry.getKey(), temp);
((Map<String, Object>)powertools).put(entry.getKey(), temp);
}
}
config.save();
config.forceSave();
}
}
catch (RuntimeException ex)
@@ -295,7 +226,7 @@ public class EssentialsUpgrade
config.setProperty("homes.home", defloc);
}
List<String> worlds = config.getKeys("home.worlds");
Set<String> worlds = config.getConfigurationSection("home.worlds").getKeys(false);
Location loc;
String worldName;
@@ -314,14 +245,14 @@ public class EssentialsUpgrade
{
continue;
}
worldName = loc.getWorld().getName().toLowerCase();
worldName = loc.getWorld().getName().toLowerCase(Locale.ENGLISH);
if (worldName != null && !worldName.isEmpty())
{
config.setProperty("homes." + worldName, loc);
}
}
config.removeProperty("home");
config.save();
config.forceSave();
}
}
@@ -335,195 +266,6 @@ public class EssentialsUpgrade
doneFile.save();
}
private void moveUsersDataToUserdataFolder()
{
final File usersFile = new File(ess.getDataFolder(), "users.yml");
if (!usersFile.exists())
{
return;
}
final EssentialsConf usersConfig = new EssentialsConf(usersFile);
usersConfig.load();
for (String username : usersConfig.getKeys(null))
{
final User user = new User(new OfflinePlayer(username, ess), ess);
final String nickname = usersConfig.getString(username + ".nickname");
if (nickname != null && !nickname.isEmpty() && !nickname.equals(username))
{
user.setNickname(nickname);
}
final List<String> mails = usersConfig.getStringList(username + ".mail", null);
if (mails != null && !mails.isEmpty())
{
user.setMails(mails);
}
if (!user.hasHome())
{
@SuppressWarnings("unchecked")
final List<Object> vals = (List<Object>)usersConfig.getProperty(username + ".home");
if (vals != null)
{
World world = ess.getServer().getWorlds().get(0);
if (vals.size() > 5)
{
world = getFakeWorld((String)vals.get(5));
}
if (world != null)
{
user.setHome("home", new Location(world,
((Number)vals.get(0)).doubleValue(),
((Number)vals.get(1)).doubleValue(),
((Number)vals.get(2)).doubleValue(),
((Number)vals.get(3)).floatValue(),
((Number)vals.get(4)).floatValue()));
}
}
}
}
usersFile.renameTo(new File(usersFile.getAbsolutePath() + ".old"));
}
private void convertWarps()
{
final File warpsFolder = new File(ess.getDataFolder(), "warps");
if (!warpsFolder.exists())
{
warpsFolder.mkdirs();
}
final File[] listOfFiles = warpsFolder.listFiles();
if (listOfFiles.length >= 1)
{
for (int i = 0; i < listOfFiles.length; i++)
{
final String filename = listOfFiles[i].getName();
if (listOfFiles[i].isFile() && filename.endsWith(".dat"))
{
try
{
final BufferedReader rx = new BufferedReader(new FileReader(listOfFiles[i]));
double x, y, z;
float yaw, pitch;
String worldName;
try
{
if (!rx.ready())
{
continue;
}
x = Double.parseDouble(rx.readLine().trim());
if (!rx.ready())
{
continue;
}
y = Double.parseDouble(rx.readLine().trim());
if (!rx.ready())
{
continue;
}
z = Double.parseDouble(rx.readLine().trim());
if (!rx.ready())
{
continue;
}
yaw = Float.parseFloat(rx.readLine().trim());
if (!rx.ready())
{
continue;
}
pitch = Float.parseFloat(rx.readLine().trim());
worldName = rx.readLine();
}
finally
{
rx.close();
}
World w = null;
for (World world : ess.getServer().getWorlds())
{
if (world.getEnvironment() != World.Environment.NETHER)
{
w = world;
break;
}
}
if (worldName != null)
{
worldName = worldName.trim();
World w1 = null;
w1 = getFakeWorld(worldName);
if (w1 != null)
{
w = w1;
}
}
final Location loc = new Location(w, x, y, z, yaw, pitch);
ess.getWarps().setWarp(filename.substring(0, filename.length() - 4), loc);
if (!listOfFiles[i].renameTo(new File(warpsFolder, filename + ".old")))
{
throw new Exception(Util.format("fileRenameError", filename));
}
}
catch (Exception ex)
{
LOGGER.log(Level.SEVERE, null, ex);
}
}
}
}
final File warpFile = new File(ess.getDataFolder(), "warps.txt");
if (warpFile.exists())
{
try
{
final BufferedReader rx = new BufferedReader(new FileReader(warpFile));
try
{
for (String[] parts = new String[0]; rx.ready(); parts = rx.readLine().split(":"))
{
if (parts.length < 6)
{
continue;
}
final String name = parts[0];
final double x = Double.parseDouble(parts[1].trim());
final double y = Double.parseDouble(parts[2].trim());
final double z = Double.parseDouble(parts[3].trim());
final float yaw = Float.parseFloat(parts[4].trim());
final float pitch = Float.parseFloat(parts[5].trim());
if (name.isEmpty())
{
continue;
}
World w = null;
for (World world : ess.getServer().getWorlds())
{
if (world.getEnvironment() != World.Environment.NETHER)
{
w = world;
break;
}
}
final Location loc = new Location(w, x, y, z, yaw, pitch);
ess.getWarps().setWarp(name, loc);
if (!warpFile.renameTo(new File(ess.getDataFolder(), "warps.txt.old")))
{
throw new Exception(Util.format("fileRenameError", "warps.txt"));
}
}
}
finally
{
rx.close();
}
}
catch (Exception ex)
{
LOGGER.log(Level.SEVERE, null, ex);
}
}
}
private void sanitizeAllUserFilenames()
{
if (doneFile.getBoolean("sanitizeAllUserFilenames", false))
@@ -536,33 +278,33 @@ public class EssentialsUpgrade
return;
}
final File[] listOfFiles = usersFolder.listFiles();
for (int i = 0; i < listOfFiles.length; i++)
for (File listOfFile : listOfFiles)
{
final String filename = listOfFiles[i].getName();
if (!listOfFiles[i].isFile() || !filename.endsWith(".yml"))
final String filename = listOfFile.getName();
if (!listOfFile.isFile() || !filename.endsWith(".yml"))
{
continue;
}
final String sanitizedFilename = Util.sanitizeFileName(filename.substring(0, filename.length() - 4)) + ".yml";
final String sanitizedFilename = StringUtil.sanitizeFileName(filename.substring(0, filename.length() - 4)) + ".yml";
if (sanitizedFilename.equals(filename))
{
continue;
}
final File tmpFile = new File(listOfFiles[i].getParentFile(), sanitizedFilename + ".tmp");
final File newFile = new File(listOfFiles[i].getParentFile(), sanitizedFilename);
if (!listOfFiles[i].renameTo(tmpFile))
final File tmpFile = new File(listOfFile.getParentFile(), sanitizedFilename + ".tmp");
final File newFile = new File(listOfFile.getParentFile(), sanitizedFilename);
if (!listOfFile.renameTo(tmpFile))
{
LOGGER.log(Level.WARNING, Util.format("userdataMoveError", filename, sanitizedFilename));
LOGGER.log(Level.WARNING, tl("userdataMoveError", filename, sanitizedFilename));
continue;
}
if (newFile.exists())
{
LOGGER.log(Level.WARNING, Util.format("duplicatedUserdata", filename, sanitizedFilename));
LOGGER.log(Level.WARNING, tl("duplicatedUserdata", filename, sanitizedFilename));
continue;
}
if (!tmpFile.renameTo(newFile))
{
LOGGER.log(Level.WARNING, Util.format("userdataMoveBackError", sanitizedFilename, sanitizedFilename));
LOGGER.log(Level.WARNING, tl("userdataMoveBackError", sanitizedFilename, sanitizedFilename));
}
}
doneFile.setProperty("sanitizeAllUserFilenames", true);
@@ -647,23 +389,291 @@ public class EssentialsUpgrade
}
}
private void updateSpawnsToNewSpawnsConfig()
{
if (doneFile.getBoolean("updateSpawnsToNewSpawnsConfig", false))
{
return;
}
final File configFile = new File(ess.getDataFolder(), "spawn.yml");
if (configFile.exists())
{
final EssentialsConf config = new EssentialsConf(configFile);
try
{
config.load();
if (!config.hasProperty("spawns"))
{
final Spawns spawns = new Spawns();
Set<String> keys = config.getKeys(false);
for (String group : keys)
{
Location loc = getFakeLocation(config, group);
spawns.getSpawns().put(group.toLowerCase(Locale.ENGLISH), loc);
}
if (!configFile.renameTo(new File(ess.getDataFolder(), "spawn.yml.old")))
{
throw new Exception(tl("fileRenameError", "spawn.yml"));
}
PrintWriter writer = new PrintWriter(configFile);
try
{
new YamlStorageWriter(writer).save(spawns);
}
finally
{
writer.close();
}
}
}
catch (Exception ex)
{
Bukkit.getLogger().log(Level.SEVERE, ex.getMessage(), ex);
}
}
doneFile.setProperty("updateSpawnsToNewSpawnsConfig", true);
doneFile.save();
}
private void updateJailsToNewJailsConfig()
{
if (doneFile.getBoolean("updateJailsToNewJailsConfig", false))
{
return;
}
final File configFile = new File(ess.getDataFolder(), "jail.yml");
if (configFile.exists())
{
final EssentialsConf config = new EssentialsConf(configFile);
try
{
config.load();
if (!config.hasProperty("jails"))
{
final com.earth2me.essentials.settings.Jails jails = new com.earth2me.essentials.settings.Jails();
Set<String> keys = config.getKeys(false);
for (String jailName : keys)
{
Location loc = getFakeLocation(config, jailName);
jails.getJails().put(jailName.toLowerCase(Locale.ENGLISH), loc);
}
if (!configFile.renameTo(new File(ess.getDataFolder(), "jail.yml.old")))
{
throw new Exception(tl("fileRenameError", "jail.yml"));
}
PrintWriter writer = new PrintWriter(configFile);
try
{
new YamlStorageWriter(writer).save(jails);
}
finally
{
writer.close();
}
}
}
catch (Exception ex)
{
Bukkit.getLogger().log(Level.SEVERE, ex.getMessage(), ex);
}
}
doneFile.setProperty("updateJailsToNewJailsConfig", true);
doneFile.save();
}
private void warnMetrics()
{
if (doneFile.getBoolean("warnMetrics", false))
{
return;
}
ess.getSettings().setMetricsEnabled(false);
doneFile.setProperty("warnMetrics", true);
doneFile.save();
}
private void uuidFileChange()
{
if (doneFile.getBoolean("uuidFileChange", false))
{
return;
}
final File userdir = new File(ess.getDataFolder(), "userdata");
if (!userdir.exists())
{
return;
}
int countFiles = 0;
int countReqFiles = 0;
for (String string : userdir.list())
{
if (!string.endsWith(".yml") || string.length() < 5)
{
continue;
}
countFiles++;
final String name = string.substring(0, string.length() - 4);
UUID uuid = null;
try
{
uuid = UUID.fromString(name);
}
catch (IllegalArgumentException ex)
{
countReqFiles++;
}
if (countFiles > 100)
{
break;
}
}
if (countReqFiles < 1)
{
return;
}
ess.getLogger().info("#### Starting Essentials UUID userdata conversion in a few seconds. ####");
ess.getLogger().info("We recommend you take a backup of your server before upgrading from the old username system.");
try
{
Thread.sleep(10000);
}
catch (InterruptedException ex)
{
// NOOP
}
uuidFileConvert(ess);
doneFile.setProperty("uuidFileChange", true);
doneFile.save();
}
public static void uuidFileConvert(IEssentials ess)
{
ess.getLogger().info("Starting Essentials UUID userdata conversion");
final File userdir = new File(ess.getDataFolder(), "userdata");
if (!userdir.exists())
{
return;
}
int countFiles = 0;
int countFails = 0;
int countEssCache = 0;
int countBukkit = 0;
ess.getLogger().info("Found " + userdir.list().length + " files to convert...");
for (String string : userdir.list())
{
if (!string.endsWith(".yml") || string.length() < 5)
{
continue;
}
final int showProgress = countFiles % 250;
if (showProgress == 0)
{
ess.getUserMap().getUUIDMap().forceWriteUUIDMap();
ess.getLogger().info("Converted " + countFiles + "/" + userdir.list().length);
}
countFiles++;
final String name = string.substring(0, string.length() - 4);
EssentialsUserConf config;
UUID uuid = null;
try
{
uuid = UUID.fromString(name);
}
catch (IllegalArgumentException ex)
{
File file = new File(userdir, string);
EssentialsConf conf = new EssentialsConf(file);
conf.load();
conf.setProperty("lastAccountName", name);
conf.save();
String uuidString = conf.getString("uuid", null);
for (int i = 0; i < 4; i++)
{
try
{
uuid = UUID.fromString(uuidString);
countEssCache++;
break;
}
catch (Exception ex2)
{
if (conf.getBoolean("npc", false))
{
uuid = UUID.nameUUIDFromBytes(("NPC:" + name).getBytes(Charsets.UTF_8));
break;
}
org.bukkit.OfflinePlayer player = ess.getServer().getOfflinePlayer(name);
uuid = player.getUniqueId();
}
if (uuid != null)
{
countBukkit++;
break;
}
}
if (uuid != null)
{
conf.forceSave();
config = new EssentialsUserConf(name, uuid, new File(userdir, uuid + ".yml"));
config.convertLegacyFile();
ess.getUserMap().trackUUID(uuid, name);
continue;
}
countFails++;
}
}
ess.getUserMap().getUUIDMap().forceWriteUUIDMap();
ess.getLogger().info("Converted " + countFiles + "/" + countFiles + ". Conversion complete.");
ess.getLogger().info("Converted via cache: " + countEssCache + " :: Converted via lookup: " + countBukkit + " :: Failed to convert: " + countFails);
ess.getLogger().info("To rerun the conversion type /essentials uuidconvert");
}
public void beforeSettings()
{
if (!ess.getDataFolder().exists())
{
ess.getDataFolder().mkdirs();
}
moveWorthValuesToWorthYml();
moveMotdRulesToFile("motd");
moveMotdRulesToFile("rules");
}
public void afterSettings()
{
sanitizeAllUserFilenames();
updateUsersToNewDefaultHome();
moveUsersDataToUserdataFolder();
convertWarps();
updateUsersPowerToolsFormat();
updateUsersHomesFormat();
deleteOldItemsCsv();
updateSpawnsToNewSpawnsConfig();
updateJailsToNewJailsConfig();
uuidFileChange();
warnMetrics();
}
}

View File

@@ -0,0 +1,76 @@
package com.earth2me.essentials;
import com.google.common.base.Charsets;
import com.google.common.io.Files;
import java.io.File;
import java.io.IOException;
import java.util.Locale;
import java.util.UUID;
import java.util.logging.Level;
import org.bukkit.Bukkit;
public class EssentialsUserConf extends EssentialsConf
{
final String username;
final UUID uuid;
public EssentialsUserConf(final String username, final UUID uuid, final File configFile)
{
super(configFile);
this.username = username;
this.uuid = uuid;
}
@Override
public boolean legacyFileExists()
{
final File file = new File(configFile.getParentFile(), username + ".yml");
return file.exists();
}
@Override
public void convertLegacyFile()
{
final File file = new File(configFile.getParentFile(), username + ".yml");
try
{
Files.move(file, new File(configFile.getParentFile(), uuid + ".yml"));
}
catch (IOException ex)
{
Bukkit.getLogger().log(Level.WARNING, "Failed to migrate user: " + username, ex);
}
setProperty("lastAccountName", username);
}
private File getAltFile()
{
final UUID fn = UUID.nameUUIDFromBytes(("OfflinePlayer:" + username.toLowerCase(Locale.ENGLISH)).getBytes(Charsets.UTF_8));
return new File(configFile.getParentFile(), fn.toString() + ".yml");
}
@Override
public boolean altFileExists()
{
if (username.equals(username.toLowerCase()))
{
return false;
}
return getAltFile().exists();
}
@Override
public void convertAltFile()
{
try
{
Files.move(getAltFile(), new File(configFile.getParentFile(), uuid + ".yml"));
}
catch (IOException ex)
{
Bukkit.getLogger().log(Level.WARNING, "Failed to migrate user: " + username, ex);
}
}
}

View File

@@ -1,12 +1,17 @@
package com.earth2me.essentials;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
public class ExecuteTimer
{
private final List<ExecuteRecord> times;
private final transient List<ExecuteRecord> times;
private final transient DecimalFormat decimalFormat = new DecimalFormat("#0.000", DecimalFormatSymbols.getInstance(Locale.US));
public ExecuteTimer()
{
@@ -24,7 +29,7 @@ public class ExecuteTimer
{
if (!times.isEmpty() || "start".equals(label))
{
times.add(new ExecuteRecord(label, System.currentTimeMillis()));
times.add(new ExecuteRecord(label, System.nanoTime()));
}
}
@@ -36,7 +41,7 @@ public class ExecuteTimer
long time0 = 0;
long time1 = 0;
long time2 = 0;
long duration;
double duration;
for (ExecuteRecord pair : times)
{
@@ -44,8 +49,8 @@ public class ExecuteTimer
time2 = (Long)pair.getTime();
if (time1 > 0)
{
duration = time2 - time1;
output.append(mark).append(": ").append(duration).append("ms - ");
duration = (time2 - time1)/1000000.0;
output.append(mark).append(": ").append(decimalFormat.format(duration)).append("ms - ");
}
else
{
@@ -53,14 +58,14 @@ public class ExecuteTimer
}
time1 = time2;
}
duration = time1 - time0;
output.append("Total: ").append(duration).append("ms");
duration = (time1 - time0)/1000000.0;
output.append("Total: ").append(decimalFormat.format(duration)).append("ms");
times.clear();
return output.toString();
}
static private class ExecuteRecord
private static class ExecuteRecord
{
private final String mark;
private final long time;

View File

@@ -1,190 +0,0 @@
package com.earth2me.essentials;
import java.util.HashMap;
import org.bukkit.Material;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
public class FakeInventory implements Inventory
{
ItemStack[] items;
public FakeInventory(ItemStack[] items)
{
this.items = new ItemStack[items.length];
for (int i = 0; i < items.length; i++)
{
if (items[i] == null)
{
continue;
}
this.items[i] = new ItemStack(items[i].getTypeId(), items[i].getAmount(), items[i].getDurability());
}
}
@Override
public int getSize()
{
return items.length;
}
@Override
public String getName()
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public ItemStack getItem(int i)
{
return items[i];
}
@Override
public void setItem(int i, ItemStack is)
{
items[i] = is;
}
@Override
public HashMap<Integer, ItemStack> addItem(ItemStack... iss)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public HashMap<Integer, ItemStack> removeItem(ItemStack... iss)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public ItemStack[] getContents()
{
return items;
}
@Override
public void setContents(ItemStack[] iss)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public boolean contains(int i)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public boolean contains(Material mtrl)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public boolean contains(ItemStack is)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public boolean contains(int i, int i1)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public boolean contains(Material mtrl, int i)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public boolean contains(ItemStack is, int i)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public HashMap<Integer, ? extends ItemStack> all(int i)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public HashMap<Integer, ? extends ItemStack> all(Material mtrl)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public HashMap<Integer, ? extends ItemStack> all(ItemStack is)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public int first(int i)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public int first(Material mtrl)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public int first(ItemStack is)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public int firstEmpty()
{
for (int i = 0; i < items.length; i++)
{
if (items[i] == null || items[i].getTypeId() == 0) {
return i;
}
}
return -1;
}
@Override
public void remove(int i)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void remove(Material mtrl)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void remove(ItemStack is)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void clear(int i)
{
items[i] = null;
}
@Override
public void clear()
{
for (int i = 0; i < items.length; i++)
{
items[i] = null;
}
}
}

View File

@@ -0,0 +1,189 @@
package com.earth2me.essentials;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.text.MessageFormat;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Pattern;
import net.ess3.api.IEssentials;
public class I18n implements net.ess3.api.II18n
{
private static I18n instance;
private static final String MESSAGES = "messages";
private final transient Locale defaultLocale = Locale.getDefault();
private transient Locale currentLocale = defaultLocale;
private transient ResourceBundle customBundle;
private transient ResourceBundle localeBundle;
private final transient ResourceBundle defaultBundle;
private final transient Map<String, MessageFormat> messageFormatCache = new HashMap<String, MessageFormat>();
private final transient IEssentials ess;
private static final Pattern NODOUBLEMARK = Pattern.compile("''");
public I18n(final IEssentials ess)
{
this.ess = ess;
customBundle = ResourceBundle.getBundle(MESSAGES, defaultLocale, new FileResClassLoader(I18n.class.getClassLoader(), ess));
localeBundle = ResourceBundle.getBundle(MESSAGES, defaultLocale);
defaultBundle = ResourceBundle.getBundle(MESSAGES, Locale.ENGLISH);
}
public void onEnable()
{
instance = this;
}
public void onDisable()
{
instance = null;
}
@Override
public Locale getCurrentLocale()
{
return currentLocale;
}
private String translate(final String string)
{
try
{
try
{
return customBundle.getString(string);
}
catch (MissingResourceException ex)
{
return localeBundle.getString(string);
}
}
catch (MissingResourceException ex)
{
Logger.getLogger("Essentials").log(Level.WARNING, String.format("Missing translation key \"%s\" in translation file %s", ex.getKey(), localeBundle.getLocale().toString()), ex);
return defaultBundle.getString(string);
}
}
public static String tl(final String string, final Object... objects)
{
if (instance == null)
{
return "";
}
if (objects.length == 0)
{
return NODOUBLEMARK.matcher(instance.translate(string)).replaceAll("'");
}
else
{
return instance.format(string, objects);
}
}
public String format(final String string, final Object... objects)
{
String format = translate(string);
MessageFormat messageFormat = messageFormatCache.get(format);
if (messageFormat == null)
{
try
{
messageFormat = new MessageFormat(format);
}
catch (IllegalArgumentException e)
{
ess.getLogger().log(Level.SEVERE, "Invalid Translation key for '" + string + "': " + e.getMessage());
format = format.replaceAll("\\{(\\D*?)\\}", "\\[$1\\]");
messageFormat = new MessageFormat(format);
}
messageFormatCache.put(format, messageFormat);
}
return messageFormat.format(objects);
}
public void updateLocale(final String loc)
{
if (loc == null || loc.isEmpty())
{
return;
}
final String[] parts = loc.split("[_\\.]");
if (parts.length == 1)
{
currentLocale = new Locale(parts[0]);
}
if (parts.length == 2)
{
currentLocale = new Locale(parts[0], parts[1]);
}
if (parts.length == 3)
{
currentLocale = new Locale(parts[0], parts[1], parts[2]);
}
ResourceBundle.clearCache();
Logger.getLogger("Essentials").log(Level.INFO, String.format("Using locale %s", currentLocale.toString()));
customBundle = ResourceBundle.getBundle(MESSAGES, currentLocale, new FileResClassLoader(I18n.class.getClassLoader(), ess));
localeBundle = ResourceBundle.getBundle(MESSAGES, currentLocale);
}
public static String capitalCase(final String input)
{
return input == null || input.length() == 0
? input
: input.toUpperCase(Locale.ENGLISH).charAt(0)
+ input.toLowerCase(Locale.ENGLISH).substring(1);
}
private static class FileResClassLoader extends ClassLoader
{
private final transient File dataFolder;
FileResClassLoader(final ClassLoader classLoader, final IEssentials ess)
{
super(classLoader);
this.dataFolder = ess.getDataFolder();
}
@Override
public URL getResource(final String string)
{
final File file = new File(dataFolder, string);
if (file.exists())
{
try
{
return file.toURI().toURL();
}
catch (MalformedURLException ex)
{
}
}
return super.getResource(string);
}
@Override
public InputStream getResourceAsStream(final String string)
{
final File file = new File(dataFolder, string);
if (file.exists())
{
try
{
return new FileInputStream(file);
}
catch (FileNotFoundException ex)
{
}
}
return super.getResourceAsStream(string);
}
}
}

View File

@@ -1,5 +1,6 @@
package com.earth2me.essentials;
public interface IConf {
public interface IConf
{
public void reloadConfig();
}

View File

@@ -1,12 +1,20 @@
package com.earth2me.essentials;
import com.earth2me.essentials.api.IItemDb;
import com.earth2me.essentials.api.IJails;
import com.earth2me.essentials.api.IWarps;
import com.earth2me.essentials.metrics.Metrics;
import com.earth2me.essentials.perm.PermissionsHandler;
import com.earth2me.essentials.register.payment.Methods;
import java.util.List;
import java.util.UUID;
import org.bukkit.World;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitScheduler;
import org.bukkit.scheduler.BukkitTask;
public interface IEssentials extends Plugin
@@ -15,37 +23,46 @@ public interface IEssentials extends Plugin
void reload();
boolean onCommandEssentials(CommandSender sender, Command command, String commandLabel, String[] args, ClassLoader classLoader, String commandPath, String permissionPrefix);
boolean onCommandEssentials(CommandSender sender, Command command, String commandLabel, String[] args, ClassLoader classLoader, String commandPath, String permissionPrefix, IEssentialsModule module);
@Deprecated
User getUser(Object base);
User getUser(UUID base);
User getUser(String base);
User getUser(Player base);
I18n getI18n();
User getOfflineUser(String name);
World getWorld(String name);
int broadcastMessage(String message);
int broadcastMessage(IUser sender, String message);
int broadcastMessage(String permission, String message);
ISettings getSettings();
BukkitScheduler getScheduler();
String[] getMotd(CommandSender sender, String def);
IJails getJails();
String[] getLines(CommandSender sender, String node, String def);
Jail getJail();
Warps getWarps();
IWarps getWarps();
Worth getWorth();
Backup getBackup();
Spawn getSpawn();
Methods getPaymentMethod();
int scheduleAsyncDelayedTask(Runnable run);
BukkitTask runTaskAsynchronously(Runnable run);
BukkitTask runTaskLaterAsynchronously(Runnable run, long delay);
int scheduleSyncDelayedTask(Runnable run);
@@ -57,9 +74,19 @@ public interface IEssentials extends Plugin
PermissionsHandler getPermissionsHandler();
void showError(final CommandSender sender, final Throwable exception, final String commandLabel);
AlternativeCommandsHandler getAlternativeCommandsHandler();
ItemDb getItemDb();
void showError(final CommandSource sender, final Throwable exception, final String commandLabel);
IItemDb getItemDb();
UserMap getUserMap();
Metrics getMetrics();
void setMetrics(Metrics metrics);
EssentialsTimer getTimer();
List<String> getVanishedPlayers();
}

View File

@@ -0,0 +1,6 @@
package com.earth2me.essentials;
public interface IEssentialsModule
{
}

View File

@@ -1,9 +1,16 @@
package com.earth2me.essentials;
import org.bukkit.command.CommandSender;
public interface IReplyTo
{
/**
* Sets the user to reply to
* @param user
*/
public void setReplyTo(CommandSource user);
public interface IReplyTo {
public void setReplyTo(CommandSender user);
public CommandSender getReplyTo();
/**
* Gets the user the sender should reply to
* @return
*/
public CommandSource getReplyTo();
}

View File

@@ -1,45 +1,56 @@
package com.earth2me.essentials;
import com.earth2me.essentials.commands.IEssentialsCommand;
import com.earth2me.essentials.signs.EssentialsSign;
import com.earth2me.essentials.textreader.IText;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.bukkit.ChatColor;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.event.EventPriority;
public interface ISettings extends IConf
{
boolean areSignsDisabled();
String format(String format, IUser user);
String getAnnounceNewPlayerFormat(IUser user);
IText getAnnounceNewPlayerFormat();
boolean getAnnounceNewPlayers();
String getNewPlayerKit();
String getBackupCommand();
long getBackupInterval();
boolean getBedSetsHome();
String getChatFormat(String group);
int getChatRadius();
char getChatShout();
char getChatQuestion();
double getCommandCost(IEssentialsCommand cmd);
BigDecimal getCommandCost(IEssentialsCommand cmd);
double getCommandCost(String label);
BigDecimal getCommandCost(String label);
String getCurrencySymbol();
int getOversizedStackSize();
int getDefaultStackSize();
double getHealCooldown();
Object getKit(String name);
Set<String> getSocialSpyCommands();
Map<String, Object> getKits();
Map<String, Object> getKit(String name);
ConfigurationSection getKits();
String getLocale();
@@ -61,21 +72,19 @@ public interface ISettings extends IConf
String getProtectString(final String configName);
boolean getReclaimSetting();
boolean getRespawnAtHome();
List getMultipleHomes();
int getHomeLimit(String set);
int getHomeLimit(User user);
boolean getSortListByGroups();
Set getMultipleHomes();
int getHomeLimit(String set);
int getHomeLimit(User user);
int getSpawnMobLimit();
int getStartingBalance();
BigDecimal getStartingBalance();
boolean isTeleportSafetyEnabled();
double getTeleportCooldown();
@@ -89,10 +98,6 @@ public interface ISettings extends IConf
boolean isCommandOverridden(String name);
boolean isCommandRestricted(IEssentialsCommand cmd);
boolean isCommandRestricted(String label);
boolean isDebug();
boolean isEcoDisabled();
@@ -101,32 +106,38 @@ public interface ISettings extends IConf
List<Integer> itemSpawnBlacklist();
List<EssentialsSign> enabledSigns();
boolean permissionBasedItemSpawn();
boolean showNonEssCommandsInHelp();
boolean spawnIfNoHome();
boolean warnOnBuildDisallow();
boolean warnOnSmite();
double getMaxMoney();
BigDecimal getMaxMoney();
BigDecimal getMinMoney();
boolean isEcoLogEnabled();
boolean isEcoLogUpdateEnabled();
boolean removeGodOnDisconnect();
boolean changeDisplayName();
boolean changePlayerListName();
boolean isPlayerCommand(String string);
boolean useBukkitPermissions();
boolean addPrefixSuffix();
boolean disablePrefix();
boolean disableSuffix();
long getAutoAfk();
@@ -134,6 +145,72 @@ public interface ISettings extends IConf
long getAutoAfkKick();
boolean getFreezeAfkPlayers();
boolean cancelAfkOnMove();
boolean cancelAfkOnInteract();
boolean areDeathMessagesEnabled();
void setDebug(boolean debug);
Set<String> getNoGodWorlds();
boolean getUpdateBedAtDaytime();
boolean allowUnsafeEnchantments();
boolean getRepairEnchanted();
boolean isWorldTeleportPermissions();
boolean isWorldHomePermissions();
boolean registerBackInListener();
boolean getDisableItemPickupWhileAfk();
EventPriority getRespawnPriority();
long getTpaAcceptCancellation();
boolean isMetricsEnabled();
void setMetricsEnabled(boolean metricsEnabled);
long getTeleportInvulnerability();
boolean isTeleportInvulnerability();
long getLoginAttackDelay();
int getSignUsePerSecond();
double getMaxFlySpeed();
double getMaxWalkSpeed();
int getMailsPerMinute();
long getEconomyLagWarning();
void setEssentialsChatActive(boolean b);
long getMaxTempban();
Map<String, Object> getListGroupConfig();
int getMaxNickLength();
int getMaxUserCacheCount();
boolean allowSilentJoinQuit();
boolean isCustomJoinMessage();
String getCustomJoinMessage();
boolean isCustomQuitMessage();
String getCustomQuitMessage();
}

View File

@@ -0,0 +1,9 @@
package com.earth2me.essentials;
import org.bukkit.Location;
public interface ITarget
{
public Location getLocation();
}

View File

@@ -1,59 +1,144 @@
package com.earth2me.essentials;
import com.earth2me.essentials.commands.IEssentialsCommand;
import java.net.InetSocketAddress;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import java.util.Set;
import net.ess3.api.ITeleport;
import net.ess3.api.MaxMoneyException;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.inventory.PlayerInventory;
public interface IUser
{
int getHealth();
Location getLocation();
boolean isOnline();
void sendMessage(String string);
long getLastTeleportTimestamp();
boolean isAuthorized(String node);
boolean isAuthorized(IEssentialsCommand cmd);
boolean isAuthorized(IEssentialsCommand cmd, String permissionPrefix);
void setLastTeleportTimestamp(long time);
void healCooldown() throws Exception;
Location getLastLocation();
void giveMoney(BigDecimal value) throws MaxMoneyException;
Player getBase();
void giveMoney(final BigDecimal value, final CommandSource initiator) throws MaxMoneyException;
void payUser(final User reciever, final BigDecimal value) throws Exception;
double getMoney();
void takeMoney(BigDecimal value);
void takeMoney(double value);
void takeMoney(final BigDecimal value, final CommandSource initiator);
void giveMoney(double value);
boolean canAfford(BigDecimal value);
PlayerInventory getInventory();
void updateInventory();
String getGroup();
Boolean canSpawnItem(final int itemId);
void setLastLocation();
void setLogoutLocation();
void requestTeleport(final User player, final boolean here);
ITeleport getTeleport();
BigDecimal getMoney();
void setMoney(final BigDecimal value) throws MaxMoneyException;
void setAfk(final boolean set);
/**
* 'Hidden' Represents when a player is hidden from others. This status includes when the player is hidden via other
* supported plugins. Use isVanished() if you want to check if a user is vanished by Essentials.
*
* @return If the user is hidden or not
* @see isVanished
*/
boolean isHidden();
void setHidden(boolean vanish);
boolean isGodModeEnabled();
String getGroup();
boolean inGroup(final String group);
boolean canBuild();
long getTeleportRequestTime();
void enableInvulnerabilityAfterTeleport();
void resetInvulnerabilityAfterTeleport();
boolean hasInvulnerabilityAfterTeleport();
/**
* 'Vanished' Represents when a player is hidden from others by Essentials. This status does NOT include when the
* player is hidden via other plugins. Use isHidden() if you want to check if a user is vanished by any supported
* plugin.
*
* @return If the user is vanished or not
* @see isHidden
*/
boolean isVanished();
void setVanished(boolean vanish);
boolean isIgnoreExempt();
public void sendMessage(String message);
/*
* UserData
*/
Location getHome(String name) throws Exception;
Location getHome(Location loc) throws Exception;
String getName();
List<String> getHomes();
InetSocketAddress getAddress();
void setHome(String name, Location loc);
String getDisplayName();
void delHome(String name) throws Exception;
boolean isHidden();
boolean hasHome();
Location getLastLocation();
Location getLogoutLocation();
long getLastTeleportTimestamp();
void setLastTeleportTimestamp(long time);
String getJail();
void setJail(String jail);
List<String> getMails();
void addMail(String mail);
boolean isAfk();
void setConfigProperty(String node, Object object);
Set<String> getConfigKeys();
Map<String, Object> getConfigMap();
Map<String, Object> getConfigMap(String node);
/*
* PlayerExtension
*/
Player getBase();
CommandSource getSource();
public String getName();
}

View File

@@ -1,332 +0,0 @@
package com.earth2me.essentials;
import java.util.HashMap;
import java.util.Map;
import org.bukkit.Location;
import org.bukkit.entity.Item;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
/*
* This class can be removed when
* https://github.com/Bukkit/CraftBukkit/pull/193
* is accepted to CraftBukkit
*/
public final class InventoryWorkaround
{
private InventoryWorkaround()
{
}
public static int first(final Inventory inventory, final ItemStack item, final boolean forceDurability, final boolean forceAmount)
{
return next(inventory, item, 0, forceDurability, forceAmount);
}
public static int next(final Inventory cinventory, final ItemStack item, final int start, final boolean forceDurability, final boolean forceAmount)
{
final ItemStack[] inventory = cinventory.getContents();
for (int i = start; i < inventory.length; i++)
{
final ItemStack cItem = inventory[i];
if (cItem == null)
{
continue;
}
if (item.getTypeId() == cItem.getTypeId() && (!forceAmount || item.getAmount() == cItem.getAmount()) && (!forceDurability || cItem.getDurability() == item.getDurability()))
{
return i;
}
}
return -1;
}
public static int firstPartial(final Inventory cinventory, final ItemStack item, final boolean forceDurability)
{
if (item == null)
{
return -1;
}
final ItemStack[] inventory = cinventory.getContents();
for (int i = 0; i < inventory.length; i++)
{
final ItemStack cItem = inventory[i];
if (cItem == null)
{
continue;
}
if (item.getTypeId() == cItem.getTypeId() && cItem.getAmount() < cItem.getType().getMaxStackSize() && (!forceDurability || cItem.getDurability() == item.getDurability()))
{
return i;
}
}
return -1;
}
public static boolean addAllItems(final Inventory cinventory, final boolean forceDurability, final ItemStack... items)
{
final Inventory fake = new FakeInventory(cinventory.getContents());
if (addItem(fake, forceDurability, items).isEmpty())
{
addItem(cinventory, forceDurability, items);
return true;
}
else
{
return false;
}
}
public static Map<Integer, ItemStack> addItem(final Inventory cinventory, final boolean forceDurability, final ItemStack... items)
{
final Map<Integer, ItemStack> leftover = new HashMap<Integer, ItemStack>();
/* TODO: some optimization
* - Create a 'firstPartial' with a 'fromIndex'
* - Record the lastPartial per Material
* - Cache firstEmpty result
*/
// combine items
ItemStack[] combined = new ItemStack[items.length];
for (int i = 0; i < items.length; i++)
{
if (items[i] == null || items[i].getAmount() < 1)
{
continue;
}
for (int j = 0; j < combined.length; j++)
{
if (combined[j] == null)
{
combined[j] = new ItemStack(items[i].getType(), items[i].getAmount(), items[i].getDurability());
break;
}
if (combined[j].getTypeId() == items[i].getTypeId() && (!forceDurability || combined[j].getDurability() == items[i].getDurability()))
{
combined[j].setAmount(combined[j].getAmount() + items[i].getAmount());
break;
}
}
}
for (int i = 0; i < combined.length; i++)
{
final ItemStack item = combined[i];
if (item == null)
{
continue;
}
while (true)
{
// Do we already have a stack of it?
final int firstPartial = firstPartial(cinventory, item, forceDurability);
// Drat! no partial stack
if (firstPartial == -1)
{
// Find a free spot!
final int firstFree = cinventory.firstEmpty();
if (firstFree == -1)
{
// No space at all!
leftover.put(i, item);
break;
}
else
{
// More than a single stack!
if (item.getAmount() > item.getType().getMaxStackSize())
{
cinventory.setItem(firstFree, new ItemStack(item.getTypeId(), item.getType().getMaxStackSize(), item.getDurability()));
item.setAmount(item.getAmount() - item.getType().getMaxStackSize());
}
else
{
// Just store it
cinventory.setItem(firstFree, item);
break;
}
}
}
else
{
// So, apparently it might only partially fit, well lets do just that
final ItemStack partialItem = cinventory.getItem(firstPartial);
final int amount = item.getAmount();
final int partialAmount = partialItem.getAmount();
final int maxAmount = partialItem.getType().getMaxStackSize();
// Check if it fully fits
if (amount + partialAmount <= maxAmount)
{
partialItem.setAmount(amount + partialAmount);
break;
}
// It fits partially
partialItem.setAmount(maxAmount);
item.setAmount(amount + partialAmount - maxAmount);
}
}
}
return leftover;
}
public static Map<Integer, ItemStack> removeItem(final Inventory cinventory, final boolean forceDurability, final ItemStack... items)
{
final Map<Integer, ItemStack> leftover = new HashMap<Integer, ItemStack>();
// TODO: optimization
for (int i = 0; i < items.length; i++)
{
final ItemStack item = items[i];
if (item == null)
{
continue;
}
int toDelete = item.getAmount();
while (true)
{
// Bail when done
if (toDelete <= 0)
{
break;
}
// get first Item, ignore the amount
final int first = first(cinventory, item, forceDurability, false);
// Drat! we don't have this type in the inventory
if (first == -1)
{
item.setAmount(toDelete);
leftover.put(i, item);
break;
}
else
{
final ItemStack itemStack = cinventory.getItem(first);
final int amount = itemStack.getAmount();
if (amount <= toDelete)
{
toDelete -= amount;
// clear the slot, all used up
cinventory.clear(first);
}
else
{
// split the stack and store
itemStack.setAmount(amount - toDelete);
cinventory.setItem(first, itemStack);
toDelete = 0;
}
}
}
}
return leftover;
}
public static boolean containsItem(final Inventory cinventory, final boolean forceDurability, final ItemStack... items)
{
final Map<Integer, ItemStack> leftover = new HashMap<Integer, ItemStack>();
// TODO: optimization
// combine items
ItemStack[] combined = new ItemStack[items.length];
for (int i = 0; i < items.length; i++)
{
if (items[i] == null)
{
continue;
}
for (int j = 0; j < combined.length; j++)
{
if (combined[j] == null)
{
combined[j] = new ItemStack(items[i].getType(), items[i].getAmount(), items[i].getDurability());
break;
}
if (combined[j].getTypeId() == items[i].getTypeId() && (!forceDurability || combined[j].getDurability() == items[i].getDurability()))
{
combined[j].setAmount(combined[j].getAmount() + items[i].getAmount());
break;
}
}
}
for (int i = 0; i < combined.length; i++)
{
final ItemStack item = combined[i];
if (item == null)
{
continue;
}
int mustHave = item.getAmount();
int position = 0;
while (true)
{
// Bail when done
if (mustHave <= 0)
{
break;
}
final int slot = next(cinventory, item, position, forceDurability, false);
// Drat! we don't have this type in the inventory
if (slot == -1)
{
leftover.put(i, item);
break;
}
else
{
final ItemStack itemStack = cinventory.getItem(slot);
final int amount = itemStack.getAmount();
if (amount <= mustHave)
{
mustHave -= amount;
}
else
{
mustHave = 0;
}
position = slot + 1;
}
}
}
return leftover.isEmpty();
}
public static Item[] dropItem(final Location loc, final ItemStack itm)
{
final int maxStackSize = itm.getType().getMaxStackSize();
final int stacks = itm.getAmount() / maxStackSize;
final int leftover = itm.getAmount() % maxStackSize;
Item[] itemStacks = new Item[stacks + (leftover > 0 ? 1 : 0)];
for (int i = 0; i < stacks; i++)
{
itemStacks[i] = loc.getWorld().dropItem(loc, new ItemStack(itm.getType(), maxStackSize, itm.getDurability()));
}
if (leftover > 0)
{
itemStacks[stacks] = loc.getWorld().dropItem(loc, new ItemStack(itm.getType(), leftover, itm.getDurability()));
}
return itemStacks;
}
}

View File

@@ -1,40 +1,51 @@
package com.earth2me.essentials;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.utils.NumberUtil;
import com.earth2me.essentials.utils.StringUtil;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import net.ess3.api.IEssentials;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
public class ItemDb implements IConf
public class ItemDb implements IConf, net.ess3.api.IItemDb
{
private final transient IEssentials ess;
private final transient Map<String, Integer> items = new HashMap<String, Integer>();
private final transient Map<ItemData, List<String>> names = new HashMap<ItemData, List<String>>();
private final transient Map<ItemData, String> primaryName = new HashMap<ItemData, String>();
private final transient Map<String, Short> durabilities = new HashMap<String, Short>();
private final transient ManagedFile file;
private final transient Pattern splitPattern = Pattern.compile("((.*)[:+',;.](\\d+))");
public ItemDb(final IEssentials ess)
{
this.ess = ess;
file = new ManagedFile("items.csv", ess);
}
private final transient Map<String, Integer> items = new HashMap<String, Integer>();
private final transient Map<String, Short> durabilities = new HashMap<String, Short>();
private final transient ManagedFile file;
@Override
public void reloadConfig()
{
final List<String> lines = file.getLines();
if (lines.isEmpty()) {
if (lines.isEmpty())
{
return;
}
durabilities.clear();
items.clear();
names.clear();
primaryName.clear();
for (String line : lines)
{
line = line.trim().toLowerCase();
line = line.trim().toLowerCase(Locale.ENGLISH);
if (line.length() > 0 && line.charAt(0) == '#')
{
continue;
@@ -47,44 +58,68 @@ public class ItemDb implements IConf
}
final int numeric = Integer.parseInt(parts[1]);
final short data = parts.length > 2 && !parts[2].equals("0") ? Short.parseShort(parts[2]) : 0;
String itemName = parts[0].toLowerCase(Locale.ENGLISH);
durabilities.put(parts[0].toLowerCase(), parts.length > 2 && !parts[2].equals("0") ? Short.parseShort(parts[2]) : 0);
items.put(parts[0].toLowerCase(), numeric);
durabilities.put(itemName, data);
items.put(itemName, numeric);
ItemData itemData = new ItemData(numeric, data);
if (names.containsKey(itemData))
{
List<String> nameList = names.get(itemData);
nameList.add(itemName);
Collections.sort(nameList, new LengthCompare());
}
else
{
List<String> nameList = new ArrayList<String>();
nameList.add(itemName);
names.put(itemData, nameList);
primaryName.put(itemData, itemName);
}
}
}
@Override
public ItemStack get(final String id, final int quantity) throws Exception
{
final ItemStack retval = get(id.toLowerCase());
final ItemStack retval = get(id.toLowerCase(Locale.ENGLISH));
retval.setAmount(quantity);
return retval;
}
@Override
public ItemStack get(final String id) throws Exception
{
int itemid = 0;
String itemname = null;
short metaData = 0;
if (id.matches("^\\d+[:+',;.]\\d+$"))
Matcher parts = splitPattern.matcher(id);
if (parts.matches())
{
itemid = Integer.parseInt(id.split("[:+',;.]")[0]);
metaData = Short.parseShort(id.split("[:+',;.]")[1]);
}
else if (id.matches("^\\d+$"))
{
itemid = Integer.parseInt(id);
}
else if (id.matches("^[^:+',;.]+[:+',;.]\\d+$"))
{
itemname = id.split("[:+',;.]")[0].toLowerCase();
metaData = Short.parseShort(id.split("[:+',;.]")[1]);
itemname = parts.group(2);
metaData = Short.parseShort(parts.group(3));
}
else
{
itemname = id.toLowerCase();
itemname = id;
}
if (itemname != null)
if (NumberUtil.isInt(itemname))
{
itemid = Integer.parseInt(itemname);
}
else if (NumberUtil.isInt(id))
{
itemid = Integer.parseInt(id);
}
else
{
itemname = itemname.toLowerCase(Locale.ENGLISH);
}
if (itemid < 1)
{
if (items.containsKey(itemname))
{
@@ -94,25 +129,185 @@ public class ItemDb implements IConf
metaData = durabilities.get(itemname);
}
}
else if (Material.getMaterial(itemname) != null)
else if (Material.getMaterial(itemname.toUpperCase(Locale.ENGLISH)) != null)
{
itemid = Material.getMaterial(itemname).getId();
metaData = 0;
Material bMaterial = Material.getMaterial(itemname.toUpperCase(Locale.ENGLISH));
itemid = bMaterial.getId();
}
else
{
throw new Exception(Util.format("unknownItemName", id));
try
{
Material bMaterial = Bukkit.getUnsafe().getMaterialFromInternalName(itemname.toLowerCase(Locale.ENGLISH));
itemid = bMaterial.getId();
}
catch (Throwable throwable)
{
throw new Exception(tl("unknownItemName", itemname), throwable);
}
}
}
if (itemid < 1)
{
throw new Exception(tl("unknownItemName", itemname));
}
final Material mat = Material.getMaterial(itemid);
if (mat == null)
{
throw new Exception(Util.format("unknownItemId", itemid));
throw new Exception(tl("unknownItemId", itemid));
}
final ItemStack retval = new ItemStack(mat);
retval.setAmount(ess.getSettings().getDefaultStackSize());
retval.setAmount(mat.getMaxStackSize());
retval.setDurability(metaData);
return retval;
}
@Override
public List<ItemStack> getMatching(User user, String[] args) throws Exception
{
List<ItemStack> is = new ArrayList<ItemStack>();
if (args.length < 1)
{
is.add(user.getBase().getItemInHand());
}
else if (args[0].equalsIgnoreCase("hand"))
{
is.add(user.getBase().getItemInHand());
}
else if (args[0].equalsIgnoreCase("inventory") || args[0].equalsIgnoreCase("invent") || args[0].equalsIgnoreCase("all"))
{
for (ItemStack stack : user.getBase().getInventory().getContents())
{
if (stack == null || stack.getType() == Material.AIR)
{
continue;
}
is.add(stack);
}
}
else if (args[0].equalsIgnoreCase("blocks"))
{
for (ItemStack stack : user.getBase().getInventory().getContents())
{
if (stack == null || stack.getTypeId() > 255 || stack.getType() == Material.AIR)
{
continue;
}
is.add(stack);
}
}
else
{
is.add(get(args[0]));
}
if (is.isEmpty() || is.get(0).getType() == Material.AIR)
{
throw new Exception(tl("itemSellAir"));
}
return is;
}
@Override
public String names(ItemStack item)
{
ItemData itemData = new ItemData(item.getTypeId(), item.getDurability());
List<String> nameList = names.get(itemData);
if (nameList == null)
{
itemData = new ItemData(item.getTypeId(), (short)0);
nameList = names.get(itemData);
if (nameList == null)
{
return null;
}
}
if (nameList.size() > 15)
{
nameList = nameList.subList(0, 14);
}
return StringUtil.joinList(", ", nameList);
}
@Override
public String name(ItemStack item)
{
ItemData itemData = new ItemData(item.getTypeId(), item.getDurability());
String name = primaryName.get(itemData);
if (name == null)
{
itemData = new ItemData(item.getTypeId(), (short)0);
name = primaryName.get(itemData);
if (name == null)
{
return null;
}
}
return name;
}
static class ItemData
{
final private int itemNo;
final private short itemData;
ItemData(final int itemNo, final short itemData)
{
this.itemNo = itemNo;
this.itemData = itemData;
}
public int getItemNo()
{
return itemNo;
}
public short getItemData()
{
return itemData;
}
@Override
public int hashCode()
{
return (31 * itemNo) ^ itemData;
}
@Override
public boolean equals(Object o)
{
if (o == null)
{
return false;
}
if (!(o instanceof ItemData))
{
return false;
}
ItemData pairo = (ItemData)o;
return this.itemNo == pairo.getItemNo()
&& this.itemData == pairo.getItemData();
}
}
class LengthCompare implements java.util.Comparator<String>
{
public LengthCompare()
{
super();
}
@Override
public int compare(String s1, String s2)
{
return s1.length() - s2.length();
}
}
}

View File

@@ -1,97 +0,0 @@
package com.earth2me.essentials;
import java.io.File;
import java.util.List;
import java.util.logging.Logger;
import org.bukkit.Location;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockDamageEvent;
import org.bukkit.event.block.BlockListener;
import org.bukkit.event.block.BlockPlaceEvent;
public class Jail extends BlockListener implements IConf
{
private static final Logger logger = Logger.getLogger("Minecraft");
private final EssentialsConf config;
private final IEssentials ess;
public Jail(IEssentials ess)
{
this.ess = ess;
config = new EssentialsConf(new File(ess.getDataFolder(), "jail.yml"));
config.load();
}
public void setJail(Location loc, String jailName) throws Exception
{
config.setProperty(jailName.toLowerCase(), loc);
config.save();
}
public Location getJail(String jailName) throws Exception
{
if (jailName == null || config.getProperty(jailName.toLowerCase()) == null)
{
throw new Exception(Util.i18n("jailNotExist"));
}
Location loc = config.getLocation(jailName.toLowerCase(), ess.getServer());
return loc;
}
public void sendToJail(User user, String jail) throws Exception
{
if (!(user.getBase() instanceof OfflinePlayer))
{
user.getTeleport().now(getJail(jail));
}
user.setJail(jail);
}
public void delJail(String jail) throws Exception
{
config.removeProperty(jail.toLowerCase());
config.save();
}
public List<String> getJails() throws Exception
{
return config.getKeys(null);
}
public void reloadConfig()
{
config.load();
}
@Override
public void onBlockBreak(BlockBreakEvent event)
{
User user = ess.getUser(event.getPlayer());
if (user.isJailed())
{
event.setCancelled(true);
}
}
@Override
public void onBlockPlace(BlockPlaceEvent event)
{
User user = ess.getUser(event.getPlayer());
if (user.isJailed())
{
event.setCancelled(true);
}
}
@Override
public void onBlockDamage(BlockDamageEvent event)
{
User user = ess.getUser(event.getPlayer());
if (user.isJailed())
{
event.setCancelled(true);
}
}
}

View File

@@ -1,84 +0,0 @@
package com.earth2me.essentials;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerListener;
import org.bukkit.event.player.PlayerRespawnEvent;
import org.bukkit.event.player.PlayerTeleportEvent;
public class JailPlayerListener extends PlayerListener
{
private static final Logger LOGGER = Logger.getLogger("Minecraft");
private final IEssentials ess;
public JailPlayerListener(IEssentials parent)
{
this.ess = parent;
}
@Override
public void onPlayerInteract(PlayerInteractEvent event)
{
final User user = ess.getUser(event.getPlayer());
if (user.isJailed())
{
event.setCancelled(true);
}
}
@Override
public void onPlayerRespawn(PlayerRespawnEvent event)
{
final User user = ess.getUser(event.getPlayer());
if (user.isJailed() && user.getJail() != null && !user.getJail().isEmpty())
{
try
{
event.setRespawnLocation(ess.getJail().getJail(user.getJail()));
}
catch (Exception ex)
{
}
}
}
@Override
public void onPlayerTeleport(PlayerTeleportEvent event)
{
final User user = ess.getUser(event.getPlayer());
if (!user.isJailed() || user.getJail() == null || user.getJail().isEmpty())
{
return;
}
try
{
event.setTo(ess.getJail().getJail(user.getJail()));
}
catch (Exception ex)
{
LOGGER.log(Level.WARNING, Util.i18n("returnPlayerToJailError"), ex);
}
user.sendMessage(Util.i18n("jailMessage"));
}
@Override
public void onPlayerJoin(final PlayerJoinEvent event)
{
User u = ess.getUser(event.getPlayer());
if (u.isJailed())
{
try
{
ess.getJail().sendToJail(u, u.getJail());
}
catch (Exception ex)
{
LOGGER.log(Level.WARNING, Util.i18n("returnPlayerToJailError"), ex);
}
u.sendMessage(Util.i18n("jailMessage"));
}
}
}

View File

@@ -0,0 +1,340 @@
package com.earth2me.essentials;
import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.storage.AsyncStorageObjectHolder;
import java.io.File;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.ess3.api.IEssentials;
import net.ess3.api.IUser;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockDamageEvent;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerRespawnEvent;
import org.bukkit.event.player.PlayerTeleportEvent;
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
import org.bukkit.plugin.PluginManager;
public class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.settings.Jails> implements net.ess3.api.IJails
{
private static final transient Logger LOGGER = Bukkit.getLogger();
private static transient boolean enabled = false;
public Jails(final IEssentials ess)
{
super(ess, com.earth2me.essentials.settings.Jails.class);
reloadConfig();
}
private void registerListeners()
{
enabled = true;
final PluginManager pluginManager = ess.getServer().getPluginManager();
final JailListener blockListener = new JailListener();
pluginManager.registerEvents(blockListener, ess);
if (ess.getSettings().isDebug())
{
LOGGER.log(Level.INFO, "Registering Jail listener");
}
}
@Override
public File getStorageFile()
{
return new File(ess.getDataFolder(), "jail.yml");
}
@Override
public void finishRead()
{
checkRegister();
}
@Override
public void finishWrite()
{
checkRegister();
}
public void resetListener()
{
enabled = false;
checkRegister();
}
private void checkRegister()
{
if (enabled == false && getCount() > 0)
{
registerListeners();
}
}
@Override
public Location getJail(final String jailName) throws Exception
{
acquireReadLock();
try
{
if (getData().getJails() == null || jailName == null
|| !getData().getJails().containsKey(jailName.toLowerCase(Locale.ENGLISH)))
{
throw new Exception(tl("jailNotExist"));
}
Location loc = getData().getJails().get(jailName.toLowerCase(Locale.ENGLISH));
if (loc == null || loc.getWorld() == null)
{
throw new Exception(tl("jailNotExist"));
}
return loc;
}
finally
{
unlock();
}
}
@Override
public Collection<String> getList() throws Exception
{
acquireReadLock();
try
{
if (getData().getJails() == null)
{
return Collections.emptyList();
}
return new ArrayList<String>(getData().getJails().keySet());
}
finally
{
unlock();
}
}
@Override
public void removeJail(final String jail) throws Exception
{
acquireWriteLock();
try
{
if (getData().getJails() == null)
{
return;
}
getData().getJails().remove(jail.toLowerCase(Locale.ENGLISH));
}
finally
{
unlock();
}
}
@Override
public void sendToJail(final IUser user, final String jail) throws Exception
{
acquireReadLock();
try
{
if (user.getBase().isOnline())
{
Location loc = getJail(jail);
user.getTeleport().now(loc, false, TeleportCause.COMMAND);
}
user.setJail(jail);
}
finally
{
unlock();
}
}
@Override
public void setJail(final String jailName, final Location loc) throws Exception
{
acquireWriteLock();
try
{
if (getData().getJails() == null)
{
getData().setJails(new HashMap<String, Location>());
}
getData().getJails().put(jailName.toLowerCase(Locale.ENGLISH), loc);
}
finally
{
unlock();
}
}
@Override
public int getCount()
{
try
{
return getList().size();
}
catch (Exception ex)
{
return 0;
}
}
private class JailListener implements Listener
{
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onBlockBreak(final BlockBreakEvent event)
{
final User user = ess.getUser(event.getPlayer());
if (user.isJailed())
{
event.setCancelled(true);
}
}
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onBlockPlace(final BlockPlaceEvent event)
{
final User user = ess.getUser(event.getPlayer());
if (user.isJailed())
{
event.setCancelled(true);
}
}
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onBlockDamage(final BlockDamageEvent event)
{
final User user = ess.getUser(event.getPlayer());
if (user.isJailed())
{
event.setCancelled(true);
}
}
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onEntityDamageByEntity(final EntityDamageByEntityEvent event)
{
if (event.getCause() != DamageCause.ENTITY_ATTACK || event.getEntity().getType() != EntityType.PLAYER)
{
return;
}
final Entity damager = event.getDamager();
if (damager.getType() == EntityType.PLAYER)
{
final User user = ess.getUser((Player)damager);
if (user != null && user.isJailed())
{
event.setCancelled(true);
}
}
}
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onPlayerInteract(final PlayerInteractEvent event)
{
final User user = ess.getUser(event.getPlayer());
if (user.isJailed())
{
event.setCancelled(true);
}
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onPlayerRespawn(final PlayerRespawnEvent event)
{
final User user = ess.getUser(event.getPlayer());
if (!user.isJailed() || user.getJail() == null || user.getJail().isEmpty())
{
return;
}
try
{
event.setRespawnLocation(getJail(user.getJail()));
}
catch (Exception ex)
{
if (ess.getSettings().isDebug())
{
LOGGER.log(Level.INFO, tl("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage()), ex);
}
else
{
LOGGER.log(Level.INFO, tl("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage()));
}
}
}
@EventHandler(priority = EventPriority.HIGH)
public void onPlayerTeleport(final PlayerTeleportEvent event)
{
final User user = ess.getUser(event.getPlayer());
if (!user.isJailed() || user.getJail() == null || user.getJail().isEmpty())
{
return;
}
try
{
event.setTo(getJail(user.getJail()));
}
catch (Exception ex)
{
if (ess.getSettings().isDebug())
{
LOGGER.log(Level.INFO, tl("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage()), ex);
}
else
{
LOGGER.log(Level.INFO, tl("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage()));
}
}
user.sendMessage(tl("jailMessage"));
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onPlayerJoin(final PlayerJoinEvent event)
{
final User user = ess.getUser(event.getPlayer());
final long currentTime = System.currentTimeMillis();
user.checkJailTimeout(currentTime);
if (!user.isJailed() || user.getJail() == null || user.getJail().isEmpty())
{
return;
}
try
{
sendToJail(user, user.getJail());
}
catch (Exception ex)
{
if (ess.getSettings().isDebug())
{
LOGGER.log(Level.INFO, tl("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage()), ex);
}
else
{
LOGGER.log(Level.INFO, tl("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage()));
}
}
user.sendMessage(tl("jailMessage"));
}
}
}

View File

@@ -0,0 +1,239 @@
package com.earth2me.essentials;
import static com.earth2me.essentials.I18n.tl;
import static com.earth2me.essentials.I18n.capitalCase;
import com.earth2me.essentials.Trade.OverflowType;
import com.earth2me.essentials.commands.NoChargeException;
import com.earth2me.essentials.craftbukkit.InventoryWorkaround;
import com.earth2me.essentials.textreader.IText;
import com.earth2me.essentials.textreader.KeywordReplacer;
import com.earth2me.essentials.textreader.SimpleTextInput;
import com.earth2me.essentials.utils.DateUtil;
import com.earth2me.essentials.utils.NumberUtil;
import java.math.BigDecimal;
import java.util.*;
import java.util.logging.Level;
import net.ess3.api.IEssentials;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.inventory.ItemStack;
public class Kit
{
//TODO: Convert this to use one of the new text classes?
public static String listKits(final IEssentials ess, final User user) throws Exception
{
try
{
final ConfigurationSection kits = ess.getSettings().getKits();
final StringBuilder list = new StringBuilder();
for (String kitItem : kits.getKeys(false))
{
if (user == null)
{
list.append(" ").append(capitalCase(kitItem));
}
else if (user.isAuthorized("essentials.kits." + kitItem.toLowerCase(Locale.ENGLISH)))
{
String cost = "";
String name = capitalCase(kitItem);
BigDecimal costPrice = new Trade("kit-" + kitItem.toLowerCase(Locale.ENGLISH), ess).getCommandCost(user);
if (costPrice.signum() > 0)
{
cost = tl("kitCost", NumberUtil.displayCurrency(costPrice, ess));
}
final Map<String, Object> kit = ess.getSettings().getKit(kitItem);
if (Kit.getNextUse(user, kitItem, kit) != 0)
{
name = tl("kitDelay", name);
}
list.append(" ").append(name).append(cost);
}
}
return list.toString().trim();
}
catch (Exception ex)
{
throw new Exception(tl("kitError"), ex);
}
}
public static void checkTime(final User user, final String kitName, final Map<String, Object> els) throws Exception
{
final Calendar time = new GregorianCalendar();
long nextUse = getNextUse(user, kitName, els);
if (nextUse == 0L)
{
user.setKitTimestamp(kitName, time.getTimeInMillis());
}
else if (nextUse < 0L)
{
user.sendMessage(tl("kitOnce"));
throw new NoChargeException();
}
else
{
user.sendMessage(tl("kitTimed", DateUtil.formatDateDiff(nextUse)));
throw new NoChargeException();
}
}
public static long getNextUse(final User user, final String kitName, final Map<String, Object> els) throws Exception
{
if (user.isAuthorized("essentials.kit.exemptdelay"))
{
return 0L;
}
final Calendar time = new GregorianCalendar();
double delay = 0;
try
{
// Make sure delay is valid
delay = els.containsKey("delay") ? ((Number)els.get("delay")).doubleValue() : 0.0d;
}
catch (Exception e)
{
throw new Exception(tl("kitError2"));
}
// When was the last kit used?
final long lastTime = user.getKitTimestamp(kitName);
// When can be use the kit again?
final Calendar delayTime = new GregorianCalendar();
delayTime.setTimeInMillis(lastTime);
delayTime.add(Calendar.SECOND, (int)delay);
delayTime.add(Calendar.MILLISECOND, (int)((delay * 1000.0) % 1000.0));
if (lastTime == 0L || lastTime > time.getTimeInMillis())
{
// If we have no record of kit use, or its corrupted, give them benifit of the doubt.
return 0L;
}
else if (delay < 0d)
{
// If the kit has a negative kit time, it can only be used once.
return -1;
}
else if (delayTime.before(time))
{
// If the kit was used in the past, but outside the delay time, it can be used.
return 0L;
}
else
{
// If the kit has been used recently, return the next time it can be used.
return delayTime.getTimeInMillis();
}
}
public static List<String> getItems(final IEssentials ess, final User user, final String kitName, final Map<String, Object> kit) throws Exception
{
if (kit == null)
{
throw new Exception(tl("kitNotFound"));
}
try
{
final List<String> itemList = new ArrayList<String>();
final Object kitItems = kit.get("items");
if (kitItems instanceof List)
{
for (Object item : (List)kitItems)
{
if (item instanceof String)
{
itemList.add(item.toString());
continue;
}
throw new Exception("Invalid kit item: " + item.toString());
}
return itemList;
}
throw new Exception("Invalid item list");
}
catch (Exception e)
{
ess.getLogger().log(Level.WARNING, "Error parsing kit " + kitName + ": " + e.getMessage());
throw new Exception(tl("kitError2"), e);
}
}
public static void expandItems(final IEssentials ess, final User user, final List<String> items) throws Exception
{
try
{
IText input = new SimpleTextInput(items);
IText output = new KeywordReplacer(input, user.getSource(), ess);
boolean spew = false;
final boolean allowUnsafe = ess.getSettings().allowUnsafeEnchantments();
for (String kitItem : output.getLines())
{
if (kitItem.startsWith(ess.getSettings().getCurrencySymbol()))
{
BigDecimal value = new BigDecimal(kitItem.substring(ess.getSettings().getCurrencySymbol().length()).trim());
Trade t = new Trade(value, ess);
t.pay(user, OverflowType.DROP);
continue;
}
final String[] parts = kitItem.split(" +");
final ItemStack parseStack = ess.getItemDb().get(parts[0], parts.length > 1 ? Integer.parseInt(parts[1]) : 1);
if (parseStack.getType() == Material.AIR) {
continue;
}
final MetaItemStack metaStack = new MetaItemStack(parseStack);
if (parts.length > 2)
{
// We pass a null sender here because kits should not do perm checks
metaStack.parseStringMeta(null, allowUnsafe, parts, 2, ess);
}
final Map<Integer, ItemStack> overfilled;
final boolean allowOversizedStacks = user.isAuthorized("essentials.oversizedstacks");
if (allowOversizedStacks)
{
overfilled = InventoryWorkaround.addOversizedItems(user.getBase().getInventory(), ess.getSettings().getOversizedStackSize(), metaStack.getItemStack());
}
else
{
overfilled = InventoryWorkaround.addItems(user.getBase().getInventory(), metaStack.getItemStack());
}
for (ItemStack itemStack : overfilled.values())
{
int spillAmount = itemStack.getAmount();
if (!allowOversizedStacks) {
itemStack.setAmount(spillAmount < itemStack.getMaxStackSize() ? spillAmount : itemStack.getMaxStackSize());
}
while (spillAmount > 0) {
user.getWorld().dropItemNaturally(user.getLocation(), itemStack);
spillAmount -= itemStack.getAmount();
}
spew = true;
}
}
user.getBase().updateInventory();
if (spew)
{
user.sendMessage(tl("kitInvFull"));
}
}
catch (Exception e)
{
user.getBase().updateInventory();
ess.getLogger().log(Level.WARNING, e.getMessage());
throw new Exception(tl("kitError2"), e);
}
}
}

View File

@@ -0,0 +1,20 @@
package com.earth2me.essentials;
import org.bukkit.Location;
public class LocationTarget implements ITarget
{
private final Location location;
LocationTarget(Location location)
{
this.location = location;
}
@Override
public Location getLocation()
{
return location;
}
}

View File

@@ -1,15 +1,7 @@
package com.earth2me.essentials;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import static com.earth2me.essentials.I18n.tl;
import java.io.*;
import java.math.BigInteger;
import java.security.DigestInputStream;
import java.security.DigestOutputStream;
@@ -19,12 +11,13 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.logging.Level;
import net.ess3.api.IEssentials;
import org.bukkit.Bukkit;
public class ManagedFile
{
private final static int BUFFERSIZE = 1024 * 8;
private static final int BUFFERSIZE = 1024 * 8;
private final transient File file;
public ManagedFile(final String filename, final IEssentials ess)
@@ -54,7 +47,7 @@ public class ManagedFile
}
catch (IOException ex)
{
Bukkit.getLogger().log(Level.SEVERE, Util.i18n("itemsCsvNotLoaded"), ex);
Bukkit.getLogger().log(Level.SEVERE, tl("itemsCsvNotLoaded"), ex);
}
}
}
@@ -138,12 +131,12 @@ public class ManagedFile
try
{
String hash = reader.readLine();
if (hash.matches("#[a-f0-9]{32}"))
if (hash != null && hash.matches("#[a-f0-9]{32}"))
{
hash = hash.substring(1);
bais.reset();
final String versionline = reader.readLine();
if (versionline.matches("#version: .+"))
if (versionline != null && versionline.matches("#version: .+"))
{
final String versioncheck = versionline.substring(10);
if (!versioncheck.equalsIgnoreCase(version))

View File

@@ -0,0 +1,577 @@
package com.earth2me.essentials;
import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.textreader.BookInput;
import com.earth2me.essentials.textreader.BookPager;
import com.earth2me.essentials.textreader.IText;
import com.earth2me.essentials.utils.FormatUtil;
import com.earth2me.essentials.utils.NumberUtil;
import java.util.*;
import java.util.regex.Pattern;
import com.google.common.base.Joiner;
import java.util.logging.Level;
import net.ess3.api.IEssentials;
import org.bukkit.Color;
import org.bukkit.DyeColor;
import org.bukkit.FireworkEffect;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.*;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
public class MetaItemStack
{
private static final Map<String, DyeColor> colorMap = new HashMap<String, DyeColor>();
private static final Map<String, FireworkEffect.Type> fireworkShape = new HashMap<String, FireworkEffect.Type>();
static
{
for (DyeColor color : DyeColor.values())
{
colorMap.put(color.name(), color);
}
for (FireworkEffect.Type type : FireworkEffect.Type.values())
{
fireworkShape.put(type.name(), type);
}
}
private final transient Pattern splitPattern = Pattern.compile("[:+',;.]");
private ItemStack stack;
private FireworkEffect.Builder builder = FireworkEffect.builder();
private PotionEffectType pEffectType;
private PotionEffect pEffect;
private boolean validFirework = false;
private boolean validPotionEffect = false;
private boolean validPotionDuration = false;
private boolean validPotionPower = false;
private boolean completePotion = false;
private int power = 1;
private int duration = 120;
public MetaItemStack(final ItemStack stack)
{
this.stack = stack.clone();
}
public ItemStack getItemStack()
{
return stack;
}
public boolean isValidFirework()
{
return validFirework;
}
public boolean isValidPotion()
{
return validPotionEffect && validPotionDuration && validPotionPower;
}
public FireworkEffect.Builder getFireworkBuilder()
{
return builder;
}
public PotionEffect getPotionEffect()
{
return pEffect;
}
public boolean completePotion()
{
return completePotion;
}
private void resetPotionMeta()
{
pEffect = null;
pEffectType = null;
validPotionEffect = false;
validPotionDuration = false;
validPotionPower = false;
completePotion = true;
}
public boolean canSpawn(final IEssentials ess)
{
try
{
ess.getServer().getUnsafe().modifyItemStack(stack, "{}");
return true;
}
catch (NullPointerException npe)
{
if (ess.getSettings().isDebug())
{
ess.getLogger().log(Level.INFO, "Itemstack is invalid", npe);
}
return false;
}
catch (NoSuchMethodError nsme)
{
return true;
}
catch (Throwable throwable)
{
if (ess.getSettings().isDebug())
{
ess.getLogger().log(Level.INFO, "Itemstack is invalid", throwable);
}
return false;
}
}
public void parseStringMeta(final CommandSource sender, final boolean allowUnsafe, String[] string, int fromArg, final IEssentials ess) throws Exception
{
if (string[fromArg].startsWith("{"))
{
try
{
stack = ess.getServer().getUnsafe().modifyItemStack(stack, Joiner.on(' ').join(Arrays.asList(string).subList(fromArg, string.length)));
}
catch (NullPointerException npe)
{
if (ess.getSettings().isDebug())
{
ess.getLogger().log(Level.INFO, "Itemstack is invalid", npe);
}
}
catch (NoSuchMethodError nsme)
{
throw new Exception(tl("noMetaJson"), nsme);
}
catch (Throwable throwable)
{
throw new Exception(throwable.getMessage(), throwable);
}
}
else
{
for (int i = fromArg; i < string.length; i++)
{
addStringMeta(sender, allowUnsafe, string[i], ess);
}
if (validFirework)
{
if (!hasMetaPermission(sender, "firework", true, true, ess))
{
throw new Exception(tl("noMetaFirework"));
}
FireworkEffect effect = builder.build();
FireworkMeta fmeta = (FireworkMeta)stack.getItemMeta();
fmeta.addEffect(effect);
if (fmeta.getEffects().size() > 1 && !hasMetaPermission(sender, "firework-multiple", true, true, ess))
{
throw new Exception(tl("multipleCharges"));
}
stack.setItemMeta(fmeta);
}
}
}
public void addStringMeta(final CommandSource sender, final boolean allowUnsafe, final String string, final IEssentials ess) throws Exception
{
final String[] split = splitPattern.split(string, 2);
if (split.length < 1)
{
return;
}
if (split.length > 1 && split[0].equalsIgnoreCase("name") && hasMetaPermission(sender, "name", false, true, ess))
{
final String displayName = FormatUtil.replaceFormat(split[1].replace('_', ' '));
final ItemMeta meta = stack.getItemMeta();
meta.setDisplayName(displayName);
stack.setItemMeta(meta);
}
else if (split.length > 1 && (split[0].equalsIgnoreCase("lore") || split[0].equalsIgnoreCase("desc")) && hasMetaPermission(sender, "lore", false, true, ess))
{
final List<String> lore = new ArrayList<String>();
for (String line : split[1].split("\\|"))
{
lore.add(FormatUtil.replaceFormat(line.replace('_', ' ')));
}
final ItemMeta meta = stack.getItemMeta();
meta.setLore(lore);
stack.setItemMeta(meta);
}
else if (split.length > 1 && (split[0].equalsIgnoreCase("player") || split[0].equalsIgnoreCase("owner")) && stack.getType() == Material.SKULL_ITEM && hasMetaPermission(sender, "head", false, true, ess))
{
if (stack.getDurability() == 3)
{
final String owner = split[1];
final SkullMeta meta = (SkullMeta)stack.getItemMeta();
meta.setOwner(owner);
stack.setItemMeta(meta);
}
else
{
throw new Exception(tl("onlyPlayerSkulls"));
}
}
else if (split.length > 1 && split[0].equalsIgnoreCase("book") && stack.getType() == Material.WRITTEN_BOOK
&& (hasMetaPermission(sender, "book", true, true, ess) || hasMetaPermission(sender, "chapter-" + split[1].toLowerCase(Locale.ENGLISH), true, true, ess)))
{
final BookMeta meta = (BookMeta)stack.getItemMeta();
final IText input = new BookInput("book", true, ess);
final BookPager pager = new BookPager(input);
List<String> pages = pager.getPages(split[1]);
meta.setPages(pages);
stack.setItemMeta(meta);
}
else if (split.length > 1 && split[0].equalsIgnoreCase("author") && stack.getType() == Material.WRITTEN_BOOK && hasMetaPermission(sender, "author", false, true, ess))
{
final String author = FormatUtil.replaceFormat(split[1]);
final BookMeta meta = (BookMeta)stack.getItemMeta();
meta.setAuthor(author);
stack.setItemMeta(meta);
}
else if (split.length > 1 && split[0].equalsIgnoreCase("title") && stack.getType() == Material.WRITTEN_BOOK && hasMetaPermission(sender, "title", false, true, ess))
{
final String title = FormatUtil.replaceFormat(split[1].replace('_', ' '));
final BookMeta meta = (BookMeta)stack.getItemMeta();
meta.setTitle(title);
stack.setItemMeta(meta);
}
else if (split.length > 1 && split[0].equalsIgnoreCase("power") && stack.getType() == Material.FIREWORK && hasMetaPermission(sender, "firework-power", false, true, ess))
{
final int power = NumberUtil.isInt(split[1]) ? Integer.parseInt(split[1]) : 0;
final FireworkMeta meta = (FireworkMeta)stack.getItemMeta();
meta.setPower(power > 3 ? 4 : power);
stack.setItemMeta(meta);
}
else if (stack.getType() == Material.FIREWORK) //WARNING - Meta for fireworks will be ignored after this point.
{
addFireworkMeta(sender, false, string, ess);
}
else if (stack.getType() == Material.POTION) //WARNING - Meta for potions will be ignored after this point.
{
addPotionMeta(sender, false, string, ess);
}
else if (split.length > 1 && (split[0].equalsIgnoreCase("color") || split[0].equalsIgnoreCase("colour"))
&& (stack.getType() == Material.LEATHER_BOOTS
|| stack.getType() == Material.LEATHER_CHESTPLATE
|| stack.getType() == Material.LEATHER_HELMET
|| stack.getType() == Material.LEATHER_LEGGINGS))
{
final String[] color = split[1].split("(\\||,)");
if (color.length == 3)
{
final int red = NumberUtil.isInt(color[0]) ? Integer.parseInt(color[0]) : 0;
final int green = NumberUtil.isInt(color[1]) ? Integer.parseInt(color[1]) : 0;
final int blue = NumberUtil.isInt(color[2]) ? Integer.parseInt(color[2]) : 0;
final LeatherArmorMeta meta = (LeatherArmorMeta)stack.getItemMeta();
meta.setColor(Color.fromRGB(red, green, blue));
stack.setItemMeta(meta);
}
else
{
throw new Exception(tl("leatherSyntax"));
}
}
else
{
parseEnchantmentStrings(sender, allowUnsafe, split, ess);
}
}
public void addFireworkMeta(final CommandSource sender, final boolean allowShortName, final String string, final IEssentials ess) throws Exception
{
if (stack.getType() == Material.FIREWORK)
{
final String[] split = splitPattern.split(string, 2);
if (split.length < 2)
{
return;
}
if (split[0].equalsIgnoreCase("color") || split[0].equalsIgnoreCase("colour") || (allowShortName && split[0].equalsIgnoreCase("c")))
{
if (validFirework)
{
if (!hasMetaPermission(sender, "firework", true, true, ess))
{
throw new Exception(tl("noMetaFirework"));
}
FireworkEffect effect = builder.build();
FireworkMeta fmeta = (FireworkMeta)stack.getItemMeta();
fmeta.addEffect(effect);
if (fmeta.getEffects().size() > 1 && !hasMetaPermission(sender, "firework-multiple", true, true, ess))
{
throw new Exception(tl("multipleCharges"));
}
stack.setItemMeta(fmeta);
builder = FireworkEffect.builder();
}
List<Color> primaryColors = new ArrayList<Color>();
String[] colors = split[1].split(",");
for (String color : colors)
{
if (colorMap.containsKey(color.toUpperCase()))
{
validFirework = true;
primaryColors.add(colorMap.get(color.toUpperCase()).getFireworkColor());
}
else
{
throw new Exception(tl("invalidFireworkFormat", split[1], split[0]));
}
}
builder.withColor(primaryColors);
}
else if (split[0].equalsIgnoreCase("shape") || split[0].equalsIgnoreCase("type") || (allowShortName && (split[0].equalsIgnoreCase("s") || split[0].equalsIgnoreCase("t"))))
{
FireworkEffect.Type finalEffect = null;
split[1] = (split[1].equalsIgnoreCase("large") ? "BALL_LARGE" : split[1]);
if (fireworkShape.containsKey(split[1].toUpperCase()))
{
finalEffect = fireworkShape.get(split[1].toUpperCase());
}
else
{
throw new Exception(tl("invalidFireworkFormat", split[1], split[0]));
}
if (finalEffect != null)
{
builder.with(finalEffect);
}
}
else if (split[0].equalsIgnoreCase("fade") || (allowShortName && split[0].equalsIgnoreCase("f")))
{
List<Color> fadeColors = new ArrayList<Color>();
String[] colors = split[1].split(",");
for (String color : colors)
{
if (colorMap.containsKey(color.toUpperCase()))
{
fadeColors.add(colorMap.get(color.toUpperCase()).getFireworkColor());
}
else
{
throw new Exception(tl("invalidFireworkFormat", split[1], split[0]));
}
}
if (!fadeColors.isEmpty())
{
builder.withFade(fadeColors);
}
}
else if (split[0].equalsIgnoreCase("effect") || (allowShortName && split[0].equalsIgnoreCase("e")))
{
String[] effects = split[1].split(",");
for (String effect : effects)
{
if (effect.equalsIgnoreCase("twinkle"))
{
builder.flicker(true);
}
else if (effect.equalsIgnoreCase("trail"))
{
builder.trail(true);
}
else
{
throw new Exception(tl("invalidFireworkFormat", split[1], split[0]));
}
}
}
}
}
public void addPotionMeta(final CommandSource sender, final boolean allowShortName, final String string, final IEssentials ess) throws Exception
{
if (stack.getType() == Material.POTION)
{
final String[] split = splitPattern.split(string, 2);
if (split.length < 2)
{
return;
}
if (split[0].equalsIgnoreCase("effect") || (allowShortName && split[0].equalsIgnoreCase("e")))
{
pEffectType = Potions.getByName(split[1]);
if (pEffectType != null && pEffectType.getName() != null)
{
if (hasMetaPermission(sender, "potions." + pEffectType.getName().toLowerCase(Locale.ENGLISH), true, false, ess))
{
validPotionEffect = true;
}
else
{
throw new Exception(tl("noPotionEffectPerm", pEffectType.getName().toLowerCase(Locale.ENGLISH)));
}
}
else
{
throw new Exception(tl("invalidPotionMeta", split[1]));
}
}
else if (split[0].equalsIgnoreCase("power") || (allowShortName && split[0].equalsIgnoreCase("p")))
{
if (NumberUtil.isInt(split[1]))
{
validPotionPower = true;
power = Integer.parseInt(split[1]);
if (power > 0 && power < 4)
{
power -= 1;
}
}
else
{
throw new Exception(tl("invalidPotionMeta", split[1]));
}
}
else if (split[0].equalsIgnoreCase("duration") || (allowShortName && split[0].equalsIgnoreCase("d")))
{
if (NumberUtil.isInt(split[1]))
{
validPotionDuration = true;
duration = Integer.parseInt(split[1]) * 20; //Duration is in ticks by default, converted to seconds
}
else
{
throw new Exception(tl("invalidPotionMeta", split[1]));
}
}
if (isValidPotion())
{
PotionMeta pmeta = (PotionMeta)stack.getItemMeta();
pEffect = pEffectType.createEffect(duration, power);
if (pmeta.getCustomEffects().size() > 1 && !hasMetaPermission(sender, "potions.multiple", true, false, ess))
{
throw new Exception(tl("multiplePotionEffects"));
}
pmeta.addCustomEffect(pEffect, true);
stack.setItemMeta(pmeta);
resetPotionMeta();
}
}
}
private void parseEnchantmentStrings(final CommandSource sender, final boolean allowUnsafe, final String[] split, final IEssentials ess) throws Exception
{
final Enchantment enchantment = Enchantments.getByName(split[0]);
if (enchantment == null || !hasMetaPermission(sender, "enchantments." + enchantment.getName().toLowerCase(Locale.ENGLISH), false, false, ess))
{
return;
}
int level = -1;
if (split.length > 1)
{
try
{
level = Integer.parseInt(split[1]);
}
catch (NumberFormatException ex)
{
level = -1;
}
}
if (level < 0 || (!allowUnsafe && level > enchantment.getMaxLevel()))
{
level = enchantment.getMaxLevel();
}
addEnchantment(sender, allowUnsafe, enchantment, level);
}
public void addEnchantment(final CommandSource sender, final boolean allowUnsafe, final Enchantment enchantment, final int level) throws Exception
{
if (enchantment == null)
{
throw new Exception(tl("enchantmentNotFound"));
}
try
{
if (stack.getType().equals(Material.ENCHANTED_BOOK))
{
EnchantmentStorageMeta meta = (EnchantmentStorageMeta)stack.getItemMeta();
if (level == 0)
{
meta.removeStoredEnchant(enchantment);
}
else
{
meta.addStoredEnchant(enchantment, level, allowUnsafe);
}
stack.setItemMeta(meta);
}
else // all other material types besides ENCHANTED_BOOK
{
if (level == 0)
{
stack.removeEnchantment(enchantment);
}
else
{
if (allowUnsafe)
{
stack.addUnsafeEnchantment(enchantment, level);
}
else
{
stack.addEnchantment(enchantment, level);
}
}
}
}
catch (Exception ex)
{
throw new Exception("Enchantment " + enchantment.getName() + ": " + ex.getMessage(), ex);
}
}
public Enchantment getEnchantment(final User user, final String name) throws Exception
{
final Enchantment enchantment = Enchantments.getByName(name);
if (enchantment == null)
{
return null;
}
final String enchantmentName = enchantment.getName().toLowerCase(Locale.ENGLISH);
if (!hasMetaPermission(user, "enchantments." + enchantmentName, true, false))
{
throw new Exception(tl("enchantmentPerm", enchantmentName));
}
return enchantment;
}
private boolean hasMetaPermission(final CommandSource sender, final String metaPerm, final boolean graceful, final boolean includeBase, final IEssentials ess) throws Exception
{
final User user = sender != null && sender.isPlayer() ? ess.getUser(sender.getPlayer()) : null;
return hasMetaPermission(user, metaPerm, graceful, includeBase);
}
private boolean hasMetaPermission(final User user, final String metaPerm, final boolean graceful, final boolean includeBase) throws Exception
{
final String permBase = includeBase ? "essentials.itemspawn.meta-" : "essentials.";
if (user == null || user.isAuthorized(permBase + metaPerm))
{
return true;
}
if (graceful)
{
return false;
}
else
{
throw new Exception(tl("noMetaPerm", metaPerm));
}
}
}

View File

@@ -1,39 +1,61 @@
package com.earth2me.essentials;
import java.util.HashMap;
import java.util.Map;
import static com.earth2me.essentials.I18n.tl;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.Location;
import org.bukkit.Server;
import org.bukkit.entity.CreatureType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.World;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
// Suffixes can be appended on the end of a mob name to make it plural
// Entities without a suffix, will default to 's'
public enum Mob
{
CHICKEN("Chicken", Enemies.FRIENDLY, CreatureType.CHICKEN),
COW("Cow", Enemies.FRIENDLY, CreatureType.COW),
CREEPER("Creeper", Enemies.ENEMY, CreatureType.CREEPER),
GHAST("Ghast", Enemies.ENEMY, CreatureType.GHAST),
GIANT("Giant", Enemies.ENEMY, CreatureType.GIANT),
PIG("Pig", Enemies.FRIENDLY, CreatureType.PIG),
PIGZOMB("PigZombie", Enemies.NEUTRAL, CreatureType.PIG_ZOMBIE),
SHEEP("Sheep", Enemies.FRIENDLY, "", CreatureType.SHEEP),
SKELETON("Skeleton", Enemies.ENEMY, CreatureType.SKELETON),
SLIME("Slime", Enemies.ENEMY, CreatureType.SLIME),
SPIDER("Spider", Enemies.ENEMY, CreatureType.SPIDER),
SQUID("Squid", Enemies.FRIENDLY, CreatureType.SQUID),
ZOMBIE("Zombie", Enemies.ENEMY, CreatureType.ZOMBIE),
WOLF("Wolf", Enemies.NEUTRAL, CreatureType.WOLF),
CAVESPIDER("CaveSpider", Enemies.ENEMY, CreatureType.CAVE_SPIDER),
ENDERMAN("Enderman", Enemies.ENEMY, "", CreatureType.ENDERMAN),
SILVERFISH("Silverfish", Enemies.ENEMY, "", CreatureType.SILVERFISH);
CHICKEN("Chicken", Enemies.FRIENDLY, EntityType.CHICKEN),
COW("Cow", Enemies.FRIENDLY, EntityType.COW),
CREEPER("Creeper", Enemies.ENEMY, EntityType.CREEPER),
GHAST("Ghast", Enemies.ENEMY, EntityType.GHAST),
GIANT("Giant", Enemies.ENEMY, EntityType.GIANT),
HORSE("Horse", Enemies.FRIENDLY, EntityType.HORSE),
PIG("Pig", Enemies.FRIENDLY, EntityType.PIG),
PIGZOMB("PigZombie", Enemies.NEUTRAL, EntityType.PIG_ZOMBIE),
SHEEP("Sheep", Enemies.FRIENDLY, "", EntityType.SHEEP),
SKELETON("Skeleton", Enemies.ENEMY, EntityType.SKELETON),
SLIME("Slime", Enemies.ENEMY, EntityType.SLIME),
SPIDER("Spider", Enemies.ENEMY, EntityType.SPIDER),
SQUID("Squid", Enemies.FRIENDLY, EntityType.SQUID),
ZOMBIE("Zombie", Enemies.ENEMY, EntityType.ZOMBIE),
WOLF("Wolf", Enemies.NEUTRAL, "", EntityType.WOLF),
CAVESPIDER("CaveSpider", Enemies.ENEMY, EntityType.CAVE_SPIDER),
ENDERMAN("Enderman", Enemies.ENEMY, "", EntityType.ENDERMAN),
SILVERFISH("Silverfish", Enemies.ENEMY, "", EntityType.SILVERFISH),
ENDERDRAGON("EnderDragon", Enemies.ENEMY, EntityType.ENDER_DRAGON),
VILLAGER("Villager", Enemies.FRIENDLY, EntityType.VILLAGER),
BLAZE("Blaze", Enemies.ENEMY, EntityType.BLAZE),
MUSHROOMCOW("MushroomCow", Enemies.FRIENDLY, EntityType.MUSHROOM_COW),
MAGMACUBE("MagmaCube", Enemies.ENEMY, EntityType.MAGMA_CUBE),
SNOWMAN("Snowman", Enemies.FRIENDLY, "", EntityType.SNOWMAN),
OCELOT("Ocelot", Enemies.NEUTRAL, EntityType.OCELOT),
IRONGOLEM("IronGolem", Enemies.NEUTRAL, EntityType.IRON_GOLEM),
WITHER("Wither", Enemies.ENEMY, EntityType.WITHER),
BAT("Bat", Enemies.FRIENDLY, EntityType.BAT),
WITCH("Witch", Enemies.ENEMY, EntityType.WITCH),
BOAT("Boat", Enemies.NEUTRAL, EntityType.BOAT),
MINECART("Minecart", Enemies.NEUTRAL, EntityType.MINECART),
MINECART_CHEST("ChestMinecart", Enemies.NEUTRAL, EntityType.MINECART_CHEST),
MINECART_FURNACE("FurnaceMinecart", Enemies.NEUTRAL, EntityType.MINECART_FURNACE),
MINECART_TNT("TNTMinecart", Enemies.NEUTRAL, EntityType.MINECART_TNT),
MINECART_HOPPER("HopperMinecart", Enemies.NEUTRAL, EntityType.MINECART_HOPPER),
MINECART_MOB_SPAWNER("SpawnerMinecart", Enemies.NEUTRAL, EntityType.MINECART_MOB_SPAWNER),
ENDERCRYSTAL("EnderCrystal", Enemies.NEUTRAL, EntityType.ENDER_CRYSTAL),
EXPERIENCEORB("ExperienceOrb", Enemies.NEUTRAL, EntityType.EXPERIENCE_ORB);
public static final Logger logger = Logger.getLogger("Essentials");
public static final Logger logger = Logger.getLogger("Minecraft");
private Mob(String n, Enemies en, String s, CreatureType type)
private Mob(String n, Enemies en, String s, EntityType type)
{
this.suffix = s;
this.name = n;
@@ -41,34 +63,39 @@ public enum Mob
this.bukkitType = type;
}
private Mob(String n, Enemies en, CreatureType type)
private Mob(String n, Enemies en, EntityType type)
{
this.name = n;
this.type = en;
this.bukkitType = type;
}
public String suffix = "s";
final public String name;
final public Enemies type;
final private CreatureType bukkitType;
final private EntityType bukkitType;
private static final Map<String, Mob> hashMap = new HashMap<String, Mob>();
private static final Map<EntityType, Mob> bukkitMap = new HashMap<EntityType, Mob>();
static
{
for (Mob mob : Mob.values())
{
hashMap.put(mob.name, mob);
hashMap.put(mob.name.toLowerCase(Locale.ENGLISH), mob);
bukkitMap.put(mob.bukkitType, mob);
}
}
public LivingEntity spawn(final Player player, final Server server, final Location loc) throws MobException
public static Set<String> getMobList()
{
return Collections.unmodifiableSet(hashMap.keySet());
}
final LivingEntity entity = player.getWorld().spawnCreature(loc, this.bukkitType);
public Entity spawn(final World world, final Server server, final Location loc) throws MobException
{
final Entity entity = world.spawn(loc, (Class<? extends Entity>)this.bukkitType.getEntityClass());
if (entity == null)
{
logger.log(Level.WARNING, Util.i18n("unableToSpawnMob"));
logger.log(Level.WARNING, tl("unableToSpawnMob"));
throw new MobException();
}
return entity;
@@ -81,24 +108,31 @@ public enum Mob
NEUTRAL("neutral"),
ENEMY("enemy");
private Enemies(final String t)
private Enemies(final String type)
{
this.type = t;
this.type = type;
}
final protected String type;
}
public CreatureType getType () {
public EntityType getType()
{
return bukkitType;
}
public static Mob fromName(final String name)
{
return hashMap.get(name.toLowerCase(Locale.ENGLISH));
}
public static Mob fromBukkitType(final EntityType type)
{
return bukkitMap.get(type);
}
public static class MobException extends Exception
{
private static final long serialVersionUID = 1L;
}
public static Mob fromName(String n)
{
return hashMap.get(n);
}
}

View File

@@ -0,0 +1,339 @@
package com.earth2me.essentials;
import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.utils.StringUtil;
import java.util.*;
import java.util.logging.Logger;
import org.bukkit.DyeColor;
import org.bukkit.Material;
import org.bukkit.entity.Ageable;
import org.bukkit.entity.Creeper;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.ExperienceOrb;
import org.bukkit.entity.Horse;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Ocelot;
import org.bukkit.entity.Pig;
import org.bukkit.entity.Player;
import org.bukkit.entity.Skeleton;
import org.bukkit.entity.Slime;
import org.bukkit.entity.Tameable;
import org.bukkit.entity.Villager;
import org.bukkit.entity.Wolf;
import org.bukkit.entity.Zombie;
import org.bukkit.inventory.EntityEquipment;
import org.bukkit.inventory.ItemStack;
import org.bukkit.material.Colorable;
public enum MobData
{
BABY_AGEABLE("baby", Ageable.class, Data.BABY, true),
BABY_PIG("piglet", EntityType.PIG, Data.BABY, false),
BABY_WOLF("puppy", EntityType.WOLF, Data.BABY, false),
BABY_CHICKEN("chick", EntityType.CHICKEN, Data.BABY, false),
BABY_HORSE("colt", EntityType.HORSE, Data.BABY, false),
BABY_OCELOT("kitten", EntityType.OCELOT, Data.BABY, false),
BABY_SHEEP("lamb", EntityType.SHEEP, Data.BABY, false),
BABY_COW("calf", EntityType.COW.getEntityClass(), Data.BABY, false),
BABY_VILLAGER("child", EntityType.VILLAGER, Data.BABY, false),
TAMED_TAMEABLE("tamed", Tameable.class, Data.TAMED, true),
TAME_TAMEABLE("tame", Tameable.class, Data.TAMED, false),
RANDOM_SHEEP("random", EntityType.SHEEP, Data.COLORABLE, true),
COLORABLE_SHEEP("", StringUtil.joinList(DyeColor.values()).toLowerCase(Locale.ENGLISH), EntityType.SHEEP, Data.COLORABLE, true),
DONKEY_HORSE("donkey", EntityType.HORSE, Horse.Variant.DONKEY, true),
MULE_HORSE("mule", EntityType.HORSE, Horse.Variant.MULE, true),
SKELETON_HORSE("skeleton", EntityType.HORSE, Horse.Variant.SKELETON_HORSE, true),
UNDEAD_HORSE("undead", EntityType.HORSE, Horse.Variant.UNDEAD_HORSE, true),
ZOMBIE_HORSE("zombie", EntityType.HORSE, Horse.Variant.UNDEAD_HORSE, false),
POLKA_HORSE("polka", EntityType.HORSE, Horse.Style.BLACK_DOTS, true),
SOOTY_HORSE("sooty", EntityType.HORSE, Horse.Style.BLACK_DOTS, false),
BLAZE_HORSE("blaze", EntityType.HORSE, Horse.Style.WHITE, true),
SOCKS_HORSE("socks", EntityType.HORSE, Horse.Style.WHITE, false),
LEOPARD_HORSE("leopard", EntityType.HORSE, Horse.Style.WHITE_DOTS, true),
APPALOOSA_HORSE("appaloosa", EntityType.HORSE, Horse.Style.WHITE_DOTS, false),
PAINT_HORSE("paint", EntityType.HORSE, Horse.Style.WHITEFIELD, true),
MILKY_HORSE("milky", EntityType.HORSE, Horse.Style.WHITEFIELD, false),
SPLOTCHY_HORSE("splotchy", EntityType.HORSE, Horse.Style.WHITEFIELD, false),
BLACK_HORSE("black", EntityType.HORSE, Horse.Color.BLACK, true),
CHESTNUT_HORSE("chestnut", EntityType.HORSE, Horse.Color.CHESTNUT, true),
LIVER_HORSE("liver", EntityType.HORSE, Horse.Color.CHESTNUT, false),
CREAMY_HORSE("creamy", EntityType.HORSE, Horse.Color.CREAMY, true),
FLAXEN_HORSE("flaxen", EntityType.HORSE, Horse.Color.CREAMY, false),
GRAY_HORSE("gray", EntityType.HORSE, Horse.Color.GRAY, true),
DAPPLE_HORSE("dapple", EntityType.HORSE, Horse.Color.GRAY, false),
BUCKSKIN_HORSE("buckskin", EntityType.HORSE, Horse.Color.DARK_BROWN, true),
DARKBROWN_HORSE("darkbrown", EntityType.HORSE, Horse.Color.DARK_BROWN, false),
DARK_HORSE("dark", EntityType.HORSE, Horse.Color.DARK_BROWN, false),
DBROWN_HORSE("dbrown", EntityType.HORSE, Horse.Color.DARK_BROWN, false),
BAY_HORSE("bay", EntityType.HORSE, Horse.Color.BROWN, true),
BROWN_HORSE("brown", EntityType.HORSE, Horse.Color.BROWN, false),
CHEST_HORSE("chest", EntityType.HORSE, Data.CHEST, true),
SADDLE_HORSE("saddle", EntityType.HORSE, Data.HORSESADDLE, true),
GOLD_ARMOR_HORSE("goldarmor", EntityType.HORSE, Material.GOLD_BARDING, true),
DIAMOND_ARMOR_HORSE("diamondarmor", EntityType.HORSE, Material.DIAMOND_BARDING, true),
ARMOR_HORSE("armor", EntityType.HORSE, Material.IRON_BARDING, true),
SIAMESE_CAT("siamese", EntityType.OCELOT, Ocelot.Type.SIAMESE_CAT, true),
WHITE_CAT("white", EntityType.OCELOT, Ocelot.Type.SIAMESE_CAT, false),
RED_CAT("red", EntityType.OCELOT, Ocelot.Type.RED_CAT, true),
ORANGE_CAT("orange", EntityType.OCELOT, Ocelot.Type.RED_CAT, false),
TABBY_CAT("tabby", EntityType.OCELOT, Ocelot.Type.RED_CAT, false),
BLACK_CAT("black", EntityType.OCELOT, Ocelot.Type.BLACK_CAT, true),
TUXEDO_CAT("tuxedo", EntityType.OCELOT, Ocelot.Type.BLACK_CAT, false),
VILLAGER_ZOMBIE("villager", EntityType.ZOMBIE.getEntityClass(), Data.VILLAGER, true),
BABY_ZOMBIE("baby", EntityType.ZOMBIE.getEntityClass(), Data.BABYZOMBIE, true),
DIAMOND_SWORD_ZOMBIE("diamondsword", EntityType.ZOMBIE.getEntityClass(), Material.DIAMOND_SWORD, true),
GOLD_SWORD_ZOMBIE("goldsword", EntityType.ZOMBIE.getEntityClass(), Material.GOLD_SWORD, true),
IRON_SWORD_ZOMBIE("ironsword", EntityType.ZOMBIE.getEntityClass(), Material.IRON_SWORD, true),
STONE_SWORD_ZOMBIE("stonesword", EntityType.ZOMBIE.getEntityClass(), Material.STONE_SWORD, false),
SWORD_ZOMBIE("sword", EntityType.ZOMBIE.getEntityClass(), Material.STONE_SWORD, true),
DIAMOND_SWORD_SKELETON("diamondsword", EntityType.SKELETON, Material.DIAMOND_SWORD, true),
GOLD_SWORD_SKELETON("goldsword", EntityType.SKELETON, Material.GOLD_SWORD, true),
IRON_SWORD_SKELETON("ironsword", EntityType.SKELETON, Material.IRON_SWORD, true),
STONE_SWORD_SKELETON("stonesword", EntityType.SKELETON, Material.STONE_SWORD, false),
SWORD_SKELETON("sword", EntityType.SKELETON, Material.STONE_SWORD, true),
BOW_SKELETON("bow", EntityType.SKELETON, Material.BOW, true),
WHITHER_SKELETON("wither", EntityType.SKELETON, Data.WITHER, true),
POWERED_CREEPER("powered", EntityType.CREEPER, Data.ELECTRIFIED, true),
ELECTRIC_CREEPER("electric", EntityType.CREEPER, Data.ELECTRIFIED, false),
CHARGED_CREEPER("charged", EntityType.CREEPER, Data.ELECTRIFIED, false),
SADDLE_PIG("saddle", EntityType.PIG, Data.PIGSADDLE, true),
ANGRY_WOLF("angry", EntityType.WOLF, Data.ANGRY, true),
RABID_WOLF("rabid", EntityType.WOLF, Data.ANGRY, false),
FARMER_VILLAGER("farmer", EntityType.VILLAGER, Villager.Profession.FARMER, true),
LIBRARIAN_VILLAGER("librarian", EntityType.VILLAGER, Villager.Profession.LIBRARIAN, true),
PRIEST_VILLAGER("priest", EntityType.VILLAGER, Villager.Profession.PRIEST, true),
FATHER_VILLAGER("father", EntityType.VILLAGER, Villager.Profession.PRIEST, false),
SMITH_VILLAGER("smith", EntityType.VILLAGER, Villager.Profession.BLACKSMITH, true),
BUTCHER_VILLAGER("butcher", EntityType.VILLAGER, Villager.Profession.BUTCHER, true),
SIZE_SLIME("", "<1-100>", EntityType.SLIME.getEntityClass(), Data.SIZE, true),
NUM_EXPERIENCE_ORB("", "<1-2000000000>", EntityType.EXPERIENCE_ORB, Data.EXP, true);
public enum Data
{
BABY,
CHEST,
BABYZOMBIE,
VILLAGER,
HORSESADDLE,
PIGSADDLE,
ELECTRIFIED,
WITHER,
ANGRY,
TAMED,
COLORABLE,
EXP,
SIZE;
}
public static final Logger logger = Logger.getLogger("Essentials");
private MobData(String n, Object type, Object value, boolean isPublic)
{
this.nickname = n;
this.matched = n;
this.helpMessage = n;
this.type = type;
this.value = value;
this.isPublic = isPublic;
}
private MobData(String n, String h, Object type, Object value, boolean isPublic)
{
this.nickname = n;
this.matched = n;
this.helpMessage = h;
this.type = type;
this.value = value;
this.isPublic = isPublic;
}
final private String nickname;
final private String helpMessage;
final private Object type;
final private Object value;
final private boolean isPublic;
private String matched;
public static LinkedHashMap<String, MobData> getPossibleData(final Entity spawned, boolean publicOnly)
{
LinkedHashMap<String, MobData> mobList = new LinkedHashMap<String, MobData>();
for (MobData data : MobData.values())
{
if (data.type instanceof EntityType && spawned.getType().equals(data.type) && ((publicOnly && data.isPublic) || !publicOnly))
{
mobList.put(data.nickname.toLowerCase(Locale.ENGLISH), data);
}
else if (data.type instanceof Class && ((Class)data.type).isAssignableFrom(spawned.getClass()) && ((publicOnly && data.isPublic) || !publicOnly))
{
mobList.put(data.nickname.toLowerCase(Locale.ENGLISH), data);
}
}
return mobList;
}
public static List<String> getValidHelp(final Entity spawned)
{
List<String> output = new ArrayList<String>();
LinkedHashMap<String, MobData> posData = getPossibleData(spawned, true);
for (MobData data : posData.values())
{
output.add(data.helpMessage);
}
return output;
}
public static MobData fromData(final Entity spawned, final String name)
{
if (name.isEmpty())
{
return null;
}
LinkedHashMap<String, MobData> posData = getPossibleData(spawned, false);
for (String data : posData.keySet())
{
if (name.contains(data))
{
return posData.get(data);
}
}
return null;
}
public String getMatched()
{
return this.matched;
}
public void setData(final Entity spawned, final Player target, final String rawData) throws Exception
{
if (this.value.equals(Data.ANGRY))
{
((Wolf)spawned).setAngry(true);
}
else if (this.value.equals(Data.BABY))
{
((Ageable)spawned).setBaby();
}
else if (this.value.equals(Data.BABYZOMBIE))
{
((Zombie)spawned).setBaby(true);
}
else if (this.value.equals(Data.CHEST))
{
((Horse)spawned).setTamed(true);
((Horse)spawned).setCarryingChest(true);
}
else if (this.value.equals(Data.ELECTRIFIED))
{
((Creeper)spawned).setPowered(true);
}
else if (this.value.equals(Data.HORSESADDLE))
{
final Horse horse = ((Horse)spawned);
horse.setTamed(true);
horse.setOwner(target);
horse.getInventory().setSaddle(new ItemStack(Material.SADDLE, 1));
}
else if (this.value.equals(Data.PIGSADDLE))
{
((Pig)spawned).setSaddle(true);
}
else if (this.value.equals(Data.TAMED))
{
final Tameable tameable = ((Tameable)spawned);
tameable.setTamed(true);
tameable.setOwner(target);
}
else if (this.value.equals(Data.VILLAGER))
{
((Zombie)spawned).setVillager(this.value.equals(Data.VILLAGER));
}
else if (this.value.equals(Data.WITHER))
{
((Skeleton)spawned).setSkeletonType(Skeleton.SkeletonType.WITHER);
}
else if (this.value.equals(Data.COLORABLE))
{
final String color = rawData.toUpperCase(Locale.ENGLISH);
try
{
if (color.equals("RANDOM"))
{
final Random rand = new Random();
((Colorable)spawned).setColor(DyeColor.values()[rand.nextInt(DyeColor.values().length)]);
}
else if (!color.isEmpty())
{
((Colorable)spawned).setColor(DyeColor.valueOf(color));
}
this.matched = rawData;
}
catch (Exception e)
{
throw new Exception(tl("sheepMalformedColor"), e);
}
}
else if (this.value.equals(Data.EXP))
{
try
{
((ExperienceOrb)spawned).setExperience(Integer.parseInt(rawData));
this.matched = rawData;
}
catch (NumberFormatException e)
{
throw new Exception(tl("invalidNumber"), e);
}
}
else if (this.value.equals(Data.SIZE))
{
try
{
((Slime)spawned).setSize(Integer.parseInt(rawData));
this.matched = rawData;
}
catch (NumberFormatException e)
{
throw new Exception(tl("slimeMalformedSize"), e);
}
}
else if (this.value instanceof Horse.Color)
{
((Horse)spawned).setColor((Horse.Color)this.value);
}
else if (this.value instanceof Horse.Style)
{
((Horse)spawned).setStyle((Horse.Style)this.value);
}
else if (this.value instanceof Horse.Variant)
{
((Horse)spawned).setVariant((Horse.Variant)this.value);
}
else if (this.value instanceof Ocelot.Type)
{
((Ocelot)spawned).setCatType((Ocelot.Type)this.value);
}
else if (this.value instanceof Villager.Profession)
{
((Villager)spawned).setProfession((Villager.Profession)this.value);
}
else if (this.value instanceof Material)
{
if (this.type.equals(EntityType.HORSE))
{
((Horse)spawned).setTamed(true);
((Horse)spawned).getInventory().setArmor(new ItemStack((Material)this.value, 1));
}
else if (this.type.equals(EntityType.ZOMBIE.getEntityClass()) || this.type.equals(EntityType.SKELETON))
{
final EntityEquipment invent = ((LivingEntity)spawned).getEquipment();
invent.setItemInHand(new ItemStack((Material)this.value, 1));
invent.setItemInHandDropChance(0.1f);
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,12 +1,11 @@
package com.earth2me.essentials;
import lombok.Delegate;
import org.bukkit.craftbukkit.entity.CraftPlayer;
import net.minecraft.server.EntityPlayer;
import net.minecraft.server.IInventory;
import org.bukkit.Location;
import org.bukkit.Server;
import org.bukkit.World;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.bukkit.craftbukkit.inventory.CraftInventoryPlayer;
import org.bukkit.entity.Entity;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.LivingEntity;
@@ -15,23 +14,15 @@ import org.bukkit.permissions.Permissible;
import org.bukkit.permissions.ServerOperator;
public class PlayerExtension implements Player
public class PlayerExtension
{
protected final transient IEssentials ess;
@Delegate(types =
{
Player.class, Entity.class, CommandSender.class, ServerOperator.class,
HumanEntity.class, ConfigurationSerializable.class, LivingEntity.class,
Permissible.class
})
protected Player base;
public PlayerExtension(final Player base, final IEssentials ess)
public PlayerExtension(final Player base)
{
this.base = base;
this.ess = ess;
}
public final Player getBase()
{
return base;
@@ -42,43 +33,16 @@ public class PlayerExtension implements Player
return this.base = base;
}
public void showInventory(final IInventory inventory)
public Server getServer()
{
getHandle().a(inventory);
}
public void showInventory(final CraftInventoryPlayer inventory)
{
showInventory((IInventory)inventory.getInventory());
}
public TargetBlock getTarget()
{
return new TargetBlock(getBase());
}
public String getGroup()
{
return ess.getPermissionsHandler().getGroup(base);
return base.getServer();
}
public boolean inGroup(final String group)
{
return ess.getPermissionsHandler().inGroup(base, group);
public World getWorld() {
return base.getWorld();
}
public boolean canBuild()
{
return ess.getPermissionsHandler().canBuild(base, getGroup());
}
public EntityPlayer getHandle()
{
return getCraftPlayer().getHandle();
}
public CraftPlayer getCraftPlayer()
{
return (CraftPlayer)base;
public Location getLocation() {
return base.getLocation();
}
}

View File

@@ -0,0 +1,151 @@
package com.earth2me.essentials;
import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.utils.FormatUtil;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import org.bukkit.Server;
import org.bukkit.entity.Player;
public class PlayerList
{
// Cosmetic list formatting
public static String listUsers(final IEssentials ess, final List<User> users, final String seperator)
{
final StringBuilder groupString = new StringBuilder();
Collections.sort(users);
boolean needComma = false;
for (User user : users)
{
if (needComma)
{
groupString.append(seperator);
}
needComma = true;
if (user.isAfk())
{
groupString.append(tl("listAfkTag"));
}
if (user.isHidden())
{
groupString.append(tl("listHiddenTag"));
}
user.setDisplayNick();
groupString.append(user.getDisplayName());
groupString.append("\u00a7f");
}
return groupString.toString();
}
// Produce a user summary: There are 5 out of maximum 10 players online.
public static String listSummary(final IEssentials ess, final boolean showHidden)
{
Server server = ess.getServer();
int playerHidden = 0;
for (Player onlinePlayer : server.getOnlinePlayers())
{
if (ess.getUser(onlinePlayer).isHidden())
{
playerHidden++;
}
}
String online;
if (showHidden && playerHidden > 0)
{
online = tl("listAmountHidden", server.getOnlinePlayers().length - playerHidden, playerHidden, server.getMaxPlayers());
}
else
{
online = tl("listAmount", server.getOnlinePlayers().length - playerHidden, server.getMaxPlayers());
}
return online;
}
// Build the basic player list, divided by groups.
public static Map<String, List<User>> getPlayerLists(final IEssentials ess, final boolean showHidden)
{
Server server = ess.getServer();
final Map<String, List<User>> playerList = new HashMap<String, List<User>>();
for (Player onlinePlayer : server.getOnlinePlayers())
{
final User onlineUser = ess.getUser(onlinePlayer);
if (onlineUser.isHidden() && !showHidden)
{
continue;
}
final String group = FormatUtil.stripFormat(FormatUtil.stripEssentialsFormat(onlineUser.getGroup().toLowerCase()));
List<User> list = playerList.get(group);
if (list == null)
{
list = new ArrayList<User>();
playerList.put(group, list);
}
list.add(onlineUser);
}
return playerList;
}
// Handle the merging of groups
public static List<User> getMergedList(final IEssentials ess, final Map<String, List<User>> playerList, final String groupName)
{
final Set<String> configGroups = ess.getSettings().getListGroupConfig().keySet();
final List<User> users = new ArrayList<User>();
for (String configGroup : configGroups)
{
if (configGroup.equalsIgnoreCase(groupName))
{
String[] groupValues = ess.getSettings().getListGroupConfig().get(configGroup).toString().trim().split(" ");
for (String groupValue : groupValues)
{
groupValue = groupValue.toLowerCase(Locale.ENGLISH);
if (groupValue == null || groupValue.isEmpty())
{
continue;
}
List<User> u = playerList.get(groupValue.trim());
if (u == null || u.isEmpty())
{
continue;
}
playerList.remove(groupValue);
users.addAll(u);
}
}
}
return users;
}
// Output a playerlist of just a single group, /list <groupname>
public static String listGroupUsers(final IEssentials ess, final Map<String, List<User>> playerList, final String groupName) throws Exception
{
final List<User> users = getMergedList(ess, playerList, groupName);
final List<User> groupUsers = playerList.get(groupName);
if (groupUsers != null && !groupUsers.isEmpty())
{
users.addAll(groupUsers);
}
if (users == null || users.isEmpty())
{
throw new Exception(tl("groupDoesNotExist"));
}
final StringBuilder displayGroupName = new StringBuilder();
displayGroupName.append(Character.toTitleCase(groupName.charAt(0)));
displayGroupName.append(groupName.substring(1));
return outputFormat(displayGroupName.toString(), listUsers(ess, users, ", "));
}
// Build the output string
public static String outputFormat(final String group, final String message)
{
final StringBuilder outputString = new StringBuilder();
outputString.append(tl("listGroupTag", FormatUtil.replaceFormat(group)));
outputString.append(message);
return outputString.toString();
}
}

View File

@@ -0,0 +1,22 @@
package com.earth2me.essentials;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Player;
public class PlayerTarget implements ITarget
{
private final String name;
public PlayerTarget(Player entity)
{
this.name = entity.getName();
}
@Override
public Location getLocation()
{
return Bukkit.getServer().getPlayerExact(name).getLocation();
}
}

View File

@@ -0,0 +1,160 @@
package com.earth2me.essentials;
import com.earth2me.essentials.utils.NumberUtil;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.bukkit.potion.PotionEffectType;
public class Potions
{
private static final Map<String, PotionEffectType> POTIONS = new HashMap<String, PotionEffectType>();
private static final Map<String, PotionEffectType> ALIASPOTIONS = new HashMap<String, PotionEffectType>();
static
{
POTIONS.put("speed", PotionEffectType.SPEED);
ALIASPOTIONS.put("fast", PotionEffectType.SPEED);
ALIASPOTIONS.put("runfast", PotionEffectType.SPEED);
ALIASPOTIONS.put("sprint", PotionEffectType.SPEED);
ALIASPOTIONS.put("swift", PotionEffectType.SPEED);
POTIONS.put("slowness", PotionEffectType.SLOW);
ALIASPOTIONS.put("slow", PotionEffectType.SLOW);
ALIASPOTIONS.put("sluggish", PotionEffectType.SLOW);
POTIONS.put("haste", PotionEffectType.FAST_DIGGING);
ALIASPOTIONS.put("superpick", PotionEffectType.FAST_DIGGING);
ALIASPOTIONS.put("quickmine", PotionEffectType.FAST_DIGGING);
ALIASPOTIONS.put("digspeed", PotionEffectType.FAST_DIGGING);
ALIASPOTIONS.put("digfast", PotionEffectType.FAST_DIGGING);
ALIASPOTIONS.put("sharp", PotionEffectType.FAST_DIGGING);
POTIONS.put("fatigue", PotionEffectType.SLOW_DIGGING);
ALIASPOTIONS.put("slow", PotionEffectType.SLOW_DIGGING);
ALIASPOTIONS.put("dull", PotionEffectType.SLOW_DIGGING);
POTIONS.put("strength", PotionEffectType.INCREASE_DAMAGE);
ALIASPOTIONS.put("strong", PotionEffectType.INCREASE_DAMAGE);
ALIASPOTIONS.put("bull", PotionEffectType.INCREASE_DAMAGE);
ALIASPOTIONS.put("attack", PotionEffectType.INCREASE_DAMAGE);
POTIONS.put("heal", PotionEffectType.HEAL);
ALIASPOTIONS.put("healthy", PotionEffectType.HEAL);
ALIASPOTIONS.put("instaheal", PotionEffectType.HEAL);
POTIONS.put("harm", PotionEffectType.HARM);
ALIASPOTIONS.put("harming", PotionEffectType.HARM);
ALIASPOTIONS.put("injure", PotionEffectType.HARM);
ALIASPOTIONS.put("damage", PotionEffectType.HARM);
ALIASPOTIONS.put("inflict", PotionEffectType.HARM);
POTIONS.put("jump", PotionEffectType.JUMP);
ALIASPOTIONS.put("leap", PotionEffectType.JUMP);
POTIONS.put("nausea", PotionEffectType.CONFUSION);
ALIASPOTIONS.put("sick", PotionEffectType.CONFUSION);
ALIASPOTIONS.put("sickness", PotionEffectType.CONFUSION);
ALIASPOTIONS.put("confusion", PotionEffectType.CONFUSION);
POTIONS.put("regeneration", PotionEffectType.REGENERATION);
ALIASPOTIONS.put("regen", PotionEffectType.REGENERATION);
POTIONS.put("resistance", PotionEffectType.DAMAGE_RESISTANCE);
ALIASPOTIONS.put("dmgresist", PotionEffectType.DAMAGE_RESISTANCE);
ALIASPOTIONS.put("armor", PotionEffectType.DAMAGE_RESISTANCE);
POTIONS.put("fireresist", PotionEffectType.FIRE_RESISTANCE);
ALIASPOTIONS.put("fireresistance", PotionEffectType.FIRE_RESISTANCE);
ALIASPOTIONS.put("resistfire", PotionEffectType.FIRE_RESISTANCE);
POTIONS.put("waterbreath", PotionEffectType.WATER_BREATHING);
ALIASPOTIONS.put("waterbreathing", PotionEffectType.WATER_BREATHING);
POTIONS.put("invisibility", PotionEffectType.INVISIBILITY);
ALIASPOTIONS.put("invisible", PotionEffectType.INVISIBILITY);
ALIASPOTIONS.put("invis", PotionEffectType.INVISIBILITY);
ALIASPOTIONS.put("vanish", PotionEffectType.INVISIBILITY);
ALIASPOTIONS.put("disappear", PotionEffectType.INVISIBILITY);
POTIONS.put("blindness", PotionEffectType.BLINDNESS);
ALIASPOTIONS.put("blind", PotionEffectType.BLINDNESS);
POTIONS.put("nightvision", PotionEffectType.NIGHT_VISION);
ALIASPOTIONS.put("vision", PotionEffectType.NIGHT_VISION);
POTIONS.put("hunger", PotionEffectType.HUNGER);
ALIASPOTIONS.put("hungry", PotionEffectType.HUNGER);
ALIASPOTIONS.put("starve", PotionEffectType.HUNGER);
POTIONS.put("weakness", PotionEffectType.WEAKNESS);
ALIASPOTIONS.put("weak", PotionEffectType.WEAKNESS);
POTIONS.put("poison", PotionEffectType.POISON);
ALIASPOTIONS.put("venom", PotionEffectType.POISON);
POTIONS.put("wither", PotionEffectType.WITHER);
ALIASPOTIONS.put("decay", PotionEffectType.WITHER);
try // 1.6 update
{
POTIONS.put("healthboost", PotionEffectType.HEALTH_BOOST);
ALIASPOTIONS.put("boost", PotionEffectType.HEALTH_BOOST);
POTIONS.put("absorption", PotionEffectType.ABSORPTION);
ALIASPOTIONS.put("absorb", PotionEffectType.ABSORPTION);
POTIONS.put("saturation", PotionEffectType.SATURATION);
ALIASPOTIONS.put("food", PotionEffectType.SATURATION);
}
catch (java.lang.NoSuchFieldError e)
{
Essentials.wrongVersion();
}
try // 1.7 update
{
POTIONS.put("waterbreathing", PotionEffectType.WATER_BREATHING);
ALIASPOTIONS.put("underwaterbreathing", PotionEffectType.WATER_BREATHING);
ALIASPOTIONS.put("waterbreath", PotionEffectType.WATER_BREATHING);
ALIASPOTIONS.put("underwaterbreath", PotionEffectType.WATER_BREATHING);
ALIASPOTIONS.put("air", PotionEffectType.WATER_BREATHING);
}
catch (java.lang.NoSuchFieldError e)
{
Essentials.wrongVersion();
}
}
public static PotionEffectType getByName(String name)
{
PotionEffectType peffect;
if (NumberUtil.isInt(name))
{
peffect = PotionEffectType.getById(Integer.parseInt(name));
}
else
{
peffect = PotionEffectType.getByName(name.toUpperCase(Locale.ENGLISH));
}
if (peffect == null)
{
peffect = POTIONS.get(name.toLowerCase(Locale.ENGLISH));
}
if (peffect == null)
{
peffect = ALIASPOTIONS.get(name.toLowerCase(Locale.ENGLISH));
}
return peffect;
}
public static Set<Entry<String, PotionEffectType>> entrySet()
{
return POTIONS.entrySet();
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,102 +0,0 @@
package com.earth2me.essentials;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Logger;
import org.bukkit.Location;
import org.bukkit.Server;
import org.bukkit.World;
import org.bukkit.World.Environment;
public class Spawn implements IConf
{
private static final Logger logger = Logger.getLogger("Minecraft");
private final EssentialsConf config;
private final Server server;
public Spawn(Server server, File dataFolder)
{
File configFile = new File(dataFolder, "spawn.yml");
this.server = server;
config = new EssentialsConf(configFile);
config.load();
}
public void setSpawn(Location loc, String group)
{
Map<String, Object> map = new HashMap<String, Object>();
map.put("world", loc.getWorld().getName());
map.put("x", loc.getX());
map.put("y", loc.getY());
map.put("z", loc.getZ());
map.put("yaw", loc.getYaw());
map.put("pitch", loc.getPitch());
config.setProperty(group, map);
config.save();
if ("default".equals(group))
{
loc.getWorld().setSpawnLocation(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
}
}
public Location getSpawn(String group)
{
if (config.getProperty(group) == null)
{
group = "default";
}
if (config.getProperty(group) == null)
{
for (World w : server.getWorlds())
{
if (w.getEnvironment() != Environment.NORMAL)
{
continue;
}
return w.getSpawnLocation();
}
}
String worldId = config.getString(group + ".world", "");
World world = server.getWorlds().get(server.getWorlds().size() > 1 ? 1 : 0);
for (World w : server.getWorlds())
{
if (w.getEnvironment() != Environment.NORMAL)
{
continue;
}
world = w;
break;
}
for (World w : server.getWorlds())
{
if (!w.getName().equals(worldId))
{
continue;
}
world = w;
break;
}
double x = config.getDouble(group + ".x", config.getDouble("default.x", 0));
double y = config.getDouble(group + ".y", config.getDouble("default.y", 0));
double z = config.getDouble(group + ".z", config.getDouble("default.z", 0));
float yaw = (float)config.getDouble(group + ".yaw", config.getDouble("default.yaw", 0));
float pitch = (float)config.getDouble(group + ".pitch", config.getDouble("default.pitch", 0));
Location retval = new Location(world, x, y, z, yaw, pitch);
if (y < 1)
{
retval.setY(world.getHighestBlockYAt(retval));
}
return retval;
}
public void reloadConfig()
{
config.load();
}
}

View File

@@ -0,0 +1,308 @@
package com.earth2me.essentials;
import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.Mob.MobException;
import com.earth2me.essentials.utils.LocationUtil;
import com.earth2me.essentials.utils.StringUtil;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Set;
import net.ess3.api.IEssentials;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Server;
import org.bukkit.block.Block;
import org.bukkit.entity.*;
import org.bukkit.inventory.EntityEquipment;
import org.bukkit.inventory.ItemStack;
public class SpawnMob
{
public static String mobList(final User user)
{
final Set<String> mobList = Mob.getMobList();
final Set<String> availableList = new HashSet<String>();
for (String mob : mobList)
{
if (user.isAuthorized("essentials.spawnmob." + mob.toLowerCase(Locale.ENGLISH)))
{
availableList.add(mob);
}
}
if (availableList.isEmpty())
{
availableList.add(tl("none"));
}
return StringUtil.joinList(availableList);
}
public static List<String> mobParts(final String mobString)
{
String[] mobParts = mobString.split(",");
List<String> mobs = new ArrayList<String>();
for (String mobPart : mobParts)
{
String[] mobDatas = mobPart.split(":");
mobs.add(mobDatas[0]);
}
return mobs;
}
public static List<String> mobData(final String mobString)
{
String[] mobParts = mobString.split(",");
List<String> mobData = new ArrayList<String>();
for (String mobPart : mobParts)
{
String[] mobDatas = mobPart.split(":");
if (mobDatas.length == 1)
{
if (mobPart.contains(":"))
{
mobData.add("");
}
else
{
mobData.add(null);
}
}
else
{
mobData.add(mobDatas[1]);
}
}
return mobData;
}
// This method spawns a mob where the user is looking, owned by user
public static void spawnmob(final IEssentials ess, final Server server, final User user, final List<String> parts, final List<String> data, int mobCount) throws Exception
{
final Block block = LocationUtil.getTarget(user.getBase()).getBlock();
if (block == null)
{
throw new Exception(tl("unableToSpawnMob"));
}
spawnmob(ess, server, user.getSource(), user, block.getLocation(), parts, data, mobCount);
}
// This method spawns a mob at target, owned by target
public static void spawnmob(final IEssentials ess, final Server server, final CommandSource sender, final User target, final List<String> parts, final List<String> data, int mobCount) throws Exception
{
spawnmob(ess, server, sender, target, target.getLocation(), parts, data, mobCount);
}
// This method spawns a mob at loc, owned by target
public static void spawnmob(final IEssentials ess, final Server server, final CommandSource sender, final User target, final Location loc, final List<String> parts, final List<String> data, int mobCount) throws Exception
{
final Location sloc = LocationUtil.getSafeDestination(loc);
for (int i = 0; i < parts.size(); i++)
{
Mob mob = Mob.fromName(parts.get(i));
checkSpawnable(ess, sender, mob);
}
final int serverLimit = ess.getSettings().getSpawnMobLimit();
int effectiveLimit = serverLimit / parts.size();
if (effectiveLimit < 1)
{
effectiveLimit = 1;
while (parts.size() > serverLimit)
{
parts.remove(serverLimit);
}
}
if (mobCount > effectiveLimit)
{
mobCount = effectiveLimit;
sender.sendMessage(tl("mobSpawnLimit"));
}
Mob mob = Mob.fromName(parts.get(0)); // Get the first mob
try
{
for (int i = 0; i < mobCount; i++)
{
spawnMob(ess, server, sender, target, sloc, parts, data);
}
sender.sendMessage(mobCount * parts.size() + " " + mob.name.toLowerCase(Locale.ENGLISH) + mob.suffix + " " + tl("spawned"));
}
catch (MobException e1)
{
throw new Exception(tl("unableToSpawnMob"), e1);
}
catch (NumberFormatException e2)
{
throw new Exception(tl("numberRequired"), e2);
}
catch (NullPointerException np)
{
throw new Exception(tl("soloMob"), np);
}
}
private static void spawnMob(final IEssentials ess, final Server server, final CommandSource sender, final User target, final Location sloc, List<String> parts, List<String> data) throws Exception
{
Mob mob;
Entity spawnedMob = null;
Entity spawnedMount;
for (int i = 0; i < parts.size(); i++)
{
if (i == 0)
{
mob = Mob.fromName(parts.get(i));
spawnedMob = mob.spawn(sloc.getWorld(), server, sloc);
defaultMobData(mob.getType(), spawnedMob);
if (data.get(i) != null)
{
changeMobData(sender, mob.getType(), spawnedMob, data.get(i).toLowerCase(Locale.ENGLISH), target);
}
}
int next = (i + 1);
if (next < parts.size()) //If it's the last mob in the list, don't set the mount
{
Mob mMob = Mob.fromName(parts.get(next));
spawnedMount = mMob.spawn(sloc.getWorld(), server, sloc);
defaultMobData(mMob.getType(), spawnedMount);
if (data.get(next) != null)
{
changeMobData(sender, mMob.getType(), spawnedMount, data.get(next).toLowerCase(Locale.ENGLISH), target);
}
spawnedMob.setPassenger(spawnedMount);
spawnedMob = spawnedMount;
}
}
}
private static void checkSpawnable(IEssentials ess, CommandSource sender, Mob mob) throws Exception
{
if (mob == null)
{
throw new Exception(tl("invalidMob"));
}
if (ess.getSettings().getProtectPreventSpawn(mob.getType().toString().toLowerCase(Locale.ENGLISH)))
{
throw new Exception(tl("disabledToSpawnMob"));
}
if (sender.isPlayer() && !ess.getUser(sender.getPlayer()).isAuthorized("essentials.spawnmob." + mob.name.toLowerCase(Locale.ENGLISH)))
{
throw new Exception(tl("noPermToSpawnMob"));
}
}
private static void changeMobData(final CommandSource sender, final EntityType type, final Entity spawned, final String inputData, final User target) throws Exception
{
String data = inputData;
if (data.isEmpty())
{
sender.sendMessage(tl("mobDataList", StringUtil.joinList(MobData.getValidHelp(spawned))));
}
if (spawned instanceof Zombie || type == EntityType.SKELETON)
{
if (inputData.contains("armor") || inputData.contains("armour"))
{
final EntityEquipment invent = ((LivingEntity)spawned).getEquipment();
if (inputData.contains("noarmor") || inputData.contains("noarmour"))
{
invent.clear();
}
else if (inputData.contains("diamond"))
{
invent.setBoots(new ItemStack(Material.DIAMOND_BOOTS, 1));
invent.setLeggings(new ItemStack(Material.DIAMOND_LEGGINGS, 1));
invent.setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE, 1));
invent.setHelmet(new ItemStack(Material.DIAMOND_HELMET, 1));
}
else if (inputData.contains("gold"))
{
invent.setBoots(new ItemStack(Material.GOLD_BOOTS, 1));
invent.setLeggings(new ItemStack(Material.GOLD_LEGGINGS, 1));
invent.setChestplate(new ItemStack(Material.GOLD_CHESTPLATE, 1));
invent.setHelmet(new ItemStack(Material.GOLD_HELMET, 1));
}
else if (inputData.contains("leather"))
{
invent.setBoots(new ItemStack(Material.LEATHER_BOOTS, 1));
invent.setLeggings(new ItemStack(Material.LEATHER_LEGGINGS, 1));
invent.setChestplate(new ItemStack(Material.LEATHER_CHESTPLATE, 1));
invent.setHelmet(new ItemStack(Material.LEATHER_HELMET, 1));
}
else
{
invent.setBoots(new ItemStack(Material.IRON_BOOTS, 1));
invent.setLeggings(new ItemStack(Material.IRON_LEGGINGS, 1));
invent.setChestplate(new ItemStack(Material.IRON_CHESTPLATE, 1));
invent.setHelmet(new ItemStack(Material.IRON_HELMET, 1));
}
invent.setBootsDropChance(0f);
invent.setLeggingsDropChance(0f);
invent.setChestplateDropChance(0f);
invent.setHelmetDropChance(0f);
}
}
MobData newData = MobData.fromData(spawned, data);
while (newData != null)
{
newData.setData(spawned, target.getBase(), data);
data = data.replace(newData.getMatched(), "");
newData = MobData.fromData(spawned, data);
}
}
private static void defaultMobData(final EntityType type, final Entity spawned)
{
if (type == EntityType.SKELETON)
{
final EntityEquipment invent = ((LivingEntity)spawned).getEquipment();
invent.setItemInHand(new ItemStack(Material.BOW, 1));
invent.setItemInHandDropChance(0.1f);
invent.setBoots(new ItemStack(Material.GOLD_BOOTS, 1));
invent.setBootsDropChance(0.0f);
}
if (type == EntityType.PIG_ZOMBIE)
{
final EntityEquipment invent = ((LivingEntity)spawned).getEquipment();
invent.setItemInHand(new ItemStack(Material.GOLD_SWORD, 1));
invent.setItemInHandDropChance(0.1f);
invent.setBoots(new ItemStack(Material.GOLD_BOOTS, 1));
invent.setBootsDropChance(0.0f);
}
if (type == EntityType.ZOMBIE)
{
final EntityEquipment invent = ((LivingEntity)spawned).getEquipment();
invent.setBoots(new ItemStack(Material.GOLD_BOOTS, 1));
invent.setBootsDropChance(0.0f);
}
if (type == EntityType.HORSE)
{
((Horse)spawned).setJumpStrength(1.2);
}
}
}

View File

@@ -1,31 +1,22 @@
package com.earth2me.essentials;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.minecraft.server.ChunkPosition;
import net.minecraft.server.Packet60Explosion;
import org.bukkit.Location;
import org.bukkit.block.Block;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.CraftWorld;
import net.ess3.api.IEssentials;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.EntityListener;
public class TNTExplodeListener extends EntityListener implements Runnable
public class TNTExplodeListener implements Listener, Runnable
{
private final IEssentials ess;
private boolean enabled = false;
private int timer = -1;
private final transient IEssentials ess;
private transient boolean enabled = false;
private transient int timer = -1;
public TNTExplodeListener(IEssentials ess)
public TNTExplodeListener(final IEssentials ess)
{
super();
this.ess = ess;
}
@@ -34,17 +25,17 @@ public class TNTExplodeListener extends EntityListener implements Runnable
if (!enabled)
{
enabled = true;
timer = ess.scheduleSyncDelayedTask(this, 1000);
timer = ess.scheduleSyncDelayedTask(this, 200);
return;
}
if (timer != -1)
{
ess.getScheduler().cancelTask(timer);
timer = ess.scheduleSyncDelayedTask(this, 1000);
timer = ess.scheduleSyncDelayedTask(this, 200);
}
}
@Override
@EventHandler(priority = EventPriority.LOW)
public void onEntityExplode(final EntityExplodeEvent event)
{
if (!enabled)
@@ -55,36 +46,15 @@ public class TNTExplodeListener extends EntityListener implements Runnable
{
return;
}
try
if (event.blockList().size() < 1)
{
final Set<ChunkPosition> set = new HashSet<ChunkPosition>(event.blockList().size());
final Player[] players = ess.getServer().getOnlinePlayers();
final List<ChunkPosition> blocksUnderPlayers = new ArrayList<ChunkPosition>(players.length);
final Location loc = event.getLocation();
for (Player player : players)
{
if (player.getWorld().equals(loc.getWorld()))
{
blocksUnderPlayers.add(new ChunkPosition(player.getLocation().getBlockX(), player.getLocation().getBlockY() - 1, player.getLocation().getBlockZ()));
}
}
for (Block block : event.blockList())
{
final ChunkPosition cp = new ChunkPosition(block.getX(), block.getY(), block.getZ());
if (!blocksUnderPlayers.contains(cp))
{
set.add(cp);
}
}
((CraftServer)ess.getServer()).getHandle().sendPacketNearby(loc.getX(), loc.getY(), loc.getZ(), 64.0, ((CraftWorld)loc.getWorld()).getHandle().worldProvider.dimension, new Packet60Explosion(loc.getX(), loc.getY(), loc.getZ(), 3.0F, set));
}
catch (Throwable ex)
{
Logger.getLogger("Minecraft").log(Level.SEVERE, null, ex);
return;
}
event.setCancelled(true);
event.getLocation().getWorld().createExplosion(event.getLocation(), 0F);
}
@Override
public void run()
{
enabled = false;

View File

@@ -1,527 +0,0 @@
package com.earth2me.essentials;
import java.util.List;
import org.bukkit.block.Block;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Player;
/**
* Original authors: toi & Raphfrk
*/
@Deprecated
public class TargetBlock
{
private transient final Location location;
private transient final double viewHeight;
private transient final int maxDistance;
private transient final int[] blockToIgnore;
private transient final double checkDistance;
private transient double curDistance;
private transient double targetPositionX;
private transient double targetPositionY;
private transient double targetPositionZ;
private transient int itargetPositionX;
private transient int itargetPositionY;
private transient int itargetPositionZ;
private transient int prevPositionX;
private transient int prevPositionY;
private transient int prevPositionZ;
private transient final double offsetX;
private transient final double offsetY;
private transient final double offsetZ;
/**
* Constructor requiring a player, uses default values
*
* @param player Player to work with
*/
public TargetBlock(final Player player)
{
this(player.getLocation(), 300, 1.65, 0.2, null);
}
/**
* Constructor requiring a location, uses default values
*
* @param loc Location to work with
*/
public TargetBlock(final Location loc)
{
this(loc, 300, 0, 0.2, null);
}
/**
* Constructor requiring a player, max distance and a checking distance
*
* @param player Player to work with
* @param maxDistance How far it checks for blocks
* @param checkDistance How often to check for blocks, the smaller the more precise
*/
public TargetBlock(final Player player, final int maxDistance, final double checkDistance)
{
this(player.getLocation(), maxDistance, 1.65, checkDistance, null);
}
/**
* Constructor requiring a location, max distance and a checking distance
*
* @param loc What location to work with
* @param maxDistance How far it checks for blocks
* @param checkDistance How often to check for blocks, the smaller the more precise
*/
public TargetBlock(final Location loc, final int maxDistance, final double checkDistance)
{
this(loc, maxDistance, 0, checkDistance, null);
}
/**
* Constructor requiring a player, max distance, checking distance and an array of blocks to ignore
*
* @param player What player to work with
* @param maxDistance How far it checks for blocks
* @param checkDistance How often to check for blocks, the smaller the more precise
* @param blocksToIgnore Integer array of what block ids to ignore while checking for viable targets
*/
public TargetBlock(final Player player, final int maxDistance, final double checkDistance, final int[] blocksToIgnore)
{
this(player.getLocation(), maxDistance, 1.65, checkDistance, blocksToIgnore);
}
/**
* Constructor requiring a location, max distance, checking distance and an array of blocks to ignore
*
* @param loc What location to work with
* @param maxDistance How far it checks for blocks
* @param checkDistance How often to check for blocks, the smaller the more precise
* @param blocksToIgnore Array of what block ids to ignore while checking for viable targets
*/
public TargetBlock(final Location loc, final int maxDistance, final double checkDistance, final int[] blocksToIgnore)
{
this(loc, maxDistance, 0, checkDistance, blocksToIgnore);
}
/**
* Constructor requiring a player, max distance, checking distance and an array of blocks to ignore
*
* @param player What player to work with
* @param maxDistance How far it checks for blocks
* @param checkDistance How often to check for blocks, the smaller the more precise
* @param blocksToIgnore String ArrayList of what block ids to ignore while checking for viable targets
*/
public TargetBlock(final Player player, final int maxDistance, final double checkDistance, final List<String> blocksToIgnore)
{
this(player.getLocation(), maxDistance, 1.65, checkDistance, TargetBlock.convertStringArraytoIntArray(blocksToIgnore));
}
/**
* Constructor requiring a location, max distance, checking distance and an array of blocks to ignore
*
* @param loc What location to work with
* @param maxDistance How far it checks for blocks
* @param checkDistance How often to check for blocks, the smaller the more precise
* @param blocksToIgnore String ArrayList of what block ids to ignore while checking for viable targets
*/
public TargetBlock(final Location loc, final int maxDistance, final double checkDistance, final List<String> blocksToIgnore)
{
this(loc, maxDistance, 0, checkDistance, TargetBlock.convertStringArraytoIntArray(blocksToIgnore));
}
/**
* Set the values, all constructors uses this function
*
* @param loc Location of the view
* @param maxDistance How far it checks for blocks
* @param viewPos Where the view is positioned in y-axis
* @param checkDistance How often to check for blocks, the smaller the more precise
* @param blocksToIgnore Ids of blocks to ignore while checking for viable targets
*/
private TargetBlock(final Location loc, final int maxDistance, final double viewHeight, final double checkDistance, final int[] blocksToIgnore)
{
this.location = loc;
this.maxDistance = maxDistance;
this.viewHeight = viewHeight;
this.checkDistance = checkDistance;
if (blocksToIgnore == null || blocksToIgnore.length == 0)
{
this.blockToIgnore = new int[0];
}
else
{
this.blockToIgnore = new int[blocksToIgnore.length];
System.arraycopy(blocksToIgnore, 0, this.blockToIgnore, 0, this.blockToIgnore.length);
}
final double xRotation = (loc.getYaw() + 90) % 360;
final double yRotation = loc.getPitch() * -1;
final double hypotenuse = (checkDistance * Math.cos(Math.toRadians(yRotation)));
offsetX = hypotenuse * Math.cos(Math.toRadians(xRotation));
offsetY = checkDistance * Math.sin(Math.toRadians(yRotation));
offsetZ = hypotenuse * Math.sin(Math.toRadians(xRotation));
reset();
}
/**
* Call this to reset checking position to allow you to check for a new target with the same TargetBlock instance.
*/
public final void reset()
{
targetPositionX = location.getX();
targetPositionY = location.getY() + viewHeight;
targetPositionZ = location.getZ();
itargetPositionX = (int)Math.floor(targetPositionX);
itargetPositionY = (int)Math.floor(targetPositionY);
itargetPositionZ = (int)Math.floor(targetPositionZ);
prevPositionX = itargetPositionX;
prevPositionY = itargetPositionY;
prevPositionZ = itargetPositionZ;
this.curDistance = 0;
}
/**
* Gets the distance to a block. Measures from the block underneath the player to the targetblock
* Should only be used when passing player as an constructor parameter
*
* @return double
*/
public double getDistanceToBlock()
{
final double blockUnderPlayerX = Math.floor(location.getX() + 0.5);
final double blockUnderPlayerY = Math.floor(location.getY() - 0.5);
final double blockUnderPlayerZ = Math.floor(location.getZ() + 0.5);
final Block block = getTargetBlock();
final double distX = block.getX() - blockUnderPlayerX;
final double distY = block.getY() - blockUnderPlayerY;
final double distZ = block.getZ() - blockUnderPlayerZ;
return Math.sqrt(distX*distX + distY*distY + distZ*distZ);
}
/**
* Gets the rounded distance to a block. Measures from the block underneath the player to the targetblock
* Should only be used when passing player as an constructor parameter
*
* @return int
*/
public int getDistanceToBlockRounded()
{
return (int)Math.round(getDistanceToBlock());
}
/**
* Gets the floored x distance to a block.
*
* @return int
*/
public int getXDistanceToBlock()
{
return (int)Math.floor(getTargetBlock().getX() - location.getBlockX() + 0.5);
}
/**
* Gets the floored y distance to a block
*
* @return int
*/
public int getYDistanceToBlock()
{
return (int)Math.floor(getTargetBlock().getY() - location.getBlockY() + viewHeight);
}
/**
* Gets the floored z distance to a block
*
* @return int
*/
public int getZDistanceToBlock()
{
return (int)Math.floor(getTargetBlock().getZ() - location.getBlockZ() + 0.5);
}
/**
* Returns the block at the sight. Returns null if out of range or if no viable target was found
*
* @return Block
*/
public Block getTargetBlock()
{
this.reset();
Block block;
do
{
block = getNextBlock();
}
while (block != null && ((block.getTypeId() == 0) || this.blockIsIgnored(block.getTypeId())));
return block;
}
/**
* Sets the type of the block at the sight. Returns false if the block wasn't set.
*
* @param typeID ID of type to set the block to
* @return boolean
*/
public boolean setTargetBlock(final int typeID)
{
return setTargetBlock(Material.getMaterial(typeID));
}
/**
* Sets the type of the block at the sight. Returns false if the block wasn't set.
*
* @param type Material to set the block to
* @return boolean
*/
@SuppressWarnings("empty-statement")
public boolean setTargetBlock(final Material type)
{
if (type == null)
{
return false;
}
final Block block = getTargetBlock();
if (block != null)
{
block.setType(type);
return true;
}
return false;
}
/**
* Sets the type of the block at the sight. Returns false if the block wasn't set.
* Observe! At the moment this function is using the built-in enumerator function .valueOf(String) but would preferably be changed to smarter function, when implemented
*
* @param type Name of type to set the block to
* @return boolean
*/
public boolean setTargetBlock(final String type)
{
return setTargetBlock(Material.valueOf(type));
}
/**
* Returns the block attached to the face at the sight. Returns null if out of range or if no viable target was found
*
* @return Block
*/
public Block getFaceBlock()
{
final Block block = getTargetBlock();
if (block == null)
{
return null;
}
return getPreviousBlock();
}
/**
* Sets the type of the block attached to the face at the sight. Returns false if the block wasn't set.
*
* @param typeID
* @return boolean
*/
public boolean setFaceBlock(final int typeID)
{
return setFaceBlock(Material.getMaterial(typeID));
}
/**
* Sets the type of the block attached to the face at the sight. Returns false if the block wasn't set.
*
* @param type
* @return boolean
*/
public boolean setFaceBlock(final Material type)
{
if (type == null)
{
return false;
}
if (getCurrentBlock() != null)
{
final Block blk = location.getWorld().getBlockAt(prevPositionX, prevPositionY, prevPositionZ);
blk.setType(type);
return true;
}
return false;
}
/**
* Sets the type of the block attached to the face at the sight. Returns false if the block wasn't set.
* Observe! At the moment this function is using the built-in enumerator function .valueOf(String) but would preferably be changed to smarter function, when implemented
*
* @param type
* @return boolean
*/
public boolean setFaceBlock(final String type)
{
return setFaceBlock(Material.valueOf(type));
}
/**
* Get next block
*
* @return Block
*/
public Block getNextBlock()
{
prevPositionX = itargetPositionX;
prevPositionY = itargetPositionY;
prevPositionZ = itargetPositionZ;
do
{
curDistance += checkDistance;
targetPositionX += offsetX;
targetPositionY += offsetY;
targetPositionZ += offsetZ;
itargetPositionX = (int)Math.floor(targetPositionX);
itargetPositionY = (int)Math.floor(targetPositionY);
itargetPositionZ = (int)Math.floor(targetPositionZ);
}
while (curDistance <= maxDistance && itargetPositionX == prevPositionX && itargetPositionY == prevPositionY && itargetPositionZ == prevPositionZ);
if (curDistance > maxDistance)
{
return null;
}
return this.location.getWorld().getBlockAt(itargetPositionX, itargetPositionY, itargetPositionZ);
}
/**
* Returns the current block along the line of vision
*
* @return Block
*/
public Block getCurrentBlock()
{
Block block;
if (curDistance <= maxDistance)
{
block = this.location.getWorld().getBlockAt(itargetPositionX, itargetPositionY, itargetPositionZ);
}
else
{
block = null;
}
return block;
}
/**
* Sets current block type. Returns false if the block wasn't set.
*
* @param typeID
*/
public boolean setCurrentBlock(final int typeID)
{
return setCurrentBlock(Material.getMaterial(typeID));
}
/**
* Sets current block type. Returns false if the block wasn't set.
*
* @param type
*/
public boolean setCurrentBlock(final Material type)
{
final Block blk = getCurrentBlock();
if (blk != null && type != null)
{
blk.setType(type);
return true;
}
return false;
}
/**
* Sets current block type. Returns false if the block wasn't set.
* Observe! At the moment this function is using the built-in enumerator function .valueOf(String) but would preferably be changed to smarter function, when implemented
*
* @param type
*/
public boolean setCurrentBlock(final String type)
{
return setCurrentBlock(Material.valueOf(type));
}
/**
* Returns the previous block in the aimed path
*
* @return Block
*/
public Block getPreviousBlock()
{
return this.location.getWorld().getBlockAt(prevPositionX, prevPositionY, prevPositionZ);
}
/**
* Sets previous block type id. Returns false if the block wasn't set.
*
* @param typeID
*/
public boolean setPreviousBlock(final int typeID)
{
return setPreviousBlock(Material.getMaterial(typeID));
}
/**
* Sets previous block type id. Returns false if the block wasn't set.
*
* @param type
*/
public boolean setPreviousBlock(final Material type)
{
final Block blk = getPreviousBlock();
if (blk != null && type != null)
{
blk.setType(type);
return true;
}
return false;
}
/**
* Sets previous block type id. Returns false if the block wasn't set.
* Observe! At the moment this function is using the built-in enumerator function .valueOf(String) but would preferably be changed to smarter function, when implemented
*
* @param type
*/
public boolean setPreviousBlock(final String type)
{
return setPreviousBlock(Material.valueOf(type));
}
private static int[] convertStringArraytoIntArray(final List<String> array)
{
final int intarray[] = new int[array == null ? 0 : array.size()];
for (int i = 0; i < intarray.length; i++)
{
try
{
intarray[i] = Integer.parseInt(array.get(i));
}
catch (NumberFormatException nfe)
{
}
}
return intarray;
}
private boolean blockIsIgnored(final int value)
{
for (int i : this.blockToIgnore)
{
if (i == value)
{
return true;
}
}
return false;
}
}

View File

@@ -1,271 +1,292 @@
package com.earth2me.essentials;
import com.earth2me.essentials.commands.NotEnoughArgumentsException;
import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.utils.DateUtil;
import com.earth2me.essentials.utils.LocationUtil;
import java.math.BigDecimal;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.logging.Logger;
import net.ess3.api.IEssentials;
import net.ess3.api.IUser;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerRespawnEvent;
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
public class Teleport implements Runnable
public class Teleport implements net.ess3.api.ITeleport
{
private static final double MOVE_CONSTANT = 0.3;
private static class Target
{
private final Location location;
private final Entity entity;
public Target(Location location)
{
this.location = location;
this.entity = null;
}
public Target(Entity entity)
{
this.entity = entity;
this.location = null;
}
public Location getLocation()
{
if (this.entity != null)
{
return this.entity.getLocation();
}
return location;
}
}
private IUser user;
private int teleTimer = -1;
private long started; // time this task was initiated
private long delay; // how long to delay the teleport
private int health;
// note that I initially stored a clone of the location for reference, but...
// when comparing locations, I got incorrect mismatches (rounding errors, looked like)
// so, the X/Y/Z values are stored instead and rounded off
private long initX;
private long initY;
private long initZ;
private Target teleportTarget;
private Trade chargeFor;
private final IUser teleportOwner;
private final IEssentials ess;
private static final Logger logger = Logger.getLogger("Minecraft");
private void initTimer(long delay, Target target, Trade chargeFor)
{
this.started = System.currentTimeMillis();
this.delay = delay;
this.health = user.getHealth();
this.initX = Math.round(user.getLocation().getX() * MOVE_CONSTANT);
this.initY = Math.round(user.getLocation().getY() * MOVE_CONSTANT);
this.initZ = Math.round(user.getLocation().getZ() * MOVE_CONSTANT);
this.teleportTarget = target;
this.chargeFor = chargeFor;
}
public void run()
{
if (user == null || !user.isOnline() || user.getLocation() == null)
{
cancel();
return;
}
if (Math.round(user.getLocation().getX() * MOVE_CONSTANT) != initX
|| Math.round(user.getLocation().getY() * MOVE_CONSTANT) != initY
|| Math.round(user.getLocation().getZ() * MOVE_CONSTANT) != initZ
|| user.getHealth() < health)
{ // user moved, cancel teleport
cancel(true);
return;
}
health = user.getHealth(); // in case user healed, then later gets injured
long now = System.currentTimeMillis();
if (now > started + delay)
{
try
{
cooldown(false);
user.sendMessage(Util.i18n("teleportationCommencing"));
try
{
now(teleportTarget);
if (chargeFor != null)
{
chargeFor.charge(user);
}
}
catch (Throwable ex)
{
ess.showError(user.getBase(), ex, "teleport");
}
return;
}
catch (Exception ex)
{
user.sendMessage(Util.format("cooldownWithMessage", ex.getMessage()));
}
}
}
private TimedTeleport timedTeleport;
public Teleport(IUser user, IEssentials ess)
{
this.user = user;
this.teleportOwner = user;
this.ess = ess;
}
public void respawn(Spawn spawn, Trade chargeFor) throws Exception
{
teleport(new Target(spawn.getSpawn(user.getGroup())), chargeFor);
}
public void warp(String warp, Trade chargeFor) throws Exception
{
Location loc = ess.getWarps().getWarp(warp);
teleport(new Target(loc), chargeFor);
user.sendMessage(Util.format("warpingTo", warp));
}
public void cooldown(boolean check) throws Exception
{
Calendar now = new GregorianCalendar();
if (user.getLastTeleportTimestamp() > 0)
final Calendar time = new GregorianCalendar();
if (teleportOwner.getLastTeleportTimestamp() > 0)
{
double cooldown = ess.getSettings().getTeleportCooldown();
Calendar cooldownTime = new GregorianCalendar();
cooldownTime.setTimeInMillis(user.getLastTeleportTimestamp());
cooldownTime.add(Calendar.SECOND, (int)cooldown);
cooldownTime.add(Calendar.MILLISECOND, (int)((cooldown * 1000.0) % 1000.0));
if (cooldownTime.after(now) && !user.isAuthorized("essentials.teleport.cooldown.bypass"))
// Take the current time, and remove the delay from it.
final double cooldown = ess.getSettings().getTeleportCooldown();
final Calendar earliestTime = new GregorianCalendar();
earliestTime.add(Calendar.SECOND, -(int)cooldown);
earliestTime.add(Calendar.MILLISECOND, -(int)((cooldown * 1000.0) % 1000.0));
// This value contains the most recent time a teleportPlayer could have been used that would allow another use.
final long earliestLong = earliestTime.getTimeInMillis();
// When was the last teleportPlayer used?
final Long lastTime = teleportOwner.getLastTeleportTimestamp();
if (lastTime > time.getTimeInMillis())
{
throw new Exception(Util.format("timeBeforeTeleport", Util.formatDateDiff(cooldownTime.getTimeInMillis())));
// This is to make sure time didn't get messed up on last teleportPlayer use.
// If this happens, let's give the user the benifit of the doubt.
teleportOwner.setLastTeleportTimestamp(time.getTimeInMillis());
return;
}
else if (lastTime > earliestLong && !teleportOwner.isAuthorized("essentials.teleport.cooldown.bypass"))
{
time.setTimeInMillis(lastTime);
time.add(Calendar.SECOND, (int)cooldown);
time.add(Calendar.MILLISECOND, (int)((cooldown * 1000.0) % 1000.0));
throw new Exception(tl("timeBeforeTeleport", DateUtil.formatDateDiff(time.getTimeInMillis())));
}
}
// if justCheck is set, don't update lastTeleport; we're just checking
if (!check)
{
user.setLastTeleportTimestamp(now.getTimeInMillis());
teleportOwner.setLastTeleportTimestamp(time.getTimeInMillis());
}
}
public void cancel(boolean notifyUser)
private void warnUser(final IUser user, final double delay)
{
if (teleTimer == -1)
{
return;
}
try
{
ess.getServer().getScheduler().cancelTask(teleTimer);
if (notifyUser)
{
user.sendMessage(Util.i18n("pendingTeleportCancelled"));
}
}
finally
{
teleTimer = -1;
}
}
public void cancel()
{
cancel(false);
}
public void teleport(Location loc, Trade chargeFor) throws Exception
{
teleport(new Target(loc), chargeFor);
}
public void teleport(Entity entity, Trade chargeFor) throws Exception
{
teleport(new Target(entity), chargeFor);
}
private void teleport(Target target, Trade chargeFor) throws Exception
{
double delay = ess.getSettings().getTeleportDelay();
if (chargeFor != null)
{
chargeFor.isAffordableFor(user);
}
cooldown(true);
if (delay <= 0 || user.isAuthorized("essentials.teleport.timer.bypass"))
{
cooldown(false);
now(target);
if (chargeFor != null)
{
chargeFor.charge(user);
}
return;
}
cancel();
Calendar c = new GregorianCalendar();
c.add(Calendar.SECOND, (int)delay);
c.add(Calendar.MILLISECOND, (int)((delay * 1000.0) % 1000.0));
user.sendMessage(Util.format("dontMoveMessage", Util.formatDateDiff(c.getTimeInMillis())));
initTimer((long)(delay * 1000.0), target, chargeFor);
teleTimer = ess.scheduleSyncRepeatingTask(this, 10, 10);
user.sendMessage(tl("dontMoveMessage", DateUtil.formatDateDiff(c.getTimeInMillis())));
}
private void now(Target target) throws Exception
{
cancel();
user.setLastLocation();
user.getBase().teleport(Util.getSafeDestination(target.getLocation()));
}
public void now(Location loc) throws Exception
{
cooldown(false);
now(new Target(loc));
}
public void now(Location loc, Trade chargeFor) throws Exception
{
cooldown(false);
chargeFor.charge(user);
now(new Target(loc));
}
public void now(Entity entity, boolean cooldown) throws Exception
//The now function is used when you want to skip tp delay when teleporting someone to a location or player.
@Override
public void now(Location loc, boolean cooldown, TeleportCause cause) throws Exception
{
if (cooldown)
{
cooldown(false);
}
now(new Target(entity));
final ITarget target = new LocationTarget(loc);
now(teleportOwner, target, cause);
}
@Override
public void now(Player entity, boolean cooldown, TeleportCause cause) throws Exception
{
if (cooldown)
{
cooldown(false);
}
final ITarget target = new PlayerTarget(entity);
now(teleportOwner, target, cause);
teleportOwner.sendMessage(tl("teleporting", target.getLocation().getWorld().getName(), target.getLocation().getBlockX(), target.getLocation().getBlockY(), target.getLocation().getBlockZ()));
}
protected void now(IUser teleportee, ITarget target, TeleportCause cause) throws Exception
{
cancel(false);
teleportee.setLastLocation();
final Location loc = target.getLocation();
if (LocationUtil.isBlockUnsafe(loc.getWorld(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()))
{
if (ess.getSettings().isTeleportSafetyEnabled())
{
if (teleportee.getBase().isInsideVehicle())
{
teleportee.getBase().leaveVehicle();
}
teleportee.getBase().teleport(LocationUtil.getSafeDestination(teleportee, loc), cause);
}
else
{
throw new Exception(tl("unsafeTeleportDestination", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));
}
}
else
{
if (teleportee.getBase().isInsideVehicle())
{
teleportee.getBase().leaveVehicle();
}
teleportee.getBase().teleport(LocationUtil.getRoundedDestination(loc), cause);
}
}
//The teleportPlayer function is used when you want to normally teleportPlayer someone to a location or player.
//This method is nolonger used internally and will be removed.
@Deprecated
@Override
public void teleport(Location loc, Trade chargeFor) throws Exception
{
teleport(loc, chargeFor, TeleportCause.PLUGIN);
}
@Override
public void teleport(Location loc, Trade chargeFor, TeleportCause cause) throws Exception
{
teleport(teleportOwner, new LocationTarget(loc), chargeFor, cause);
}
//This is used when teleporting to a player
@Override
public void teleport(Player entity, Trade chargeFor, TeleportCause cause) throws Exception
{
ITarget target = new PlayerTarget(entity);
teleport(teleportOwner, target, chargeFor, cause);
teleportOwner.sendMessage(tl("teleporting", target.getLocation().getWorld().getName(), target.getLocation().getBlockX(), target.getLocation().getBlockY(), target.getLocation().getBlockZ()));
}
//This is used when teleporting to stored location
@Override
public void teleportPlayer(IUser teleportee, Location loc, Trade chargeFor, TeleportCause cause) throws Exception
{
teleport(teleportee, new LocationTarget(loc), chargeFor, cause);
}
//This is used on /tphere
@Override
public void teleportPlayer(IUser teleportee, Player entity, Trade chargeFor, TeleportCause cause) throws Exception
{
ITarget target = new PlayerTarget(entity);
teleport(teleportee, target, chargeFor, cause);
teleportee.sendMessage(tl("teleporting", target.getLocation().getWorld().getName(), target.getLocation().getBlockX(), target.getLocation().getBlockY(), target.getLocation().getBlockZ()));
teleportOwner.sendMessage(tl("teleporting", target.getLocation().getWorld().getName(), target.getLocation().getBlockX(), target.getLocation().getBlockY(), target.getLocation().getBlockZ()));
}
private void teleport(IUser teleportee, ITarget target, Trade chargeFor, TeleportCause cause) throws Exception
{
double delay = ess.getSettings().getTeleportDelay();
Trade cashCharge = chargeFor;
if (chargeFor != null)
{
chargeFor.isAffordableFor(teleportOwner);
//This code is to make sure that commandcosts are checked in the initial world, and not in the resulting world.
if (!chargeFor.getCommandCost(teleportOwner).equals(BigDecimal.ZERO))
{
//By converting a command cost to a regular cost, the command cost permission isn't checked when executing the charge after teleport.
cashCharge = new Trade(chargeFor.getCommandCost(teleportOwner), ess);
}
}
cooldown(true);
if (delay <= 0 || teleportOwner.isAuthorized("essentials.teleport.timer.bypass")
|| teleportee.isAuthorized("essentials.teleport.timer.bypass"))
{
cooldown(false);
now(teleportee, target, cause);
if (cashCharge != null)
{
cashCharge.charge(teleportOwner);
}
return;
}
cancel(false);
warnUser(teleportee, delay);
initTimer((long)(delay * 1000.0), teleportee, target, cashCharge, cause, false);
}
//The respawn function is a wrapper used to handle tp fallback, on /jail and /home
@Override
public void respawn(final Trade chargeFor, TeleportCause cause) throws Exception
{
double delay = ess.getSettings().getTeleportDelay();
if (chargeFor != null)
{
chargeFor.isAffordableFor(teleportOwner);
}
cooldown(true);
if (delay <= 0 || teleportOwner.isAuthorized("essentials.teleport.timer.bypass"))
{
cooldown(false);
respawnNow(teleportOwner, cause);
if (chargeFor != null)
{
chargeFor.charge(teleportOwner);
}
return;
}
cancel(false);
warnUser(teleportOwner, delay);
initTimer((long)(delay * 1000.0), teleportOwner, null, chargeFor, cause, true);
}
protected void respawnNow(IUser teleportee, TeleportCause cause) throws Exception
{
final Player player = teleportee.getBase();
Location bed = player.getBedSpawnLocation();
if (bed != null)
{
now(teleportee, new LocationTarget(bed), cause);
}
else
{
if (ess.getSettings().isDebug())
{
ess.getLogger().info("Could not find bed spawn, forcing respawn event.");
}
final PlayerRespawnEvent pre = new PlayerRespawnEvent(player, player.getWorld().getSpawnLocation(), false);
ess.getServer().getPluginManager().callEvent(pre);
now(teleportee, new LocationTarget(pre.getRespawnLocation()), cause);
}
}
//The warp function is a wrapper used to teleportPlayer a player to a /warp
@Override
public void warp(IUser teleportee, String warp, Trade chargeFor, TeleportCause cause) throws Exception
{
Location loc = ess.getWarps().getWarp(warp);
teleportee.sendMessage(tl("warpingTo", warp, loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));
teleport(teleportee, new LocationTarget(loc), chargeFor, cause);
}
//The back function is a wrapper used to teleportPlayer a player /back to their previous location.
@Override
public void back(Trade chargeFor) throws Exception
{
teleport(new Target(user.getLastLocation()), chargeFor);
final Location loc = teleportOwner.getLastLocation();
teleportOwner.sendMessage(tl("backUsageMsg", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));
teleport(teleportOwner, new LocationTarget(loc), chargeFor, TeleportCause.COMMAND);
}
//This function is used to throw a user back after a jail sentence
@Override
public void back() throws Exception
{
now(new Target(user.getLastLocation()));
now(teleportOwner, new LocationTarget(teleportOwner.getLastLocation()), TeleportCause.COMMAND);
}
public void home(IUser user, String home, Trade chargeFor) throws Exception
//If we need to cancelTimer a pending teleportPlayer call this method
private void cancel(boolean notifyUser)
{
final Location loc = user.getHome(home);
if (loc == null)
if (timedTeleport != null)
{
throw new NotEnoughArgumentsException();
timedTeleport.cancelTimer(notifyUser);
timedTeleport = null;
}
teleport(new Target(loc), chargeFor);
}
private void initTimer(long delay, IUser teleportUser, ITarget target, Trade chargeFor, TeleportCause cause, boolean respawn)
{
timedTeleport = new TimedTeleport(teleportOwner, ess, this, delay, teleportUser, target, chargeFor, cause, respawn);
}
}

View File

@@ -0,0 +1,160 @@
package com.earth2me.essentials;
import static com.earth2me.essentials.I18n.tl;
import net.ess3.api.IEssentials;
import net.ess3.api.IUser;
import org.bukkit.Location;
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
public class TimedTeleport implements Runnable
{
private static final double MOVE_CONSTANT = 0.3;
private final IUser teleportOwner;
private final IEssentials ess;
private final Teleport teleport;
private final String timer_teleportee;
private int timer_task = -1;
private final long timer_started; // time this task was initiated
private final long timer_delay; // how long to delay the teleportPlayer
private double timer_health;
// note that I initially stored a clone of the location for reference, but...
// when comparing locations, I got incorrect mismatches (rounding errors, looked like)
// so, the X/Y/Z values are stored instead and rounded off
private final long timer_initX;
private final long timer_initY;
private final long timer_initZ;
private final ITarget timer_teleportTarget;
private final boolean timer_respawn;
private final boolean timer_canMove;
private final Trade timer_chargeFor;
private final TeleportCause timer_cause;
public TimedTeleport(IUser user, IEssentials ess, Teleport teleport, long delay, IUser teleportUser, ITarget target, Trade chargeFor, TeleportCause cause, boolean respawn)
{
this.teleportOwner = user;
this.ess = ess;
this.teleport = teleport;
this.timer_started = System.currentTimeMillis();
this.timer_delay = delay;
this.timer_health = teleportUser.getBase().getHealth();
this.timer_initX = Math.round(teleportUser.getBase().getLocation().getX() * MOVE_CONSTANT);
this.timer_initY = Math.round(teleportUser.getBase().getLocation().getY() * MOVE_CONSTANT);
this.timer_initZ = Math.round(teleportUser.getBase().getLocation().getZ() * MOVE_CONSTANT);
this.timer_teleportee = teleportUser.getName();
this.timer_teleportTarget = target;
this.timer_chargeFor = chargeFor;
this.timer_cause = cause;
this.timer_respawn = respawn;
this.timer_canMove = user.isAuthorized("essentials.teleport.timer.move");
timer_task = ess.scheduleSyncRepeatingTask(this, 20, 20);
}
@Override
public void run()
{
if (teleportOwner == null || !teleportOwner.getBase().isOnline() || teleportOwner.getBase().getLocation() == null)
{
cancelTimer(false);
return;
}
IUser teleportUser = ess.getUser(this.timer_teleportee);
if (teleportUser == null || !teleportUser.getBase().isOnline())
{
cancelTimer(false);
return;
}
final Location currLocation = teleportUser.getBase().getLocation();
if (currLocation == null)
{
cancelTimer(false);
return;
}
if (!timer_canMove
&& (Math.round(currLocation.getX() * MOVE_CONSTANT) != timer_initX
|| Math.round(currLocation.getY() * MOVE_CONSTANT) != timer_initY
|| Math.round(currLocation.getZ() * MOVE_CONSTANT) != timer_initZ
|| teleportUser.getBase().getHealth() < timer_health))
{
// user moved, cancelTimer teleportPlayer
cancelTimer(true);
return;
}
timer_health = teleportUser.getBase().getHealth(); // in case user healed, then later gets injured
final long now = System.currentTimeMillis();
if (now > timer_started + timer_delay)
{
try
{
teleport.cooldown(false);
}
catch (Exception ex)
{
teleportOwner.sendMessage(tl("cooldownWithMessage", ex.getMessage()));
if (teleportOwner != teleportUser)
{
teleportUser.sendMessage(tl("cooldownWithMessage", ex.getMessage()));
}
}
try
{
cancelTimer(false);
teleportUser.sendMessage(tl("teleportationCommencing"));
if (timer_chargeFor != null)
{
timer_chargeFor.isAffordableFor(teleportOwner);
}
if (timer_respawn)
{
teleport.respawnNow(teleportUser, timer_cause);
}
else
{
teleport.now(teleportUser, timer_teleportTarget, timer_cause);
}
if (timer_chargeFor != null)
{
timer_chargeFor.charge(teleportOwner);
}
}
catch (Exception ex)
{
ess.showError(teleportOwner.getSource(), ex, "\\ teleport");
}
}
}
//If we need to cancelTimer a pending teleportPlayer call this method
public void cancelTimer(boolean notifyUser)
{
if (timer_task == -1)
{
return;
}
try
{
ess.getServer().getScheduler().cancelTask(timer_task);
if (notifyUser)
{
teleportOwner.sendMessage(tl("pendingTeleportCancelled"));
if (timer_teleportee != null && !timer_teleportee.equals(teleportOwner.getName()))
{
ess.getUser(timer_teleportee).sendMessage(tl("pendingTeleportCancelled"));
}
}
}
finally
{
timer_task = -1;
}
}
}

View File

@@ -1,141 +1,274 @@
package com.earth2me.essentials;
import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.craftbukkit.InventoryWorkaround;
import com.earth2me.essentials.craftbukkit.SetExpFix;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.math.BigDecimal;
import java.text.DateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.ess3.api.IEssentials;
import net.ess3.api.IUser;
import net.ess3.api.MaxMoneyException;
import org.bukkit.Location;
import org.bukkit.entity.Item;
import org.bukkit.inventory.ItemStack;
public class Trade
{
private final transient String command;
private final transient Double money;
private final transient Trade fallbackTrade;
private final transient BigDecimal money;
private final transient ItemStack itemStack;
private final transient IEssentials ess;
private final transient Integer exp;
private final transient com.earth2me.essentials.IEssentials ess;
public enum TradeType
{
MONEY,
EXP,
ITEM
}
public enum OverflowType
{
ABORT,
DROP,
RETURN
}
public Trade(final String command, final IEssentials ess)
{
this(command, null, null, ess);
this(command, null, null, null, null, ess);
}
public Trade(final double money, final IEssentials ess)
public Trade(final String command, final Trade fallback, final IEssentials ess)
{
this(null, money, null, ess);
this(command, fallback, null, null, null, ess);
}
@Deprecated
public Trade(final double money, final com.earth2me.essentials.IEssentials ess)
{
this(null, null, BigDecimal.valueOf(money), null, null, ess);
}
public Trade(final BigDecimal money, final IEssentials ess)
{
this(null, null, money, null, null, ess);
}
public Trade(final ItemStack items, final IEssentials ess)
{
this(null, null, items, ess);
this(null, null, null, items, null, ess);
}
private Trade(final String command, final Double money, final ItemStack item, final IEssentials ess)
public Trade(final int exp, final IEssentials ess)
{
this(null, null, null, null, exp, ess);
}
private Trade(final String command, final Trade fallback, final BigDecimal money, final ItemStack item, final Integer exp, final com.earth2me.essentials.IEssentials ess)
{
this.command = command;
this.fallbackTrade = fallback;
this.money = money;
this.itemStack = item;
this.exp = exp;
this.ess = ess;
}
public void isAffordableFor(final IUser user) throws ChargeException
{
final double mon = user.getMoney();
if (getMoney() != null
&& mon < getMoney()
&& getMoney() > 0
&& !user.isAuthorized("essentials.eco.loan"))
if (ess.getSettings().isDebug())
{
throw new ChargeException(Util.i18n("notEnoughMoney"));
ess.getLogger().log(Level.INFO, "checking if " + user.getName() + " can afford charge.");
}
if (getMoney() != null
&& getMoney().signum() > 0
&& !user.canAfford(getMoney()))
{
throw new ChargeException(tl("notEnoughMoney"));
}
if (getItemStack() != null
&& !InventoryWorkaround.containsItem(user.getInventory(), true, itemStack))
&& !user.getBase().getInventory().containsAtLeast(itemStack, itemStack.getAmount()))
{
throw new ChargeException(Util.format("missingItems", getItemStack().getAmount(), getItemStack().getType().toString().toLowerCase().replace("_", " ")));
throw new ChargeException(tl("missingItems", getItemStack().getAmount(), ess.getItemDb().name(getItemStack())));
}
BigDecimal money;
if (command != null && !command.isEmpty()
&& !user.isAuthorized("essentials.nocommandcost.all")
&& !user.isAuthorized("essentials.nocommandcost." + command)
&& mon < ess.getSettings().getCommandCost(command.charAt(0) == '/' ? command.substring(1) : command)
&& 0 < ess.getSettings().getCommandCost(command.charAt(0) == '/' ? command.substring(1) : command)
&& !user.isAuthorized("essentials.eco.loan"))
&& (money = getCommandCost(user)).signum() > 0
&& !user.canAfford(money))
{
throw new ChargeException(Util.i18n("notEnoughMoney"));
throw new ChargeException(tl("notEnoughMoney"));
}
if (exp != null && exp > 0
&& SetExpFix.getTotalExperience(user.getBase()) < exp)
{
throw new ChargeException(tl("notEnoughExperience"));
}
}
public void pay(final IUser user)
public boolean pay(final IUser user) throws MaxMoneyException
{
pay(user, true);
return pay(user, OverflowType.ABORT) == null;
}
public boolean pay(final IUser user, final boolean dropItems)
public Map<Integer, ItemStack> pay(final IUser user, final OverflowType type) throws MaxMoneyException
{
boolean success = true;
if (getMoney() != null && getMoney() > 0)
if (getMoney() != null && getMoney().signum() > 0)
{
if (ess.getSettings().isDebug())
{
ess.getLogger().log(Level.INFO, "paying user " + user.getName() + " via trade " + getMoney().toPlainString());
}
user.giveMoney(getMoney());
}
if (getItemStack() != null)
{
if (dropItems)
// This stores the would be overflow
Map<Integer, ItemStack> overFlow = InventoryWorkaround.addAllItems(user.getBase().getInventory(), getItemStack());
if (overFlow != null)
{
final Map<Integer, ItemStack> leftOver = InventoryWorkaround.addItem(user.getInventory(), true, getItemStack());
for (ItemStack itemStack : leftOver.values())
switch (type)
{
InventoryWorkaround.dropItem(user.getLocation(), itemStack);
case ABORT:
if (ess.getSettings().isDebug())
{
ess.getLogger().log(Level.INFO, "abort paying " + user.getName() + " itemstack " + getItemStack().toString() + " due to lack of inventory space ");
}
return overFlow;
case RETURN:
// Pay the user the items, and return overflow
final Map<Integer, ItemStack> returnStack = InventoryWorkaround.addItems(user.getBase().getInventory(), getItemStack());
user.getBase().updateInventory();
if (ess.getSettings().isDebug())
{
ess.getLogger().log(Level.INFO, "paying " + user.getName() + " partial itemstack " + getItemStack().toString() + " with overflow " + returnStack.get(0).toString());
}
return returnStack;
case DROP:
// Pay the users the items directly, and drop the rest, will always return no overflow.
final Map<Integer, ItemStack> leftOver = InventoryWorkaround.addItems(user.getBase().getInventory(), getItemStack());
final Location loc = user.getBase().getLocation();
for (ItemStack loStack : leftOver.values())
{
final int maxStackSize = loStack.getType().getMaxStackSize();
final int stacks = loStack.getAmount() / maxStackSize;
final int leftover = loStack.getAmount() % maxStackSize;
final Item[] itemStacks = new Item[stacks + (leftover > 0 ? 1 : 0)];
for (int i = 0; i < stacks; i++)
{
final ItemStack stack = loStack.clone();
stack.setAmount(maxStackSize);
itemStacks[i] = loc.getWorld().dropItem(loc, stack);
}
if (leftover > 0)
{
final ItemStack stack = loStack.clone();
stack.setAmount(leftover);
itemStacks[stacks] = loc.getWorld().dropItem(loc, stack);
}
}
if (ess.getSettings().isDebug())
{
ess.getLogger().log(Level.INFO, "paying " + user.getName() + " partial itemstack " + getItemStack().toString() + " and dropping overflow " + leftOver.get(0).toString());
}
}
}
else
else if (ess.getSettings().isDebug())
{
success = InventoryWorkaround.addAllItems(user.getInventory(), true, getItemStack());
ess.getLogger().log(Level.INFO, "paying " + user.getName() + " itemstack " + getItemStack().toString());
}
user.updateInventory();
user.getBase().updateInventory();
}
return success;
if (getExperience() != null)
{
SetExpFix.setTotalExperience(user.getBase(), SetExpFix.getTotalExperience(user.getBase()) + getExperience());
}
return null;
}
public void charge(final IUser user) throws ChargeException
{
if (ess.getSettings().isDebug())
{
ess.getLogger().log(Level.INFO, "attempting to charge user " + user.getName());
}
if (getMoney() != null)
{
final double mon = user.getMoney();
if (mon < getMoney() && getMoney() > 0 && !user.isAuthorized("essentials.eco.loan"))
if (ess.getSettings().isDebug())
{
throw new ChargeException(Util.i18n("notEnoughMoney"));
ess.getLogger().log(Level.INFO, "charging user " + user.getName() + " money " + getMoney().toPlainString());
}
if (!user.canAfford(getMoney()) && getMoney().signum() > 0)
{
throw new ChargeException(tl("notEnoughMoney"));
}
user.takeMoney(getMoney());
}
if (getItemStack() != null)
{
if (!InventoryWorkaround.containsItem(user.getInventory(), true, itemStack))
if (ess.getSettings().isDebug())
{
throw new ChargeException(Util.format("missingItems", getItemStack().getAmount(), getItemStack().getType().toString().toLowerCase().replace("_", " ")));
ess.getLogger().log(Level.INFO, "charging user " + user.getName() + " itemstack " + getItemStack().toString());
}
InventoryWorkaround.removeItem(user.getInventory(), true, getItemStack());
user.updateInventory();
}
if (command != null && !command.isEmpty()
&& !user.isAuthorized("essentials.nocommandcost.all")
&& !user.isAuthorized("essentials.nocommandcost." + command))
{
final double mon = user.getMoney();
final double cost = ess.getSettings().getCommandCost(command.charAt(0) == '/' ? command.substring(1) : command);
if (mon < cost && cost > 0 && !user.isAuthorized("essentials.eco.loan"))
if (!user.getBase().getInventory().containsAtLeast(getItemStack(), getItemStack().getAmount()))
{
throw new ChargeException(Util.i18n("notEnoughMoney"));
throw new ChargeException(tl("missingItems", getItemStack().getAmount(), getItemStack().getType().toString().toLowerCase(Locale.ENGLISH).replace("_", " ")));
}
user.getBase().getInventory().removeItem(getItemStack());
user.getBase().updateInventory();
}
if (command != null)
{
final BigDecimal cost = getCommandCost(user);
if (!user.canAfford(cost) && cost.signum() > 0)
{
throw new ChargeException(tl("notEnoughMoney"));
}
user.takeMoney(cost);
}
if (getExperience() != null)
{
if (ess.getSettings().isDebug())
{
ess.getLogger().log(Level.INFO, "charging user " + user.getName() + " exp " + getExperience());
}
final int experience = SetExpFix.getTotalExperience(user.getBase());
if (experience < getExperience() && getExperience() > 0)
{
throw new ChargeException(tl("notEnoughExperience"));
}
SetExpFix.setTotalExperience(user.getBase(), experience - getExperience());
}
if (ess.getSettings().isDebug())
{
ess.getLogger().log(Level.INFO, "charge user " + user.getName() + " completed");
}
}
public Double getMoney()
public BigDecimal getMoney()
{
return money;
}
@@ -144,11 +277,59 @@ public class Trade
{
return itemStack;
}
public Integer getExperience()
{
return exp;
}
public TradeType getType()
{
if (getExperience() != null)
{
return TradeType.EXP;
}
if (getItemStack() != null)
{
return TradeType.ITEM;
}
return TradeType.MONEY;
}
public BigDecimal getCommandCost(final IUser user)
{
BigDecimal cost = BigDecimal.ZERO;
if (command != null && !command.isEmpty())
{
cost = ess.getSettings().getCommandCost(command.charAt(0) == '/' ? command.substring(1) : command);
if (cost.signum() == 0 && fallbackTrade != null)
{
cost = fallbackTrade.getCommandCost(user);
}
if (ess.getSettings().isDebug())
{
ess.getLogger().log(Level.INFO, "calculated command (" + command + ") cost for " + user.getName() + " as " + cost);
}
}
if (cost.signum() != 0 && (user.isAuthorized("essentials.nocommandcost.all")
|| user.isAuthorized("essentials.nocommandcost." + command)))
{
return BigDecimal.ZERO;
}
return cost;
}
private static FileWriter fw = null;
public static void log(String type, String subtype, String event, String sender, Trade charge, String receiver, Trade pay, Location loc, IEssentials ess)
{
if (!ess.getSettings().isEcoLogEnabled())
//isEcoLogUpdateEnabled() - This refers to log entries with no location, ie API updates #EasterEgg
//isEcoLogEnabled() - This refers to log entries with with location, ie /pay /sell and eco signs.
if ((loc == null && !ess.getSettings().isEcoLogUpdateEnabled())
|| (loc != null && !ess.getSettings().isEcoLogEnabled()))
{
return;
}
@@ -160,7 +341,7 @@ public class Trade
}
catch (IOException ex)
{
Logger.getLogger("Minecraft").log(Level.SEVERE, null, ex);
Logger.getLogger("Essentials").log(Level.SEVERE, null, ex);
}
}
StringBuilder sb = new StringBuilder();
@@ -190,6 +371,12 @@ public class Trade
sb.append("money").append(",");
sb.append(ess.getSettings().getCurrencySymbol());
}
if (charge.getExperience() != null)
{
sb.append(charge.getExperience()).append(",");
sb.append("exp").append(",");
sb.append("\"\"");
}
}
sb.append(",\"");
if (receiver != null)
@@ -215,6 +402,12 @@ public class Trade
sb.append("money").append(",");
sb.append(ess.getSettings().getCurrencySymbol());
}
if (pay.getExperience() != null)
{
sb.append(pay.getExperience()).append(",");
sb.append("exp").append(",");
sb.append("\"\"");
}
}
if (loc == null)
{
@@ -236,7 +429,7 @@ public class Trade
}
catch (IOException ex)
{
Logger.getLogger("Minecraft").log(Level.SEVERE, null, ex);
Logger.getLogger("Essentials").log(Level.SEVERE, null, ex);
}
}
@@ -250,7 +443,7 @@ public class Trade
}
catch (IOException ex)
{
Logger.getLogger("Minecraft").log(Level.SEVERE, null, ex);
Logger.getLogger("Essentials").log(Level.SEVERE, null, ex);
}
fw = null;
}

View File

@@ -0,0 +1,197 @@
package com.earth2me.essentials;
import com.google.common.io.Files;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ConcurrentSkipListMap;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level;
import java.util.regex.Pattern;
import org.bukkit.Bukkit;
public class UUIDMap
{
private final transient net.ess3.api.IEssentials ess;
private File userList;
private final transient Pattern splitPattern = Pattern.compile(",");
private static final ExecutorService EXECUTOR_SERVICE = Executors.newSingleThreadExecutor();
private final AtomicInteger pendingDiskWrites = new AtomicInteger(0);
public UUIDMap(final net.ess3.api.IEssentials ess)
{
this.ess = ess;
userList = new File(ess.getDataFolder(), "usermap.csv");
}
public void loadAllUsers(final ConcurrentSkipListMap<String, UUID> names, final ConcurrentSkipListMap<UUID, ArrayList<String>> history)
{
try
{
if (!userList.exists())
{
userList.createNewFile();
}
final BufferedReader reader = new BufferedReader(new FileReader(userList));
try
{
while (true)
{
final String line = reader.readLine();
if (line == null)
{
break;
}
else
{
final String[] values = splitPattern.split(line);
if (values.length == 2)
{
final String name = values[0];
final UUID uuid = UUID.fromString(values[1]);
names.put(name, uuid);
if (!history.containsKey(uuid))
{
final ArrayList<String> list = new ArrayList<String>();
list.add(name);
history.put(uuid, list);
}
else
{
final ArrayList<String> list = history.get(uuid);
if (!list.contains(name))
{
list.add(name);
}
}
}
}
}
}
finally
{
reader.close();
}
}
catch (IOException ex)
{
Bukkit.getLogger().log(Level.SEVERE, ex.getMessage(), ex);
}
}
public void writeUUIDMap()
{
_writeUUIDMap();
}
public void forceWriteUUIDMap()
{
try
{
Future<?> future = _writeUUIDMap();;
if (future != null)
{
future.get();
}
}
catch (InterruptedException ex)
{
ess.getLogger().log(Level.SEVERE, ex.getMessage(), ex);
}
catch (ExecutionException ex)
{
ess.getLogger().log(Level.SEVERE, ex.getMessage(), ex);
}
}
public Future<?> _writeUUIDMap()
{
final ConcurrentSkipListMap<String, UUID> names = ess.getUserMap().getNames().clone();
if (names.size() < 1)
{
return null;
}
pendingDiskWrites.incrementAndGet();
Future<?> future = EXECUTOR_SERVICE.submit(new WriteRunner(ess.getDataFolder(), userList, names, pendingDiskWrites));
return future;
}
private static class WriteRunner implements Runnable
{
private final File location;
private final File endFile;
private final ConcurrentSkipListMap<String, UUID> names;
private final AtomicInteger pendingDiskWrites;
private WriteRunner(final File location, final File endFile, final ConcurrentSkipListMap<String, UUID> names, final AtomicInteger pendingDiskWrites)
{
this.location = location;
this.endFile = endFile;
this.names = names;
this.pendingDiskWrites = pendingDiskWrites;
}
@Override
public void run()
{
synchronized (pendingDiskWrites)
{
if (pendingDiskWrites.get() > 1)
{
pendingDiskWrites.decrementAndGet();
return;
}
File configFile = null;
try
{
configFile = File.createTempFile("usermap", ".tmp.csv", location);
final BufferedWriter bWriter = new BufferedWriter(new FileWriter(configFile));
for (Map.Entry<String, UUID> entry : names.entrySet())
{
bWriter.write(entry.getKey() + "," + entry.getValue().toString());
bWriter.newLine();
}
bWriter.close();
Files.move(configFile, endFile);
}
catch (IOException ex)
{
try
{
if (configFile != null && configFile.exists())
{
Files.move(configFile, new File(endFile.getParentFile(), "usermap.bak.csv"));
}
}
catch (Exception ex2)
{
Bukkit.getLogger().log(Level.SEVERE, ex2.getMessage(), ex2);
}
Bukkit.getLogger().log(Level.WARNING, ex.getMessage(), ex);
}
finally
{
pendingDiskWrites.decrementAndGet();
}
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,35 +1,59 @@
package com.earth2me.essentials;
import com.earth2me.essentials.commands.NotEnoughArgumentsException;
import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.utils.NumberUtil;
import com.earth2me.essentials.utils.StringUtil;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
import java.math.BigDecimal;
import java.util.*;
import net.ess3.api.IEssentials;
import net.ess3.api.InvalidWorldException;
import net.ess3.api.MaxMoneyException;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
public abstract class UserData extends PlayerExtension implements IConf
{
private final EssentialsConf config;
private static final Logger logger = Logger.getLogger("Minecraft");
protected final transient IEssentials ess;
private final EssentialsUserConf config;
private final File folder;
protected UserData(Player base, IEssentials ess)
{
super(base, ess);
File folder = new File(ess.getDataFolder(), "userdata");
super(base);
this.ess = ess;
folder = new File(ess.getDataFolder(), "userdata");
if (!folder.exists())
{
folder.mkdirs();
}
config = new EssentialsConf(new File(folder, Util.sanitizeFileName(base.getName()) + ".yml"));
String filename;
try
{
filename = base.getUniqueId().toString();
}
catch (Throwable ex)
{
ess.getLogger().warning("Falling back to old username system for " + base.getName());
filename = base.getName();
}
config = new EssentialsUserConf(base.getName(), base.getUniqueId(), new File(folder, filename + ".yml"));
reloadConfig();
}
public final void reset()
{
config.forceSave();
config.getFile().delete();
ess.getUserMap().removeUser(this.getBase().getName());
}
@Override
public final void reloadConfig()
{
config.load();
@@ -42,121 +66,145 @@ public abstract class UserData extends PlayerExtension implements IConf
lastHealTimestamp = _getLastHealTimestamp();
jail = _getJail();
mails = _getMails();
savedInventory = _getSavedInventory();
teleportEnabled = getTeleportEnabled();
ignoredPlayers = getIgnoredPlayers();
godmode = getGodModeEnabled();
muted = getMuted();
teleportEnabled = _getTeleportEnabled();
godmode = _getGodModeEnabled();
muted = _getMuted();
muteTimeout = _getMuteTimeout();
jailed = getJailed();
jailed = _getJailed();
jailTimeout = _getJailTimeout();
lastLogin = _getLastLogin();
lastLogout = _getLastLogout();
afk = getAfk();
newplayer = getNew();
lastLoginAddress = _getLastLoginAddress();
afk = _getAfk();
geolocation = _getGeoLocation();
isSocialSpyEnabled = _isSocialSpyEnabled();
isNPC = _isNPC();
arePowerToolsEnabled = _arePowerToolsEnabled();
kitTimestamps = _getKitTimestamps();
nickname = _getNickname();
ignoredPlayers = _getIgnoredPlayers();
logoutLocation = _getLogoutLocation();
lastAccountName = _getLastAccountName();
}
private double money;
private BigDecimal money;
private double _getMoney()
private BigDecimal _getMoney()
{
double money = ess.getSettings().getStartingBalance();
BigDecimal result = ess.getSettings().getStartingBalance();
BigDecimal maxMoney = ess.getSettings().getMaxMoney();
BigDecimal minMoney = ess.getSettings().getMinMoney();
if (config.hasProperty("money"))
{
money = config.getDouble("money", money);
result = config.getBigDecimal("money", result);
}
if (Math.abs(money) > ess.getSettings().getMaxMoney())
if (result.compareTo(maxMoney) > 0)
{
money = money < 0 ? -ess.getSettings().getMaxMoney() : ess.getSettings().getMaxMoney();
result = maxMoney;
}
return money;
if (result.compareTo(minMoney) < 0)
{
result = minMoney;
}
return result;
}
public double getMoney()
public BigDecimal getMoney()
{
return money;
}
public void setMoney(double value)
public void setMoney(BigDecimal value, boolean throwError) throws MaxMoneyException
{
money = value;
if (Math.abs(money) > ess.getSettings().getMaxMoney())
BigDecimal maxMoney = ess.getSettings().getMaxMoney();
BigDecimal minMoney = ess.getSettings().getMinMoney();
if (money.compareTo(maxMoney) > 0)
{
money = money < 0 ? -ess.getSettings().getMaxMoney() : ess.getSettings().getMaxMoney();
money = maxMoney;
if (throwError)
{
throw new MaxMoneyException();
}
}
config.setProperty("money", value);
if (money.compareTo(minMoney) < 0)
{
money = minMoney;
}
config.setProperty("money", money);
config.save();
}
private Map<String, Object> homes;
private Map<String, Object> _getHomes()
{
Object o = config.getProperty("homes");
if (o instanceof Map)
if (config.isConfigurationSection("homes"))
{
return (Map<String, Object>)o;
}
else
{
return new HashMap<String, Object>();
return config.getConfigurationSection("homes").getValues(false);
}
return new HashMap<String, Object>();
}
private String getHomeName(String search)
{
if (NumberUtil.isInt(search))
{
try
{
search = getHomes().get(Integer.parseInt(search) - 1);
}
catch (NumberFormatException e)
{
}
catch (IndexOutOfBoundsException e)
{
}
}
return search;
}
public Location getHome(String name) throws Exception
{
Location loc = config.getLocation("homes." + name, getServer());
if (loc == null)
{
try
{
loc = config.getLocation("homes." + getHomes().get(Integer.parseInt(name) - 1), getServer());
}
catch (IndexOutOfBoundsException e)
{
return null;
}
catch (NumberFormatException e)
{
return null;
}
}
return loc;
String search = getHomeName(name);
return config.getLocation("homes." + search, this.getBase().getServer());
}
public Location getHome(Location world) throws Exception
public Location getHome(final Location world)
{
Location loc;
for (String home : getHomes())
try
{
loc = config.getLocation("homes." + home, getServer());
if (world.getWorld() == loc.getWorld())
if (getHomes().isEmpty())
{
return loc;
return null;
}
Location loc;
for (String home : getHomes())
{
loc = config.getLocation("homes." + home, this.getBase().getServer());
if (world.getWorld() == loc.getWorld())
{
return loc;
}
}
loc = config.getLocation("homes." + getHomes().get(0), this.getBase().getServer());
return loc;
}
catch (InvalidWorldException ex)
{
return null;
}
loc = config.getLocation("homes." + getHomes().get(0), getServer());
return loc;
}
public List<String> getHomes()
{
List<String> list = new ArrayList(homes.keySet());
return list;
return new ArrayList<String>(homes.keySet());
}
public void setHome(String name, Location loc)
{
//Invalid names will corrupt the yaml
name = Util.sanitizeFileName(name);
name = StringUtil.safeString(name);
homes.put(name, loc);
config.setProperty("homes." + name, loc);
config.save();
@@ -164,21 +212,20 @@ public abstract class UserData extends PlayerExtension implements IConf
public void delHome(String name) throws Exception
{
String search = name;
String search = getHomeName(name);
if (!homes.containsKey(search))
{
search = Util.sanitizeFileName(name);
search = StringUtil.safeString(search);
}
if (homes.containsKey(search))
{
homes.remove(name);
config.removeProperty("homes." + name);
homes.remove(search);
config.removeProperty("homes." + search);
config.save();
}
else
{
//TODO: move this message to messages file
throw new Exception("Home " + name + " doesn't exist");
throw new Exception(tl("invalidHome", search));
}
}
@@ -190,14 +237,21 @@ public abstract class UserData extends PlayerExtension implements IConf
}
return false;
}
private String nickname;
public String getNickname()
public String _getNickname()
{
return config.getString("nickname");
}
public String getNickname()
{
return nickname;
}
public void setNickname(String nick)
{
nickname = nick;
config.setProperty("nickname", nick);
config.save();
}
@@ -205,7 +259,7 @@ public abstract class UserData extends PlayerExtension implements IConf
private List<Integer> _getUnlimited()
{
return config.getIntList("unlimited", new ArrayList<Integer>());
return config.getIntegerList("unlimited");
}
public List<Integer> getUnlimited()
@@ -231,22 +285,15 @@ public abstract class UserData extends PlayerExtension implements IConf
config.setProperty("unlimited", unlimited);
config.save();
}
private Map<Integer, Object> powertools;
private Map<String, Object> powertools;
@SuppressWarnings("unchecked")
private Map<Integer, Object> _getPowertools()
private Map<String, Object> _getPowertools()
{
Object o = config.getProperty("powertools");
if (o instanceof Map)
if (config.isConfigurationSection("powertools"))
{
return (Map<Integer, Object>)o;
return config.getConfigurationSection("powertools").getValues(false);
}
else
{
return new HashMap<Integer, Object>();
}
return new HashMap<String, Object>();
}
public void clearAllPowertools()
@@ -256,20 +303,27 @@ public abstract class UserData extends PlayerExtension implements IConf
config.save();
}
@SuppressWarnings("unchecked")
public List<String> getPowertool(ItemStack stack)
{
return (List<String>)powertools.get(stack.getTypeId());
return (List<String>)powertools.get("" + stack.getTypeId());
}
@SuppressWarnings("unchecked")
public List<String> getPowertool(int id)
{
return (List<String>)powertools.get("" + id);
}
public void setPowertool(ItemStack stack, List<String> commandList)
{
if (commandList == null || commandList.isEmpty())
{
powertools.remove(stack.getTypeId());
powertools.remove("" + stack.getTypeId());
}
else
{
powertools.put(stack.getTypeId(), commandList);
powertools.put("" + stack.getTypeId(), commandList);
}
config.setProperty("powertools", powertools);
config.save();
@@ -277,7 +331,7 @@ public abstract class UserData extends PlayerExtension implements IConf
public boolean hasPowerTools()
{
return powertools.size() > 0;
return !powertools.isEmpty();
}
private Location lastLocation;
@@ -285,9 +339,9 @@ public abstract class UserData extends PlayerExtension implements IConf
{
try
{
return config.getLocation("lastlocation", getServer());
return config.getLocation("lastlocation", this.getBase().getServer());
}
catch (Exception e)
catch (InvalidWorldException e)
{
return null;
}
@@ -308,6 +362,35 @@ public abstract class UserData extends PlayerExtension implements IConf
config.setProperty("lastlocation", loc);
config.save();
}
private Location logoutLocation;
private Location _getLogoutLocation()
{
try
{
return config.getLocation("logoutlocation", this.getBase().getServer());
}
catch (InvalidWorldException e)
{
return null;
}
}
public Location getLogoutLocation()
{
return logoutLocation;
}
public void setLogoutLocation(Location loc)
{
if (loc == null || loc.getWorld() == null)
{
return;
}
logoutLocation = loc;
config.setProperty("logoutlocation", loc);
config.save();
}
private long lastTeleportTimestamp;
private long _getLastTeleportTimestamp()
@@ -374,7 +457,7 @@ public abstract class UserData extends PlayerExtension implements IConf
private List<String> _getMails()
{
return config.getStringList("mail", new ArrayList<String>());
return config.getStringList("mail");
}
public List<String> getMails()
@@ -402,53 +485,9 @@ public abstract class UserData extends PlayerExtension implements IConf
mails.add(mail);
setMails(mails);
}
private ItemStack[] savedInventory;
public ItemStack[] getSavedInventory()
{
return savedInventory;
}
private ItemStack[] _getSavedInventory()
{
int size = config.getInt("inventory.size", 0);
if (size < 1 || (getInventory() != null && size > getInventory().getSize()))
{
return null;
}
ItemStack[] is = new ItemStack[size];
for (int i = 0; i < size; i++)
{
is[i] = config.getItemStack("inventory." + i);
}
return is;
}
public void setSavedInventory(ItemStack[] is)
{
if (is == null || is.length == 0)
{
savedInventory = null;
config.removeProperty("inventory");
}
else
{
savedInventory = is;
config.setProperty("inventory.size", is.length);
for (int i = 0; i < is.length; i++)
{
if (is[i] == null || is[i].getType() == Material.AIR)
{
continue;
}
config.setProperty("inventory." + i, is[i]);
}
}
config.save();
}
private boolean teleportEnabled;
private boolean getTeleportEnabled()
private boolean _getTeleportEnabled()
{
return config.getBoolean("teleportenabled", true);
}
@@ -464,32 +503,18 @@ public abstract class UserData extends PlayerExtension implements IConf
config.setProperty("teleportenabled", set);
config.save();
}
public boolean toggleTeleportEnabled()
{
boolean ret = !isTeleportEnabled();
setTeleportEnabled(ret);
return ret;
}
public boolean toggleSocialSpy()
{
boolean ret = !isSocialSpyEnabled();
setSocialSpyEnabled(ret);
return ret;
}
private List<String> ignoredPlayers;
public List<String> getIgnoredPlayers()
public List<String> _getIgnoredPlayers()
{
return config.getStringList("ignore", new ArrayList<String>());
return Collections.synchronizedList(config.getStringList("ignore"));
}
public void setIgnoredPlayers(List<String> players)
{
if (players == null || players.isEmpty())
{
ignoredPlayers = new ArrayList<String>();
ignoredPlayers = Collections.synchronizedList(new ArrayList<String>());
config.removeProperty("ignore");
}
else
@@ -500,26 +525,37 @@ public abstract class UserData extends PlayerExtension implements IConf
config.save();
}
public boolean isIgnoredPlayer(String name)
@Deprecated
public boolean isIgnoredPlayer(final String userName)
{
return ignoredPlayers.contains(name.toLowerCase());
final IUser user = ess.getUser(userName);
if (user == null || !user.getBase().isOnline())
{
return false;
}
return isIgnoredPlayer(user);
}
public void setIgnoredPlayer(String name, boolean set)
public boolean isIgnoredPlayer(IUser user)
{
return (ignoredPlayers.contains(user.getName().toLowerCase(Locale.ENGLISH)) && !user.isIgnoreExempt());
}
public void setIgnoredPlayer(IUser user, boolean set)
{
if (set)
{
ignoredPlayers.add(name.toLowerCase());
ignoredPlayers.add(user.getName().toLowerCase(Locale.ENGLISH));
}
else
{
ignoredPlayers.remove(name.toLowerCase());
ignoredPlayers.remove(user.getName().toLowerCase(Locale.ENGLISH));
}
setIgnoredPlayers(ignoredPlayers);
}
private boolean godmode;
private boolean getGodModeEnabled()
private boolean _getGodModeEnabled()
{
return config.getBoolean("godmode", false);
}
@@ -535,20 +571,18 @@ public abstract class UserData extends PlayerExtension implements IConf
config.setProperty("godmode", set);
config.save();
}
public boolean toggleGodModeEnabled()
{
boolean ret = !isGodModeEnabled();
setGodModeEnabled(ret);
return ret;
}
private boolean muted;
private boolean getMuted()
public boolean _getMuted()
{
return config.getBoolean("muted", false);
}
public boolean getMuted()
{
return muted;
}
public boolean isMuted()
{
return muted;
@@ -560,13 +594,6 @@ public abstract class UserData extends PlayerExtension implements IConf
config.setProperty("muted", set);
config.save();
}
public boolean toggleMuted()
{
boolean ret = !isMuted();
setMuted(ret);
return ret;
}
private long muteTimeout;
private long _getMuteTimeout()
@@ -587,7 +614,7 @@ public abstract class UserData extends PlayerExtension implements IConf
}
private boolean jailed;
private boolean getJailed()
private boolean _getJailed()
{
return config.getBoolean("jailed", false);
}
@@ -631,12 +658,12 @@ public abstract class UserData extends PlayerExtension implements IConf
public String getBanReason()
{
return config.getString("ban.reason");
return config.getString("ban.reason", "");
}
public void setBanReason(String reason)
{
config.setProperty("ban.reason", reason);
config.setProperty("ban.reason", StringUtil.sanitizeString(reason));
config.save();
}
@@ -662,10 +689,19 @@ public abstract class UserData extends PlayerExtension implements IConf
return lastLogin;
}
public void setLastLogin(long time)
private void _setLastLogin(long time)
{
lastLogin = time;
config.setProperty("timestamps.login", time);
}
public void setLastLogin(long time)
{
_setLastLogin(time);
if (base.getAddress() != null && base.getAddress().getAddress() != null)
{
_setLastLoginAddress(base.getAddress().getAddress().getHostAddress());
}
config.save();
}
private long lastLogout;
@@ -686,9 +722,26 @@ public abstract class UserData extends PlayerExtension implements IConf
config.setProperty("timestamps.logout", time);
config.save();
}
private String lastLoginAddress;
private String _getLastLoginAddress()
{
return config.getString("ipAddress", "");
}
public String getLastLoginAddress()
{
return lastLoginAddress;
}
private void _setLastLoginAddress(String address)
{
lastLoginAddress = address;
config.setProperty("ipAddress", address);
}
private boolean afk;
private boolean getAfk()
private boolean _getAfk()
{
return config.getBoolean("afk", false);
}
@@ -698,37 +751,13 @@ public abstract class UserData extends PlayerExtension implements IConf
return afk;
}
public void setAfk(boolean set)
public void _setAfk(boolean set)
{
afk = set;
config.setProperty("afk", set);
config.save();
}
public boolean toggleAfk()
{
boolean ret = !isAfk();
setAfk(ret);
return ret;
}
private boolean newplayer;
private boolean getNew()
{
return config.getBoolean("newplayer", true);
}
public boolean isNew()
{
return newplayer;
}
public void setNew(boolean set)
{
newplayer = set;
config.setProperty("newplayer", set);
config.save();
}
private String geolocation;
private String _getGeoLocation()
@@ -784,6 +813,25 @@ public abstract class UserData extends PlayerExtension implements IConf
{
return isNPC;
}
private String lastAccountName = null;
public String getLastAccountName()
{
return lastAccountName;
}
public String _getLastAccountName()
{
return config.getString("lastAccountName", null);
}
public void setLastAccountName(String lastAccountName)
{
this.lastAccountName = lastAccountName;
config.setProperty("lastAccountName", lastAccountName);
config.save();
ess.getUserMap().trackUUID(base.getUniqueId(), lastAccountName);
}
public void setNPC(boolean set)
{
@@ -816,32 +864,104 @@ public abstract class UserData extends PlayerExtension implements IConf
{
return config.getBoolean("powertoolsenabled", true);
}
private Map<String, Object> kitTimestamps;
private Map<String, Long> kitTimestamps;
private Map<String, Object> _getKitTimestamps()
private Map<String, Long> _getKitTimestamps()
{
final Object map = config.getProperty("timestamps.kits");
if (map instanceof Map)
if (config.isConfigurationSection("timestamps.kits"))
{
return (Map<String, Object>)map;
}
else
{
return new HashMap<String, Object>();
final ConfigurationSection section = config.getConfigurationSection("timestamps.kits");
final Map<String, Long> timestamps = new HashMap<String, Long>();
for (String command : section.getKeys(false))
{
if (section.isLong(command))
{
timestamps.put(command.toLowerCase(Locale.ENGLISH), section.getLong(command));
}
else if (section.isInt(command))
{
timestamps.put(command.toLowerCase(Locale.ENGLISH), (long)section.getInt(command));
}
}
return timestamps;
}
return new HashMap<String, Long>();
}
public Long getKitTimestamp(final String name)
public long getKitTimestamp(String name)
{
final Number num = (Number)kitTimestamps.get(name.toLowerCase());
return num == null ? null : num.longValue();
name = name.replace('.', '_').replace('/', '_');
if (kitTimestamps != null && kitTimestamps.containsKey(name))
{
return kitTimestamps.get(name);
}
return 0l;
}
public void setKitTimestamp(final String name, final long time)
{
kitTimestamps.put(name.toLowerCase(), time);
kitTimestamps.put(name.toLowerCase(Locale.ENGLISH), time);
config.setProperty("timestamps.kits", kitTimestamps);
config.save();
}
public void setConfigProperty(String node, Object object)
{
final String prefix = "info.";
node = prefix + node;
if (object instanceof Map)
{
config.setProperty(node, (Map)object);
}
else if (object instanceof List)
{
config.setProperty(node, (List<String>)object);
}
else if (object instanceof Location)
{
config.setProperty(node, (Location)object);
}
else if (object instanceof ItemStack)
{
config.setProperty(node, (ItemStack)object);
}
else
{
config.setProperty(node, object);
}
config.save();
}
public Set<String> getConfigKeys()
{
if (config.isConfigurationSection("info"))
{
return config.getConfigurationSection("info").getKeys(true);
}
return new HashSet<String>();
}
public Map<String, Object> getConfigMap()
{
if (config.isConfigurationSection("info"))
{
return config.getConfigurationSection("info").getValues(true);
}
return new HashMap<String, Object>();
}
public Map<String, Object> getConfigMap(String node)
{
if (config.isConfigurationSection("info." + node))
{
return config.getConfigurationSection("info." + node).getValues(true);
}
return new HashMap<String, Object>();
}
public void save()
{
config.save();
}
}

View File

@@ -1,119 +1,242 @@
package com.earth2me.essentials;
import com.google.common.base.Function;
import com.google.common.collect.ComputationException;
import com.google.common.collect.MapMaker;
import com.earth2me.essentials.utils.StringUtil;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.util.concurrent.UncheckedExecutionException;
import java.io.File;
import java.util.HashSet;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ConcurrentMap;
import java.util.logging.Level;
import java.util.UUID;
import java.util.concurrent.ConcurrentSkipListMap;
import java.util.concurrent.ConcurrentSkipListSet;
import java.util.concurrent.ExecutionException;
import net.ess3.api.IEssentials;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
public class UserMap implements Function<String, User>, IConf
public class UserMap extends CacheLoader<UUID, User> implements IConf
{
private final transient IEssentials ess;
private final transient ConcurrentMap<String, User> users = new MapMaker().softValues().makeComputingMap(this);
private final transient Cache<UUID, User> users;
private final transient ConcurrentSkipListSet<UUID> keys = new ConcurrentSkipListSet<UUID>();
private final transient ConcurrentSkipListMap<String, UUID> names = new ConcurrentSkipListMap<String, UUID>();
private final transient ConcurrentSkipListMap<UUID, ArrayList<String>> history = new ConcurrentSkipListMap<UUID, ArrayList<String>>();
private UUIDMap uuidMap;
public UserMap(final IEssentials ess)
{
super();
this.ess = ess;
loadAllUsersAsync(ess);
uuidMap = new UUIDMap(ess);
users = CacheBuilder.newBuilder().maximumSize(ess.getSettings().getMaxUserCacheCount()).softValues().build(this);
}
private void loadAllUsersAsync(final IEssentials ess)
{
ess.scheduleAsyncDelayedTask(new Runnable()
ess.runTaskAsynchronously(new Runnable()
{
@Override
public void run()
{
final File userdir = new File(ess.getDataFolder(), "userdata");
if (!userdir.exists())
synchronized (users)
{
return;
}
for (String string : userdir.list())
{
if (!string.endsWith(".yml"))
final File userdir = new File(ess.getDataFolder(), "userdata");
if (!userdir.exists())
{
continue;
return;
}
final String name = string.substring(0, string.length() - 4);
try
keys.clear();
names.clear();
users.invalidateAll();
for (String string : userdir.list())
{
users.get(name.toLowerCase());
}
catch (NullPointerException ex)
{
// Ignore these
}
catch (ComputationException ex)
{
Bukkit.getLogger().log(Level.INFO, "Failed to preload user " + name, ex);
if (!string.endsWith(".yml"))
{
continue;
}
final String name = string.substring(0, string.length() - 4);
try
{
keys.add(UUID.fromString(name));
}
catch (IllegalArgumentException ex)
{
//Ignore these users till they rejoin.
}
}
uuidMap.loadAllUsers(names, history);
}
}
});
}
public boolean userExists(final String name)
public boolean userExists(final UUID uuid)
{
return users.containsKey(name.toLowerCase());
return keys.contains(uuid);
}
public User getUser(final String name) throws NullPointerException
public User getUser(final String name)
{
return users.get(name.toLowerCase());
try
{
final String sanitizedName = StringUtil.sanitizeFileName(name);
if (names.containsKey(sanitizedName))
{
final UUID uuid = names.get(sanitizedName);
return users.get(uuid);
}
for (Player player : ess.getServer().getOnlinePlayers())
{
String sanitizedPlayer = StringUtil.sanitizeFileName(player.getName());
if (sanitizedPlayer.equalsIgnoreCase(sanitizedName))
{
User user = new User(player, ess);
trackUUID(user.getBase().getUniqueId(), user.getName());
return new User(player, ess);
}
}
final File userFile = getUserFileFromString(sanitizedName);
if (userFile.exists())
{
User user = new User(new OfflinePlayer(sanitizedName, ess.getServer()), ess);
trackUUID(user.getBase().getUniqueId(), user.getName());
return user;
}
return null;
}
catch (ExecutionException ex)
{
return null;
}
catch (UncheckedExecutionException ex)
{
return null;
}
}
public User getUser(final UUID uuid)
{
try
{
return users.get(uuid);
}
catch (ExecutionException ex)
{
return null;
}
catch (UncheckedExecutionException ex)
{
return null;
}
}
public void trackUUID(final UUID uuid, final String name)
{
if (uuid != null)
{
keys.add(uuid);
if (name != null && name.length() > 0)
{
final String keyName = StringUtil.sanitizeFileName(name);
if (!names.containsKey(keyName) || !names.get(keyName).equals(uuid))
{
names.put(keyName, uuid);
uuidMap.writeUUIDMap();
}
}
}
}
@Override
public User apply(final String name)
public User load(final UUID uuid) throws Exception
{
for (Player player : ess.getServer().getOnlinePlayers())
Player player = ess.getServer().getPlayer(uuid);
if (player != null)
{
if (player.getName().equalsIgnoreCase(name))
{
return new User(player, ess);
}
final User user = new User(player, ess);
trackUUID(uuid, user.getName());
return user;
}
final File userFolder = new File(ess.getDataFolder(), "userdata");
final File userFile = new File(userFolder, Util.sanitizeFileName(name) + ".yml");
final File userFile = getUserFileFromID(uuid);
if (userFile.exists())
{
return new User(new OfflinePlayer(name, ess), ess);
player = new OfflinePlayer(uuid, ess.getServer());
final User user = new User(player, ess);
((OfflinePlayer)player).setName(user.getLastAccountName());
trackUUID(uuid, user.getName());
return user;
}
return null;
throw new Exception("User not found!");
}
@Override
public void reloadConfig()
{
for (User user : users.values())
{
user.reloadConfig();
}
getUUIDMap().forceWriteUUIDMap();
loadAllUsersAsync(ess);
}
public void removeUser(final String name)
{
users.remove(name.toLowerCase());
UUID uuid = names.get(name);
if (uuid != null)
{
keys.remove(uuid);
users.invalidate(uuid);
}
names.remove(name);
names.remove(StringUtil.sanitizeFileName(name));
}
public Set<User> getAllUsers()
public Set<UUID> getAllUniqueUsers()
{
final Set<User> userSet = new HashSet<User>();
for (String name : users.keySet())
{
userSet.add(users.get(name));
}
return userSet;
return Collections.unmodifiableSet(keys);
}
public int getUniqueUsers()
{
return users.size();
return keys.size();
}
public ConcurrentSkipListMap<String, UUID> getNames()
{
return names;
}
public ConcurrentSkipListMap<UUID, ArrayList<String>> getHistory()
{
return history;
}
public List<String> getUserHistory(final UUID uuid)
{
return history.get(uuid);
}
public UUIDMap getUUIDMap()
{
return uuidMap;
}
private File getUserFileFromID(final UUID uuid)
{
final File userFolder = new File(ess.getDataFolder(), "userdata");
return new File(userFolder, uuid.toString() + ".yml");
}
public File getUserFileFromString(final String name)
{
final File userFolder = new File(ess.getDataFolder(), "userdata");
return new File(userFolder, StringUtil.sanitizeFileName(name) + ".yml");
}
}

View File

@@ -1,551 +0,0 @@
package com.earth2me.essentials;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.MessageFormat;
import java.util.Calendar;
import java.util.Enumeration;
import java.util.GregorianCalendar;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Block;
public class Util
{
private Util()
{
}
private final static Logger logger = Logger.getLogger("Minecraft");
public static String sanitizeFileName(String name)
{
return name.toLowerCase().replaceAll("[^a-z0-9]", "_");
}
public static String formatDateDiff(long date)
{
Calendar c = new GregorianCalendar();
c.setTimeInMillis(date);
Calendar now = new GregorianCalendar();
return Util.formatDateDiff(now, c);
}
public static String formatDateDiff(Calendar fromDate, Calendar toDate)
{
boolean future = false;
if (toDate.equals(fromDate))
{
return Util.i18n("now");
}
if (toDate.after(fromDate))
{
future = true;
}
StringBuilder sb = new StringBuilder();
int[] types = new int[]
{
Calendar.YEAR,
Calendar.MONTH,
Calendar.DAY_OF_MONTH,
Calendar.HOUR_OF_DAY,
Calendar.MINUTE,
Calendar.SECOND
};
String[] names = new String[]
{
Util.i18n("year"),
Util.i18n("years"),
Util.i18n("month"),
Util.i18n("months"),
Util.i18n("day"),
Util.i18n("days"),
Util.i18n("hour"),
Util.i18n("hours"),
Util.i18n("minute"),
Util.i18n("minutes"),
Util.i18n("second"),
Util.i18n("seconds")
};
for (int i = 0; i < types.length; i++)
{
int diff = dateDiff(types[i], fromDate, toDate, future);
if (diff > 0)
{
sb.append(" ").append(diff).append(" ").append(names[i * 2 + (diff > 1 ? 1 : 0)]);
}
}
if (sb.length() == 0)
{
return "now";
}
return sb.toString();
}
private static int dateDiff(int type, Calendar fromDate, Calendar toDate, boolean future)
{
int diff = 0;
long savedDate = fromDate.getTimeInMillis();
while ((future && !fromDate.after(toDate)) || (!future && !fromDate.before(toDate)))
{
savedDate = fromDate.getTimeInMillis();
fromDate.add(type, future ? 1 : -1);
diff++;
}
diff--;
fromDate.setTimeInMillis(savedDate);
return diff;
}
public static long parseDateDiff(String time, boolean future) throws Exception
{
Pattern timePattern = Pattern.compile(
"(?:([0-9]+)\\s*y[a-z]*[,\\s]*)?"
+ "(?:([0-9]+)\\s*mo[a-z]*[,\\s]*)?"
+ "(?:([0-9]+)\\s*w[a-z]*[,\\s]*)?"
+ "(?:([0-9]+)\\s*d[a-z]*[,\\s]*)?"
+ "(?:([0-9]+)\\s*h[a-z]*[,\\s]*)?"
+ "(?:([0-9]+)\\s*m[a-z]*[,\\s]*)?"
+ "(?:([0-9]+)\\s*(?:s[a-z]*)?)?", Pattern.CASE_INSENSITIVE);
Matcher m = timePattern.matcher(time);
int years = 0;
int months = 0;
int weeks = 0;
int days = 0;
int hours = 0;
int minutes = 0;
int seconds = 0;
boolean found = false;
while (m.find())
{
if (m.group() == null || m.group().isEmpty())
{
continue;
}
for (int i = 0; i < m.groupCount(); i++)
{
if (m.group(i) != null && !m.group(i).isEmpty())
{
found = true;
break;
}
}
if (found)
{
if (m.group(1) != null && !m.group(1).isEmpty())
{
years = Integer.parseInt(m.group(1));
}
if (m.group(2) != null && !m.group(2).isEmpty())
{
months = Integer.parseInt(m.group(2));
}
if (m.group(3) != null && !m.group(3).isEmpty())
{
weeks = Integer.parseInt(m.group(3));
}
if (m.group(4) != null && !m.group(4).isEmpty())
{
days = Integer.parseInt(m.group(4));
}
if (m.group(5) != null && !m.group(5).isEmpty())
{
hours = Integer.parseInt(m.group(5));
}
if (m.group(6) != null && !m.group(6).isEmpty())
{
minutes = Integer.parseInt(m.group(6));
}
if (m.group(7) != null && !m.group(7).isEmpty())
{
seconds = Integer.parseInt(m.group(7));
}
break;
}
}
if (!found)
{
throw new Exception(Util.i18n("illegalDate"));
}
Calendar c = new GregorianCalendar();
if (years > 0)
{
c.add(Calendar.YEAR, years * (future ? 1 : -1));
}
if (months > 0)
{
c.add(Calendar.MONTH, months * (future ? 1 : -1));
}
if (weeks > 0)
{
c.add(Calendar.WEEK_OF_YEAR, weeks * (future ? 1 : -1));
}
if (days > 0)
{
c.add(Calendar.DAY_OF_MONTH, days * (future ? 1 : -1));
}
if (hours > 0)
{
c.add(Calendar.HOUR_OF_DAY, hours * (future ? 1 : -1));
}
if (minutes > 0)
{
c.add(Calendar.MINUTE, minutes * (future ? 1 : -1));
}
if (seconds > 0)
{
c.add(Calendar.SECOND, seconds * (future ? 1 : -1));
}
return c.getTimeInMillis();
}
// The player can stand inside these materials
private static final Set<Integer> AIR_MATERIALS = new HashSet<Integer>();
static {
AIR_MATERIALS.add(Material.AIR.getId());
AIR_MATERIALS.add(Material.SAPLING.getId());
AIR_MATERIALS.add(Material.POWERED_RAIL.getId());
AIR_MATERIALS.add(Material.DETECTOR_RAIL.getId());
AIR_MATERIALS.add(Material.LONG_GRASS.getId());
AIR_MATERIALS.add(Material.DEAD_BUSH.getId());
AIR_MATERIALS.add(Material.YELLOW_FLOWER.getId());
AIR_MATERIALS.add(Material.RED_ROSE.getId());
AIR_MATERIALS.add(Material.BROWN_MUSHROOM.getId());
AIR_MATERIALS.add(Material.RED_MUSHROOM.getId());
AIR_MATERIALS.add(Material.TORCH.getId());
AIR_MATERIALS.add(Material.REDSTONE_WIRE.getId());
AIR_MATERIALS.add(Material.SEEDS.getId());
AIR_MATERIALS.add(Material.SIGN_POST.getId());
AIR_MATERIALS.add(Material.WOODEN_DOOR.getId());
AIR_MATERIALS.add(Material.LADDER.getId());
AIR_MATERIALS.add(Material.RAILS.getId());
AIR_MATERIALS.add(Material.WALL_SIGN.getId());
AIR_MATERIALS.add(Material.LEVER.getId());
AIR_MATERIALS.add(Material.STONE_PLATE.getId());
AIR_MATERIALS.add(Material.IRON_DOOR_BLOCK.getId());
AIR_MATERIALS.add(Material.WOOD_PLATE.getId());
AIR_MATERIALS.add(Material.REDSTONE_TORCH_OFF.getId());
AIR_MATERIALS.add(Material.REDSTONE_TORCH_ON.getId());
AIR_MATERIALS.add(Material.STONE_BUTTON.getId());
AIR_MATERIALS.add(Material.SUGAR_CANE_BLOCK.getId());
AIR_MATERIALS.add(Material.DIODE_BLOCK_OFF.getId());
AIR_MATERIALS.add(Material.DIODE_BLOCK_ON.getId());
AIR_MATERIALS.add(Material.TRAP_DOOR.getId());
AIR_MATERIALS.add(Material.PUMPKIN_STEM.getId());
AIR_MATERIALS.add(Material.MELON_STEM.getId());
AIR_MATERIALS.add(Material.VINE.getId());
//TODO: Add 1.9 materials
}
public static Location getSafeDestination(final Location loc) throws Exception
{
if (loc == null || loc.getWorld() == null)
{
throw new Exception(Util.i18n("destinationNotSet"));
}
final World world = loc.getWorld();
int x = loc.getBlockX();
int y = (int)Math.round(loc.getY());
int z = loc.getBlockZ();
while (isBlockAboveAir(world, x, y, z))
{
y -= 1;
if (y < 0)
{
break;
}
}
while (isBlockUnsafe(world, x, y, z))
{
y += 1;
if (y >= 127)
{
x += 1;
break;
}
}
while (isBlockUnsafe(world, x, y, z))
{
y -= 1;
if (y <= 1)
{
y = 127;
x += 1;
if (x - 32 > loc.getBlockX())
{
throw new Exception(Util.i18n("holeInFloor"));
}
}
}
return new Location(world, x + 0.5D, y, z + 0.5D, loc.getYaw(), loc.getPitch());
}
private static boolean isBlockAboveAir(final World world, final int x, final int y, final int z)
{
return AIR_MATERIALS.contains(world.getBlockAt(x, y - 1, z).getType().getId());
}
public static boolean isBlockUnsafe(final World world, final int x, final int y, final int z)
{
final Block below = world.getBlockAt(x, y - 1, z);
if (below.getType() == Material.LAVA || below.getType() == Material.STATIONARY_LAVA)
{
return true;
}
if (below.getType() == Material.FIRE)
{
return true;
}
if ((!AIR_MATERIALS.contains(world.getBlockAt(x, y, z).getType().getId()))
|| (!AIR_MATERIALS.contains(world.getBlockAt(x, y + 1, z).getType().getId())))
{
return true;
}
return isBlockAboveAir(world, x, y, z);
}
private static DecimalFormat df = new DecimalFormat("#0.00", DecimalFormatSymbols.getInstance(Locale.US));
public static String formatCurrency(final double value, final IEssentials ess)
{
String str = ess.getSettings().getCurrencySymbol() + df.format(value);
if (str.endsWith(".00"))
{
str = str.substring(0, str.length() - 3);
}
return str;
}
public static double roundDouble(final double d)
{
return Math.round(d * 100.0) / 100.0;
}
public static Locale getCurrentLocale()
{
return currentLocale;
}
private static class ConfigClassLoader extends ClassLoader
{
private final transient File dataFolder;
private final transient ClassLoader cl;
private final transient IEssentials ess;
public ConfigClassLoader(final ClassLoader cl, final IEssentials ess)
{
this.ess = ess;
this.dataFolder = ess.getDataFolder();
this.cl = cl;
}
@Override
public URL getResource(final String string)
{
final File file = new File(dataFolder, string);
if (file.exists())
{
try
{
return file.toURI().toURL();
}
catch (MalformedURLException ex)
{
return cl.getResource(string);
}
}
return cl.getResource(string);
}
@Override
public synchronized void clearAssertionStatus()
{
cl.clearAssertionStatus();
}
@Override
public InputStream getResourceAsStream(final String string)
{
final File file = new File(dataFolder, string);
if (file.exists())
{
BufferedReader br = null;
try
{
br = new BufferedReader(new FileReader(file));
final String version = br.readLine();
if (version == null || !version.equals("#version: " + ess.getDescription().getVersion()))
{
logger.log(Level.WARNING, String.format("Translation file %s is not updated for Essentials version. Will use default.", file));
return cl.getResourceAsStream(string);
}
return new FileInputStream(file);
}
catch (IOException ex)
{
return cl.getResourceAsStream(string);
}
finally
{
if (br != null)
{
try
{
br.close();
}
catch (IOException ex)
{
}
}
}
}
return cl.getResourceAsStream(string);
}
@Override
public Enumeration<URL> getResources(final String string) throws IOException
{
return cl.getResources(string);
}
@Override
public Class<?> loadClass(final String string) throws ClassNotFoundException
{
return cl.loadClass(string);
}
@Override
public synchronized void setClassAssertionStatus(final String string, final boolean bln)
{
cl.setClassAssertionStatus(string, bln);
}
@Override
public synchronized void setDefaultAssertionStatus(final boolean bln)
{
cl.setDefaultAssertionStatus(bln);
}
@Override
public synchronized void setPackageAssertionStatus(final String string, final boolean bln)
{
cl.setPackageAssertionStatus(string, bln);
}
}
private static final Locale defaultLocale = Locale.getDefault();
private static Locale currentLocale = defaultLocale;
private static ResourceBundle bundle = ResourceBundle.getBundle("messages", defaultLocale);
private static ResourceBundle defaultBundle = ResourceBundle.getBundle("messages", Locale.US);
public static String i18n(String string)
{
try
{
return bundle.getString(string);
}
catch (MissingResourceException ex)
{
logger.log(Level.WARNING, String.format("Missing translation key \"%s\" in translation file %s", ex.getKey(), bundle.getLocale().toString()), ex);
return defaultBundle.getString(string);
}
}
public static String format(String string, Object... objects)
{
MessageFormat mf = new MessageFormat(i18n(string));
return mf.format(objects);
}
public static void updateLocale(String loc, IEssentials ess)
{
if (loc == null || loc.isEmpty())
{
return;
}
String[] parts = loc.split("[_\\.]");
if (parts.length == 1)
{
currentLocale = new Locale(parts[0]);
}
if (parts.length == 2)
{
currentLocale = new Locale(parts[0], parts[1]);
}
if (parts.length == 3)
{
currentLocale = new Locale(parts[0], parts[1], parts[2]);
}
logger.log(Level.INFO, String.format("Using locale %s", currentLocale.toString()));
bundle = ResourceBundle.getBundle("messages", currentLocale, new ConfigClassLoader(Util.class.getClassLoader(), ess));
if (!bundle.keySet().containsAll(defaultBundle.keySet()))
{
logger.log(Level.WARNING, String.format("Translation file %s does not contain all translation keys.", currentLocale.toString()));
}
}
public static String joinList(Object... list)
{
return joinList(", ", list);
}
public static String joinList(String seperator, Object... list)
{
StringBuilder buf = new StringBuilder();
for (Object each : list)
{
if (buf.length() > 0)
{
buf.append(seperator);
}
if(each instanceof List)
{
buf.append(joinList(seperator, ((List)each).toArray()));
}
else
{
try
{
buf.append(each.toString());
}
catch (Exception e)
{
buf.append(each.toString());
}
}
}
return buf.toString();
}
public static String capitalCase(String s)
{
return s.toUpperCase().charAt(0) + s.toLowerCase().substring(1);
}
}

View File

@@ -1,21 +1,22 @@
package com.earth2me.essentials;
import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.commands.WarpNotFoundException;
import com.earth2me.essentials.utils.StringUtil;
import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.io.IOException;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.ess3.api.InvalidNameException;
import net.ess3.api.InvalidWorldException;
import org.bukkit.Location;
import org.bukkit.Server;
public class Warps implements IConf
public class Warps implements IConf, net.ess3.api.IWarps
{
private static final Logger logger = Logger.getLogger("Minecraft");
private static final Logger logger = Logger.getLogger("Essentials");
private final Map<StringIgnoreCase, EssentialsConf> warpPoints = new HashMap<StringIgnoreCase, EssentialsConf>();
private final File warpsFolder;
private final Server server;
@@ -31,12 +32,14 @@ public class Warps implements IConf
reloadConfig();
}
@Override
public boolean isEmpty()
{
return warpPoints.isEmpty();
}
public Collection<String> getWarpNames()
@Override
public Collection<String> getList()
{
final List<String> keys = new ArrayList<String>();
for (StringIgnoreCase stringIgnoreCase : warpPoints.keySet())
@@ -47,49 +50,60 @@ public class Warps implements IConf
return keys;
}
public Location getWarp(String warp) throws Exception
@Override
public Location getWarp(String warp) throws WarpNotFoundException, InvalidWorldException
{
EssentialsConf conf = warpPoints.get(new StringIgnoreCase(warp));
if (conf == null)
{
throw new Exception(Util.i18n("warpNotExist"));
throw new WarpNotFoundException();
}
return conf.getLocation(null, server);
}
@Override
public void setWarp(String name, Location loc) throws Exception
{
String filename = Util.sanitizeFileName(name);
String filename = StringUtil.sanitizeFileName(name);
EssentialsConf conf = warpPoints.get(new StringIgnoreCase(name));
if (conf == null)
{
File confFile = new File(warpsFolder, filename + ".yml");
if (confFile.exists())
{
throw new Exception(Util.i18n("similarWarpExist"));
throw new Exception(tl("similarWarpExist"));
}
conf = new EssentialsConf(confFile);
warpPoints.put(new StringIgnoreCase(name), conf);
}
conf.setProperty(null, loc);
conf.setProperty("name", name);
conf.save();
try
{
conf.saveWithError();
}
catch (IOException ex)
{
throw new IOException(tl("invalidWarpName"));
}
}
public void delWarp(String name) throws Exception
@Override
public void removeWarp(String name) throws Exception
{
EssentialsConf conf = warpPoints.get(new StringIgnoreCase(name));
if (conf == null)
{
throw new Exception(Util.i18n("warpNotExist"));
throw new Exception(tl("warpNotExist"));
}
if (!conf.getFile().delete())
{
throw new Exception(Util.i18n("warpDeleteError"));
throw new Exception(tl("warpDeleteError"));
}
warpPoints.remove(new StringIgnoreCase(name));
}
@Override
public final void reloadConfig()
{
warpPoints.clear();
@@ -113,13 +127,25 @@ public class Warps implements IConf
}
catch (Exception ex)
{
logger.log(Level.WARNING, Util.format("loadWarpError", filename), ex);
logger.log(Level.WARNING, tl("loadWarpError", filename), ex);
}
}
}
}
}
//This is here for future 3.x api support. Not implemented here becasue storage is handled differently
@Override
public File getWarpFile(String name) throws InvalidNameException
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public int getCount()
{
return getList().size();
}
private static class StringIgnoreCase
{
@@ -133,7 +159,7 @@ public class Warps implements IConf
@Override
public int hashCode()
{
return getString().toLowerCase().hashCode();
return getString().toLowerCase(Locale.ENGLISH).hashCode();
}
@Override

View File

@@ -1,13 +1,18 @@
package com.earth2me.essentials;
import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.commands.NotEnoughArgumentsException;
import java.io.File;
import java.math.BigDecimal;
import java.util.Locale;
import java.util.logging.Logger;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.inventory.ItemStack;
public class Worth implements IConf
{
private static final Logger logger = Logger.getLogger("Minecraft");
private final EssentialsConf config;
public Worth(File dataFolder)
@@ -17,41 +22,153 @@ public class Worth implements IConf
config.load();
}
public double getPrice(ItemStack itemStack)
public BigDecimal getPrice(ItemStack itemStack)
{
String itemname = itemStack.getType().toString().toLowerCase().replace("_", "");
double result;
result = config.getDouble("worth." + itemname + "." + itemStack.getDurability(), Double.NaN);
if (Double.isNaN(result))
String itemname = itemStack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", "");
BigDecimal result;
//First check for matches with item name
result = config.getBigDecimal("worth." + itemname + "." + itemStack.getDurability(), BigDecimal.ONE.negate());
if (result.signum() < 0)
{
result = config.getDouble("worth." + itemname + ".0", Double.NaN);
final ConfigurationSection itemNameMatch = config.getConfigurationSection("worth." + itemname);
if (itemNameMatch != null && itemNameMatch.getKeys(false).size() == 1)
{
result = config.getBigDecimal("worth." + itemname + ".0", BigDecimal.ONE.negate());
}
}
if (Double.isNaN(result))
if (result.signum() < 0)
{
result = config.getDouble("worth." + itemname, Double.NaN);
result = config.getBigDecimal("worth." + itemname + ".*", BigDecimal.ONE.negate());
}
if (Double.isNaN(result))
if (result.signum() < 0)
{
result = config.getDouble("worth-" + itemStack.getTypeId(), Double.NaN);
result = config.getBigDecimal("worth." + itemname, BigDecimal.ONE.negate());
}
//Now we should check for item ID
if (result.signum() < 0)
{
result = config.getBigDecimal("worth." + itemStack.getTypeId() + "." + itemStack.getDurability(), BigDecimal.ONE.negate());
}
if (result.signum() < 0)
{
final ConfigurationSection itemNumberMatch = config.getConfigurationSection("worth." + itemStack.getTypeId());
if (itemNumberMatch != null && itemNumberMatch.getKeys(false).size() == 1)
{
result = config.getBigDecimal("worth." + itemStack.getTypeId() + ".0", BigDecimal.ONE.negate());
}
}
if (result.signum() < 0)
{
result = config.getBigDecimal("worth." + itemStack.getTypeId() + ".*", BigDecimal.ONE.negate());
}
if (result.signum() < 0)
{
result = config.getBigDecimal("worth." + itemStack.getTypeId(), BigDecimal.ONE.negate());
}
//This is to match the old worth syntax
if (result.signum() < 0)
{
result = config.getBigDecimal("worth-" + itemStack.getTypeId(), BigDecimal.ONE.negate());
}
if (result.signum() < 0)
{
return null;
}
return result;
}
public int getAmount(IEssentials ess, User user, ItemStack is, String[] args, boolean isBulkSell) throws Exception
{
if (is == null || is.getType() == Material.AIR)
{
throw new Exception(tl("itemSellAir"));
}
int id = is.getTypeId();
int amount = 0;
if (args.length > 1)
{
try
{
amount = Integer.parseInt(args[1].replaceAll("[^0-9]", ""));
}
catch (NumberFormatException ex)
{
throw new NotEnoughArgumentsException(ex);
}
if (args[1].startsWith("-"))
{
amount = -amount;
}
}
boolean stack = args.length > 1 && args[1].endsWith("s");
boolean requireStack = ess.getSettings().isTradeInStacks(id);
if (requireStack && !stack)
{
throw new Exception(tl("itemMustBeStacked"));
}
int max = 0;
for (ItemStack s : user.getBase().getInventory().getContents())
{
if (s == null || !s.isSimilar(is))
{
continue;
}
max += s.getAmount();
}
if (stack)
{
amount *= is.getType().getMaxStackSize();
}
if (amount < 1)
{
amount += max;
}
if (requireStack)
{
amount -= amount % is.getType().getMaxStackSize();
}
if (amount > max || amount < 1)
{
if (!isBulkSell)
{
user.sendMessage(tl("itemNotEnough2"));
user.sendMessage(tl("itemNotEnough3"));
throw new Exception(tl("itemNotEnough1"));
}
else
{
return amount;
}
}
return amount;
}
public void setPrice(ItemStack itemStack, double price)
{
if (itemStack.getType().getData() == null)
{
config.setProperty("worth." + itemStack.getType().toString().toLowerCase().replace("_", ""), price);
config.setProperty("worth." + itemStack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", ""), price);
}
else
{
// Bukkit-bug: getDurability still contains the correct value, while getData().getData() is 0.
config.setProperty("worth." + itemStack.getType().toString().toLowerCase().replace("_", "") + "." + itemStack.getDurability(), price);
config.setProperty("worth." + itemStack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", "") + "." + itemStack.getDurability(), price);
}
config.removeProperty("worth-" + itemStack.getTypeId());
config.save();
}
@Override
public void reloadConfig()
{
config.load();

View File

@@ -1,27 +1,44 @@
package com.earth2me.essentials.api;
import com.earth2me.essentials.EssentialsConf;
import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.EssentialsUserConf;
import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import static com.earth2me.essentials.api.Economy.add;
import static com.earth2me.essentials.api.Economy.divide;
import static com.earth2me.essentials.api.Economy.format;
import static com.earth2me.essentials.api.Economy.getMoneyExact;
import static com.earth2me.essentials.api.Economy.hasEnough;
import static com.earth2me.essentials.api.Economy.hasLess;
import static com.earth2me.essentials.api.Economy.hasMore;
import static com.earth2me.essentials.api.Economy.multiply;
import static com.earth2me.essentials.api.Economy.setMoney;
import static com.earth2me.essentials.api.Economy.substract;
import com.earth2me.essentials.utils.NumberUtil;
import com.earth2me.essentials.utils.StringUtil;
import com.google.common.base.Charsets;
import java.io.File;
import java.math.BigDecimal;
import java.math.MathContext;
import java.util.UUID;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.entity.Player;
import net.ess3.api.IEssentials;
import net.ess3.api.MaxMoneyException;
/**
* Instead of using this api directly, we recommend to use the register plugin:
* http://bit.ly/RegisterMethod
* Instead of using this api directly, we recommend to use the register plugin: http://bit.ly/RegisterMethod
*/
public final class Economy
public class Economy
{
private Economy()
public Economy()
{
}
private static final Logger logger = Logger.getLogger("Minecraft");
private static final Logger logger = Logger.getLogger("Essentials");
private static IEssentials ess;
private static final String noCallBeforeLoad = "Essentials API is called before Essentials is loaded.";
public static final MathContext MATH_CONTEXT = MathContext.DECIMAL128;
/**
* @param aEss the ess to set
@@ -38,31 +55,20 @@ public final class Economy
{
folder.mkdirs();
}
EssentialsConf npcConfig = new EssentialsConf(new File(folder, Util.sanitizeFileName(name) + ".yml"));
UUID npcUUID = UUID.nameUUIDFromBytes(("NPC:" + name).getBytes(Charsets.UTF_8));
EssentialsUserConf npcConfig = new EssentialsUserConf(name, npcUUID, new File(folder, npcUUID.toString() + ".yml"));
npcConfig.load();
npcConfig.setProperty("npc", true);
npcConfig.setProperty("lastAccountName", name);
npcConfig.setProperty("money", ess.getSettings().getStartingBalance());
npcConfig.save();
npcConfig.forceSave();
ess.getUserMap().trackUUID(npcUUID, name);
}
private static void deleteNPC(String name)
{
File folder = new File(ess.getDataFolder(), "userdata");
if (!folder.exists())
{
folder.mkdirs();
}
File config = new File(folder, Util.sanitizeFileName(name) + ".yml");
EssentialsConf npcConfig = new EssentialsConf(config);
npcConfig.load();
if (npcConfig.hasProperty("npc") && npcConfig.getBoolean("npc", false))
{
if (!config.delete())
{
logger.log(Level.WARNING, Util.format("deleteFileError", config));
}
ess.getUserMap().removeUser(name);
}
User user = ess.getUser(name);
user.reset();
}
private static User getUserByName(String name)
@@ -71,26 +77,23 @@ public final class Economy
{
throw new RuntimeException(noCallBeforeLoad);
}
User user;
Player player = ess.getServer().getPlayer(name);
if (player != null)
{
user = ess.getUser(player);
}
else
{
user = ess.getOfflineUser(name);
}
return user;
return ess.getUser(name);
}
/**
* Returns the balance of a user
*
* @param name Name of the user
* @return balance
* @throws UserDoesNotExistException
* @throws UserDoesNotExistException
*/
@Deprecated
public static double getMoney(String name) throws UserDoesNotExistException
{
return getMoneyExact(name).doubleValue();
}
public static BigDecimal getMoneyExact(String name) throws UserDoesNotExistException
{
User user = getUserByName(name);
if (user == null)
@@ -102,79 +105,161 @@ public final class Economy
/**
* Sets the balance of a user
*
* @param name Name of the user
* @param balance The balance you want to set
* @throws UserDoesNotExistException If a user by that name does not exists
* @throws NoLoanPermittedException If the user is not allowed to have a negative balance
*/
@Deprecated
public static void setMoney(String name, double balance) throws UserDoesNotExistException, NoLoanPermittedException
{
try
{
setMoney(name, BigDecimal.valueOf(balance));
}
catch (ArithmeticException e)
{
logger.log(Level.WARNING, "Failed to set balance of " + name + " to " + balance + ": " + e.getMessage(), e);
}
}
public static void setMoney(String name, BigDecimal balance) throws UserDoesNotExistException, NoLoanPermittedException
{
User user = getUserByName(name);
if (user == null)
{
throw new UserDoesNotExistException(name);
}
if (balance < 0.0 && !user.isAuthorized("essentials.eco.loan"))
if (balance.compareTo(ess.getSettings().getMinMoney()) < 0)
{
throw new NoLoanPermittedException();
}
user.setMoney(balance);
if (balance.signum() < 0 && !user.isAuthorized("essentials.eco.loan"))
{
throw new NoLoanPermittedException();
}
try
{
user.setMoney(balance);
}
catch (MaxMoneyException ex)
{
//TODO: Update API to show max balance errors
}
}
/**
* Adds money to the balance of a user
*
* @param name Name of the user
* @param amount The money you want to add
* @throws UserDoesNotExistException If a user by that name does not exists
* @throws NoLoanPermittedException If the user is not allowed to have a negative balance
*/
@Deprecated
public static void add(String name, double amount) throws UserDoesNotExistException, NoLoanPermittedException
{
double result = getMoney(name) + amount;
try
{
add(name, BigDecimal.valueOf(amount));
}
catch (ArithmeticException e)
{
logger.log(Level.WARNING, "Failed to add " + amount + " to balance of " + name + ": " + e.getMessage(), e);
}
}
public static void add(String name, BigDecimal amount) throws UserDoesNotExistException, NoLoanPermittedException, ArithmeticException
{
BigDecimal result = getMoneyExact(name).add(amount, MATH_CONTEXT);
setMoney(name, result);
}
/**
* Substracts money from the balance of a user
*
* @param name Name of the user
* @param amount The money you want to substract
* @throws UserDoesNotExistException If a user by that name does not exists
* @throws NoLoanPermittedException If the user is not allowed to have a negative balance
*/
@Deprecated
public static void subtract(String name, double amount) throws UserDoesNotExistException, NoLoanPermittedException
{
double result = getMoney(name) - amount;
try
{
substract(name, BigDecimal.valueOf(amount));
}
catch (ArithmeticException e)
{
logger.log(Level.WARNING, "Failed to substract " + amount + " of balance of " + name + ": " + e.getMessage(), e);
}
}
public static void substract(String name, BigDecimal amount) throws UserDoesNotExistException, NoLoanPermittedException, ArithmeticException
{
BigDecimal result = getMoneyExact(name).subtract(amount, MATH_CONTEXT);
setMoney(name, result);
}
/**
* Divides the balance of a user by a value
*
* @param name Name of the user
* @param value The balance is divided by this value
* @throws UserDoesNotExistException If a user by that name does not exists
* @throws NoLoanPermittedException If the user is not allowed to have a negative balance
*/
public static void divide(String name, double value) throws UserDoesNotExistException, NoLoanPermittedException
@Deprecated
public static void divide(String name, double amount) throws UserDoesNotExistException, NoLoanPermittedException
{
double result = getMoney(name) / value;
try
{
divide(name, BigDecimal.valueOf(amount));
}
catch (ArithmeticException e)
{
logger.log(Level.WARNING, "Failed to divide balance of " + name + " by " + amount + ": " + e.getMessage(), e);
}
}
public static void divide(String name, BigDecimal amount) throws UserDoesNotExistException, NoLoanPermittedException, ArithmeticException
{
BigDecimal result = getMoneyExact(name).divide(amount, MATH_CONTEXT);
setMoney(name, result);
}
/**
* Multiplies the balance of a user by a value
*
* @param name Name of the user
* @param value The balance is multiplied by this value
* @throws UserDoesNotExistException If a user by that name does not exists
* @throws NoLoanPermittedException If the user is not allowed to have a negative balance
*/
public static void multiply(String name, double value) throws UserDoesNotExistException, NoLoanPermittedException
@Deprecated
public static void multiply(String name, double amount) throws UserDoesNotExistException, NoLoanPermittedException
{
double result = getMoney(name) * value;
try
{
multiply(name, BigDecimal.valueOf(amount));
}
catch (ArithmeticException e)
{
logger.log(Level.WARNING, "Failed to multiply balance of " + name + " by " + amount + ": " + e.getMessage(), e);
}
}
public static void multiply(String name, BigDecimal amount) throws UserDoesNotExistException, NoLoanPermittedException, ArithmeticException
{
BigDecimal result = getMoneyExact(name).multiply(amount, MATH_CONTEXT);
setMoney(name, result);
}
/**
* Resets the balance of a user to the starting balance
*
* @param name Name of the user
* @throws UserDoesNotExistException If a user by that name does not exists
* @throws NoLoanPermittedException If the user is not allowed to have a negative balance
@@ -194,9 +279,23 @@ public final class Economy
* @return true, if the user has more or an equal amount of money
* @throws UserDoesNotExistException If a user by that name does not exists
*/
@Deprecated
public static boolean hasEnough(String name, double amount) throws UserDoesNotExistException
{
return amount <= getMoney(name);
try
{
return hasEnough(name, BigDecimal.valueOf(amount));
}
catch (ArithmeticException e)
{
logger.log(Level.WARNING, "Failed to compare balance of " + name + " with " + amount + ": " + e.getMessage(), e);
return false;
}
}
public static boolean hasEnough(String name, BigDecimal amount) throws UserDoesNotExistException, ArithmeticException
{
return amount.compareTo(getMoneyExact(name)) <= 0;
}
/**
@@ -205,9 +304,23 @@ public final class Economy
* @return true, if the user has more money
* @throws UserDoesNotExistException If a user by that name does not exists
*/
@Deprecated
public static boolean hasMore(String name, double amount) throws UserDoesNotExistException
{
return amount < getMoney(name);
try
{
return hasMore(name, BigDecimal.valueOf(amount));
}
catch (ArithmeticException e)
{
logger.log(Level.WARNING, "Failed to compare balance of " + name + " with " + amount + ": " + e.getMessage(), e);
return false;
}
}
public static boolean hasMore(String name, BigDecimal amount) throws UserDoesNotExistException, ArithmeticException
{
return amount.compareTo(getMoneyExact(name)) < 0;
}
/**
@@ -216,39 +329,69 @@ public final class Economy
* @return true, if the user has less money
* @throws UserDoesNotExistException If a user by that name does not exists
*/
@Deprecated
public static boolean hasLess(String name, double amount) throws UserDoesNotExistException
{
return amount > getMoney(name);
try
{
return hasLess(name, BigDecimal.valueOf(amount));
}
catch (ArithmeticException e)
{
logger.log(Level.WARNING, "Failed to compare balance of " + name + " with " + amount + ": " + e.getMessage(), e);
return false;
}
}
public static boolean hasLess(String name, BigDecimal amount) throws UserDoesNotExistException, ArithmeticException
{
return amount.compareTo(getMoneyExact(name)) > 0;
}
/**
* Test if the user has a negative balance
*
* @param name Name of the user
* @return true, if the user has a negative balance
* @throws UserDoesNotExistException If a user by that name does not exists
*/
public static boolean isNegative(String name) throws UserDoesNotExistException
{
return getMoney(name) < 0.0;
return getMoneyExact(name).signum() < 0;
}
/**
* Formats the amount of money like all other Essentials functions.
* Example: $100000 or $12345.67
* Formats the amount of money like all other Essentials functions. Example: $100000 or $12345.67
*
* @param amount The amount of money
* @return Formatted money
*/
@Deprecated
public static String format(double amount)
{
try
{
return format(BigDecimal.valueOf(amount));
}
catch (NumberFormatException e)
{
logger.log(Level.WARNING, "Failed to display " + amount + ": " + e.getMessage(), e);
return "NaN";
}
}
public static String format(BigDecimal amount)
{
if (ess == null)
{
throw new RuntimeException(noCallBeforeLoad);
}
return Util.formatCurrency(amount, ess);
return NumberUtil.displayCurrency(amount, ess);
}
/**
* Test if a player exists to avoid the UserDoesNotExistException
*
* @param name Name of the user
* @return true, if the user exists
*/
@@ -259,9 +402,10 @@ public final class Economy
/**
* Test if a player is a npc
*
* @param name Name of the player
* @return true, if it's a npc
* @throws UserDoesNotExistException
* @throws UserDoesNotExistException
*/
public static boolean isNPC(String name) throws UserDoesNotExistException
{
@@ -275,6 +419,7 @@ public final class Economy
/**
* Creates dummy files for a npc, if there is no player yet with that name.
*
* @param name Name of the player
* @return true, if a new npc was created
*/
@@ -290,9 +435,10 @@ public final class Economy
}
/**
* Deletes a user, if it is marked as npc.
* Deletes a user, if it is marked as npc.
*
* @param name Name of the player
* @throws UserDoesNotExistException
* @throws UserDoesNotExistException
*/
public static void removeNPC(String name) throws UserDoesNotExistException
{
@@ -304,3 +450,4 @@ public final class Economy
deleteNPC(name);
}
}

View File

@@ -0,0 +1,13 @@
package com.earth2me.essentials.api;
import java.util.Locale;
public interface II18n
{
/**
* Gets the current locale setting
* @return the current locale, if not set it will return the default locale
*/
Locale getCurrentLocale();
}

View File

@@ -0,0 +1,20 @@
package com.earth2me.essentials.api;
import com.earth2me.essentials.User;
import java.util.List;
import org.bukkit.inventory.ItemStack;
public interface IItemDb
{
ItemStack get(final String name, final int quantity) throws Exception;
ItemStack get(final String name) throws Exception;
public String names(ItemStack item);
public String name(ItemStack item);
List<ItemStack> getMatching(User user, String[] args) throws Exception;
}

View File

@@ -0,0 +1,53 @@
package com.earth2me.essentials.api;
import java.util.Collection;
import net.ess3.api.IUser;
import org.bukkit.Location;
public interface IJails extends IReload
{
/**
* Gets the location of the jail with the given name
* @param jailName The name of the jail
* @return the location of the jail
* @throws Exception if the jail does not exist
*/
Location getJail(String jailName) throws Exception;
/**
* Gets a list of jails by names
* @return a list of jails, if there are none the list will be empty
* @throws Exception
*/
Collection<String> getList() throws Exception;
/**
* Gets the number of jails
* @return the size of the list of jails
*/
int getCount();
/**
* Remove the jail with the given name
* @param jail the jail to remove
* @throws Exception if the jail does not exist
*/
void removeJail(String jail) throws Exception;
/**
* Attempts to send the given user to the given jail
* @param user the user to send to jail
* @param jail the jail to send the user to
* @throws Exception if the user is offline or jail does not exist
*/
void sendToJail(IUser user, String jail) throws Exception;
/**
* Set a new jail with the given name and location
* @param jailName the name of the jail being set
* @param loc the location of the jail being set
* @throws Exception
*/
void setJail(String jailName, Location loc) throws Exception;
}

View File

@@ -0,0 +1,7 @@
package com.earth2me.essentials.api;
public interface IReload
{
void onReload();
}

View File

@@ -0,0 +1,112 @@
package com.earth2me.essentials.api;
import com.earth2me.essentials.Trade;
import net.ess3.api.IUser;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerTeleportEvent;
public interface ITeleport
{
/**
* Used to skip teleportPlayer delay when teleporting someone to a location or player.
*
* @param loc - Where should the player end up
* @param cooldown - If cooldown should be enforced
* @param cause - The reported teleportPlayer cause
* @throws Exception
*/
void now(Location loc, boolean cooldown, PlayerTeleportEvent.TeleportCause cause) throws Exception;
/**
* Used to skip teleportPlayer delay when teleporting someone to a location or player.
*
* @param entity - Where should the player end up
* @param cooldown - If cooldown should be enforced
* @param cause - The reported teleportPlayer cause
* @throws Exception
*/
void now(Player entity, boolean cooldown, PlayerTeleportEvent.TeleportCause cause) throws Exception;
@Deprecated
void teleport(Location loc, Trade chargeFor) throws Exception;
/**
* Teleport a player to a specific location
*
* @param loc - Where should the player end up
* @param chargeFor - What the user will be charged if teleportPlayer is successful
* @param cause - The reported teleportPlayer cause
* @throws Exception
*/
void teleport(Location loc, Trade chargeFor, PlayerTeleportEvent.TeleportCause cause) throws Exception;
/**
* Teleport a player to a specific player
*
* @param entity - Where should the player end up
* @param chargeFor - What the user will be charged if teleportPlayer is successful
* @param cause - The reported teleportPlayer cause
* @throws Exception
*/
void teleport(Player entity, Trade chargeFor, PlayerTeleportEvent.TeleportCause cause) throws Exception;
/**
* Teleport a player to a specific location
*
* @param otherUser - Which user will be teleported
* @param loc - Where should the player end up
* @param chargeFor - What the user will be charged if teleportPlayer is successful
* @param cause - The reported teleportPlayer cause
* @throws Exception
*/
void teleportPlayer(IUser otherUser, Location loc, Trade chargeFor, PlayerTeleportEvent.TeleportCause cause) throws Exception;
/**
* Teleport a player to a specific player
*
* @param otherUser - Which user will be teleported
* @param entity - Where should the player end up
* @param chargeFor - What the user will be charged if teleportPlayer is successful
* @param cause - The reported teleportPlayer cause
* @throws Exception
*/
void teleportPlayer(IUser otherUser, Player entity, Trade chargeFor, PlayerTeleportEvent.TeleportCause cause) throws Exception;
/**
* Teleport wrapper used to handle tp fallback on /jail and /home
*
* @param chargeFor - What the user will be charged if teleportPlayer is successful
* @param cause - The reported teleportPlayer cause
* @throws Exception
*/
public void respawn(final Trade chargeFor, PlayerTeleportEvent.TeleportCause cause) throws Exception;
/**
* Teleport wrapper used to handle /warp teleports
*
* @param otherUser - Which user will be teleported
* @param warp - The name of the warp the user will be teleported too.
* @param chargeFor - What the user will be charged if teleportPlayer is successful
* @param cause - The reported teleportPlayer cause
* @throws Exception
*/
public void warp(IUser otherUser, String warp, Trade chargeFor, PlayerTeleportEvent.TeleportCause cause) throws Exception;
/**
* Teleport wrapper used to handle /back teleports
*
* @param chargeFor - What the user will be charged if teleportPlayer is successful
* @throws Exception
*/
public void back(Trade chargeFor) throws Exception;
/**
* Teleport wrapper used to handle throwing user home after a jail sentence
*
* @throws Exception
*/
public void back() throws Exception;
}

View File

@@ -0,0 +1,68 @@
package com.earth2me.essentials.api;
import com.earth2me.essentials.IConf;
import com.earth2me.essentials.commands.WarpNotFoundException;
import java.io.File;
import java.util.Collection;
import org.bukkit.Location;
public interface IWarps extends IConf
{
/**
* Get a warp by name
*
* @param warp - Warp name
* @return - Location the warp is set to
* @throws WarpNotFoundException When the warp is not found
* @throws InvalidWorldException When the world the warp is in is not found
*/
Location getWarp(String warp) throws WarpNotFoundException, net.ess3.api.InvalidWorldException;
/**
* Gets a list of warps
*
* @return - A {@link Collection} of warps
*/
Collection<String> getList();
/**
* Gets the number of warps
*
* @return the size of the list of warps
*/
int getCount();
/**
* Delete a warp from the warp DB
*
* @param name - Name of warp
* @throws Exception
*/
void removeWarp(String name) throws Exception;
/**
* Set a warp
*
* @param name - Name of warp
* @param loc - Location of warp
* @throws Exception
*/
void setWarp(String name, Location loc) throws Exception;
/**
* Check to see if the file is empty
*
* @return
*/
boolean isEmpty();
/**
* Get a warp file note: this is not yet implemented, as 3.x uses different storage methods
*
* @param name - name of file
* @return - an instance of the file
* @throws InvalidNameException - When the file is not found
*/
File getWarpFile(String name) throws net.ess3.api.InvalidNameException;
}

View File

@@ -0,0 +1,16 @@
package com.earth2me.essentials.api;
public class InvalidNameException extends Exception
{
/**
* NOTE: This is not implemented yet, just here for future 3.x api support
* Allow serialization of the InvalidNameException exception
*/
private static final long serialVersionUID = 1485321420293663139L;
public InvalidNameException(Throwable thrwbl)
{
super(thrwbl);
}
}

View File

@@ -0,0 +1,20 @@
package com.earth2me.essentials.api;
import static com.earth2me.essentials.I18n.tl;
public class InvalidWorldException extends Exception
{
private final String world;
public InvalidWorldException(final String world)
{
super(tl("invalidWorld"));
this.world = world;
}
public String getWorld()
{
return this.world;
}
}

View File

@@ -1,13 +1,7 @@
package com.earth2me.essentials.api;
import com.earth2me.essentials.Util;
public class NoLoanPermittedException extends Exception
public class NoLoanPermittedException extends net.ess3.api.NoLoanPermittedException
{
public NoLoanPermittedException()
{
super(Util.i18n("negativeBalanceError"));
}
}

View File

@@ -1,13 +1,12 @@
package com.earth2me.essentials.api;
import com.earth2me.essentials.Util;
import static com.earth2me.essentials.I18n.tl;
public class UserDoesNotExistException extends Exception
{
public UserDoesNotExistException(String name)
{
super(Util.format("userDoesNotExist", name));
super(tl("userDoesNotExist", name));
}
}

View File

@@ -1,8 +1,9 @@
package com.earth2me.essentials.commands;
import org.bukkit.Server;
import com.earth2me.essentials.CommandSource;
import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import org.bukkit.Server;
public class Commandafk extends EssentialsCommand
@@ -17,36 +18,54 @@ public class Commandafk extends EssentialsCommand
{
if (args.length > 0 && user.isAuthorized("essentials.afk.others"))
{
User afkUser = ess.getUser(ess.getServer().matchPlayer(args[0]));
if (afkUser != null)
{
toggleAfk(afkUser);
}
User afkUser = getPlayer(server, user, args, 0);
toggleAfk(afkUser);
}
else
{
toggleAfk(user);
}
}
private final void toggleAfk(User user)
@Override
public void run(Server server, CommandSource sender, String commandLabel, String[] args) throws Exception
{
if (args.length > 0)
{
User afkUser = getPlayer(server, args, 0, true, false);
toggleAfk(afkUser);
}
else
{
throw new NotEnoughArgumentsException();
}
}
private void toggleAfk(User user)
{
user.setDisplayNick();
String msg = "";
if (!user.toggleAfk())
{
//user.sendMessage(Util.i18n("markedAsNotAway"));
//user.sendMessage(_("markedAsNotAway"));
if (!user.isHidden())
{
ess.broadcastMessage(user, Util.format("userIsNotAway", user.getDisplayName()));
msg = tl("userIsNotAway", user.getDisplayName());
}
user.updateActivity(false);
}
else
{
//user.sendMessage(Util.i18n("markedAsAway"));
//user.sendMessage(_("markedAsAway"));
if (!user.isHidden())
{
ess.broadcastMessage(user, Util.format("userIsAway", user.getDisplayName()));
msg = tl("userIsAway", user.getDisplayName());
}
}
if (!msg.isEmpty())
{
ess.broadcastMessage(user, msg);
}
}
}

View File

@@ -1,12 +1,12 @@
package com.earth2me.essentials.commands;
import com.earth2me.essentials.User;
import com.earth2me.essentials.utils.LocationUtil;
import org.bukkit.Location;
import org.bukkit.Server;
import com.earth2me.essentials.User;
import com.earth2me.essentials.TargetBlock;
import org.bukkit.entity.TNTPrimed;
// This command has a in theme message that only shows if you supply a parameter #EasterEgg
public class Commandantioch extends EssentialsCommand
{
public Commandantioch()
@@ -17,10 +17,13 @@ public class Commandantioch extends EssentialsCommand
@Override
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
ess.broadcastMessage(user, "...lobbest thou thy Holy Hand Grenade of Antioch towards thy foe,");
ess.broadcastMessage(user, "who being naughty in My sight, shall snuff it.");
if (args.length > 0)
{
ess.broadcastMessage(user, "...lobbest thou thy Holy Hand Grenade of Antioch towards thy foe,");
ess.broadcastMessage(user, "who being naughty in My sight, shall snuff it.");
}
final Location loc = new TargetBlock(user).getTargetBlock().getLocation();
final Location loc = LocationUtil.getTarget(user.getBase());
loc.getWorld().spawn(loc, TNTPrimed.class);
}
}

View File

@@ -1,8 +1,8 @@
package com.earth2me.essentials.commands;
import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.Trade;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import org.bukkit.Server;
@@ -14,11 +14,20 @@ public class Commandback extends EssentialsCommand
}
@Override
protected void run(Server server, User user, String commandLabel, String[] args) throws Exception
protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
Trade charge = new Trade(this.getName(), ess);
if (user.getLastLocation() == null)
{
throw new Exception(tl("noLocationFound"));
}
if (user.getWorld() != user.getLastLocation().getWorld() && ess.getSettings().isWorldTeleportPermissions()
&& !user.isAuthorized("essentials.worlds." + user.getLastLocation().getWorld().getName()))
{
throw new Exception(tl("noPerm", "essentials.worlds." + user.getLastLocation().getWorld().getName()));
}
final Trade charge = new Trade(this.getName(), ess);
charge.isAffordableFor(user);
user.sendMessage(Util.i18n("backUsageMsg"));
user.getTeleport().back(charge);
throw new NoChargeException();
}
}

View File

@@ -1,9 +1,9 @@
package com.earth2me.essentials.commands;
import com.earth2me.essentials.Backup;
import com.earth2me.essentials.Util;
import com.earth2me.essentials.CommandSource;
import static com.earth2me.essentials.I18n.tl;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
public class Commandbackup extends EssentialsCommand
@@ -14,14 +14,19 @@ public class Commandbackup extends EssentialsCommand
}
@Override
protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
protected void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception
{
Backup backup = ess.getBackup();
final Backup backup = ess.getBackup();
if (backup == null)
{
throw new Exception();
throw new Exception(tl("backupDisabled"));
}
final String command = ess.getSettings().getBackupCommand();
if (command == null || "".equals(command) || "save-all".equalsIgnoreCase(command))
{
throw new Exception(tl("backupDisabled"));
}
backup.run();
sender.sendMessage(Util.i18n("backupStarted"));
sender.sendMessage(tl("backupStarted"));
}
}

View File

@@ -1,9 +1,11 @@
package com.earth2me.essentials.commands;
import org.bukkit.Server;
import com.earth2me.essentials.CommandSource;
import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import org.bukkit.command.CommandSender;
import com.earth2me.essentials.utils.NumberUtil;
import java.math.BigDecimal;
import org.bukkit.Server;
public class Commandbalance extends EssentialsCommand
@@ -14,23 +16,34 @@ public class Commandbalance extends EssentialsCommand
}
@Override
protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
protected void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
throw new NotEnoughArgumentsException();
}
sender.sendMessage(Util.format("balance", Util.formatCurrency(getPlayer(server, args, 0, true).getMoney(), ess)));
User target = getPlayer(server, args, 0, true, true);
sender.sendMessage(tl("balanceOther", target.isHidden() ? target.getName() : target.getDisplayName(), NumberUtil.displayCurrency(target.getMoney(), ess)));
}
@Override
public void run(Server server, User user, String commandLabel, String[] args) throws Exception
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
double bal = (args.length < 1
|| !(user.isAuthorized("essentials.balance.others")
|| user.isAuthorized("essentials.balance.other"))
? user
: getPlayer(server, args, 0, true)).getMoney();
user.sendMessage(Util.format("balance", Util.formatCurrency(bal, ess)));
if (args.length == 1 && user.isAuthorized("essentials.balance.others"))
{
final User target = getPlayer(server, args, 0, true, true);
final BigDecimal bal = target.getMoney();
user.sendMessage(tl("balanceOther", target.isHidden() ? target.getName() : target.getDisplayName(), NumberUtil.displayCurrency(bal, ess)));
}
else if (args.length < 2)
{
final BigDecimal bal = user.getMoney();
user.sendMessage(tl("balance", NumberUtil.displayCurrency(bal, ess)));
}
else
{
throw new NotEnoughArgumentsException();
}
}
}

View File

@@ -1,16 +1,17 @@
package com.earth2me.essentials.commands;
import java.util.Map.Entry;
import org.bukkit.Server;
import com.earth2me.essentials.CommandSource;
import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.bukkit.command.CommandSender;
import com.earth2me.essentials.textreader.SimpleTextInput;
import com.earth2me.essentials.textreader.TextPager;
import com.earth2me.essentials.utils.NumberUtil;
import java.math.BigDecimal;
import java.text.DateFormat;
import java.util.*;
import java.util.Map.Entry;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import org.bukkit.Server;
public class Commandbalancetop extends EssentialsCommand
@@ -19,49 +20,178 @@ public class Commandbalancetop extends EssentialsCommand
{
super("balancetop");
}
private static final int CACHETIME = 2 * 60 * 1000;
public static final int MINUSERS = 50;
private static final SimpleTextInput cache = new SimpleTextInput();
private static long cacheage = 0;
private static final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
@Override
protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
protected void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception
{
int max = 10;
int page = 0;
boolean force = false;
if (args.length > 0)
{
try
{
if (Integer.parseInt(args[0]) < 10)
{
max = Integer.parseInt(args[0]);
}
page = Integer.parseInt(args[0]);
}
catch (NumberFormatException ex)
{
//catch it because they tried to enter a string not number.
if (args[0].equalsIgnoreCase("force")
&& (!sender.isPlayer() || ess.getUser(sender.getPlayer()).isAuthorized("essentials.balancetop.force")))
{
force = true;
}
}
}
final Map<User, Double> balances = new HashMap<User, Double>();
for (User u : ess.getUserMap().getAllUsers())
{
balances.put(u, u.getMoney());
}
final List<Map.Entry<User, Double>> sortedEntries = new ArrayList<Map.Entry<User, Double>>(balances.entrySet());
Collections.sort(sortedEntries, new Comparator<Map.Entry<User, Double>>()
if (!force && lock.readLock().tryLock())
{
public int compare(final Entry<User, Double> entry1, final Entry<User, Double> entry2)
try
{
return -entry1.getValue().compareTo(entry2.getValue());
if (cacheage > System.currentTimeMillis() - CACHETIME)
{
outputCache(sender, page);
return;
}
if (ess.getUserMap().getUniqueUsers() > MINUSERS)
{
sender.sendMessage(tl("orderBalances", ess.getUserMap().getUniqueUsers()));
}
}
});
int count = 0;
sender.sendMessage(Util.format("balanceTop", max));
for (Map.Entry<User, Double> entry : sortedEntries)
finally
{
lock.readLock().unlock();
}
ess.runTaskAsynchronously(new Viewer(sender, page, force));
}
else
{
if (count == max)
if (ess.getUserMap().getUniqueUsers() > MINUSERS)
{
break;
sender.sendMessage(tl("orderBalances", ess.getUserMap().getUniqueUsers()));
}
sender.sendMessage(entry.getKey().getDisplayName() + ", " + Util.formatCurrency(entry.getValue(), ess));
count++;
ess.runTaskAsynchronously(new Viewer(sender, page, force));
}
}
private static void outputCache(final CommandSource sender, int page)
{
final Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(cacheage);
final DateFormat format = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
sender.sendMessage(tl("balanceTop", format.format(cal.getTime())));
new TextPager(cache).showPage(Integer.toString(page), null, "balancetop", sender);
}
private class Calculator implements Runnable
{
private final transient Viewer viewer;
private final boolean force;
public Calculator(final Viewer viewer, final boolean force)
{
this.viewer = viewer;
this.force = force;
}
@Override
public void run()
{
lock.writeLock().lock();
try
{
if (force || cacheage <= System.currentTimeMillis() - CACHETIME)
{
cache.getLines().clear();
final Map<String, BigDecimal> balances = new HashMap<String, BigDecimal>();
BigDecimal totalMoney = BigDecimal.ZERO;
if (ess.getSettings().isEcoDisabled())
{
if (ess.getSettings().isDebug())
{
ess.getLogger().info("Internal economy functions disabled, aborting baltop.");
}
}
else
{
for (UUID u : ess.getUserMap().getAllUniqueUsers())
{
final User user = ess.getUserMap().getUser(u);
if (user != null)
{
final BigDecimal userMoney = user.getMoney();
user.updateMoneyCache(userMoney);
totalMoney = totalMoney.add(userMoney);
final String name = user.isHidden() ? user.getName() : user.getDisplayName();
balances.put(name, userMoney);
}
}
}
final List<Map.Entry<String, BigDecimal>> sortedEntries = new ArrayList<Map.Entry<String, BigDecimal>>(balances.entrySet());
Collections.sort(sortedEntries, new Comparator<Map.Entry<String, BigDecimal>>()
{
@Override
public int compare(final Entry<String, BigDecimal> entry1, final Entry<String, BigDecimal> entry2)
{
return entry2.getValue().compareTo(entry1.getValue());
}
});
cache.getLines().add(tl("serverTotal", NumberUtil.displayCurrency(totalMoney, ess)));
int pos = 1;
for (Map.Entry<String, BigDecimal> entry : sortedEntries)
{
cache.getLines().add(pos + ". " + entry.getKey() + ", " + NumberUtil.displayCurrency(entry.getValue(), ess));
pos++;
}
cacheage = System.currentTimeMillis();
}
}
finally
{
lock.writeLock().unlock();
}
ess.runTaskAsynchronously(viewer);
}
}
private class Viewer implements Runnable
{
private final transient CommandSource sender;
private final transient int page;
private final transient boolean force;
public Viewer(final CommandSource sender, final int page, final boolean force)
{
this.sender = sender;
this.page = page;
this.force = force;
}
@Override
public void run()
{
lock.readLock().lock();
try
{
if (!force && cacheage > System.currentTimeMillis() - CACHETIME)
{
outputCache(sender, page);
return;
}
}
finally
{
lock.readLock().unlock();
}
ess.runTaskAsynchronously(new Calculator(new Viewer(sender, page, false), force));
}
}
}

View File

@@ -1,12 +1,13 @@
package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource;
import com.earth2me.essentials.Console;
import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.OfflinePlayer;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import org.bukkit.entity.Player;
import com.earth2me.essentials.utils.FormatUtil;
import java.util.logging.Level;
import org.bukkit.Server;
public class Commandban extends EssentialsCommand
@@ -17,52 +18,61 @@ public class Commandban extends EssentialsCommand
}
@Override
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
public void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception
{
boolean nomatch = false;
if (args.length < 1)
{
throw new NotEnoughArgumentsException();
}
final User player = getPlayer(server, args, 0, true);
if (player.getBase() instanceof OfflinePlayer)
User user;
try
{
if (sender instanceof Player
&& !ess.getUser(sender).isAuthorized("essentials.ban.offline"))
user = getPlayer(server, args, 0, true, true);
}
catch (PlayerNotFoundException e)
{
nomatch = true;
user = ess.getUser(new OfflinePlayer(args[0], ess.getServer()));
}
if (!user.getBase().isOnline())
{
if (sender.isPlayer() && !ess.getUser(sender.getPlayer()).isAuthorized("essentials.ban.offline"))
{
sender.sendMessage(Util.i18n("banExempt"));
return;
throw new Exception(tl("banExemptOffline"));
}
}
else
{
if (player.isAuthorized("essentials.ban.exempt"))
if (user.isAuthorized("essentials.ban.exempt") && sender.isPlayer())
{
sender.sendMessage(Util.i18n("banExempt"));
return;
throw new Exception(tl("banExempt"));
}
}
final String senderName = sender.isPlayer() ? sender.getPlayer().getDisplayName() : Console.NAME;
String banReason;
if (args.length > 1)
{
banReason = getFinalArg(args, 1);
player.setBanReason(banReason);
banReason = FormatUtil.replaceFormat(getFinalArg(args, 1).replace("\\n", "\n").replace("|", "\n"));
}
else
{
banReason = Util.i18n("defaultBanReason");
banReason = tl("defaultBanReason");
}
player.setBanned(true);
player.kickPlayer(banReason);
String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME;
for(Player p : server.getOnlinePlayers())
user.setBanReason(tl("banFormat", banReason, senderName));
user.getBase().setBanned(true);
user.setBanTimeout(0);
user.getBase().kickPlayer(tl("banFormat", banReason, senderName));
server.getLogger().log(Level.INFO, tl("playerBanned", senderName, user.getName(), banReason));
if (nomatch)
{
User u = ess.getUser(p);
if(u.isAuthorized("essentials.ban.notify"))
{
p.sendMessage(Util.format("playerBanned", senderName, player.getName(), banReason));
}
sender.sendMessage(tl("userUnknown", user.getName()));
}
ess.broadcastMessage("essentials.ban.notify", tl("playerBanned", senderName, user.getName(), banReason));
}
}

View File

@@ -1,9 +1,12 @@
package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource;
import com.earth2me.essentials.Console;
import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import com.earth2me.essentials.utils.FormatUtil;
import java.util.logging.Level;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
public class Commandbanip extends EssentialsCommand
@@ -14,24 +17,41 @@ public class Commandbanip extends EssentialsCommand
}
@Override
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
public void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
throw new NotEnoughArgumentsException();
}
final User u = ess.getUser(args[0]);
final String senderName = sender.isPlayer() ? sender.getPlayer().getDisplayName() : Console.NAME;
if (u == null)
String ipAddress;
if (FormatUtil.validIP(args[0]))
{
ess.getServer().banIP(args[0]);
sender.sendMessage(Util.i18n("banIpAddress"));
ipAddress = args[0];
}
else
{
ess.getServer().banIP(u.getAddress().getAddress().getHostAddress());
sender.sendMessage(Util.i18n("banIpAddress"));
try
{
User player = getPlayer(server, args, 0, true, true);
ipAddress = player.getLastLoginAddress();
}
catch (PlayerNotFoundException ex)
{
ipAddress = args[0];
}
}
if (ipAddress.isEmpty())
{
throw new PlayerNotFoundException();
}
ess.getServer().banIP(ipAddress);
server.getLogger().log(Level.INFO, tl("playerBanIpAddress", senderName, ipAddress));
ess.broadcastMessage("essentials.ban.notify", tl("playerBanIpAddress", senderName, ipAddress));
}
}

View File

@@ -1,11 +1,11 @@
package com.earth2me.essentials.commands;
import com.earth2me.essentials.TargetBlock;
import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.User;
import com.earth2me.essentials.utils.LocationUtil;
import org.bukkit.Location;
import org.bukkit.Server;
import org.bukkit.TreeType;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import org.bukkit.Location;
public class Commandbigtree extends EssentialsCommand
@@ -16,7 +16,7 @@ public class Commandbigtree extends EssentialsCommand
}
@Override
public void run(Server server, User user, String commandLabel, String[] args) throws Exception
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
TreeType tree;
if (args.length > 0 && args[0].equalsIgnoreCase("redwood"))
@@ -27,25 +27,25 @@ public class Commandbigtree extends EssentialsCommand
{
tree = TreeType.BIG_TREE;
}
else if (args.length > 0 && args[0].equalsIgnoreCase("jungle"))
{
tree = TreeType.JUNGLE;
}
else
{
throw new NotEnoughArgumentsException();
}
final int[] ignore =
{
8, 9
};
final Location loc = (new TargetBlock(user, 300, 0.2, ignore)).getTargetBlock().getLocation();
final Location safeLocation = Util.getSafeDestination(loc);
final boolean success = user.getWorld().generateTree(safeLocation, (TreeType)tree);
final Location loc = LocationUtil.getTarget(user.getBase());
final Location safeLocation = LocationUtil.getSafeDestination(loc);
final boolean success = user.getWorld().generateTree(safeLocation, tree);
if (success)
{
user.sendMessage(Util.i18n("bigTreeSuccess"));
user.sendMessage(tl("bigTreeSuccess"));
}
else
{
throw new Exception(Util.i18n("bigTreeFailure"));
throw new Exception(tl("bigTreeFailure"));
}
}
}

View File

@@ -0,0 +1,92 @@
package com.earth2me.essentials.commands;
import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.User;
import org.bukkit.Material;
import org.bukkit.Server;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.BookMeta;
public class Commandbook extends EssentialsCommand
{
public Commandbook()
{
super("book");
}
//TODO: Translate this
@Override
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
final ItemStack item = user.getBase().getItemInHand();
final String player = user.getName();
if (item.getType() == Material.WRITTEN_BOOK)
{
BookMeta bmeta = (BookMeta)item.getItemMeta();
if (args.length > 1 && args[0].equalsIgnoreCase("author"))
{
if (user.isAuthorized("essentials.book.author") && (isAuthor(bmeta, player) || user.isAuthorized("essentials.book.others")))
{
bmeta.setAuthor(args[1]);
item.setItemMeta(bmeta);
user.sendMessage(tl("bookAuthorSet", getFinalArg(args, 1)));
}
else
{
throw new Exception(tl("denyChangeAuthor"));
}
}
else if (args.length > 1 && args[0].equalsIgnoreCase("title"))
{
if (user.isAuthorized("essentials.book.title") && (isAuthor(bmeta, player) || user.isAuthorized("essentials.book.others")))
{
bmeta.setTitle(args[1]);
item.setItemMeta(bmeta);
user.sendMessage(tl("bookTitleSet", getFinalArg(args, 1)));
}
else
{
throw new Exception(tl("denyChangeTitle"));
}
}
else
{
if (isAuthor(bmeta, player) || user.isAuthorized("essentials.book.others"))
{
ItemStack newItem = new ItemStack(Material.BOOK_AND_QUILL, item.getAmount());
newItem.setItemMeta(bmeta);
user.getBase().setItemInHand(newItem);
user.sendMessage(tl("editBookContents"));
}
else
{
throw new Exception(tl("denyBookEdit"));
}
}
}
else if (item.getType() == Material.BOOK_AND_QUILL)
{
BookMeta bmeta = (BookMeta)item.getItemMeta();
if (!user.isAuthorized("essentials.book.author"))
{
bmeta.setAuthor(player);
}
ItemStack newItem = new ItemStack(Material.WRITTEN_BOOK, item.getAmount());
newItem.setItemMeta(bmeta);
user.getBase().setItemInHand(newItem);
user.sendMessage(tl("bookLocked"));
}
else
{
throw new Exception(tl("holdBook"));
}
}
private boolean isAuthor(BookMeta bmeta, String player)
{
String author = bmeta.getAuthor();
return author != null && author.equalsIgnoreCase(player);
}
}

View File

@@ -0,0 +1,48 @@
package com.earth2me.essentials.commands;
import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.User;
import org.bukkit.Material;
import org.bukkit.Server;
import org.bukkit.block.Block;
import org.bukkit.event.block.BlockBreakEvent;
public class Commandbreak extends EssentialsCommand
{
public Commandbreak()
{
super("break");
}
//TODO: Switch to use util class
@Override
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
final Block block = user.getBase().getTargetBlock(null, 20);
if (block == null)
{
throw new NoChargeException();
}
if (block.getType() == Material.AIR)
{
throw new NoChargeException();
}
if (block.getType() == Material.BEDROCK && !user.isAuthorized("essentials.break.bedrock"))
{
throw new Exception(tl("noBreakBedrock"));
}
//final List<ItemStack> list = (List<ItemStack>)block.getDrops();
//final BlockBreakEvent event = new BlockBreakEvent(block, user.getBase(), list);
final BlockBreakEvent event = new BlockBreakEvent(block, user.getBase());
server.getPluginManager().callEvent(event);
if (event.isCancelled())
{
throw new NoChargeException();
}
else
{
block.setType(Material.AIR);
}
}
}

View File

@@ -1,9 +1,10 @@
package com.earth2me.essentials.commands;
import com.earth2me.essentials.Util;
import com.earth2me.essentials.CommandSource;
import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.User;
import com.earth2me.essentials.utils.FormatUtil;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class Commandbroadcast extends EssentialsCommand
@@ -14,14 +15,24 @@ public class Commandbroadcast extends EssentialsCommand
}
@Override
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
sendBroadcast(user.getDisplayName(), args);
}
@Override
public void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception
{
sendBroadcast(sender.getSender().getName(), args);
}
private void sendBroadcast(final String name, final String[] args) throws NotEnoughArgumentsException
{
if (args.length < 1)
{
throw new NotEnoughArgumentsException();
}
ess.broadcastMessage(null,
Util.format("broadcast", getFinalArg(args, 0)));
ess.broadcastMessage(tl("broadcast", FormatUtil.replaceFormat(getFinalArg(args, 0)).replace("\\n", "\n"), name));
}
}

View File

@@ -1,9 +1,9 @@
package com.earth2me.essentials.commands;
import com.earth2me.essentials.Util;
import com.earth2me.essentials.CommandSource;
import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.User;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class Commandburn extends EssentialsCommand
@@ -14,17 +14,20 @@ public class Commandburn extends EssentialsCommand
}
@Override
protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
protected void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 2)
{
throw new NotEnoughArgumentsException();
}
for (Player p : server.matchPlayer(args[0]))
if (args[0].trim().length() < 2)
{
p.setFireTicks(Integer.parseInt(args[1]) * 20);
sender.sendMessage(Util.format("burnMsg", p.getDisplayName(), Integer.parseInt(args[1])));
throw new NotEnoughArgumentsException();
}
User user = getPlayer(server, sender, args, 0);
user.getBase().setFireTicks(Integer.parseInt(args[1]) * 20);
sender.sendMessage(tl("burnMsg", user.getDisplayName(), Integer.parseInt(args[1])));
}
}

View File

@@ -1,11 +1,16 @@
package com.earth2me.essentials.commands;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.earth2me.essentials.CommandSource;
import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import com.earth2me.essentials.utils.NumberUtil;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import org.bukkit.Server;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
public class Commandclearinventory extends EssentialsCommand
@@ -14,83 +19,143 @@ public class Commandclearinventory extends EssentialsCommand
{
super("clearinventory");
}
private static final int BASE_AMOUNT = 100000;
private static final int EXTENDED_CAP = 8;
@Override
public void run(Server server, User user, String commandLabel, String[] args) throws Exception
{
if (args.length > 0 && user.isAuthorized("essentials.clearinventory.others"))
{
//TODO: Fix fringe user match case.
if (args[0].length() >= 3)
{
List<Player> online = server.matchPlayer(args[0]);
if (!online.isEmpty())
{
for (Player p : online)
{
p.getInventory().clear();
user.sendMessage(Util.format("inventoryClearedOthers", p.getDisplayName()));
}
return;
}
throw new Exception(Util.i18n("playerNotFound"));
}
else
{
Player p = server.getPlayer(args[0]);
if (p != null)
{
p.getInventory().clear();
user.sendMessage(Util.format("inventoryClearedOthers", p.getDisplayName()));
}
else
{
throw new Exception(Util.i18n("playerNotFound"));
}
}
}
else
{
user.getInventory().clear();
user.sendMessage(Util.i18n("inventoryCleared"));
}
parseCommand(server, user.getSource(), args, user.isAuthorized("essentials.clearinventory.others"), user.isAuthorized("essentials.clearinventory.all") || user.isAuthorized("essentials.clearinventory.multiple"));
}
@Override
protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
protected void run(Server server, CommandSource sender, String commandLabel, String[] args) throws Exception
{
if (args.length < 1)
parseCommand(server, sender, args, true, true);
}
private void parseCommand(Server server, CommandSource sender, String[] args, boolean allowOthers, boolean allowAll) throws Exception
{
List<Player> players = new ArrayList<Player>();
int offset = 0;
if (sender.isPlayer())
{
throw new NotEnoughArgumentsException();
players.add(sender.getPlayer());
}
if (args[0].length() >= 3)
if (allowAll && args.length > 0 && args[0].contentEquals("*"))
{
List<Player> online = server.matchPlayer(args[0]);
sender.sendMessage(tl("inventoryClearingFromAll"));
offset = 1;
players = Arrays.asList(server.getOnlinePlayers());
}
else if (allowOthers && args.length > 0 && args[0].trim().length() > 2)
{
offset = 1;
players = server.matchPlayer(args[0].trim());
}
if (!online.isEmpty())
if (players.size() < 1)
{
throw new PlayerNotFoundException();
}
for (Player player : players)
{
clearHandler(sender, player, args, offset, players.size() < EXTENDED_CAP);
}
}
protected void clearHandler(CommandSource sender, Player player, String[] args, int offset, boolean showExtended) throws Exception
{
short data = -1;
int type = -1;
int amount = -1;
if (args.length > (offset + 1) && NumberUtil.isInt(args[(offset + 1)]))
{
amount = Integer.parseInt(args[(offset + 1)]);
}
if (args.length > offset)
{
if (args[offset].equalsIgnoreCase("**"))
{
for (Player p : online)
{
p.getInventory().clear();
sender.sendMessage(Util.format("inventoryClearedOthers", p.getDisplayName()));
}
return;
type = -2;
}
throw new Exception(Util.i18n("playerNotFound"));
else if (!args[offset].equalsIgnoreCase("*"))
{
final String[] split = args[offset].split(":");
final ItemStack item = ess.getItemDb().get(split[0]);
type = item.getTypeId();
if (split.length > 1 && NumberUtil.isInt(split[1]))
{
data = Short.parseShort(split[1]);
}
else
{
data = item.getDurability();
}
}
}
if (type == -1) // type -1 represents wildcard or all items
{
if (showExtended)
{
sender.sendMessage(tl("inventoryClearingAllItems", player.getDisplayName()));
}
player.getInventory().clear();
}
else if (type == -2) // type -2 represents double wildcard or all items and armor
{
if (showExtended)
{
sender.sendMessage(tl("inventoryClearingAllArmor", player.getDisplayName()));
}
player.getInventory().clear();
player.getInventory().setArmorContents(null);
}
else
{
Player u = server.getPlayer(args[0]);
if (u != null)
if (data == -1) // data -1 means that all subtypes will be cleared
{
u.getInventory().clear();
sender.sendMessage(Util.format("inventoryClearedOthers", u.getDisplayName()));
ItemStack stack = new ItemStack(type);
if (showExtended)
{
sender.sendMessage(tl("inventoryClearingAllStack", stack.getType().toString().toLowerCase(Locale.ENGLISH), player.getDisplayName()));
}
player.getInventory().clear(type, data);
}
else if (amount == -1) // amount -1 means all items will be cleared
{
ItemStack stack = new ItemStack(type, BASE_AMOUNT, data);
ItemStack removedStack = player.getInventory().removeItem(stack).get(0);
final int removedAmount = (BASE_AMOUNT - removedStack.getAmount());
if (removedAmount > 0 || showExtended)
{
sender.sendMessage(tl("inventoryClearingStack", removedAmount, stack.getType().toString().toLowerCase(Locale.ENGLISH), player.getDisplayName()));
}
}
else
{
throw new Exception(Util.i18n("playerNotFound"));
if (amount < 0)
{
amount = 1;
}
ItemStack stack = new ItemStack(type, amount, data);
if (player.getInventory().containsAtLeast(stack, amount))
{
sender.sendMessage(tl("inventoryClearingStack", amount, stack.getType().toString().toLowerCase(Locale.ENGLISH), player.getDisplayName()));
player.getInventory().removeItem(stack);
}
else
{
if (showExtended)
{
sender.sendMessage(tl("inventoryClearFail", player.getDisplayName(), amount, stack.getType().toString().toLowerCase(Locale.ENGLISH)));
}
}
}
}
}

View File

@@ -1,8 +1,8 @@
package com.earth2me.essentials.commands;
import org.bukkit.Server;
import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import org.bukkit.Server;
public class Commandcompass extends EssentialsCommand
@@ -13,39 +13,39 @@ public class Commandcompass extends EssentialsCommand
}
@Override
public void run(Server server, User user, String commandLabel, String[] args) throws Exception
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
int r = (int)(user.getLocation().getYaw() + 180 + 360) % 360;
final int bearing = (int)(user.getLocation().getYaw() + 180 + 360) % 360;
String dir;
if (r < 23)
if (bearing < 23)
{
dir = "N";
}
else if (r < 68)
else if (bearing < 68)
{
dir = "NE";
}
else if (r < 113)
else if (bearing < 113)
{
dir = "E";
}
else if (r < 158)
else if (bearing < 158)
{
dir = "SE";
}
else if (r < 203)
else if (bearing < 203)
{
dir = "S";
}
else if (r < 248)
else if (bearing < 248)
{
dir = "SW";
}
else if (r < 293)
else if (bearing < 293)
{
dir = "W";
}
else if (r < 338)
else if (bearing < 338)
{
dir = "NW";
}
@@ -53,6 +53,6 @@ public class Commandcompass extends EssentialsCommand
{
dir = "N";
}
user.sendMessage(Util.format("compassBearing", dir, r));
user.sendMessage(tl("compassBearing", dir, bearing));
}
}

View File

@@ -0,0 +1,40 @@
package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource;
import com.earth2me.essentials.textreader.IText;
import com.earth2me.essentials.textreader.KeywordReplacer;
import com.earth2me.essentials.textreader.TextInput;
import com.earth2me.essentials.textreader.TextPager;
import com.earth2me.essentials.utils.NumberUtil;
import org.bukkit.Server;
public class Commandcustomtext extends EssentialsCommand
{
public Commandcustomtext()
{
super("customtext");
}
@Override
protected void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception
{
final IText input = new TextInput(sender, "custom", true, ess);
final IText output = new KeywordReplacer(input, sender, ess);
final TextPager pager = new TextPager(output);
String chapter = commandLabel;
String page;
if (commandLabel.equalsIgnoreCase("customtext") && args.length > 0 && !NumberUtil.isInt(commandLabel))
{
chapter = args[0];
page = args.length > 1 ? args[1] : null;
}
else
{
page = args.length > 0 ? args[0] : null;
}
pager.showPage(chapter, page, null, sender);
}
}

View File

@@ -1,9 +1,10 @@
package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource;
import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.User;
import java.util.Locale;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import com.earth2me.essentials.Util;
public class Commanddelhome extends EssentialsCommand
@@ -14,35 +15,48 @@ public class Commanddelhome extends EssentialsCommand
}
@Override
public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
public void run(final Server server, final CommandSource sender, final String commandLabel, String[] args) throws Exception
{
//Allowing both formats /delhome khobbits house | /delhome khobbits:house
final String[] nameParts = args[0].split(":");
if (nameParts[0].length() != args[0].length())
{
args = nameParts;
}
User user = ess.getUser(sender);
String name;
if (args.length < 1)
{
throw new NotEnoughArgumentsException();
}
else if (args.length > 1 && (user == null || user.isAuthorized("essentials.delhome.others")))
User user = ess.getUser(sender.getPlayer());
String name;
String[] expandedArg;
//Allowing both formats /sethome khobbits house | /sethome khobbits:house
final String[] nameParts = args[0].split(":");
if (nameParts[0].length() != args[0].length())
{
user = getPlayer(server, args, 0, true);
name = args[1];
expandedArg = nameParts;
}
else
{
if (user == null)
{
throw new NotEnoughArgumentsException();
}
name = args[0];
expandedArg = args;
}
user.delHome(name.toLowerCase());
sender.sendMessage(Util.format("deleteHome", name));
if (expandedArg.length > 1 && (user == null || user.isAuthorized("essentials.delhome.others")))
{
user = getPlayer(server, expandedArg, 0, true, true);
name = expandedArg[1];
}
else if (user == null)
{
throw new NotEnoughArgumentsException();
}
else
{
name = expandedArg[0];
}
if (name.equalsIgnoreCase("bed"))
{
throw new Exception(tl("invalidHomeName"));
}
user.delHome(name.toLowerCase(Locale.ENGLISH));
sender.sendMessage(tl("deleteHome", name));
}
}

Some files were not shown because too many files have changed in this diff Show More