mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-01-08 16:08:39 +00:00
Check Inner Distances
This commit is contained in:
parent
ac0618616c
commit
ca426c67fa
1 changed files with 29 additions and 17 deletions
|
@ -206,12 +206,38 @@ public class AirBlast extends AirAbility {
|
||||||
if (this.random.nextInt(4) == 0) {
|
if (this.random.nextInt(4) == 0) {
|
||||||
playAirbendingSound(this.location);
|
playAirbendingSound(this.location);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (double d = 0; d < speedFactor; d += 0.1) {
|
||||||
|
if (!checkLocation()) {
|
||||||
|
remove();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
this.location.add(this.direction.clone().multiply(d));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean checkLocation() {
|
||||||
if (GeneralMethods.checkDiagonalWall(this.location, this.direction)) {
|
if (GeneralMethods.checkDiagonalWall(this.location, this.direction)) {
|
||||||
this.remove();
|
this.remove();
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.location = this.location.add(this.direction.clone().multiply(this.speedFactor));
|
Block block = location.getBlock();
|
||||||
|
if ((!block.isPassable() || block.isLiquid()) && !this.affectedLevers.contains(block)) {
|
||||||
|
if (block.getType() == Material.LAVA && this.canCoolLava) {
|
||||||
|
if (LavaFlow.isLavaFlowBlock(block)) {
|
||||||
|
LavaFlow.removeBlock(block); // TODO: Make more generic for future lava generating moves.
|
||||||
|
} else if (block.getBlockData() instanceof Levelled && ((Levelled) block.getBlockData()).getLevel() == 0) {
|
||||||
|
new TempBlock(block, Material.OBSIDIAN);
|
||||||
|
} else {
|
||||||
|
new TempBlock(block, Material.COBBLESTONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.remove();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void affect(final Entity entity) {
|
private void affect(final Entity entity) {
|
||||||
|
@ -400,20 +426,6 @@ public class AirBlast extends AirAbility {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((GeneralMethods.isSolid(block) || block.isLiquid()) && !this.affectedLevers.contains(block)) {
|
|
||||||
if (block.getType() == Material.LAVA && this.canCoolLava) {
|
|
||||||
if (LavaFlow.isLavaFlowBlock(block)) {
|
|
||||||
LavaFlow.removeBlock(block); // TODO: Make more generic for future lava generating moves.
|
|
||||||
} else if (block.getBlockData() instanceof Levelled && ((Levelled) block.getBlockData()).getLevel() == 0) {
|
|
||||||
new TempBlock(block, Material.OBSIDIAN);
|
|
||||||
} else {
|
|
||||||
new TempBlock(block, Material.COBBLESTONE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.remove();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If a player presses shift and AirBlasts straight down then the
|
* If a player presses shift and AirBlasts straight down then the
|
||||||
* AirBlast's location gets messed up and reading the distance returns
|
* AirBlast's location gets messed up and reading the distance returns
|
||||||
|
|
Loading…
Reference in a new issue