mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-11 03:30:10 +00:00
getIgnitable range
* Added option for getIgnitable to have different values for the up and down in the range
This commit is contained in:
parent
4b848f1513
commit
0538cff7e7
2 changed files with 13 additions and 2 deletions
|
@ -175,7 +175,18 @@ public abstract class FireAbility extends ElementalAbility {
|
|||
* @return null if no ignitable block found in the range
|
||||
*/
|
||||
public static Block getIgnitable(final Block block, final int range) {
|
||||
Block top = GeneralMethods.getTopBlock(block.getLocation(), range).getRelative(BlockFace.UP);
|
||||
return getIgnitable(block, range, range);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the topmost ignitable block within the specified range from the given block
|
||||
* @param block checked block and center of range
|
||||
* @param up up on the y-axis from the block to check
|
||||
* @param down down on the y-axis from the block to check
|
||||
* @return null if no ignitable block found in the range
|
||||
*/
|
||||
public static Block getIgnitable(final Block block, final int up, final int down) {
|
||||
Block top = GeneralMethods.getTopBlock(block.getLocation(), up, down).getRelative(BlockFace.UP);
|
||||
|
||||
if (isIgnitable(top)) {
|
||||
return top;
|
||||
|
|
|
@ -78,7 +78,7 @@ public class BlazeArc extends FireAbility {
|
|||
return;
|
||||
}
|
||||
|
||||
final Block ignitable = getIgnitable(block, 1);
|
||||
final Block ignitable = getIgnitable(block, 0, 2);
|
||||
if (ignitable != null) {
|
||||
this.ignite(ignitable);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue