Fix Suffocate & Bloodbending "grab" range

Fix preset

Fix Suffocate & Bloodbending bending self

Fix Bloodbending & Suffocate "grab" range
This commit is contained in:
jedk1 2016-01-05 22:22:00 +00:00
parent 8049e87e52
commit 066136fbe8
3 changed files with 21 additions and 5 deletions

View file

@ -130,8 +130,16 @@ public class Suffocate implements ConfigLoadable {
targets.add((LivingEntity) ent);
} else {
//Entity ent = GeneralMethods.getTargetedEntity(player, range, new ArrayList<Entity>());
Location location = GeneralMethods.getTargetedLocation(player, 6, transparent);
List<Entity> entities = GeneralMethods.getEntitiesAroundPoint(location, 1.5);
List<Entity> entities = new ArrayList<Entity>();
for (int i = 0; i < 6; i++) {
Location location = GeneralMethods.getTargetedLocation(player, i, transparent);
entities = GeneralMethods.getEntitiesAroundPoint(location, 1.7);
if (entities.contains(player))
entities.remove(player);
if (entities != null && !entities.isEmpty() && !entities.contains(player)) {
break;
}
}
if (entities == null || entities.isEmpty()) {
return;
}

View file

@ -147,7 +147,7 @@ public class Preset {
HashMap<Integer, String> abilities = (HashMap<Integer, String>) preset.abilities.clone();
boolean boundAll = true;
for (int i = 1; i <= 9; i++) {
if (!GeneralMethods.canBend(player.getName(), abilities.get(i))) {
if (!GeneralMethods.canBind(player.getName(), abilities.get(i))) {
abilities.remove(i);
boundAll = false;
}

View file

@ -89,8 +89,16 @@ public class Bloodbending {
}
}
} else {
Location location = GeneralMethods.getTargetedLocation(player, 6, transparent);
List<Entity> entities = GeneralMethods.getEntitiesAroundPoint(location, 1.5);
List<Entity> entities = new ArrayList<Entity>();
for (int i = 0; i < 6; i++) {
Location location = GeneralMethods.getTargetedLocation(player, i, transparent);
entities = GeneralMethods.getEntitiesAroundPoint(location, 1.7);
if (entities.contains(player))
entities.remove(player);
if (entities != null && !entities.isEmpty() && !entities.contains(player)) {
break;
}
}
if (entities == null || entities.isEmpty()) {
return;
}