Few Fixes (#576)

• Fixed Illumination dropping a torch when RaiseEarth is used bellow it
• Fixed Illumination having issues with Tremorsense (passive)
• Fixed not being able to thaw ice through water with phase change
This commit is contained in:
StrangeOne101 2016-09-15 11:04:57 +12:00 committed by OmniCypher
parent 92d32bcb9a
commit 7ed5bcd01b
4 changed files with 21 additions and 9 deletions

View file

@ -26,6 +26,7 @@ import com.projectkorra.projectkorra.earthbending.EarthPassive;
import com.projectkorra.projectkorra.earthbending.LavaFlow;
import com.projectkorra.projectkorra.earthbending.RaiseEarth;
import com.projectkorra.projectkorra.earthbending.SandSpout;
import com.projectkorra.projectkorra.firebending.Illumination;
import com.projectkorra.projectkorra.util.BlockSource;
import com.projectkorra.projectkorra.util.Information;
import com.projectkorra.projectkorra.util.ParticleEffect;
@ -144,6 +145,9 @@ public abstract class EarthAbility extends ElementalAbility {
if (EarthPassive.isPassiveSand(block)) {
EarthPassive.revertSand(block);
}
if (Illumination.isIlluminationTorch(affectedblock) && TempBlock.isTempBlock(affectedblock)) {
TempBlock.get(affectedblock).revertBlock();
}
if (affectedblock == null) {
return false;

View file

@ -8,7 +8,6 @@ import com.projectkorra.projectkorra.Element;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.command.Commands;
import com.projectkorra.projectkorra.configuration.ConfigManager;
import com.projectkorra.projectkorra.earthbending.Tremorsense;
public class FirePassive {
@ -25,7 +24,7 @@ public class FirePassive {
if (bPlayer != null && !CoreAbility.hasAbility(player, Illumination.class)
&& bPlayer.canBendIgnoreBinds(CoreAbility.getAbility("Illumination")) && ConfigManager.defaultConfig.get().getBoolean("Abilities.Fire.Illumination.Passive")) {
if (!Tremorsense.canTremorSense(player)) {
if (!bPlayer.isTremorSensing()) {
new Illumination(player);
}
}

View file

@ -11,7 +11,6 @@ import org.bukkit.entity.Player;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.FireAbility;
import com.projectkorra.projectkorra.earthbending.Tremorsense;
import com.projectkorra.projectkorra.util.TempBlock;
public class Illumination extends FireAbility {
@ -70,7 +69,7 @@ public class Illumination extends FireAbility {
return;
}
if (Tremorsense.canTremorSense(player)) {
if (bPlayer.isTremorSensing()) {
remove();
return;
}
@ -189,6 +188,18 @@ public class Illumination extends FireAbility {
public static Map<TempBlock, Player> getBlocks() {
return BLOCKS;
}
/**Returns whether the block provided is a torch created by Illumination
*
* @param block The block being tested*/
public static boolean isIlluminationTorch(Block block) {
for (TempBlock b : BLOCKS.keySet()) {
if (b.getBlock().equals(block)) {
return true;
}
}
return false;
}
public void setCooldown(long cooldown) {
this.cooldown = cooldown;

View file

@ -56,17 +56,15 @@ public class PhaseChangeMelt extends IceAbility {
boolean evaporate = false;
location = GeneralMethods.getTargetedLocation(player, range, 0, 8, 9);
if (isWater(player.getTargetBlock((HashSet<Material>) null, (int) range)) && !(player.getEyeLocation().getBlockY() <= 62)) {
if (isWater(player.getTargetBlock((HashSet<Material>) null, (int) range)) && player.getEyeLocation().getBlockY() > seaLevel) {
evaporate = true;
radius = (int) getNightFactor(evaporateRadius);
}
start();
for (Block block : GeneralMethods.getBlocksAroundPoint(location, radius)) {
if (evaporate) {
if (block.getY() > seaLevel) {
evaporate(player, block);
}
if (evaporate && block.getY() > seaLevel) {
evaporate(player, block);
} else {
melt(player, block);
}