more protection stuff

This commit is contained in:
PhanaticD 2019-01-03 13:37:14 -05:00
parent 07632b62ef
commit cc865ef41c
2 changed files with 32 additions and 34 deletions

View file

@ -1,9 +1,17 @@
package com.projectkorra.projectkorra.firebending;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.FireAbility;
import com.projectkorra.projectkorra.ability.util.Collision;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.avatar.AvatarState;
import com.projectkorra.projectkorra.command.Commands;
import com.projectkorra.projectkorra.firebending.util.FireDamageTimer;
import com.projectkorra.projectkorra.util.DamageHandler;
import com.projectkorra.projectkorra.util.ParticleEffect;
import com.projectkorra.projectkorra.waterbending.plant.PlantRegrowth;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
@ -14,17 +22,9 @@ import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.FireAbility;
import com.projectkorra.projectkorra.ability.util.Collision;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.avatar.AvatarState;
import com.projectkorra.projectkorra.firebending.util.FireDamageTimer;
import com.projectkorra.projectkorra.util.DamageHandler;
import com.projectkorra.projectkorra.util.ParticleEffect;
import com.projectkorra.projectkorra.waterbending.plant.PlantRegrowth;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public class FireBlast extends FireAbility {
@ -131,7 +131,7 @@ public class FireBlast extends FireAbility {
}
private void affect(final Entity entity) {
if (entity.getUniqueId() != this.player.getUniqueId()) {
if (entity.getUniqueId() != this.player.getUniqueId() && !GeneralMethods.isRegionProtectedFromBuild(this, entity.getLocation()) && !((entity instanceof Player) && Commands.invincible.contains(((Player) entity).getName()))) {
if (this.bPlayer.isAvatarState()) {
GeneralMethods.setVelocity(entity, this.direction.clone().multiply(AvatarState.getValue(this.knockback)));
} else {

View file

@ -1,23 +1,5 @@
package com.projectkorra.projectkorra.waterbending;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.data.BlockData;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.Element;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra;
@ -28,6 +10,19 @@ import com.projectkorra.projectkorra.util.DamageHandler;
import com.projectkorra.projectkorra.util.TempBlock;
import com.projectkorra.projectkorra.waterbending.combo.IceWave;
import com.projectkorra.projectkorra.waterbending.plant.PlantRegrowth;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.data.BlockData;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.util.Vector;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
public class WaterSpoutWave extends WaterAbility {
@ -420,6 +415,9 @@ public class WaterSpoutWave extends WaterAbility {
if (block.getLocation().distanceSquared(entity.getLocation().getBlock().getLocation()) > radius * radius) {
continue;
}
if(GeneralMethods.isRegionProtectedFromBuild(this, block.getLocation())){
continue;
}
if (block.getType() == Material.AIR || block.getType() == Material.ICE || this.isWaterbendable(block)) {
if (!FROZEN_BLOCKS.containsKey(block)) {