Commit Graph

929 Commits

Author SHA1 Message Date
Brettflan
01d9f62bdd Removed bit of code which was apparently intended to optimize movement event code but which was actually slowing the process down a bit overall 2012-05-16 12:57:44 -05:00
Brettflan
a0909ddb5c Added back a FactionsBlockListener.playerCanBuildDestroyBlock() method which references Location instead of Block, mainly for backwards compatibility 2012-05-16 11:52:47 -05:00
Brettflan
58bec9d6dc New "access" system to replace old ownership system. Access can be granted to build, destroy, and fully interact within any chunk for specific players or factions. Access can also optionally be denied to normal members of the host faction.
Some further info display to go with this feature is yet to come, and further testing for possible bugs is also needed.

Related info:

New FPerm "ACCESS" which is granted to faction leaders and officers by default. This FPerm allows you to bypass access restrictions throughout your faction territory, and (along with the "factions.access" Bukkit permission below) allows you to change access settings for any chunk owned by your faction.

New permissions:
factions.access - Ability to grant territory access for your faction, if you have the proper "ACCESS" FPerm (defaults to leaders and officers only). Added to factions.kit.halfplayer permission kit.
factions.access.any - Ability to grant territory access for any faction on the server. Added to factions.kit.mod permission kit.
factions.access.view - Ability to view territory access info for your own faction. Added to factions.kit.halfplayer permission kit.

