Commit Graph

51 Commits

Author SHA1 Message Date
Brettflan
4db904182e New setting "playersWhoBypassAllProtection" (default empty), which is a list of player names that should always bypass normal faction protections such as block destruction and placement. This is primarily for use with other plugins/mods which use a fake player to take action, which shouldn't necessarily be subject to protections provided by Factions. Note that case is important; you must preserve the exact capitalization of the name.
As with every other setting, you are advised to use /f config to modify it. Example: /f config playersWhoBypassAllProtection fakePluginPlayerName  - add/remove the specified player name

Also switched several HashSets in Conf.java to LinkedHashSets. LinkedHashSets do have slower insertion and deletion than HashSets, but importantly they have faster lookup speed (at least until you get up to several hundred entries).
2012-03-11 13:36:07 -05:00
Brettflan
fbfdf8fe23 (donington) Consolidated chat event listeners into a single chat listener class.
(Brettflan) Fixed slashless commands not being logged if player was in faction chat or alliance chat mode. Also cleaned up chat code a bit, nothing major.
2012-03-09 21:24:58 -06:00
Brettflan
84ee922ac1 "autoLeaveAfterDaysOfInactivity" routine now runs only once every few minutes instead of running every time a player logs in. New setting "autoLeaveRoutineRunsEveryXMinutes" (default 5 minutes) to determine just how often the routine is run.
The routine is also slightly more careful about how it calculates how long a player has been offline.
2012-02-26 16:55:57 -06:00
Brettflan
ff56162c12 fix for command prevention routine (used by territoryEnemyDenyCommands and such) not properly covering commands with uppercase letters in them 2012-02-19 08:21:03 -06:00
Brettflan
32da53f459 Preemptive EssentialsChat 3.x support, since they'll be removing the old local chat integration method; new implementation will need improvement to support relation coloring, but for now it otherwise works.
When chat event hits an UnknownFormatConversionException which requires better chat configuration, the quick dirty fix of setting chatTagInsertIndex to 0 is now automatically applied.
2012-02-02 19:31:34 -06:00
Brettflan
7a38ee42a7 zero-value economy gains/losses are now skipped over ("X gained 0.0 for claiming this land" and similar is a bit odd)
CLeaned up warning given for UnknownFormatConversionException chat exception; the debug info is no longer useful for us, and a distraction for users.
2012-01-31 11:07:48 -06:00
Brettflan
ff91cdfed7 Players no longer regain power while dead; no more waiting to respawn in order to regain power
Also added AuthDB to softdepend list, so it has first shot at Factions commands in case it needs to cancel one
2012-01-28 05:59:10 -06:00
Brettflan
fc04e0a446 Update to new Bukkit Event system
Also remove leftover TNT exploit prevention code which I missed earlier
2012-01-28 04:37:55 -06:00
Brettflan
84b6278529 Workaround fix for half-step placement on existing half-steps not being prevented; it's caused by a CraftBukkit bug:
https://bukkit.atlassian.net/browse/BUKKIT-646

Fix for a potential NPE in FPlayer autoLeaveOnInactivityRoutine.

