ProjectKorra/ProjectKorra — pull request #31 by nathank33 (2014-09-05 01:16:12+00:00)
Title: Added LavaFlow, and Fixed Glitches

Added LavaFlow:
Created a new File for LavaFlow.java
- Added the LavaFlow progressAll call from the EarthBendingManager
- Adjusted the PKListener to create new LavaFlow instances.
- Added the Description to the config.yml file
- Added 9 configuration items for LavaFlow in the config.yml
- Removed a duplicated permission from plugin.yml: "bending.ability.Torrent", for some reason it was there twice.
- Added the LavaFlow permissions to plugin.yml

Improved HeatControl Efficiency:
Explanation: The isRegionProtectedFromBuild uses a large amount of processing power if the server is running factions, especially if the server has a large amount of created factions. It is much more efficient to check the type of the block before calling the isRegionProtectedFromBuild.
- Added a conditional to check if the block is Lava, or Fire before checking if the region is protected from build.
WaterManipulation, EarthBlast, FireBlast accessor methods:
- Added waterManipulation.getAroundPoint() which returns all instances of WaterManipulation around a location within a specific radius.
- Added earthBlast.getAroundPoint() which returns all instances of EarthBlast around a location within a specific radius.
- Added fireBlast.getAroundPoint() which returns all instances of FireBlast around a location within a specific radius.

EarthBlast Cleanup:
- Fixed an old bug that involved EarthBlasts not being cleaned up properly if the player spammed left click and shift together. UnfocusBlock() was being called which would instantly remove the instance of EarthBlast from the “instances” ConcurrentHashMap but would not call the proper breakBlock() method to actually clean up the block. Normally calling unfocusBlock() is fine as long as the EarthBlast isn’t moving, but since the EarthBlasts were moving then we need to also unbreak the old block. To determine if the EarthBlast was moving I checked if the EarthBlast’s destination wasn’t null.
- For more information see http://projectkorra.com/threads/earthblast-floating-block-glitch.428/

IceSpike Cleanup Fix:
- IceSpikes were not being cleaned up at all because removeTimers.contains(player) was never returning true. Instead the line should be removeTimers.containsKey(player).
- For more information see http://projectkorra.com/threads/icespike.418/

WaterSpout No Fall Damage:
Methods.java:
- Added a method called getTopBlock(Location, int) which returns the highest block that is not air within a upward or downward line, the int controls how high upward and downward it will iterate through.
- Added a method called getTopBlock(Location, int, int) which allows you to specify the upward and downward iteration length independently from one another.

WaterSpout.java:
- WaterBenders were able to avoid fall damage by spamming left click while hitting the ground. This was because players were being given flight mode before the ability actually checked to see if they were above water or ground. I check the top block within a line of 50 to make sure it is actually Water/Ice/Snow before giving the player Flight.
- For More Information see http://projectkorra.com/threads/water-spout-no-fall-damage.371/

Flight Glitch:
- When the server shuts down or reloads the method Flight.removeAll() is called which should disable the players flight. Instead it was just removing the player from the Flight.instances(), without actually disabling the players flight.

WaterSpout No Fall Damage NPE Fix:
- Added a check to make sure that the topBlock was not null before checking its type.