mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-12 03:59:06 +00:00
Fix Suffocate on transparent blocks
This commit is contained in:
parent
162944f13f
commit
cdc9fdf467
1 changed files with 17 additions and 3 deletions
|
@ -69,6 +69,14 @@ public class Suffocate implements ConfigLoadable {
|
||||||
|
|
||||||
private double blind, blindDelay, blindRepeat;
|
private double blind, blindDelay, blindRepeat;
|
||||||
|
|
||||||
|
private Integer[] transparent = {0, 6, 8, 9, 10, 11, 27, 28, 30, 31, 32,
|
||||||
|
37, 38, 39, 40, 50, 51, 55, 59, 63, 64,
|
||||||
|
65, 66, 68, 69, 70, 71, 72, 75, 76, 77,
|
||||||
|
78, 83, 93, 94, 104, 105, 111, 115, 117,
|
||||||
|
132, 141, 142, 143, 147, 148, 149, 150,
|
||||||
|
157, 175, 176, 177, 183, 184, 185, 187,
|
||||||
|
193, 194, 195, 196, 197};
|
||||||
|
|
||||||
public Suffocate(Player player) {
|
public Suffocate(Player player) {
|
||||||
this.player = player;
|
this.player = player;
|
||||||
bplayer = GeneralMethods.getBendingPlayer(player.getName());
|
bplayer = GeneralMethods.getBendingPlayer(player.getName());
|
||||||
|
@ -121,9 +129,15 @@ public class Suffocate implements ConfigLoadable {
|
||||||
if (ent instanceof LivingEntity && !ent.equals(player))
|
if (ent instanceof LivingEntity && !ent.equals(player))
|
||||||
targets.add((LivingEntity) ent);
|
targets.add((LivingEntity) ent);
|
||||||
} else {
|
} else {
|
||||||
Entity ent = GeneralMethods.getTargetedEntity(player, range, new ArrayList<Entity>());
|
//Entity ent = GeneralMethods.getTargetedEntity(player, range, new ArrayList<Entity>());
|
||||||
if (ent != null && ent instanceof LivingEntity)
|
Location location = GeneralMethods.getTargetedLocation(player, 6, transparent);
|
||||||
targets.add((LivingEntity) ent);
|
List<Entity> entities = GeneralMethods.getEntitiesAroundPoint(location, 1.5);
|
||||||
|
if (entities == null || entities.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Entity target = entities.get(0);
|
||||||
|
if (target != null && target instanceof LivingEntity)
|
||||||
|
targets.add((LivingEntity) target);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!canSuffUndead) {
|
if (!canSuffUndead) {
|
||||||
|
|
Loading…
Reference in a new issue