New command:
/f access [view|p|f|player|faction=view] [name=you] - view or change the access information for the chunk you are in. If "view" or nothing is specified, it will simply display the info. If "p" or "player" is specified, a player will be granted access, or removed from the list if they were already granted access. If "f" or "faction" is specified, the same will be done for the specified faction. The name defaults to yourself or your faction if not specified. If your own faction is specified, you will toggle restricted access for the chunk so that normal faction members can be denied access, unless they are in the access list.
Examples:
/f access - view access list, if in your own territory
/f access p SomePlayer - grant access to player "SomePlayer" for the current chunk, or remove them from the access list if already there
/f access f - toggle restricted access for the current chunk (since faction name isn't specified, uses your own faction), assuming you're in your own factions territory
2012-05-14 21:41:13 -05:00
Brettflan
d2b0fee335 Delete a couple of files which are no longer used 2012-05-14 19:53:08 -05:00
Olof Larsson
5988e8e5af Simplified the perm command. 2012-05-09 06:29:52 +02:00
Olof Larsson
a0a163056d Now using automated help. Fixed SeeChunk issues. 2012-05-09 05:56:37 +02:00
Olof Larsson
67e5aa8464 Fixing a few apperance bugs and stopped updating apparance if it was the same. 2012-05-09 05:21:21 +02:00
Olof Larsson
2c5438bf70 Some minor fixes to the previous commit. 2012-05-09 03:32:04 +02:00
Olof Larsson
ca6b185bd1 New cape system and refactored spout appearances. 2012-05-09 03:24:07 +02:00
Brettflan
1f51ee9699 Improved explosion handling speed 2012-05-08 15:14:16 -05:00
Brettflan
c32736f3f1 fix for rare case where faction home location's world being removed or renamed (world with specified name not existing) could lead to NPE 2012-05-08 12:47:46 -05:00
Olof Larsson
1459c9c057 Reworked chat completely. Added Herochat integration. New tag-parsing system. Non-monitor-breaking relation colored chat. 2012-05-02 04:45:10 +02:00
Olof Larsson
06d22549e2 Added in some deprecated methods for backwards-compat. 2012-04-27 20:29:41 +02:00
Brettflan
e3a7188b0d /f show|who command will no longer reveal players as online if they are hidden from the viewer by the Vanish API 2012-04-26 08:08:11 -05:00
Brettflan
1defa2984b Relation commands will now cancel out if the same relation is already set with the target faction. 2012-04-06 13:27:23 -05:00
Brettflan
ffa4806af4 fix for /f power command used on self incorrectly also requiring factions.power.any permission 2012-04-06 13:23:01 -05:00
Olof Larsson
10522e7048 Made a sepparate health bar listener, reduced duplicate code and added respawn listener. 2012-04-01 15:08:20 +02:00
Olof Larsson
3eed72783b Added a healthbar feature :) 2012-03-25 21:07:11 +02:00
Brettflan
6d75fa39cc New setting "handleExploitTNTWaterlog" (default false/disabled) which, if enabled, will cause TNT which explodes in liquid to actually destroy a single adjacent block in all 6 directions. This will only apply to blocks which can be destroyed by TNT normally, specifically anything other than air, bedrock, water, lava, obsidian, and enchanting tables. The destruction of these blocks will be handled as if they had been mined, dropping the appropriate item.
TNT in water/lava doesn't normally destroy any surrounding blocks, which is usually desired behavior. That's the reason this setting is disabled by default. However, it is available because it provides a method to get through waterwalls with enough persistence, and it makes cheap (non-obsidian) TNT cannons require minor maintenance between shots. Both are useful things for my server.
2012-03-19 11:18:39 -05:00
Brettflan
d77cf1fa18 Double-space (or more) after command alias is no longer accepted, i.e. "f home". Otherwise, command prevention routines (in Factions itself and in other plugins) can be bypassed. For example, preventing the "f home" command wouldn't prevent anyone from using "f home" or "f home" instead. 2012-03-19 08:21:06 -05:00
Brettflan
8333354926 New setting "handleExploitInteractionSpam" (defaults to true). If enabled, players will begin to take injury if they rapidly try interacting with anything in another faction's territory. This is to prevent people from spam-clicking on doors and chests and such in the hopes that they'll get one through. After 10 rapid interaction attempts in a row, every click will cause them damage; the damage amount is a half heart of damage for every 10 clicks (up to 1 heart at 20 clicks, 1.5 hearts at 30, etc.). After the player has stopped trying for 2 seconds, their failed interaction counter will reset.
Also removed our old workaround fix code for the bug where half-step placement wasn't detected, since the Bukkit team fixed that in 1.1-R4.
2012-03-19 07:59:41 -05:00
Brettflan
8f2e587eb9 Optional prevention of a couple of exploits.
1. Obsidian generator exploit, which converts redstone wire to obsidian. New setting "handleExploitObsidianGenerators" (enabled by default) to determine whether it's prevented or not. Some servers might want to disable this prevention, to keep it as a viable obsidian creation method. Thanks to ObGenBlocker and WorldGuard plugins for the prevention method.
2. Ender pearl exploit, which could be used to clip through doors, glass, and probably a few other things if just the right spot was targeted. New setting "handleExploitEnderPearlClipping" (enabled by default) to determine whether it's prevented or not.

