getIgnitable range

* Added option for getIgnitable to have different values for the up and down in the range
This commit is contained in:
Simp 2020-06-27 14:15:21 -04:00
parent 4b848f1513
commit 0538cff7e7
2 changed files with 13 additions and 2 deletions

View file

@ -175,7 +175,18 @@ public abstract class FireAbility extends ElementalAbility {
* @return null if no ignitable block found in the range * @return null if no ignitable block found in the range
*/ */
public static Block getIgnitable(final Block block, final int 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)) { if (isIgnitable(top)) {
return top; return top;

View file

@ -78,7 +78,7 @@ public class BlazeArc extends FireAbility {
return; return;
} }
final Block ignitable = getIgnitable(block, 1); final Block ignitable = getIgnitable(block, 0, 2);
if (ignitable != null) { if (ignitable != null) {
this.ignite(ignitable); this.ignite(ignitable);
} }