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
+15 -35

No files matched your search

@@ -344,7 +344,7 @@ public class Backend
public boolean checkWaterWalk(Player player, double x, double y, double z) public boolean checkWaterWalk(Player player, double x, double y, double z)
{ {
Block block = player.getLocation().getBlock(); Block block = player.getLocation().getBlock();
if (player.getVehicle() == null && !player.isFlying()) if (player.getVehicle() == null && !player.isFlying())
{ {
if (block.isLiquid()) if (block.isLiquid())
@@ -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)
@@ -612,8 +592,8 @@ public class Backend
if (!isMovingExempt(player) && !Utilities.isHoveringOverWater(player.getLocation(), 1) && Utilities.cantStandAtExp(player.getLocation())) if (!isMovingExempt(player) && !Utilities.isHoveringOverWater(player.getLocation(), 1) && Utilities.cantStandAtExp(player.getLocation()))
{ {
/* if (y1 == y2 || y1 < y2) /* if (y1 == y2 || y1 < y2)
{ {
if (y1 == y2) if (y1 == y2)
{ {
//Check if the player is on slabs or crouching on stairs //Check if the player is on slabs or crouching on stairs
@@ -625,20 +605,20 @@ public class Backend
{ {
return false; return false;
} }
int violation = flightViolation.containsKey(name) ? flightViolation.get(name) + 1 : 1; int violation = flightViolation.containsKey(name) ? flightViolation.get(name) + 1 : 1;
increment(player, flightViolation, violation); increment(player, flightViolation, violation);
return violation > magic.FLIGHT_LIMIT; return violation > magic.FLIGHT_LIMIT;
} */ } */
if (!blocksOverFlight.containsKey(name)) if (!blocksOverFlight.containsKey(name))
{ {
blocksOverFlight.put(name, 0D); blocksOverFlight.put(name, 0D);
} }
blocksOverFlight.put(name, (blocksOverFlight.get(name) + distance.getXDifference() + distance.getYDifference() + distance.getZDifference())); blocksOverFlight.put(name, (blocksOverFlight.get(name) + distance.getXDifference() + distance.getYDifference() + distance.getZDifference()));
if (y1 > y2) if (y1 > y2)
{ {
blocksOverFlight.put(name, (blocksOverFlight.get(name) - distance.getYDifference())); blocksOverFlight.put(name, (blocksOverFlight.get(name) - distance.getYDifference()));
@@ -1010,7 +990,7 @@ public class Backend
{ {
if (waterSpeedViolation.containsKey(player.getName())) if (waterSpeedViolation.containsKey(player.getName()))
{ {
if (waterSpeedViolation.get(player.getName()) >= magic.WATER_SPEED_VIOLATION_MAX && Utilities.isHoveringOverWater(player.getLocation())) if (waterSpeedViolation.get(player.getName()) >= magic.WATER_SPEED_VIOLATION_MAX && Utilities.isHoveringOverWater(player.getLocation()))
{ {
return true; return true;
} }
@@ -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>