Added CaptureThePoints and CombatTag to our softdepend list so they can potentially cancel Factions commands.
2012-01-28 03:16:28 -06:00
Brettflan
03b368e9c4 New conf.json setting "permanentFactionMemberDenyCommands" (list, default empty), which can be used to prevent members of permanent factions from using specific commands.
Also, a minor fix for the help page regarding faction banks being shown if "bankEnabled" setting was enabled but "econEnabled" setting was false (economy as a whole disabled).
2012-01-18 23:31:37 -06:00
Brettflan
90d91180af fix for factions-specific commands not being prevented properly if they were in "territoryNeutralDenyCommands" or "territoryEnemyDenyCommands"
also got rid of a command preprocess listener which is now unnecessary
2012-01-18 22:42:56 -06:00
Brettflan
aa88c974fd Players auto-removed due to inactivity or due to being banned now have their data deleted immediately; this should fix the log spam of the same players repeatedly being marked for deletion 2012-01-09 21:38:00 -06:00
Brettflan
b3796c31f2 Added soil to the default "territoryProtectedMaterials" and "territoryProtectedMaterialsWhenOffline" settings, so people who aren't in your faction won't be able to trample crops in your territory (soil trampling is handled as an Interact event, for whatever reason)
For servers updating from older versions of Factions, you should use these commands to update your configuration:
f config territoryProtectedMaterials SOIL
f config territoryProtectedMaterialsWhenOffline SOIL
2011-12-18 08:39:52 -06:00
Brettflan
281021ce46 When a faction admin is kicked from his faction for whatever reason (not logging in for too long, a server admin running the /f kick command on him, the player being banned from server), another player will now be promoted to faction admin in his place. If the faction has at least one moderator, one of them will be chosen. Otherwise, a normal member will be promoted. If the faction admin was the last/only member, the faction will of course be disbanded. 2011-12-18 07:47:15 -06:00
Brettflan
fc5d45d8c4 New conf.json setting "removePlayerDataWhenBanned" (default true), which can be disabled to prevent Factions from deleting player data for players when they are banned from the server 2011-12-18 02:47:56 -06:00
Brettflan
e66e71f36b fix for Spout faction labels not updating for players who have /f map on 2011-12-16 00:31:23 -06:00
Brettflan
3e8faad156 Updated Spout features to improve consistency (of code, and of displayed information) 2011-10-23 09:03:28 -05:00
Olof Larsson
a78a4dff98 Managed to get rid of some commands. This needs to be rethought even more though. 2011-10-22 17:03:49 +02:00
Olof Larsson
45d6a6628a Claim command refactoring in progress. 2011-10-22 16:00:24 +02:00
Olof Larsson
f42fb8e8bf Removing some old code and try to read colors in the listeners. 2011-10-21 18:14:04 +02:00
Brettflan
358186764d Territory owner list was not being shown to people who aren't running the Spoutcraft client, when Spout was hooked... fixed 2011-10-13 14:30:47 -05:00
Brettflan
1a38007d64 With Spout, the territory indicator now also has an ownership indicator below it (but only if the current territory has any owners set), and a larger centered territory notice below which goes away after a couple of seconds.
These effectively replace the related chat notices if enabled.
Also, updated libs.
2011-10-13 14:09:47 -05:00
Brettflan
329cef6465 Fix for messed up ownership protection handling in regards to ally/enemy status
In the process, removed the separate painting handling and made it use the standard block place/destroy checking routine, and otherwise cleaned up the related code a bit
2011-10-12 22:31:18 -05:00
Olof Larsson
b202acb685 Almost finished money refactoring 2011-10-12 17:25:01 +02:00
Brettflan
f5190db257 Moved some Spout code out to a separate listener, for slightly better organization and more importantly to prevent NoClassDefFoundErrors on servers not running Spout
The text scale (size) can now be set for the territory display using conf.json setting "spoutTerritoryDisplaySize" (default 1.0), and "spoutTerritoryDisplayShowDescription" (default true) can be disabled to have only the faction tag/name displayed and not the description as well
2011-10-10 21:09:58 -05:00
Olof Larsson
a0c8fd8d7d herp... 2011-10-09 18:35:39 +02:00
Olof Larsson
10f535e637 Halfway through refactoring of commands and permissions 2011-10-09 14:53:38 +02:00
Olof Larsson
227d54dc5f Converting the command structure 2011-10-08 23:22:02 +02:00
Olof Larsson
0ce9cce9d3 In progress: Using MassiveCraftCore and Allman indentation style and minor refactoring. 2011-10-08 22:03:44 +02:00
Brettflan
77a7b2d85c New Spout feature, for Spoutcraft client users only: current territory info will now be permanently shown at top of screen, instead of being echoed out to chat as you move around
New conf.json setting "spoutTerritoryDisplayPosition" to set the screen position at which the current territory is shown. 0 = disabled, 1 = top left, 2 = top center, 3 (default) = top right.
Moved all integration code to separate package, ofr better code organization. Also moved EssentialsChat integration code out to separate file in there, allowing us to safely remove our copy IEssentialsChatListener.java file (which is otherwise needed to prevent a nasty NoClassDefFoundError).
2011-10-05 05:13:54 -05:00
Brettflan
149257f154 When a player is kicked from their faction by the autoLeaveAfterDaysOfInactivity routine, the rest of their stored data is now dropped as well
When a player is banned from the server, they will now be kicked from their faction and have their stored data removed (only works on CB 1240 or newer)
2011-10-05 00:33:15 -05:00
Brettflan
7c249e1884 Added 3 new hookable functions to main Factions class, for use by other plugins:
boolean isPlayerAllowedToBuildHere(Player player, Location location)
boolean isPlayerAllowedToInteractWith(Player player, Block block)
boolean isPlayerAllowedToUseThisHere(Player player, Location location, Material material)
Also update Bukkit lib for new RB.
2011-10-04 22:46:11 -05:00
Harry Jeffery
5eaf9c6835 Fixed autoclaim 2011-09-26 22:11:07 +01:00
Brettflan
60abb61cb9 Fix for "territoryEnemyProtectMaterials" and "territoryAllyProtectMaterials" not working correctly, and wrong protection message being sent to neutral players. Re-jiggered the related code a bit which handles such things based on enemy/ally/member/neutral status. 2011-09-22 16:12:35 -05:00
Brettflan
2aa51a4781 Added some quick and dirty fix notes for people who get a specific chat formatting error 2011-09-16 01:50:25 -05:00
Brettflan
443e083f23 Bugfix release 1.4.9: material protection (interaction with doors, chests, etc.) was being incorrectly triggered in wilderness, war zones, and safe zones 2011-09-15 09:12:24 -05:00
Brettflan
c89db2c4d6 Fix for allies bypassing ownership if Ally options allowed them to build/interact/use in allied territory
Also consolidated some Conf lookups into new functions for Relations, to simplify and de-uglify the code a bit
2011-09-06 16:35:43 -05:00
Brettflan
82db1624c9 Added new "Ally" related protection options to complement the "Enemy" ones (added thanks to donation from BeTrayed) 2011-08-23 17:12:17 -05:00
Brettflan
ef465dfcf4 New conf.json setting "worldsNoWildernessProtection", for worlds in which you don't want wilderness protections to apply 2011-08-23 00:37:31 -05:00
Brettflan
e970c02808 Capes were not applying properly to players when added at login (at least as seen by existing connected clients), so a slight delay has been added there to fix it 2011-08-22 23:48:18 -05:00
Brettflan
e573895d8a Added owner list display for faction members when moving between to/from claimed chunks which have owners set (code by Zidkon) 2011-08-22 23:31:37 -05:00
Brettflan
697e0cf466 Added Spout features, with Spout client required for all: relation-colored faction tags over players' heads via option "spoutFactionTagsOverNames", player's faction title over their head via option "spoutFactionTitlesOverNames", and relation-colored capes shown on faction admins and/or moderators via "spoutFactionAdminCapes" and "spoutFactionModeratorCapes" (all new settings default to true)
When a faction is disbanded or has peaceful status added or removed, all online players are now notified
Added further debug output if an UnknownFormatConversionException is triggered during relational chat messages, to help track down cause
2011-08-19 20:36:23 -05:00
Brettflan
b45224fff0 Added handling for potential null strings in "territoryNeutralDenyCommands" and "territoryEnemyDenyCommands" 2011-08-05 14:06:35 -05:00
Brettflan
100a1ffb1e improved command prevention from last commit to also monitor slashless Faction commands, for full coverage 2011-08-04 00:34:52 -05:00
Brettflan
699c22f655 New conf.json settings "territoryNeutralDenyCommands" and "territoryEnemyDenyCommands", which can have lists of commands added to them that will be denied while in the territory of a neutral or enemy faction. It is recommended you use /f config to add/remove such commands, for example /f config territoryEnemyDenyCommands spawn would prevent players from using /spawn in enemy territory. You can add the slash to the command string or not, it will work either way. If the used command starts with one of your denied commands, it will be prevented. For example, if you deny "time", both "/time night" and "/time day" will be prevented. However, if you deny "time n", /time night will be prevented but /time day won't. (thanks for some code contribution from Cal27) 2011-08-04 00:07:38 -05:00
Brettflan
2154b89005 Added basic support for iConomy, where most Factions commands can be made to cost (or give) money. For claiming land, there are some extra features. Each additional land claimed by default costs more than the last, with the multiplier being configurable. For example, the first claim might cost $30, the 2nd $45, the third $60, and so forth. When land is claimed from a weakened faction, there is a configurable bonus amount of money deducted from the cost of claiming the land, as an incentive; this number can be changed to a negative value to instead make it cost more to claim such land. When land is unclaimed, a configurable percentage of the cost of claiming the land can be refunded (defaults to 70% of the cost). The total value of a faction's claimed land is now shown in the info given by /f who [faction tag], along with the depreciated (refund) value. 2011-08-01 18:05:01 -05:00
Brettflan
508f953ce9 Faction admins can now mark already claimed areas as owned by specific faction members. Ownership can include multiple members. New command /f owner *[player name], to set/remove ownership. This command is only available to the faction admin and optionally the faction moderators. If no player name is specified, it will either set ownership to the player running the command (if no owner is currently set) or completely clear ownership of the territory. New command /f ownerlist, to view a list of owners for the current area. Only works inside your own faction's territory. New conf.json options "ownedAreasEnabled", "ownedAreasModeratorsCanSet", "ownedAreaModeratorsBypass", "ownedAreaDenyBuild", "ownedAreaProtectMaterials", and "ownedAreaDenyUseage" (all defaulting to true) to determine whether faction moderators can set or bypass ownership (faction admin always can), and what sort of protection these owned areas have against normal members of the faction (members other than the owner(s), faction admin, and probably faction moderators). New conf.json option "ownedAreasLimitPerFaction" to limit how many owned areas can be set. New permission node "factions.ownershipBypass" which allows a player to bypass ownership protection, but only within the person's own faction.
various little tweaks and improvements to other code
moderate speed boost to FLocation code
made commandDisable permissions work for any command alias of a command, instead of just the first one
2011-07-30 20:17:00 -05:00
Olof Larsson
6e9fd72612 Soon to be used JarLoader. 2011-07-27 22:56:45 +02:00
Brettflan
b97eaf175e When adding relational colored faction tags to chat, Factions now pays better attention to whether the recipient list has been altered by another plugin 2011-07-24 17:38:58 -05:00
Brettflan
c3f57d5105 added a secondary low priority event listener for chat events, to try and make sure Factions is able to handle slashless commands and faction chat before other plugins do anything 2011-07-24 06:09:58 -05:00