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

View file

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

View file

@ -11,7 +11,6 @@ import org.bukkit.entity.Player;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.ability.FireAbility;
import com.projectkorra.projectkorra.earthbending.Tremorsense;
import com.projectkorra.projectkorra.util.TempBlock; import com.projectkorra.projectkorra.util.TempBlock;
public class Illumination extends FireAbility { public class Illumination extends FireAbility {
@ -70,7 +69,7 @@ public class Illumination extends FireAbility {
return; return;
} }
if (Tremorsense.canTremorSense(player)) { if (bPlayer.isTremorSensing()) {
remove(); remove();
return; return;
} }
@ -189,6 +188,18 @@ public class Illumination extends FireAbility {
public static Map<TempBlock, Player> getBlocks() { public static Map<TempBlock, Player> getBlocks() {
return BLOCKS; 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) { public void setCooldown(long cooldown) {
this.cooldown = cooldown; this.cooldown = cooldown;

View file

@ -56,17 +56,15 @@ public class PhaseChangeMelt extends IceAbility {
boolean evaporate = false; boolean evaporate = false;
location = GeneralMethods.getTargetedLocation(player, range, 0, 8, 9); 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; evaporate = true;
radius = (int) getNightFactor(evaporateRadius); radius = (int) getNightFactor(evaporateRadius);
} }
start(); start();
for (Block block : GeneralMethods.getBlocksAroundPoint(location, radius)) { for (Block block : GeneralMethods.getBlocksAroundPoint(location, radius)) {
if (evaporate) { if (evaporate && block.getY() > seaLevel) {
if (block.getY() > seaLevel) { evaporate(player, block);
evaporate(player, block);
}
} else { } else {
melt(player, block); melt(player, block);
} }