Also removed our TNT exploit prevention code, since they did get it fully fixed in 1.1-R4 and it doesn't look to be coming back from the dead again like it did when they released 1.1-R2.
2012-03-19 06:55:00 -05:00
Brettflan
2df8ca0df9 Add fireball/"fire charge" to materialsEditTools list, to prevent them from being used to set things on fire like flint&steel 2012-03-19 04:18:59 -05:00
Brettflan
f3239cd9ed Should finally completely fix problem where player location world changes in the middle of the /f home smoke effect, triggering an error from trying to calculate distance between worlds
also updated Spout API lib
2012-03-19 01:28:06 -05:00
Brettflan
345e18bf56 Release 1.7.4 alpha (sorry, forgot I hadn't pushed this version change) 2012-03-17 00:39:03 -05:00
Brettflan
d8a39140fc Faction homes should no longer be lost if their target world isn't already loaded when Factions loads at server startup. This is done using a new lazy-load Location container class which only initializes the Location when it's actually needed. 2012-03-14 13:06:38 -05:00
Brettflan
7b9674dc4b Ability to pay for commands (through economy) is now checked before firing events which can be canceled, and actual payment made after making sure the event isn't canceled.
Added Econ.hasAtLeast(EconomyParticipator ep, double delta, String toDoThis) method to check if an account has at least a specified amount of money in it. Also added related FCommand.canAffordCommand(double cost, String toDoThis).
2012-03-13 09:48:34 -05:00
Brettflan
fd8ca30af6 (donington) Fixes for compiler warnings & minor .gitignore enhancement, completed the last of the creatureType/entityType renaming (a few imports and functions) 2012-03-13 08:43:45 -05:00
Brettflan
18b10ce8f9 Cleaning sweep, mainly for various stray "4 spaces" indentions to tabs 2012-03-13 08:27:03 -05:00
Brettflan
28269b7455 a bit of cleanup 2012-03-13 07:47:54 -05:00
Brett Flannigan
a53a556594 Merge pull request #103 from donington/CustomFactionEvents
Custom faction events
2012-03-13 04:31:52 -07:00
Brettflan
147982e956 updated bukkit lib 2012-03-13 05:56:11 -05:00
Brettflan
2856411594 Remake of radius claim method. It now starts in the current chunk and spirals outward, in a repeating task designed to keep from overloading the server. The old method tried to put together a list of chunks, and then tried to claim them immediately starting from one corner of the overall area.
New setting "radiusClaimFailureLimit" (default 9). If claims are unsuccessful that many times in a row during a radius claim, the task will cancel out. There is no longer a limit to the specified radius since the process should no longer cause major server stress, and due to the process canceling out after several failures as just described.

Added some new methods to FLocation to quickly convert between block/chunk/region positions, and rewrote the FLocation hashCode() method to make it faster.
2012-03-13 05:54:48 -05:00
donington
e2f0d049f9 Merge remote-tracking branch 'origin/master' into CustomFactionEvents 2012-03-13 04:51:32 -04:00
Brettflan
fbdc0503ba Fix for "econClaimUnconnectedFee" not working correctly 2012-03-11 22:44:38 -05:00
Brettflan
b88430a628 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:03 -05:00
donington
cc772b00ce Merge remote-tracking branch 'origin/master' into CustomFactionEvents 2012-03-11 13:29:37 -04:00
donington
9314b4e298 Updated Faction Event System -- Land Events
Changes:
----------
 * changed internal storage of faction from String Id to Faction for LandClaimEvent and LandUnclaimEvent
 * added getFactionId(), getFactionTag(), getPlayer() to LandClaimEvent
 * added getFactionId(), getFactionTag(), getFPlayer(), getPlayer() to LandUnclaimEvent
 * removed LandUnclaimEvent from unclaimAll() in Board.java
 * created LandUnclaimAllEvent (uncancellable) and hooked into cmdUnclaimall

Notes:
--------
 * LandUnclaimAllEvent currently only returns calling faction and fplayer information.  Location data is unavailable as it is determined in Board.java's unclaimAll().  Realistically this should be enough information for anyone hooking this event to determine what is being altered.

On branch CustomFactionEvents

	modified:   src/com/massivecraft/factions/Board.java
	modified:   src/com/massivecraft/factions/FPlayer.java
	modified:   src/com/massivecraft/factions/cmd/CmdUnclaim.java
	modified:   src/com/massivecraft/factions/cmd/CmdUnclaimall.java
	modified:   src/com/massivecraft/factions/event/LandClaimEvent.java
	new file:   src/com/massivecraft/factions/event/LandUnclaimAllEvent.java
	modified:   src/com/massivecraft/factions/event/LandUnclaimEvent.java
2012-03-11 13:28:31 -04:00
Brettflan
c0308940c8 Connected standard command handler getCommand("f"), for it to work with other plugins which directly execute commands using that interface. 2012-03-11 11:41:56 -05:00
Brettflan
2c6191b73f Removed dependence on external GSON lib in lib/gson.jar, since GSON 2.1 is now embedded in CraftBukkit itself, used by their auto-updater added shortly before 1.1-R5 was released:
0ed1d1fdbb
2012-03-11 07:39:31 -05:00
Brettflan
a888a9c5b5 Updated /f config to support modifying "factionFlagDefaults" and "factionPermDefaults". Both of these settings require an additional argument more than other settings.
Examples:
/f config factionFlagDefaults firespread false  - set default "FIRESPREAD" faction flag to false
/f config factionFlagDefaults monsters true  - set default "MONSTERS" faction flag to true
/f config factionPermDefaults build ally  - for default "BUILD" faction permission, add/remove permission for allies
/f config factionPermDefaults withdraw member  - for default "WITHDRAW" faction permission, add/remove permission for regular faction members
2012-03-11 07:33:47 -05:00
Brettflan
fd44983ae2 (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:25:01 -06:00
Brettflan
a5bb25eb44 New setting "logPlayerCommands" (default true) which can be disabled to prevent player commands from being logged. 2012-03-09 19:26:40 -06:00
donington
88bdadcb2b Merge remote-tracking branch 'origin/master' into CustomFactionEvents 2012-03-09 17:49:10 -05:00
donington
6329fd0eaf updated patrickfreed's custom event system
Patrick's Custom Event System Changes:
----------------------------------------
  * FPlayerLeaveEvent now fires for all faction players in cmdDisband()
  * FPlayerLeaveEvent removed from cmdJoin()
  * FPlayerJoinEvent now only fires when the faction is different in cmdLeade
  * Added FactionRenameEvent, firing on cmdTag()
  * Added FactionRelationEvent, firing on FRelationCommand extensions
  * Fixed FPlayerJoinEvent to fire after tag is set in cmdCreate()
  * Added getFactionId() to FactionCreateEvent

TODO:
-------
  * cmdLeader() might need a FPlayerLeaveEvent for the same reason it needs
    a FPlayerJoinEvent?

On branch CustomFactionEvents

	modified:   src/com/massivecraft/factions/cmd/CmdCreate.java
	modified:   src/com/massivecraft/factions/cmd/CmdDisband.java
	modified:   src/com/massivecraft/factions/cmd/CmdJoin.java
	modified:   src/com/massivecraft/factions/cmd/CmdKick.java
	modified:   src/com/massivecraft/factions/cmd/CmdLeader.java
	modified:   src/com/massivecraft/factions/cmd/CmdTag.java
	modified:   src/com/massivecraft/factions/cmd/FRelationCommand.java
	modified:   src/com/massivecraft/factions/event/FPlayerLeaveEvent.java
	modified:   src/com/massivecraft/factions/event/FactionCreateEvent.java
	new file:   src/com/massivecraft/factions/event/FactionRelationEvent.java
	new file:   src/com/massivecraft/factions/event/FactionRenameEvent.java
	modified:   src/com/massivecraft/factions/event/LandClaimEvent.java
2012-03-09 17:09:33 -05:00
Brettflan
1ca93948a3 Replaced deprecated CreatureType references with EntityType 2012-03-09 14:46:45 -06:00
Brettflan
0a048d6553 If plugin failed to load correctly for various reasons, it could end up wiping the board or faction list. This should now be prevented.
An example: if you loaded 1.6.6 (not 1.6.6b) on CB 1.1-R6 or newer, it would trigger an exception at startup and cause this problem.
2012-03-09 14:44:17 -06:00
patrickfreed
021bf52c62 Added Event System 2012-03-01 20:16:45 -05:00
Brettflan
54b97651b6 Release 1.7.3b ALPHA for compatibility with CB 1.1-R5 and above 2012-03-01 09:41:35 -06:00
Brettflan
2954fa621f Fix for fatal error at startup in CraftBukkit 1.1-R5 and above
Updated Bukkit lib
2012-03-01 09:40:28 -06:00