Don't check metadata on Blocks in Cause.

We don't track causes on Blocks. There's no need for the performance hit.
This commit is contained in:
sk89q 2014-08-17 15:23:34 -07:00
parent 41fb8a0722
commit 3ca147e405

View File

@ -21,6 +21,7 @@
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
import com.sk89q.worldguard.bukkit.util.WGMetadata; import com.sk89q.worldguard.bukkit.util.WGMetadata;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile; import org.bukkit.entity.Projectile;
@ -123,7 +124,7 @@ private static void expand(List<Object> list, @Nullable Object ... element) {
// Add manually tracked parent causes // Add manually tracked parent causes
Object source = o; Object source = o;
int index = list.size(); int index = list.size();
while (source instanceof Metadatable) { while (source instanceof Metadatable && !(source instanceof Block)) {
source = WGMetadata.getIfPresent((Metadatable) source, CAUSE_KEY, Object.class); source = WGMetadata.getIfPresent((Metadatable) source, CAUSE_KEY, Object.class);
if (source != null) { if (source != null) {
list.add(index, source); list.add(index, source);