geforkt von Mirrors/Paper
SPIGOT-4164: Treat new _AIR blocks as air
Dieser Commit ist enthalten in:
Ursprung
4b00823222
Commit
4d3ef4821f
@ -489,7 +489,7 @@ public class CraftBlock implements Block {
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return getType() == Material.AIR;
|
||||
return getNMS().isAir();
|
||||
}
|
||||
|
||||
public boolean isLiquid() {
|
||||
|
@ -1,5 +1,6 @@
|
||||
package org.bukkit.craftbukkit.entity;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
@ -134,6 +135,9 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
}
|
||||
|
||||
private List<Block> getLineOfSight(Set<Material> transparent, int maxDistance, int maxLength) {
|
||||
if (transparent == null) {
|
||||
transparent = Sets.newHashSet(Material.AIR, Material.CAVE_AIR, Material.VOID_AIR);
|
||||
}
|
||||
if (maxDistance > 120) {
|
||||
maxDistance = 120;
|
||||
}
|
||||
@ -146,16 +150,10 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
blocks.remove(0);
|
||||
}
|
||||
Material material = block.getType();
|
||||
if (transparent == null) {
|
||||
if (!material.equals(Material.AIR)) {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (!transparent.contains(material)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return blocks;
|
||||
}
|
||||
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren