Remove sight check for now, for some reason the CB method is screwed.

This commit is contained in:
h31ix committed 2012-11-27 17:02:33 -05:00
1 parent c0014c76b6
commit 23ced50eed
3 files changed
+6 -26

No files matched your search

@@ -565,28 +565,8 @@ public class Backend
public boolean checkSight(Player player, Entity entity) public boolean checkSight(Player player, Entity entity)
{ {
// Check to make sure the entity's head is not surrounded // TODO: Internal method was screwed. Rewrite.
Block head = entity.getWorld().getBlockAt((int) entity.getLocation().getX(), (int) (entity.getLocation().getY() + ((CraftEntity) entity).getHandle().getHeadHeight()), (int) entity.getLocation().getZ()); return true;
boolean solid = false;
//TODO: This sucks. See if it's possible to not have as many false-positives while still retaining most of the check.
for (int x = -2; x <= 2; x++)
{
for (int z = -2; z <= 2; z++)
{
for (int y = -1; y < 2; y++)
{
if (head.getRelative(x, y, z).getTypeId() != 0)
{
if (net.minecraft.server.Block.byId[head.getRelative(x, y, z).getTypeId()].material.isSolid())
{
solid = true;
break;
}
}
}
}
}
return solid ? true : player.hasLineOfSight(entity);
} }
public boolean checkFlight(Player player, Distance distance) public boolean checkFlight(Player player, Distance distance)
@@ -436,7 +436,7 @@ public class Metrics
} }
/** /**
* Gets an <b>unmodifiable</b> set of the plotter objects in the graph * Gets an <strong>unmodifiable</strong> set of the plotter objects in the graph
* *
* @return * @return
*/ */
@@ -37,11 +37,11 @@ import org.bukkit.plugin.Plugin;
/** /**
* Check dev.bukkit.org to find updates for a given plugin, and download the updates if needed. * Check dev.bukkit.org to find updates for a given plugin, and download the updates if needed.
* <p> * <p>
* <b>VERY, VERY IMPORTANT</b>: Because there are no standards for adding auto-update toggles in your plugin's config, this system provides NO CHECK WITH YOUR CONFIG to make sure the user has allowed auto-updating. * <strong>VERY, VERY IMPORTANT</strong>: Because there are no standards for adding auto-update toggles in your plugin's config, this system provides NO CHECK WITH YOUR CONFIG to make sure the user has allowed auto-updating.
* <br> * <br>
* It is a <b>BUKKIT POLICY</b> that you include a boolean value in your config that prevents the auto-updater from running <b>AT ALL</b>. * It is a <strong>BUKKIT POLICY</strong> that you include a boolean value in your config that prevents the auto-updater from running <strong>AT ALL</strong>.
* <br> * <br>
* If you fail to include this option in your config, your plugin will be <b>REJECTED</b> when you attempt to submit it to dev.bukkit.org. * If you fail to include this option in your config, your plugin will be <strong>REJECTED</strong> when you attempt to submit it to dev.bukkit.org.
* <p> * <p>
* An example of a good configuration option would be something similar to 'auto-update: true' - if this value is set to false you may NOT run the auto-updater. * An example of a good configuration option would be something similar to 'auto-update: true' - if this value is set to false you may NOT run the auto-updater.
* <br> * <br>