diff --git a/src/com/projectkorra/projectkorra/PKListener.java b/src/com/projectkorra/projectkorra/PKListener.java index 153cbca7..de3f10d8 100644 --- a/src/com/projectkorra/projectkorra/PKListener.java +++ b/src/com/projectkorra/projectkorra/PKListener.java @@ -1,105 +1,12 @@ package com.projectkorra.projectkorra; -import com.projectkorra.projectkorra.ability.Ability; -import com.projectkorra.projectkorra.ability.AddonAbility; -import com.projectkorra.projectkorra.ability.AirAbility; -import com.projectkorra.projectkorra.ability.ChiAbility; -import com.projectkorra.projectkorra.ability.CoreAbility; -import com.projectkorra.projectkorra.ability.EarthAbility; -import com.projectkorra.projectkorra.ability.ElementalAbility; -import com.projectkorra.projectkorra.ability.FireAbility; -import com.projectkorra.projectkorra.ability.WaterAbility; -import com.projectkorra.projectkorra.ability.util.ComboManager; -import com.projectkorra.projectkorra.ability.util.MultiAbilityManager; -import com.projectkorra.projectkorra.airbending.AirBlast; -import com.projectkorra.projectkorra.airbending.AirBubble; -import com.projectkorra.projectkorra.airbending.AirBurst; -import com.projectkorra.projectkorra.airbending.AirFlight; -import com.projectkorra.projectkorra.airbending.AirScooter; -import com.projectkorra.projectkorra.airbending.AirShield; -import com.projectkorra.projectkorra.airbending.AirSpout; -import com.projectkorra.projectkorra.airbending.AirSuction; -import com.projectkorra.projectkorra.airbending.AirSwipe; -import com.projectkorra.projectkorra.airbending.Suffocate; -import com.projectkorra.projectkorra.airbending.Tornado; -import com.projectkorra.projectkorra.avatar.AvatarState; -import com.projectkorra.projectkorra.chiblocking.AcrobatStance; -import com.projectkorra.projectkorra.chiblocking.ChiCombo; -import com.projectkorra.projectkorra.chiblocking.ChiPassive; -import com.projectkorra.projectkorra.chiblocking.HighJump; -import com.projectkorra.projectkorra.chiblocking.Paralyze; -import com.projectkorra.projectkorra.chiblocking.QuickStrike; -import com.projectkorra.projectkorra.chiblocking.RapidPunch; -import com.projectkorra.projectkorra.chiblocking.Smokescreen; -import com.projectkorra.projectkorra.chiblocking.SwiftKick; -import com.projectkorra.projectkorra.chiblocking.WarriorStance; -import com.projectkorra.projectkorra.command.Commands; -import com.projectkorra.projectkorra.configuration.ConfigManager; -import com.projectkorra.projectkorra.earthbending.Catapult; -import com.projectkorra.projectkorra.earthbending.Collapse; -import com.projectkorra.projectkorra.earthbending.CollapseWall; -import com.projectkorra.projectkorra.earthbending.EarthArmor; -import com.projectkorra.projectkorra.earthbending.EarthBlast; -import com.projectkorra.projectkorra.earthbending.EarthGrab; -import com.projectkorra.projectkorra.earthbending.EarthPassive; -import com.projectkorra.projectkorra.earthbending.EarthSmash; -import com.projectkorra.projectkorra.earthbending.EarthTunnel; -import com.projectkorra.projectkorra.earthbending.Extraction; -import com.projectkorra.projectkorra.earthbending.LavaFlow; -import com.projectkorra.projectkorra.earthbending.LavaFlow.AbilityType; -import com.projectkorra.projectkorra.earthbending.LavaSurge; -import com.projectkorra.projectkorra.earthbending.LavaSurgeWave; -import com.projectkorra.projectkorra.earthbending.MetalClips; -import com.projectkorra.projectkorra.earthbending.RaiseEarth; -import com.projectkorra.projectkorra.earthbending.RaiseEarthWall; -import com.projectkorra.projectkorra.earthbending.SandSpout; -import com.projectkorra.projectkorra.earthbending.Shockwave; -import com.projectkorra.projectkorra.earthbending.Tremorsense; -import com.projectkorra.projectkorra.event.EntityBendingDeathEvent; -import com.projectkorra.projectkorra.event.HorizontalVelocityChangeEvent; -import com.projectkorra.projectkorra.event.PlayerChangeElementEvent; -import com.projectkorra.projectkorra.event.PlayerChangeElementEvent.Result; -import com.projectkorra.projectkorra.event.PlayerJumpEvent; -import com.projectkorra.projectkorra.firebending.Blaze; -import com.projectkorra.projectkorra.firebending.BlazeArc; -import com.projectkorra.projectkorra.firebending.BlazeRing; -import com.projectkorra.projectkorra.firebending.Combustion; -import com.projectkorra.projectkorra.firebending.FireBlast; -import com.projectkorra.projectkorra.firebending.FireBlastCharged; -import com.projectkorra.projectkorra.firebending.FireBurst; -import com.projectkorra.projectkorra.firebending.FireCombo; -import com.projectkorra.projectkorra.firebending.FireDamageTimer; -import com.projectkorra.projectkorra.firebending.FireJet; -import com.projectkorra.projectkorra.firebending.FireShield; -import com.projectkorra.projectkorra.firebending.HeatControlExtinguish; -import com.projectkorra.projectkorra.firebending.HeatControlSolidify; -import com.projectkorra.projectkorra.firebending.Illumination; -import com.projectkorra.projectkorra.firebending.Lightning; -import com.projectkorra.projectkorra.firebending.WallOfFire; -import com.projectkorra.projectkorra.object.HorizontalVelocityTracker; -import com.projectkorra.projectkorra.object.Preset; -import com.projectkorra.projectkorra.util.BlockSource; -import com.projectkorra.projectkorra.util.ClickType; -import com.projectkorra.projectkorra.util.DamageHandler; -import com.projectkorra.projectkorra.util.Flight; -import com.projectkorra.projectkorra.util.PassiveHandler; -import com.projectkorra.projectkorra.util.TempBlock; -import com.projectkorra.projectkorra.waterbending.Bloodbending; -import com.projectkorra.projectkorra.waterbending.IceBlast; -import com.projectkorra.projectkorra.waterbending.IceSpikeBlast; -import com.projectkorra.projectkorra.waterbending.OctopusForm; -import com.projectkorra.projectkorra.waterbending.PhaseChangeFreeze; -import com.projectkorra.projectkorra.waterbending.PhaseChangeMelt; -import com.projectkorra.projectkorra.waterbending.PlantArmor; -import com.projectkorra.projectkorra.waterbending.SurgeWall; -import com.projectkorra.projectkorra.waterbending.SurgeWave; -import com.projectkorra.projectkorra.waterbending.Torrent; -import com.projectkorra.projectkorra.waterbending.WaterArms; -import com.projectkorra.projectkorra.waterbending.WaterManipulation; -import com.projectkorra.projectkorra.waterbending.WaterPassive; -import com.projectkorra.projectkorra.waterbending.WaterSpout; -import com.projectkorra.projectkorra.waterbending.WaterSpoutWave; -import com.projectkorra.rpg.RPGMethods; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.UUID; import org.bukkit.Bukkit; import org.bukkit.ChatColor; @@ -158,13 +65,105 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.util.Vector; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.UUID; +import com.projectkorra.projectkorra.ability.Ability; +import com.projectkorra.projectkorra.ability.AddonAbility; +import com.projectkorra.projectkorra.ability.AirAbility; +import com.projectkorra.projectkorra.ability.ChiAbility; +import com.projectkorra.projectkorra.ability.CoreAbility; +import com.projectkorra.projectkorra.ability.EarthAbility; +import com.projectkorra.projectkorra.ability.ElementalAbility; +import com.projectkorra.projectkorra.ability.FireAbility; +import com.projectkorra.projectkorra.ability.WaterAbility; +import com.projectkorra.projectkorra.ability.util.ComboManager; +import com.projectkorra.projectkorra.ability.util.MultiAbilityManager; +import com.projectkorra.projectkorra.airbending.AirBlast; +import com.projectkorra.projectkorra.airbending.AirBubble; +import com.projectkorra.projectkorra.airbending.AirBurst; +import com.projectkorra.projectkorra.airbending.AirFlight; +import com.projectkorra.projectkorra.airbending.AirScooter; +import com.projectkorra.projectkorra.airbending.AirShield; +import com.projectkorra.projectkorra.airbending.AirSpout; +import com.projectkorra.projectkorra.airbending.AirSuction; +import com.projectkorra.projectkorra.airbending.AirSwipe; +import com.projectkorra.projectkorra.airbending.Suffocate; +import com.projectkorra.projectkorra.airbending.Tornado; +import com.projectkorra.projectkorra.avatar.AvatarState; +import com.projectkorra.projectkorra.chiblocking.AcrobatStance; +import com.projectkorra.projectkorra.chiblocking.ChiCombo; +import com.projectkorra.projectkorra.chiblocking.ChiPassive; +import com.projectkorra.projectkorra.chiblocking.HighJump; +import com.projectkorra.projectkorra.chiblocking.Paralyze; +import com.projectkorra.projectkorra.chiblocking.QuickStrike; +import com.projectkorra.projectkorra.chiblocking.RapidPunch; +import com.projectkorra.projectkorra.chiblocking.Smokescreen; +import com.projectkorra.projectkorra.chiblocking.SwiftKick; +import com.projectkorra.projectkorra.chiblocking.WarriorStance; +import com.projectkorra.projectkorra.command.Commands; +import com.projectkorra.projectkorra.configuration.ConfigManager; +import com.projectkorra.projectkorra.earthbending.Catapult; +import com.projectkorra.projectkorra.earthbending.Collapse; +import com.projectkorra.projectkorra.earthbending.CollapseWall; +import com.projectkorra.projectkorra.earthbending.EarthArmor; +import com.projectkorra.projectkorra.earthbending.EarthBlast; +import com.projectkorra.projectkorra.earthbending.EarthGrab; +import com.projectkorra.projectkorra.earthbending.EarthPassive; +import com.projectkorra.projectkorra.earthbending.EarthSmash; +import com.projectkorra.projectkorra.earthbending.EarthTunnel; +import com.projectkorra.projectkorra.earthbending.Extraction; +import com.projectkorra.projectkorra.earthbending.LavaFlow; +import com.projectkorra.projectkorra.earthbending.LavaFlow.AbilityType; +import com.projectkorra.projectkorra.earthbending.LavaSurge; +import com.projectkorra.projectkorra.earthbending.MetalClips; +import com.projectkorra.projectkorra.earthbending.RaiseEarth; +import com.projectkorra.projectkorra.earthbending.RaiseEarthWall; +import com.projectkorra.projectkorra.earthbending.SandSpout; +import com.projectkorra.projectkorra.earthbending.Shockwave; +import com.projectkorra.projectkorra.earthbending.Tremorsense; +import com.projectkorra.projectkorra.event.EntityBendingDeathEvent; +import com.projectkorra.projectkorra.event.HorizontalVelocityChangeEvent; +import com.projectkorra.projectkorra.event.PlayerChangeElementEvent; +import com.projectkorra.projectkorra.event.PlayerChangeElementEvent.Result; +import com.projectkorra.projectkorra.event.PlayerJumpEvent; +import com.projectkorra.projectkorra.firebending.Blaze; +import com.projectkorra.projectkorra.firebending.BlazeArc; +import com.projectkorra.projectkorra.firebending.BlazeRing; +import com.projectkorra.projectkorra.firebending.Combustion; +import com.projectkorra.projectkorra.firebending.FireBlast; +import com.projectkorra.projectkorra.firebending.FireBlastCharged; +import com.projectkorra.projectkorra.firebending.FireBurst; +import com.projectkorra.projectkorra.firebending.FireCombo; +import com.projectkorra.projectkorra.firebending.FireDamageTimer; +import com.projectkorra.projectkorra.firebending.FireJet; +import com.projectkorra.projectkorra.firebending.FireShield; +import com.projectkorra.projectkorra.firebending.HeatControlExtinguish; +import com.projectkorra.projectkorra.firebending.HeatControlSolidify; +import com.projectkorra.projectkorra.firebending.Illumination; +import com.projectkorra.projectkorra.firebending.Lightning; +import com.projectkorra.projectkorra.firebending.WallOfFire; +import com.projectkorra.projectkorra.object.HorizontalVelocityTracker; +import com.projectkorra.projectkorra.object.Preset; +import com.projectkorra.projectkorra.util.BlockSource; +import com.projectkorra.projectkorra.util.ClickType; +import com.projectkorra.projectkorra.util.DamageHandler; +import com.projectkorra.projectkorra.util.Flight; +import com.projectkorra.projectkorra.util.PassiveHandler; +import com.projectkorra.projectkorra.util.TempBlock; +import com.projectkorra.projectkorra.waterbending.Bloodbending; +import com.projectkorra.projectkorra.waterbending.IceBlast; +import com.projectkorra.projectkorra.waterbending.IceSpikeBlast; +import com.projectkorra.projectkorra.waterbending.OctopusForm; +import com.projectkorra.projectkorra.waterbending.PhaseChangeFreeze; +import com.projectkorra.projectkorra.waterbending.PhaseChangeMelt; +import com.projectkorra.projectkorra.waterbending.PlantArmor; +import com.projectkorra.projectkorra.waterbending.SurgeWall; +import com.projectkorra.projectkorra.waterbending.SurgeWave; +import com.projectkorra.projectkorra.waterbending.Torrent; +import com.projectkorra.projectkorra.waterbending.WaterArms; +import com.projectkorra.projectkorra.waterbending.WaterManipulation; +import com.projectkorra.projectkorra.waterbending.WaterPassive; +import com.projectkorra.projectkorra.waterbending.WaterSpout; +import com.projectkorra.projectkorra.waterbending.WaterSpoutWave; +import com.projectkorra.rpg.RPGMethods; public class PKListener implements Listener { @@ -390,9 +389,12 @@ public class PKListener implements Listener { @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) public void onEntityDamageByBlock(EntityDamageByBlockEvent event) { - if (event.getDamager() != null) { - if (LavaSurgeWave.isBlockInWave(event.getDamager())) { + Block block = event.getDamager(); + + if (TempBlock.isTempBlock(block)) { + if (EarthAbility.isEarthbendable(block.getType()) && GeneralMethods.isSolid(block)) { event.setCancelled(true); + return; } } }